Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <math.h> #include <string.h> int main(void){ int n = 0; fscanf(stdin, "%d", &n); int isHard = 0; int cur = 0; for(int i = 0; i < n; i++){ fscanf(stdin, "%d", &cur); if(cur!= 0){ isHard = 1; }; }; if(isHard){ fprintf(stdout, "HARD\n"); } else { fprintf(stdout, "EASY\n"); }; return 0; };
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19776/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19776/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [6 x i8] c"HARD\0A\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"EASY\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %cur = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 store i32 0, ptr %n, align 4, !tbaa !5 %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %cur) #4 store i32 0, ptr %cur, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %1, 0 br i1 %cmp8, label %for.body, label %if.else for.cond.cleanup: ; preds = %for.body %2 = icmp eq i32 %spec.select, 0 br i1 %2, label %if.else, label %if.end6 for.body: ; preds = %entry, %for.body %i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %isHard.09 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %3 = load ptr, ptr @stdin, align 8, !tbaa !9 %call1 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %3, ptr noundef nonnull @.str, ptr noundef nonnull %cur) #4 %4 = load i32, ptr %cur, align 4, !tbaa !5 %cmp2.not = icmp eq i32 %4, 0 %spec.select = select i1 %cmp2.not, i32 %isHard.09, i32 1 %inc = add nuw nsw i32 %i.010, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 if.else: ; preds = %entry, %for.cond.cleanup br label %if.end6 if.end6: ; preds = %for.cond.cleanup, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.cond.cleanup ] %6 = load ptr, ptr @stdout, align 8, !tbaa !9 %7 = call i64 @fwrite(ptr nonnull %.str.2.sink, i64 5, i64 1, ptr %6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cur) #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 declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } 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 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if((a<b)&&(b<c)){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197817/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197817/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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(a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197868/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197868/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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<b&&b<c) puts("Yes"); else puts("No"); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197910/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197910/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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 (a < b && b < c){ printf("Yes\n"); }else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197961/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197961/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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<b && b<c) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198003/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198003/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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 %d %d",&a,&b,&c); if(a<b && b<c){ printf("Yes"); }else{ printf("No"); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198061/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198061/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) %putchar = call i32 @putchar(i32 10) 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d" "%d" "%d",&a,&b,&c); if(a<b){ if(b<c){ printf("Yes\n"); }else{ printf("No\n"); } }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198104/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198104/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = 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: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b,c; scanf("%i %i %i", &a, &b, &c); (a < b && b < c) ? puts("Yes") : puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198148/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198148/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%i %i %i\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) 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 x, y, z; scanf("%d", &x); scanf("%d", &y); scanf("%d", &z); if (x < y && y < z) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198199/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198199/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #4 %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 %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %z, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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){ char a, b, c; scanf("%c %c %c", &a, &b, &c); if(a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198241/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198241/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c %c\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 i8, align 1 %b = alloca i8, align 1 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 1, 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 i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %cmp = icmp slt i8 %0, %1 %2 = load i8, ptr %c, align 1 %cmp5 = icmp slt i8 %1, %2 %or.cond = select i1 %cmp, i1 %cmp5, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a < b && b < c ) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198285/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198285/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 ((a < b) && (b < c)) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198328/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198328/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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"}
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); if (a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198371/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198371/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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(a<b && b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198414/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198414/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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(a<b && b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198458/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198458/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 < b) { if(b < c) { printf("Yes\n"); } else { printf("No\n"); } } else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198500/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198500/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = 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: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if ( a < b && b < c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198544/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198544/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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",&a); scanf("%d",&b); scanf("%d",&c); if(a<b&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198588/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198588/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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){ // Your code here! int a,b,c = 0; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(a < b && b < c){ printf("Yes\n"); }else { printf("No\n"); }return 0;}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198630/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198630/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %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 store i32 0, ptr %c, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> //#include <stdlib.h> //#include <string.h> //#include <stdbool.h> //#include <limits.h> //#include <math.h> #define max(a, b) (a > b ? a : b) int main() { int n; scanf("%d", &n); int a[2][n]; for (int i=0; i<2; i++) for (int j=0; j<n; j++) scanf("%d", &(a[i][j])); int sum[2][n], ans = 0; sum[0][0] = a[0][0]; sum[1][n-1] = a[1][n-1]; for (int i=1; i<n; i++) { sum[0][i] = sum[0][i-1] + a[0][i]; sum[1][n-i-1] = sum[1][n-i] + a[1][n-i-1]; } for (int i=0; i<n; i++) ans = max(ans, sum[0][i] + sum[1][i]); printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198674/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198674/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %3 = shl nuw nsw i64 %1, 1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = icmp sgt i32 %4, 0 br i1 %5, label %for.body4, label %for.cond.cleanup for.cond.cleanup: ; preds = %entry, %for.cond.cleanup3.1 %6 = phi i32 [ %.pre, %for.cond.cleanup3.1 ], [ undef, %entry ] %7 = phi i32 [ %16, %for.cond.cleanup3.1 ], [ %4, %entry ] %8 = zext i32 %7 to i64 %9 = shl nuw nsw i64 %8, 1 %vla11 = alloca i32, i64 %9, align 16 store i32 %6, ptr %vla11, align 16, !tbaa !5 %arrayidx16 = getelementptr inbounds i32, ptr %vla, i64 %1 %sub = add nsw i32 %7, -1 %idxprom17 = sext i32 %sub to i64 %arrayidx18 = getelementptr inbounds i32, ptr %arrayidx16, i64 %idxprom17 %10 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %arrayidx19 = getelementptr inbounds i32, ptr %vla11, i64 %8 %arrayidx22 = getelementptr inbounds i32, ptr %arrayidx19, i64 %idxprom17 store i32 %10, ptr %arrayidx22, align 4, !tbaa !5 %cmp25101 = icmp sgt i32 %7, 1 br i1 %cmp25101, label %for.body27.preheader, label %for.cond57.preheader for.body27.preheader: ; preds = %for.cond.cleanup %11 = zext i32 %7 to i64 %invariant.gep = getelementptr i32, ptr %vla11, i64 -1 %12 = add nsw i64 %8, -1 %xtraiter = and i64 %12, 1 %13 = icmp eq i32 %7, 2 br i1 %13, label %for.cond57.preheader.loopexit.unr-lcssa, label %for.body27.preheader.new for.body27.preheader.new: ; preds = %for.body27.preheader %unroll_iter = and i64 %12, -2 br label %for.body27 for.cond.cleanup3: ; preds = %for.body4 %cmp298.1 = icmp sgt i32 %17, 0 br i1 %cmp298.1, label %for.body4.lr.ph.1, label %for.cond.cleanup3.1 for.body4.lr.ph.1: ; preds = %for.cond.cleanup3 %arrayidx.1 = getelementptr inbounds i32, ptr %vla, i64 %1 br label %for.body4.1 for.body4.1: ; preds = %for.body4.1, %for.body4.lr.ph.1 %indvars.iv.1 = phi i64 [ 0, %for.body4.lr.ph.1 ], [ %indvars.iv.next.1, %for.body4.1 ] %arrayidx6.1 = getelementptr inbounds i32, ptr %arrayidx.1, i64 %indvars.iv.1 %call7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1) %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp2.1 = icmp slt i64 %indvars.iv.next.1, %15 br i1 %cmp2.1, label %for.body4.1, label %for.cond.cleanup3.1, !llvm.loop !9 for.cond.cleanup3.1: ; preds = %for.body4.1, %for.cond.cleanup3 %16 = phi i32 [ %17, %for.cond.cleanup3 ], [ %14, %for.body4.1 ] %.pre = load i32, ptr %vla, align 16, !tbaa !5 br label %for.cond.cleanup for.body4: ; preds = %entry, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %18 br i1 %cmp2, label %for.body4, label %for.cond.cleanup3, !llvm.loop !9 for.cond57.preheader.loopexit.unr-lcssa: ; preds = %for.body27, %for.body27.preheader %indvars.iv111.unr = phi i64 [ 1, %for.body27.preheader ], [ %indvars.iv.next112.1, %for.body27 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond57.preheader, label %for.body27.epil for.body27.epil: ; preds = %for.cond57.preheader.loopexit.unr-lcssa %gep.epil = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv111.unr %19 = load i32, ptr %gep.epil, align 4, !tbaa !5 %arrayidx34.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv111.unr %20 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %20, %19 %arrayidx37.epil = getelementptr inbounds i32, ptr %vla11, i64 %indvars.iv111.unr store i32 %add.epil, ptr %arrayidx37.epil, align 4, !tbaa !5 %21 = sub nsw i64 %11, %indvars.iv111.unr %arrayidx41.epil = getelementptr inbounds i32, ptr %arrayidx19, i64 %21 %22 = load i32, ptr %arrayidx41.epil, align 4, !tbaa !5 %23 = add nsw i64 %21, -1 %arrayidx46.epil = getelementptr inbounds i32, ptr %arrayidx16, i64 %23 %24 = load i32, ptr %arrayidx46.epil, align 4, !tbaa !5 %add47.epil = add nsw i32 %24, %22 %arrayidx52.epil = getelementptr inbounds i32, ptr %arrayidx19, i64 %23 store i32 %add47.epil, ptr %arrayidx52.epil, align 4, !tbaa !5 br label %for.cond57.preheader for.cond57.preheader: ; preds = %for.body27.epil, %for.cond57.preheader.loopexit.unr-lcssa, %for.cond.cleanup %cmp58103 = icmp sgt i32 %7, 0 br i1 %cmp58103, label %for.body60.preheader, label %for.cond.cleanup59 for.body60.preheader: ; preds = %for.cond57.preheader %min.iters.check = icmp ult i32 %7, 8 br i1 %min.iters.check, label %for.body60.preheader128, label %vector.ph vector.ph: ; preds = %for.body60.preheader %n.vec = and i64 %8, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ] %vec.phi124 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %32, %vector.body ] %25 = getelementptr inbounds i32, ptr %vla11, i64 %index %wide.load = load <4 x i32>, ptr %25, align 16, !tbaa !5 %26 = getelementptr inbounds i32, ptr %25, i64 4 %wide.load125 = load <4 x i32>, ptr %26, align 16, !tbaa !5 %27 = getelementptr inbounds i32, ptr %arrayidx19, i64 %index %wide.load126 = load <4 x i32>, ptr %27, align 4, !tbaa !5 %28 = getelementptr inbounds i32, ptr %27, i64 4 %wide.load127 = load <4 x i32>, ptr %28, align 4, !tbaa !5 %29 = add nsw <4 x i32> %wide.load126, %wide.load %30 = add nsw <4 x i32> %wide.load127, %wide.load125 %31 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %29) %32 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi124, <4 x i32> %30) %index.next = add nuw i64 %index, 8 %33 = icmp eq i64 %index.next, %n.vec br i1 %33, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %31, <4 x i32> %32) %34 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %8 br i1 %cmp.n, label %for.cond.cleanup59, label %for.body60.preheader128 for.body60.preheader128: ; preds = %for.body60.preheader, %middle.block %indvars.iv117.ph = phi i64 [ 0, %for.body60.preheader ], [ %n.vec, %middle.block ] %ans.0104.ph = phi i32 [ 0, %for.body60.preheader ], [ %34, %middle.block ] br label %for.body60 for.body27: ; preds = %for.body27, %for.body27.preheader.new %indvars.iv111 = phi i64 [ 1, %for.body27.preheader.new ], [ %indvars.iv.next112.1, %for.body27 ] %niter = phi i64 [ 0, %for.body27.preheader.new ], [ %niter.next.1, %for.body27 ] %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv111 %35 = load i32, ptr %gep, align 4, !tbaa !5 %arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv111 %36 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %36, %35 %arrayidx37 = getelementptr inbounds i32, ptr %vla11, i64 %indvars.iv111 store i32 %add, ptr %arrayidx37, align 4, !tbaa !5 %37 = sub nsw i64 %11, %indvars.iv111 %arrayidx41 = getelementptr inbounds i32, ptr %arrayidx19, i64 %37 %38 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %39 = add nsw i64 %37, -1 %arrayidx46 = getelementptr inbounds i32, ptr %arrayidx16, i64 %39 %40 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %add47 = add nsw i32 %40, %38 %arrayidx52 = getelementptr inbounds i32, ptr %arrayidx19, i64 %39 store i32 %add47, ptr %arrayidx52, align 4, !tbaa !5 %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %gep.1 = getelementptr i32, ptr %vla11, i64 %indvars.iv111 %41 = load i32, ptr %gep.1, align 4, !tbaa !5 %arrayidx34.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next112 %42 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5 %add.1 = add nsw i32 %42, %41 %arrayidx37.1 = getelementptr inbounds i32, ptr %vla11, i64 %indvars.iv.next112 store i32 %add.1, ptr %arrayidx37.1, align 4, !tbaa !5 %43 = sub nsw i64 %11, %indvars.iv.next112 %arrayidx41.1 = getelementptr inbounds i32, ptr %arrayidx19, i64 %43 %44 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5 %45 = add nsw i64 %43, -1 %arrayidx46.1 = getelementptr inbounds i32, ptr %arrayidx16, i64 %45 %46 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5 %add47.1 = add nsw i32 %46, %44 %arrayidx52.1 = getelementptr inbounds i32, ptr %arrayidx19, i64 %45 store i32 %add47.1, ptr %arrayidx52.1, align 4, !tbaa !5 %indvars.iv.next112.1 = add nuw nsw i64 %indvars.iv111, 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.cond57.preheader.loopexit.unr-lcssa, label %for.body27, !llvm.loop !14 for.cond.cleanup59: ; preds = %for.body60, %middle.block, %for.cond57.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond57.preheader ], [ %34, %middle.block ], [ %ans.0.add67, %for.body60 ] %call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body60: ; preds = %for.body60.preheader128, %for.body60 %indvars.iv117 = phi i64 [ %indvars.iv.next118, %for.body60 ], [ %indvars.iv117.ph, %for.body60.preheader128 ] %ans.0104 = phi i32 [ %ans.0.add67, %for.body60 ], [ %ans.0104.ph, %for.body60.preheader128 ] %arrayidx63 = getelementptr inbounds i32, ptr %vla11, i64 %indvars.iv117 %47 = load i32, ptr %arrayidx63, align 4, !tbaa !5 %arrayidx66 = getelementptr inbounds i32, ptr %arrayidx19, i64 %indvars.iv117 %48 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %add67 = add nsw i32 %48, %47 %ans.0.add67 = call i32 @llvm.smax.i32(i32 %ans.0104, i32 %add67) %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %exitcond121.not = icmp eq i64 %indvars.iv.next118, %8 br i1 %exitcond121.not, label %for.cond.cleanup59, label %for.body60, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; 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 <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !13, !12}
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_W_MAX 100 // 最大幅 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpT, *szpFpA; #endif // 実行メイン int fMain( int piTNo // <I> テスト番号 1~ ) { int i; char lc1Buf[1024], lc1Out[1024]; // テストファイルオープン #ifdef D_TEST sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo); szpFpT = fopen(lc1Buf, "r"); sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo); szpFpA = fopen(lc1Buf, "r"); siRes = 0; #endif // 列数取得 int liCCnt; #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif sscanf(lc1Buf, "%d", &liCCnt); // 1行目取得 int li1Cnt1[D_W_MAX]; for (i = 0; i < liCCnt; i++) { #ifdef D_TEST fscanf(szpFpT, "%d", &li1Cnt1[i]); #else fscanf(stdin, "%d", &li1Cnt1[i]); #endif } #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif // 2行目取得 int li1Cnt2[D_W_MAX]; for (i = 0; i < liCCnt; i++) { #ifdef D_TEST fscanf(szpFpT, "%d", &li1Cnt2[i]); #else fscanf(stdin, "%d", &li1Cnt2[i]); #endif } #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif // 左下を通る場合 int liSum = li1Cnt1[0]; for (i = 0; i < liCCnt; i++) { liSum += li1Cnt2[i]; } // 右へ移動してから下に移動する全パターン int liMax = liSum; for (i = 0; i < liCCnt - 1; i++) { liSum += li1Cnt1[i + 1] - li1Cnt2[i]; if (liMax < liSum) { liMax = liSum; } } // 結果セット sprintf(lc1Out, "%d\n", liMax); // 結果表示 #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, lc1Out)) { siRes = -1; } #else printf("%s", lc1Out); #endif // テストファイルクローズ #ifdef D_TEST fclose(szpFpT); fclose(szpFpA); #endif // テスト結果 #ifdef D_TEST if (siRes == 0) { printf("OK %d\n", piTNo); } else { printf("NG %d\n", piTNo); } #endif return 0; } int main() { #ifdef D_TEST int i; for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) { fMain(i); } #else fMain(0); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198717/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198717/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @fMain(i32 %piTNo) local_unnamed_addr #0 { entry: %lc1Buf = alloca [1024 x i8], align 16 %lc1Out = alloca [1024 x i8], align 16 %liCCnt = alloca i32, align 4 %li1Cnt1 = alloca [100 x i32], align 16 %li1Cnt2 = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #5 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liCCnt) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull %liCCnt) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %li1Cnt1) #5 %1 = load i32, ptr %liCCnt, align 4, !tbaa !9 %cmp61 = icmp sgt i32 %1, 0 br i1 %cmp61, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %arrayidx = getelementptr inbounds [100 x i32], ptr %li1Cnt1, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) #5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %liCCnt, align 4, !tbaa !9 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call5 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %5) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %li1Cnt2) #5 %6 = load i32, ptr %liCCnt, align 4, !tbaa !9 %cmp763 = icmp sgt i32 %6, 0 br i1 %cmp763, label %for.body8, label %for.end14 for.body8: ; preds = %for.end, %for.body8 %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body8 ], [ 0, %for.end ] %7 = load ptr, ptr @stdin, align 8, !tbaa !5 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %li1Cnt2, i64 0, i64 %indvars.iv75 %call11 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %7, ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10) #5 %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %8 = load i32, ptr %liCCnt, align 4, !tbaa !9 %9 = sext i32 %8 to i64 %cmp7 = icmp slt i64 %indvars.iv.next76, %9 br i1 %cmp7, label %for.body8, label %for.end14, !llvm.loop !13 for.end14: ; preds = %for.body8, %for.end %10 = load ptr, ptr @stdin, align 8, !tbaa !5 %call16 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %10) %11 = load i32, ptr %li1Cnt1, align 16, !tbaa !9 %12 = load i32, ptr %liCCnt, align 4, !tbaa !9 %cmp1965 = icmp sgt i32 %12, 0 br i1 %cmp1965, label %for.body20.preheader, label %for.end39 for.body20.preheader: ; preds = %for.end14 %wide.trip.count = zext i32 %12 to i64 %min.iters.check = icmp ult i32 %12, 8 br i1 %min.iters.check, label %for.body20.preheader90, label %vector.ph vector.ph: ; preds = %for.body20.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %13 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %11, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %13, %vector.ph ], [ %16, %vector.body ] %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %14 = getelementptr inbounds [100 x i32], ptr %li1Cnt2, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %14, align 16, !tbaa !9 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load89 = load <4 x i32>, ptr %15, align 16, !tbaa !9 %16 = add <4 x i32> %wide.load, %vec.phi %17 = add <4 x i32> %wide.load89, %vec.phi88 %index.next = add nuw i64 %index, 8 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond26.preheader, label %for.body20.preheader90 for.body20.preheader90: ; preds = %for.body20.preheader, %middle.block %indvars.iv78.ph = phi i64 [ 0, %for.body20.preheader ], [ %n.vec, %middle.block ] %liSum.067.ph = phi i32 [ %11, %for.body20.preheader ], [ %19, %middle.block ] br label %for.body20 for.cond26.preheader: ; preds = %for.body20, %middle.block %add.lcssa = phi i32 [ %19, %middle.block ], [ %add, %for.body20 ] %cmp2769 = icmp sgt i32 %12, 1 br i1 %cmp2769, label %for.body28.preheader, label %for.end39 for.body28.preheader: ; preds = %for.cond26.preheader %sub = add nsw i32 %12, -1 %wide.trip.count84 = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count84, 1 %20 = icmp eq i32 %sub, 1 br i1 %20, label %for.end39.loopexit.unr-lcssa, label %for.body28.preheader.new for.body28.preheader.new: ; preds = %for.body28.preheader %unroll_iter = and i64 %wide.trip.count84, 4294967294 br label %for.body28 for.body20: ; preds = %for.body20.preheader90, %for.body20 %indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body20 ], [ %indvars.iv78.ph, %for.body20.preheader90 ] %liSum.067 = phi i32 [ %add, %for.body20 ], [ %liSum.067.ph, %for.body20.preheader90 ] %arrayidx22 = getelementptr inbounds [100 x i32], ptr %li1Cnt2, i64 0, i64 %indvars.iv78 %21 = load i32, ptr %arrayidx22, align 4, !tbaa !9 %add = add nsw i32 %21, %liSum.067 %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count br i1 %exitcond.not, label %for.cond26.preheader, label %for.body20, !llvm.loop !17 for.body28: ; preds = %for.body28, %for.body28.preheader.new %indvars.iv81 = phi i64 [ 0, %for.body28.preheader.new ], [ %indvars.iv.next82.1, %for.body28 ] %liMax.072 = phi i32 [ %add.lcssa, %for.body28.preheader.new ], [ %spec.select.1, %for.body28 ] %liSum.171 = phi i32 [ %add.lcssa, %for.body28.preheader.new ], [ %add35.1, %for.body28 ] %niter = phi i64 [ 0, %for.body28.preheader.new ], [ %niter.next.1, %for.body28 ] %indvars.iv.next82 = or i64 %indvars.iv81, 1 %arrayidx31 = getelementptr inbounds [100 x i32], ptr %li1Cnt1, i64 0, i64 %indvars.iv.next82 %22 = load i32, ptr %arrayidx31, align 4, !tbaa !9 %arrayidx33 = getelementptr inbounds [100 x i32], ptr %li1Cnt2, i64 0, i64 %indvars.iv81 %23 = load i32, ptr %arrayidx33, align 8, !tbaa !9 %sub34 = sub nsw i32 %22, %23 %add35 = add nsw i32 %sub34, %liSum.171 %spec.select = call i32 @llvm.smax.i32(i32 %liMax.072, i32 %add35) %indvars.iv.next82.1 = add nuw nsw i64 %indvars.iv81, 2 %arrayidx31.1 = getelementptr inbounds [100 x i32], ptr %li1Cnt1, i64 0, i64 %indvars.iv.next82.1 %24 = load i32, ptr %arrayidx31.1, align 8, !tbaa !9 %arrayidx33.1 = getelementptr inbounds [100 x i32], ptr %li1Cnt2, i64 0, i64 %indvars.iv.next82 %25 = load i32, ptr %arrayidx33.1, align 4, !tbaa !9 %sub34.1 = sub nsw i32 %24, %25 %add35.1 = add nsw i32 %sub34.1, %add35 %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %add35.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.end39.loopexit.unr-lcssa, label %for.body28, !llvm.loop !18 for.end39.loopexit.unr-lcssa: ; preds = %for.body28, %for.body28.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body28.preheader ], [ %spec.select.1, %for.body28 ] %indvars.iv81.unr = phi i64 [ 0, %for.body28.preheader ], [ %indvars.iv.next82.1, %for.body28 ] %liMax.072.unr = phi i32 [ %add.lcssa, %for.body28.preheader ], [ %spec.select.1, %for.body28 ] %liSum.171.unr = phi i32 [ %add.lcssa, %for.body28.preheader ], [ %add35.1, %for.body28 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end39, label %for.body28.epil for.body28.epil: ; preds = %for.end39.loopexit.unr-lcssa %indvars.iv.next82.epil = add nuw nsw i64 %indvars.iv81.unr, 1 %arrayidx31.epil = getelementptr inbounds [100 x i32], ptr %li1Cnt1, i64 0, i64 %indvars.iv.next82.epil %26 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !9 %arrayidx33.epil = getelementptr inbounds [100 x i32], ptr %li1Cnt2, i64 0, i64 %indvars.iv81.unr %27 = load i32, ptr %arrayidx33.epil, align 4, !tbaa !9 %sub34.epil = sub nsw i32 %26, %27 %add35.epil = add nsw i32 %sub34.epil, %liSum.171.unr %spec.select.epil = call i32 @llvm.smax.i32(i32 %liMax.072.unr, i32 %add35.epil) br label %for.end39 for.end39: ; preds = %for.body28.epil, %for.end39.loopexit.unr-lcssa, %for.end14, %for.cond26.preheader %liMax.0.lcssa = phi i32 [ %add.lcssa, %for.cond26.preheader ], [ %11, %for.end14 ], [ %spec.select.lcssa.ph, %for.end39.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body28.epil ] %call41 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Out, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %liMax.0.lcssa) #5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %lc1Out) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %li1Cnt2) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %li1Cnt1) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liCCnt) #5 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #5 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3 ; 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 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 @fMain(i32 poison) ret i32 0 } ; 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.vector.reduce.add.v4i32(<4 x i32>) #4 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !12, !16, !15} !18 = distinct !{!18, !12}
#include "stdio.h" int main(void) { int N; int aa[100]; int bb[100]; int max, max2; int cnt; int i, j, h; scanf("%d", &N); for(i=0; i < N; i++) { scanf("%d", &aa[i]); } for(i=0; i < N; i++) { scanf("%d", &bb[i]); } cnt = 0; max = 0; max2 = 0; for(j=0; j < N; j++) { for(i=0; i < N; i++) { max = max + aa[i]; cnt++; if (cnt == N - j ) { for(h=i; h < N; h++) { max = max + bb[h]; } if(max > max2) { max2 = max; } } } cnt = 0; max = 0; } printf("%d\n", max2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198760/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198760/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %aa = alloca [100 x i32], align 16 %bb = 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 %aa) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %bb) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp58 = icmp sgt i32 %0, 0 br i1 %cmp58, label %for.body, label %for.end38 for.cond2.preheader: ; preds = %for.body %cmp360 = icmp sgt i32 %1, 0 br i1 %cmp360, label %for.body4, label %for.end38 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %aa, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.body4 %cmp1273 = icmp sgt i32 %13, 0 br i1 %cmp1273, label %for.cond14.preheader.us.preheader, label %for.end38 for.cond14.preheader.us.preheader: ; preds = %for.cond11.preheader %wide.trip.count90 = zext i32 %13 to i64 br label %for.cond14.preheader.us for.cond14.preheader.us: ; preds = %for.cond14.preheader.us.preheader, %for.cond14.for.end35_crit_edge.us %j.075.us = phi i32 [ %inc37.us, %for.cond14.for.end35_crit_edge.us ], [ 0, %for.cond14.preheader.us.preheader ] %max2.074.us = phi i32 [ %max2.2.us, %for.cond14.for.end35_crit_edge.us ], [ 0, %for.cond14.preheader.us.preheader ] %sub.us = sub nsw i32 %13, %j.075.us br label %for.body16.us for.body16.us: ; preds = %for.cond14.preheader.us, %for.inc33.us %indvars.iv82 = phi i64 [ 0, %for.cond14.preheader.us ], [ %indvars.iv.next83, %for.inc33.us ] %max2.168.us = phi i32 [ %max2.074.us, %for.cond14.preheader.us ], [ %max2.2.us, %for.inc33.us ] %max.167.us = phi i32 [ 0, %for.cond14.preheader.us ], [ %max.3.us, %for.inc33.us ] %3 = sub nsw i64 %wide.trip.count90, %indvars.iv82 %arrayidx18.us = getelementptr inbounds [100 x i32], ptr %aa, i64 0, i64 %indvars.iv82 %4 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %add.us = add nsw i32 %4, %max.167.us %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %indvars88 = trunc i64 %indvars.iv.next83 to i32 %cmp20.us = icmp eq i32 %sub.us, %indvars88 br i1 %cmp20.us, label %for.body23.us.preheader, label %for.inc33.us for.body23.us.preheader: ; preds = %for.body16.us %min.iters.check = icmp ult i64 %3, 8 br i1 %min.iters.check, label %for.body23.us.preheader100, label %vector.ph vector.ph: ; preds = %for.body23.us.preheader %n.vec = and i64 %3, -8 %ind.end = add i64 %indvars.iv82, %n.vec %5 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %add.us, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %5, %vector.ph ], [ %8, %vector.body ] %vec.phi98 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %offset.idx = add i64 %indvars.iv82, %index %6 = getelementptr inbounds [100 x i32], ptr %bb, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 %wide.load99 = load <4 x i32>, ptr %7, align 4, !tbaa !5 %8 = add <4 x i32> %wide.load, %vec.phi %9 = add <4 x i32> %wide.load99, %vec.phi98 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.end29.us, label %for.body23.us.preheader100 for.body23.us.preheader100: ; preds = %for.body23.us.preheader, %middle.block %indvars.iv84.ph = phi i64 [ %indvars.iv82, %for.body23.us.preheader ], [ %ind.end, %middle.block ] %max.263.us.ph = phi i32 [ %add.us, %for.body23.us.preheader ], [ %11, %middle.block ] br label %for.body23.us for.end29.us: ; preds = %for.body23.us, %middle.block %add26.us.lcssa = phi i32 [ %11, %middle.block ], [ %add26.us, %for.body23.us ] %spec.select.us = call i32 @llvm.smax.i32(i32 %add26.us.lcssa, i32 %max2.168.us) br label %for.inc33.us for.inc33.us: ; preds = %for.end29.us, %for.body16.us %max.3.us = phi i32 [ %add.us, %for.body16.us ], [ %add26.us.lcssa, %for.end29.us ] %max2.2.us = phi i32 [ %max2.168.us, %for.body16.us ], [ %spec.select.us, %for.end29.us ] %exitcond91.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count90 br i1 %exitcond91.not, label %for.cond14.for.end35_crit_edge.us, label %for.body16.us, !llvm.loop !14 for.body23.us: ; preds = %for.body23.us.preheader100, %for.body23.us %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body23.us ], [ %indvars.iv84.ph, %for.body23.us.preheader100 ] %max.263.us = phi i32 [ %add26.us, %for.body23.us ], [ %max.263.us.ph, %for.body23.us.preheader100 ] %arrayidx25.us = getelementptr inbounds [100 x i32], ptr %bb, i64 0, i64 %indvars.iv84 %12 = load i32, ptr %arrayidx25.us, align 4, !tbaa !5 %add26.us = add nsw i32 %12, %max.263.us %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count90 br i1 %exitcond.not, label %for.end29.us, label %for.body23.us, !llvm.loop !15 for.cond14.for.end35_crit_edge.us: ; preds = %for.inc33.us %inc37.us = add nuw nsw i32 %j.075.us, 1 %exitcond92.not = icmp eq i32 %inc37.us, %13 br i1 %exitcond92.not, label %for.end38, label %for.cond14.preheader.us, !llvm.loop !16 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %bb, i64 0, i64 %indvars.iv79 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %13 = load i32, ptr %N, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp3 = icmp slt i64 %indvars.iv.next80, %14 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !17 for.end38: ; preds = %for.cond14.for.end35_crit_edge.us, %entry, %for.cond2.preheader, %for.cond11.preheader %max2.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %max2.2.us, %for.cond14.for.end35_crit_edge.us ] %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max2.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %bb) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %aa) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
/* cat <<EOF >mistaken-paste */ #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #define BIG 2000000007 #define MOD 1000000007 typedef unsigned long long ull; typedef signed long long sll; #define N_MAX 100000 #define M_MAX 200 typedef struct { int a; int b; } hw; typedef struct { sll a; sll b; } hwll; typedef struct { ull a; int i; } struct_a; typedef struct { ull cost; int left; int right; } struct_b; const hw vector8[8] = { {-1, -1}, {-1, 0}, {-1, +1}, { 0, -1}, { 0, +1}, {+1, -1}, {+1, 0}, {+1, +1} }; ull n, m; ull h, w; ull k; ull vua, vub, vuc, vud, vue, vuf; sll vsa, vsb, vsc, vsd, vse, vsf; long double vra, vrb, vrc; ull a[N_MAX]; // sll a[N_MAX]; // ull wall[N_MAX][M_MAX]; // ull b[N_MAX]; // sll b[N_MAX]; // char s[N_MAX + 1]; // char t[N_MAX + 1]; // size_t slen; // size_t tlen; // char s[N_MAX][M_MAX + 1]; // ull dp[N_MAX]; // sll dp[N_MAX]; // bool dp[N_MAX]; // ull dq[N_MAX]; // ull dp[N_MAX + 1][N_MAX + 1]; ull dp[N_MAX][M_MAX + 1]; // hw arr[N_MAX]; // hwll arr[N_MAX]; // hw brr[M_MAX]; // ull digitdp[102][ 2][ 2]; // pos less carry // struct_a arr[N_MAX * 2]; // struct_b brr[N_MAX * 2]; void swap_adj (ull *a, ull *b) { ull tmp = *b; *b = *a; *a = tmp; return; } ull divide (ull a, ull b) { ull x = MOD - 2; ull ans = 1; while (x) { if (x & 1) ans = (ans * b) % MOD; b = (b * b) % MOD; x /= 2; } return (a * ans) % MOD; } int digits (ull x) { int i = 1; while (x >= 10) { x /= 10; i++; } return i; } ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } // int nextroute (int arr[]) { // int i = n - 1; // int j, x; // while (arr[i - 1] > arr[i]) i--; // x = n; // for (j = i; j < n; j++) { // if (arr[j] < arr[i - 1]) continue; // if (x == n || arr[x] > arr[j]) x = j; // } // arr[i - 1] ^= arr[x]; // arr[x] ^= arr[i - 1]; // arr[i - 1] ^= arr[x]; // qsort(&arr[i], n - i, sizeof(int), comp); // return 0; // } int targetdig (ull x, int index /* 1-indexed */) { // static...? int posmax = digits(x); if (posmax < index) return -1; while (posmax > index) { posmax--; x /= 10; } return x % 10; } int charcomp (const char left, const char right) { if (left < right) { return -1; } else if (left > right) { return +1; } else { return 0; } } int pcharcomp (const char *left, const char *right) { return charcomp(*left, *right); } int intcomp (const int left, const int right) { if (left < right) { return -1; } else if (left > right) { return +1; } else { return 0; } } int pintcomp (const int *left, const int *right) { return intcomp(*left, *right); } int ullcomp (const ull left, const ull right) { if (left < right) { return -1; } else if (left > right) { return +1; } else { return 0; } } int pullcomp (const ull *left, const ull *right) { return ullcomp(*left, *right); } int sllcomp (const sll left, const sll right) { if (left < right) { return -1; } else if (left > right) { return +1; } else { return 0; } } int psllcomp (const sll *left, const sll *right) { return sllcomp(*left, *right); } int phwAcomp (const hw *left, const hw *right) { return intcomp(left->a, right->a); } int phwBcomp (const hw *left, const hw *right) { return intcomp(left->b, right->b); } int phwABcomp (const hw *left, const hw *right) { int x = phwAcomp(left, right); if (x) return x; return phwBcomp(left, right); } int phwllAcomp (const hwll *left, const hwll *right) { return sllcomp(left->a, right->a); } int phwllBcomp (const hwll *left, const hwll *right) { return sllcomp(left->b, right->b); } int phwllABcomp (const hwll *left, const hwll *right) { int x = phwllAcomp(left, right); if (x) return x; return phwllBcomp(left, right); } int bitlet (char c) { return (1 << (c - 'a')); } ull ullabs (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sllabs (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } sll nibutanlobo (bool (*func)(sll arg), sll ok, sll ng) { while (sllabs(ok, ng) > 1) { sll med = (ok + ng) / 2; if (func(med)) { ok = med; } else { ng = med; } // printf("debug: [%lld %lld)\n", ok, ng); } if (!func(ok)) return ok * 2 - ng; return ok; } bool isbeaten (sll x) { int i; ull required = 0; for (i = 0; i < n; i++) { sll remainhp = a[i] - vub * x; if (remainhp > 0) { required += (remainhp - 1) / (vua - vub) + 1; } } return (required <= x); } ull solve () { sll i, j, ki; // ull result = 0; sll result = 0; ull sum = 0; // qsortの際には"p"ullcompを使う sll okmax = 1; while (!isbeaten(okmax)) okmax *= 2; result = nibutanlobo(isbeaten, okmax, 0); printf("%lld\n", result); // puts(s); return 0; success: puts("First"); return 0; fail: puts("Second"); return 1; } int main (void) { int i, j; int x, y; // scanf("%llu%llu", &h, &w); scanf("%llu", &n, &m); scanf("%llu%llu", &vua, &vub); // scanf("%s", s); // slen = strlen(s); // scanf("%s", t); // tlen = strlen(t); for (i = 0; i < n; i++) { scanf("%llu", &a[i]); } // for (i = 0; i < m; i++) { // scanf("%lld", &b[i]); // } solve(); // for (i = 0; i < n; i++) { // // scanf("%llu%llu", &vua, &vub); // scanf("%s", s); // solve(); // } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198803/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198803/source.c" target datalayout = "e-m:e-p270: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.hw = type { i32, i32 } %struct.hwll = type { i64, i64 } @vector8 = dso_local local_unnamed_addr constant [8 x %struct.hw] [%struct.hw { i32 -1, i32 -1 }, %struct.hw { i32 -1, i32 0 }, %struct.hw { i32 -1, i32 1 }, %struct.hw { i32 0, i32 -1 }, %struct.hw { i32 0, i32 1 }, %struct.hw { i32 1, i32 -1 }, %struct.hw { i32 1, i32 0 }, %struct.hw { i32 1, i32 1 }], align 16 @n = dso_local global i64 0, align 8 @a = dso_local global [100000 x i64] zeroinitializer, align 16 @vub = dso_local global i64 0, align 8 @vua = dso_local global i64 0, align 8 @.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @m = dso_local global i64 0, align 8 @.str.4 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @vuc = dso_local local_unnamed_addr global i64 0, align 8 @vud = dso_local local_unnamed_addr global i64 0, align 8 @vue = dso_local local_unnamed_addr global i64 0, align 8 @vuf = dso_local local_unnamed_addr global i64 0, align 8 @vsa = dso_local local_unnamed_addr global i64 0, align 8 @vsb = dso_local local_unnamed_addr global i64 0, align 8 @vsc = dso_local local_unnamed_addr global i64 0, align 8 @vsd = dso_local local_unnamed_addr global i64 0, align 8 @vse = dso_local local_unnamed_addr global i64 0, align 8 @vsf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @dp = dso_local local_unnamed_addr global [100000 x [201 x i64]] zeroinitializer, align 16 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_adj(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: br label %while.body while.body: ; preds = %entry, %if.end %ans.014 = phi i64 [ 1, %entry ], [ %ans.1, %if.end ] %x.013 = phi i64 [ 1000000005, %entry ], [ %div11, %if.end ] %b.addr.012 = phi i64 [ %b, %entry ], [ %rem3, %if.end ] %and = and i64 %x.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %ans.014, %b.addr.012 %rem = urem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i64 [ %rem, %if.then ], [ %ans.014, %while.body ] %mul2 = mul i64 %b.addr.012, %b.addr.012 %rem3 = urem i64 %mul2, 1000000007 %div11 = lshr i64 %x.013, 1 %tobool.not = icmp ult i64 %x.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end %mul4 = mul i64 %ans.1, %a %rem5 = urem i64 %mul4, 1000000007 ret i64 %rem5 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @digits(i64 noundef %x) local_unnamed_addr #1 { entry: %cmp3 = icmp ugt i64 %x, 9 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 1, %entry ] %x.addr.04 = phi i64 [ %div, %while.body ], [ %x, %entry ] %div = udiv i64 %x.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %cmp = icmp ugt i64 %x.addr.04, 99 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 1, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 { entry: %tobool.not12 = icmp eq i64 %x, 0 br i1 %tobool.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.015, %a.addr.014 %rem = urem i64 %mul, %modulo br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ] %div11 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.014, %a.addr.014 %rem3 = urem i64 %mul2, %modulo %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @targetdig(i64 noundef %x, i32 noundef %index) local_unnamed_addr #1 { entry: %cmp3.i = icmp ugt i64 %x, 9 br i1 %cmp3.i, label %while.body.i, label %digits.exit while.body.i: ; preds = %entry, %while.body.i %i.05.i = phi i32 [ %inc.i, %while.body.i ], [ 1, %entry ] %x.addr.04.i = phi i64 [ %div.i, %while.body.i ], [ %x, %entry ] %div.i = udiv i64 %x.addr.04.i, 10 %inc.i = add nuw nsw i32 %i.05.i, 1 %cmp.i = icmp ugt i64 %x.addr.04.i, 99 br i1 %cmp.i, label %while.body.i, label %digits.exit, !llvm.loop !11 digits.exit: ; preds = %while.body.i, %entry %i.0.lcssa.i = phi i32 [ 1, %entry ], [ %inc.i, %while.body.i ] %cmp = icmp slt i32 %i.0.lcssa.i, %index br i1 %cmp, label %cleanup, label %while.cond.preheader while.cond.preheader: ; preds = %digits.exit %cmp17 = icmp sgt i32 %i.0.lcssa.i, %index br i1 %cmp17, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %while.cond.preheader %0 = sub i32 %i.0.lcssa.i, %index %1 = xor i32 %index, -1 %2 = add i32 %i.0.lcssa.i, %1 %xtraiter = and i32 %0, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body.prol.loopexit, label %while.body.prol while.body.prol: ; preds = %while.body.preheader, %while.body.prol %posmax.09.prol = phi i32 [ %dec.prol, %while.body.prol ], [ %i.0.lcssa.i, %while.body.preheader ] %x.addr.08.prol = phi i64 [ %div.prol, %while.body.prol ], [ %x, %while.body.preheader ] %prol.iter = phi i32 [ %prol.iter.next, %while.body.prol ], [ 0, %while.body.preheader ] %dec.prol = add nsw i32 %posmax.09.prol, -1 %div.prol = udiv i64 %x.addr.08.prol, 10 %prol.iter.next = add i32 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %while.body.prol.loopexit, label %while.body.prol, !llvm.loop !13 while.body.prol.loopexit: ; preds = %while.body.prol, %while.body.preheader %posmax.09.unr = phi i32 [ %i.0.lcssa.i, %while.body.preheader ], [ %dec.prol, %while.body.prol ] %x.addr.08.unr = phi i64 [ %x, %while.body.preheader ], [ %div.prol, %while.body.prol ] %div.lcssa.unr = phi i64 [ undef, %while.body.preheader ], [ %div.prol, %while.body.prol ] %3 = icmp ult i32 %2, 3 br i1 %3, label %while.end, label %while.body while.body: ; preds = %while.body.prol.loopexit, %while.body %posmax.09 = phi i32 [ %dec.3, %while.body ], [ %posmax.09.unr, %while.body.prol.loopexit ] %x.addr.08 = phi i64 [ %div.3, %while.body ], [ %x.addr.08.unr, %while.body.prol.loopexit ] %dec.3 = add nsw i32 %posmax.09, -4 %div.3 = udiv i64 %x.addr.08, 10000 %cmp1.3 = icmp sgt i32 %dec.3, %index br i1 %cmp1.3, label %while.body, label %while.end, !llvm.loop !15 while.end: ; preds = %while.body.prol.loopexit, %while.body, %while.cond.preheader %x.addr.0.lcssa = phi i64 [ %x, %while.cond.preheader ], [ %div.lcssa.unr, %while.body.prol.loopexit ], [ %div.3, %while.body ] %rem = urem i64 %x.addr.0.lcssa, 10 %conv = trunc i64 %rem to i32 br label %cleanup cleanup: ; preds = %digits.exit, %while.end %retval.0 = phi i32 [ %conv, %while.end ], [ -1, %digits.exit ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @charcomp(i8 noundef signext %left, i8 noundef signext %right) local_unnamed_addr #3 { entry: %cmp = icmp slt i8 %left, %right %cmp5 = icmp sgt i8 %left, %right %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i8, ptr %left, align 1, !tbaa !16 %1 = load i8, ptr %right, align 1, !tbaa !16 %cmp.i = icmp slt i8 %0, %1 %cmp5.i = icmp sgt i8 %0, %1 %..i = zext i1 %cmp5.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @intcomp(i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 { entry: %cmp = icmp slt i32 %left, %right %cmp1 = icmp sgt i32 %left, %right %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pintcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i32, ptr %left, align 4, !tbaa !17 %1 = load i32, ptr %right, align 4, !tbaa !17 %cmp.i = icmp slt i32 %0, %1 %cmp1.i = icmp sgt i32 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ullcomp(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 { entry: %cmp = icmp ult i64 %left, %right %cmp1 = icmp ugt i64 %left, %right %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i64, ptr %left, align 8, !tbaa !5 %1 = load i64, ptr %right, align 8, !tbaa !5 %cmp.i = icmp ult i64 %0, %1 %cmp1.i = icmp ugt i64 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sllcomp(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 { entry: %cmp = icmp slt i64 %left, %right %cmp1 = icmp sgt i64 %left, %right %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i64, ptr %left, align 8, !tbaa !5 %1 = load i64, ptr %right, align 8, !tbaa !5 %cmp.i = icmp slt i64 %0, %1 %cmp1.i = icmp sgt i64 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwAcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i32, ptr %left, align 4, !tbaa !19 %1 = load i32, ptr %right, align 4, !tbaa !19 %cmp.i = icmp slt i32 %0, %1 %cmp1.i = icmp sgt i32 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwBcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %b = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1 %0 = load i32, ptr %b, align 4, !tbaa !21 %b1 = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1 %1 = load i32, ptr %b1, align 4, !tbaa !21 %cmp.i = icmp slt i32 %0, %1 %cmp1.i = icmp sgt i32 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i32, ptr %left, align 4, !tbaa !19 %1 = load i32, ptr %right, align 4, !tbaa !19 %cmp.i.i = icmp slt i32 %0, %1 %cmp1.i.i = icmp sgt i32 %0, %1 %..i.i = zext i1 %cmp1.i.i to i32 %retval.0.i.i = select i1 %cmp.i.i, i32 -1, i32 %..i.i %tobool.not = icmp eq i32 %retval.0.i.i, 0 br i1 %tobool.not, label %if.end, label %cleanup if.end: ; preds = %entry %b.i = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1 %2 = load i32, ptr %b.i, align 4, !tbaa !21 %b1.i = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1 %3 = load i32, ptr %b1.i, align 4, !tbaa !21 %cmp.i.i5 = icmp slt i32 %2, %3 %cmp1.i.i6 = icmp sgt i32 %2, %3 %..i.i7 = zext i1 %cmp1.i.i6 to i32 %retval.0.i.i8 = select i1 %cmp.i.i5, i32 -1, i32 %..i.i7 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ %retval.0.i.i8, %if.end ], [ %retval.0.i.i, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllAcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i64, ptr %left, align 8, !tbaa !22 %1 = load i64, ptr %right, align 8, !tbaa !22 %cmp.i = icmp slt i64 %0, %1 %cmp1.i = icmp sgt i64 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllBcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %b = getelementptr inbounds %struct.hwll, ptr %left, i64 0, i32 1 %0 = load i64, ptr %b, align 8, !tbaa !24 %b1 = getelementptr inbounds %struct.hwll, ptr %right, i64 0, i32 1 %1 = load i64, ptr %b1, align 8, !tbaa !24 %cmp.i = icmp slt i64 %0, %1 %cmp1.i = icmp sgt i64 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load i64, ptr %left, align 8, !tbaa !22 %1 = load i64, ptr %right, align 8, !tbaa !22 %cmp.i.i = icmp slt i64 %0, %1 %cmp1.i.i = icmp sgt i64 %0, %1 %..i.i = zext i1 %cmp1.i.i to i32 %retval.0.i.i = select i1 %cmp.i.i, i32 -1, i32 %..i.i %tobool.not = icmp eq i32 %retval.0.i.i, 0 br i1 %tobool.not, label %if.end, label %cleanup if.end: ; preds = %entry %b.i = getelementptr inbounds %struct.hwll, ptr %left, i64 0, i32 1 %2 = load i64, ptr %b.i, align 8, !tbaa !24 %b1.i = getelementptr inbounds %struct.hwll, ptr %right, i64 0, i32 1 %3 = load i64, ptr %b1.i, align 8, !tbaa !24 %cmp.i.i5 = icmp slt i64 %2, %3 %cmp1.i.i6 = icmp sgt i64 %2, %3 %..i.i7 = zext i1 %cmp1.i.i6 to i32 %retval.0.i.i8 = select i1 %cmp.i.i5, i32 -1, i32 %..i.i7 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ %retval.0.i.i8, %if.end ], [ %retval.0.i.i, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @bitlet(i8 noundef signext %c) local_unnamed_addr #3 { entry: %conv = sext i8 %c to i32 %sub = add nsw i32 %conv, -97 %shl = shl nuw nsw i32 1, %sub ret i32 %shl } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @ullabs(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sllabs(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i64 @nibutanlobo(ptr nocapture noundef readonly %func, i64 noundef %ok, i64 noundef %ng) local_unnamed_addr #5 { entry: %sub.i14 = sub nsw i64 %ok, %ng %retval.0.i15 = tail call i64 @llvm.abs.i64(i64 %sub.i14, i1 true) %cmp16 = icmp ugt i64 %retval.0.i15, 1 br i1 %cmp16, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %ng.addr.018 = phi i64 [ %ng.addr.0.div, %while.body ], [ %ng, %entry ] %ok.addr.017 = phi i64 [ %div.ok.addr.0, %while.body ], [ %ok, %entry ] %add = add nsw i64 %ng.addr.018, %ok.addr.017 %div = sdiv i64 %add, 2 %call1 = tail call zeroext i1 %func(i64 noundef %div) #10 %div.ok.addr.0 = select i1 %call1, i64 %div, i64 %ok.addr.017 %ng.addr.0.div = select i1 %call1, i64 %ng.addr.018, i64 %div %sub.i = sub nsw i64 %div.ok.addr.0, %ng.addr.0.div %retval.0.i = tail call i64 @llvm.abs.i64(i64 %sub.i, i1 true) %cmp = icmp ugt i64 %retval.0.i, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !25 while.end: ; preds = %while.body, %entry %ok.addr.0.lcssa = phi i64 [ %ok, %entry ], [ %div.ok.addr.0, %while.body ] %ng.addr.0.lcssa = phi i64 [ %ng, %entry ], [ %ng.addr.0.div, %while.body ] %call2 = tail call zeroext i1 %func(i64 noundef %ok.addr.0.lcssa) #10 %mul = shl nsw i64 %ok.addr.0.lcssa, 1 %sub = sub nsw i64 %mul, %ng.addr.0.lcssa %retval.0 = select i1 %call2, i64 %ok.addr.0.lcssa, i64 %sub ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local zeroext i1 @isbeaten(i64 noundef %x) local_unnamed_addr #6 { entry: %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp14.not = icmp eq i64 %0, 0 br i1 %cmp14.not, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i64, ptr @vub, align 8, !tbaa !5 %mul = mul i64 %1, %x %2 = load i64, ptr @vua, align 8 %sub5 = sub i64 %2, %1 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.end %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end ] %required.015 = phi i64 [ 0, %for.body.lr.ph ], [ %required.1, %if.end ] %arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv %3 = load i64, ptr %arrayidx, align 8, !tbaa !5 %sub = sub i64 %3, %mul %cmp2 = icmp sgt i64 %sub, 0 br i1 %cmp2, label %if.then, label %if.end if.then: ; preds = %for.body %sub4 = add nsw i64 %sub, -1 %div = udiv i64 %sub4, %sub5 %add = add i64 %required.015, 1 %add6 = add i64 %add, %div br label %if.end if.end: ; preds = %if.then, %for.body %required.1 = phi i64 [ %add6, %if.then ], [ %required.015, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !26 for.end: ; preds = %if.end, %entry %required.0.lcssa = phi i64 [ 0, %entry ], [ %required.1, %if.end ] %cmp7 = icmp ule i64 %required.0.lcssa, %x ret i1 %cmp7 } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #7 { entry: %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp14.not.i = icmp eq i64 %0, 0 br i1 %cmp14.not.i, label %isbeaten.exit37, label %for.body.lr.ph.i.lr.ph for.body.lr.ph.i.lr.ph: ; preds = %entry %1 = load i64, ptr @vub, align 8, !tbaa !5 %2 = load i64, ptr @vua, align 8 %sub5.i = sub i64 %2, %1 br label %for.body.lr.ph.i for.body.lr.ph.i: ; preds = %isbeaten.exit, %for.body.lr.ph.i.lr.ph %okmax.062 = phi i64 [ 1, %for.body.lr.ph.i.lr.ph ], [ %mul, %isbeaten.exit ] %mul.i = mul i64 %1, %okmax.062 br label %for.body.i for.body.i: ; preds = %if.end.i, %for.body.lr.ph.i %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %if.end.i ] %required.015.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %required.1.i, %if.end.i ] %arrayidx.i = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv.i %3 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %sub.i = sub i64 %3, %mul.i %cmp2.i = icmp sgt i64 %sub.i, 0 br i1 %cmp2.i, label %if.then.i, label %if.end.i if.then.i: ; preds = %for.body.i %sub4.i = add nsw i64 %sub.i, -1 %div.i = udiv i64 %sub4.i, %sub5.i %add.i = add i64 %required.015.i, 1 %add6.i = add i64 %add.i, %div.i br label %if.end.i if.end.i: ; preds = %if.then.i, %for.body.i %required.1.i = phi i64 [ %add6.i, %if.then.i ], [ %required.015.i, %for.body.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %0 br i1 %exitcond.not.i, label %isbeaten.exit, label %for.body.i, !llvm.loop !26 isbeaten.exit: ; preds = %if.end.i %cmp7.i.not = icmp ugt i64 %required.1.i, %okmax.062 %mul = shl nsw i64 %okmax.062, 1 br i1 %cmp7.i.not, label %for.body.lr.ph.i, label %while.end while.end: ; preds = %isbeaten.exit %retval.0.i15.i = tail call i64 @llvm.abs.i64(i64 %okmax.062, i1 true) %cmp16.i = icmp ugt i64 %retval.0.i15.i, 1 br i1 %cmp16.i, label %while.body.i.preheader, label %nibutanlobo.exit while.body.i.preheader: ; preds = %while.end %4 = load i64, ptr @vub, align 8 %5 = load i64, ptr @vua, align 8 %sub5.i41 = sub i64 %5, %4 br i1 %cmp14.not.i, label %while.body.i.us, label %while.body.i while.body.i.us: ; preds = %while.body.i.preheader, %while.body.i.us %ok.addr.017.i.us = phi i64 [ %div.i15.us, %while.body.i.us ], [ %okmax.062, %while.body.i.preheader ] %div.i15.us = sdiv i64 %ok.addr.017.i.us, 2 %retval.0.i.i.us = tail call i64 @llvm.abs.i64(i64 %div.i15.us, i1 true) %cmp.i.us = icmp ugt i64 %retval.0.i.i.us, 1 br i1 %cmp.i.us, label %while.body.i.us, label %nibutanlobo.exit, !llvm.loop !25 while.body.i: ; preds = %while.body.i.preheader, %isbeaten.exit59.loopexit %ng.addr.018.i = phi i64 [ %ng.addr.0.div.i, %isbeaten.exit59.loopexit ], [ 0, %while.body.i.preheader ] %ok.addr.017.i = phi i64 [ %div.ok.addr.0.i, %isbeaten.exit59.loopexit ], [ %okmax.062, %while.body.i.preheader ] %add.i14 = add nsw i64 %ok.addr.017.i, %ng.addr.018.i %div.i15 = sdiv i64 %add.i14, 2 %mul.i40 = mul i64 %4, %div.i15 br label %for.body.i42 for.body.i42: ; preds = %if.end.i48, %while.body.i %indvars.iv.i43 = phi i64 [ 0, %while.body.i ], [ %indvars.iv.next.i50, %if.end.i48 ] %required.015.i44 = phi i64 [ 0, %while.body.i ], [ %required.1.i49, %if.end.i48 ] %arrayidx.i45 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv.i43 %6 = load i64, ptr %arrayidx.i45, align 8, !tbaa !5 %sub.i46 = sub i64 %6, %mul.i40 %cmp2.i47 = icmp sgt i64 %sub.i46, 0 br i1 %cmp2.i47, label %if.then.i54, label %if.end.i48 if.then.i54: ; preds = %for.body.i42 %sub4.i55 = add nsw i64 %sub.i46, -1 %div.i56 = udiv i64 %sub4.i55, %sub5.i41 %add.i57 = add i64 %required.015.i44, 1 %add6.i58 = add i64 %add.i57, %div.i56 br label %if.end.i48 if.end.i48: ; preds = %if.then.i54, %for.body.i42 %required.1.i49 = phi i64 [ %add6.i58, %if.then.i54 ], [ %required.015.i44, %for.body.i42 ] %indvars.iv.next.i50 = add nuw nsw i64 %indvars.iv.i43, 1 %exitcond.not.i51 = icmp eq i64 %indvars.iv.next.i50, %0 br i1 %exitcond.not.i51, label %isbeaten.exit59.loopexit, label %for.body.i42, !llvm.loop !26 isbeaten.exit59.loopexit: ; preds = %if.end.i48 %cmp7.i53.not = icmp ugt i64 %required.1.i49, %div.i15 %div.ok.addr.0.i = select i1 %cmp7.i53.not, i64 %ok.addr.017.i, i64 %div.i15 %ng.addr.0.div.i = select i1 %cmp7.i53.not, i64 %div.i15, i64 %ng.addr.018.i %sub.i.i = sub nsw i64 %div.ok.addr.0.i, %ng.addr.0.div.i %retval.0.i.i = tail call i64 @llvm.abs.i64(i64 %sub.i.i, i1 true) %cmp.i = icmp ugt i64 %retval.0.i.i, 1 br i1 %cmp.i, label %while.body.i, label %nibutanlobo.exit, !llvm.loop !25 nibutanlobo.exit: ; preds = %isbeaten.exit59.loopexit, %while.body.i.us, %while.end %ok.addr.0.lcssa.i = phi i64 [ %okmax.062, %while.end ], [ %div.i15.us, %while.body.i.us ], [ %div.ok.addr.0.i, %isbeaten.exit59.loopexit ] %ng.addr.0.lcssa.i = phi i64 [ 0, %while.end ], [ 0, %while.body.i.us ], [ %ng.addr.0.div.i, %isbeaten.exit59.loopexit ] br i1 %cmp14.not.i, label %isbeaten.exit37, label %for.body.lr.ph.i17 for.body.lr.ph.i17: ; preds = %nibutanlobo.exit %7 = load i64, ptr @vub, align 8, !tbaa !5 %mul.i18 = mul i64 %7, %ok.addr.0.lcssa.i %8 = load i64, ptr @vua, align 8 %sub5.i19 = sub i64 %8, %7 br label %for.body.i20 for.body.i20: ; preds = %if.end.i26, %for.body.lr.ph.i17 %indvars.iv.i21 = phi i64 [ 0, %for.body.lr.ph.i17 ], [ %indvars.iv.next.i28, %if.end.i26 ] %required.015.i22 = phi i64 [ 0, %for.body.lr.ph.i17 ], [ %required.1.i27, %if.end.i26 ] %arrayidx.i23 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv.i21 %9 = load i64, ptr %arrayidx.i23, align 8, !tbaa !5 %sub.i24 = sub i64 %9, %mul.i18 %cmp2.i25 = icmp sgt i64 %sub.i24, 0 br i1 %cmp2.i25, label %if.then.i32, label %if.end.i26 if.then.i32: ; preds = %for.body.i20 %sub4.i33 = add nsw i64 %sub.i24, -1 %div.i34 = udiv i64 %sub4.i33, %sub5.i19 %add.i35 = add i64 %required.015.i22, 1 %add6.i36 = add i64 %add.i35, %div.i34 br label %if.end.i26 if.end.i26: ; preds = %if.then.i32, %for.body.i20 %required.1.i27 = phi i64 [ %add6.i36, %if.then.i32 ], [ %required.015.i22, %for.body.i20 ] %indvars.iv.next.i28 = add nuw nsw i64 %indvars.iv.i21, 1 %exitcond.not.i29 = icmp eq i64 %indvars.iv.next.i28, %0 br i1 %exitcond.not.i29, label %isbeaten.exit37, label %for.body.i20, !llvm.loop !26 isbeaten.exit37: ; preds = %if.end.i26, %entry, %nibutanlobo.exit %ng.addr.0.lcssa.i87 = phi i64 [ %ng.addr.0.lcssa.i, %nibutanlobo.exit ], [ 0, %entry ], [ %ng.addr.0.lcssa.i, %if.end.i26 ] %ok.addr.0.lcssa.i86 = phi i64 [ %ok.addr.0.lcssa.i, %nibutanlobo.exit ], [ 1, %entry ], [ %ok.addr.0.lcssa.i, %if.end.i26 ] %required.0.lcssa.i30 = phi i64 [ 0, %nibutanlobo.exit ], [ 0, %entry ], [ %required.1.i27, %if.end.i26 ] %cmp7.i31.not = icmp ugt i64 %required.0.lcssa.i30, %ok.addr.0.lcssa.i86 %mul.i12 = shl nsw i64 %ok.addr.0.lcssa.i86, 1 %sub.i13 = sub nsw i64 %mul.i12, %ng.addr.0.lcssa.i87 %retval.0.i = select i1 %cmp7.i31.not, i64 %sub.i13, i64 %ok.addr.0.lcssa.i86 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %retval.0.i) ret i64 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @vua, ptr noundef nonnull @vub) %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp7.not = icmp eq i64 %0, 0 br i1 %cmp7.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv %call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %1 = load i64, ptr @n, align 8, !tbaa !5 %cmp = icmp ugt i64 %1, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !27 for.end: ; preds = %for.body, %entry %call4 = tail call i64 @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #9 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10} !16 = !{!7, !7, i64 0} !17 = !{!18, !18, i64 0} !18 = !{!"int", !7, i64 0} !19 = !{!20, !18, i64 0} !20 = !{!"", !18, i64 0, !18, i64 4} !21 = !{!20, !18, i64 4} !22 = !{!23, !6, i64 0} !23 = !{!"", !6, i64 0, !6, i64 8} !24 = !{!23, !6, i64 8} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10}
#include <stdio.h> #include <stdlib.h> #define FOR(i,a,n) for(i=(a);i<(n);i++) #define swap(type,a,b) do{type t=a;a=b;b=t;}while(0); #define MAX(a,b) (((a)>(b))?(a):(b)) #define INF 1000000000000000LL #define ll long long #define MAX_V 100000 #define MAX_E 200000 typedef struct LIST{ int to; struct LIST *next; }Edge; Edge *g[MAX_V]; Edge edge[MAX_E]; int e_size=0; void add_edge(int s,int t){ edge[e_size].next=g[s]; g[s]=&edge[e_size++]; g[s]->to=t; return; } int color[MAX_V]; int dfs(int v,int c){ Edge *e; color[v]=c; for(e=g[v];e!=NULL;e=e->next){ if(color[e->to]==-c) continue; if(color[e->to]==color[v]||!dfs(e->to,-c)) return 0; } return 1; } int main(void) { int n,m,a,b,cnt=0,flag,i; scanf("%d%d",&n,&m); FOR(i,0,m){ scanf("%d%d",&a,&b); add_edge(--a,--b); add_edge(b,a); } flag=dfs(0,1); FOR(i,0,n) cnt+=(color[i]==1); if(!flag) printf("%lld\n",(ll)n*(n-1)/2-m); else printf("%lld\n",(ll)cnt*(n-cnt)-m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198847/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198847/source.c" target datalayout = "e-m:e-p270: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.LIST = type { i32, ptr } @e_size = dso_local local_unnamed_addr global i32 0, align 4 @g = dso_local local_unnamed_addr global [100000 x ptr] zeroinitializer, align 16 @edge = dso_local global [200000 x %struct.LIST] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @add_edge(i32 noundef %s, i32 noundef %t) local_unnamed_addr #0 { entry: %idxprom = sext i32 %s to i64 %arrayidx = getelementptr inbounds [100000 x ptr], ptr @g, i64 0, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !5 %1 = load i32, ptr @e_size, align 4, !tbaa !9 %idxprom1 = sext i32 %1 to i64 %next = getelementptr inbounds [200000 x %struct.LIST], ptr @edge, i64 0, i64 %idxprom1, i32 1 store ptr %0, ptr %next, align 8, !tbaa !11 %inc = add nsw i32 %1, 1 store i32 %inc, ptr @e_size, align 4, !tbaa !9 %arrayidx4 = getelementptr inbounds [200000 x %struct.LIST], ptr @edge, i64 0, i64 %idxprom1 store ptr %arrayidx4, ptr %arrayidx, align 8, !tbaa !5 store i32 %t, ptr %arrayidx4, align 16, !tbaa !13 ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %v, i32 noundef %c) local_unnamed_addr #1 { entry: %idxprom = sext i32 %v to i64 %arrayidx = getelementptr inbounds [100000 x i32], ptr @color, i64 0, i64 %idxprom store i32 %c, ptr %arrayidx, align 4, !tbaa !9 %arrayidx2 = getelementptr inbounds [100000 x ptr], ptr @g, i64 0, i64 %idxprom %e.024 = load ptr, ptr %arrayidx2, align 8, !tbaa !5 %cmp.not25 = icmp eq ptr %e.024, null br i1 %cmp.not25, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %sub = sub nsw i32 0, %c br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %e.026 = phi ptr [ %e.024, %for.body.lr.ph ], [ %e.0, %for.inc ] %0 = load i32, ptr %e.026, align 8, !tbaa !13 %idxprom3 = sext i32 %0 to i64 %arrayidx4 = getelementptr inbounds [100000 x i32], ptr @color, i64 0, i64 %idxprom3 %1 = load i32, ptr %arrayidx4, align 4, !tbaa !9 %cmp5 = icmp eq i32 %1, %sub br i1 %cmp5, label %for.inc, label %if.end if.end: ; preds = %for.body %2 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp11 = icmp eq i32 %1, %2 br i1 %cmp11, label %cleanup, label %lor.lhs.false lor.lhs.false: ; preds = %if.end %call = tail call i32 @dfs(i32 noundef %0, i32 noundef %sub), !range !14 %tobool.not = icmp eq i32 %call, 0 br i1 %tobool.not, label %cleanup, label %for.inc for.inc: ; preds = %lor.lhs.false, %for.body %next = getelementptr inbounds %struct.LIST, ptr %e.026, i64 0, i32 1 %e.0 = load ptr, ptr %next, align 8, !tbaa !5 %cmp.not = icmp eq ptr %e.0, null br i1 %cmp.not, label %cleanup, label %for.body, !llvm.loop !15 cleanup: ; preds = %lor.lhs.false, %if.end, %for.inc, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 0, %if.end ], [ 0, %lor.lhs.false ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { 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) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !9 %cmp35 = icmp sgt i32 %0, 0 br i1 %cmp35, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.036 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %a, align 4, !tbaa !9 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %a, align 4, !tbaa !9 %2 = load i32, ptr %b, align 4, !tbaa !9 %dec2 = add nsw i32 %2, -1 store i32 %dec2, ptr %b, align 4, !tbaa !9 %idxprom.i = sext i32 %dec to i64 %arrayidx.i = getelementptr inbounds [100000 x ptr], ptr @g, i64 0, i64 %idxprom.i %3 = load ptr, ptr %arrayidx.i, align 8, !tbaa !5 %4 = load i32, ptr @e_size, align 4, !tbaa !9 %idxprom1.i = sext i32 %4 to i64 %next.i = getelementptr inbounds [200000 x %struct.LIST], ptr @edge, i64 0, i64 %idxprom1.i, i32 1 store ptr %3, ptr %next.i, align 8, !tbaa !11 %inc.i = add nsw i32 %4, 1 %arrayidx4.i = getelementptr inbounds [200000 x %struct.LIST], ptr @edge, i64 0, i64 %idxprom1.i store ptr %arrayidx4.i, ptr %arrayidx.i, align 8, !tbaa !5 store i32 %dec2, ptr %arrayidx4.i, align 16, !tbaa !13 %idxprom.i29 = sext i32 %dec2 to i64 %arrayidx.i30 = getelementptr inbounds [100000 x ptr], ptr @g, i64 0, i64 %idxprom.i29 %5 = load ptr, ptr %arrayidx.i30, align 8, !tbaa !5 %idxprom1.i31 = sext i32 %inc.i to i64 %next.i32 = getelementptr inbounds [200000 x %struct.LIST], ptr @edge, i64 0, i64 %idxprom1.i31, i32 1 store ptr %5, ptr %next.i32, align 8, !tbaa !11 %inc.i33 = add nsw i32 %4, 2 store i32 %inc.i33, ptr @e_size, align 4, !tbaa !9 %arrayidx4.i34 = getelementptr inbounds [200000 x %struct.LIST], ptr @edge, i64 0, i64 %idxprom1.i31 store ptr %arrayidx4.i34, ptr %arrayidx.i30, align 8, !tbaa !5 store i32 %dec, ptr %arrayidx4.i34, align 16, !tbaa !13 %inc = add nuw nsw i32 %i.036, 1 %6 = load i32, ptr %m, align 4, !tbaa !9 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !17 for.end: ; preds = %for.body, %entry %call3 = call i32 @dfs(i32 noundef 0, i32 noundef 1), !range !14 %7 = load i32, ptr %n, align 4, !tbaa !9 %cmp537 = icmp sgt i32 %7, 0 br i1 %cmp537, label %for.body6.preheader, label %for.end10 for.body6.preheader: ; preds = %for.end %wide.trip.count = zext i32 %7 to i64 %min.iters.check = icmp ult i32 %7, 8 br i1 %min.iters.check, label %for.body6.preheader44, label %vector.ph vector.ph: ; preds = %for.body6.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %8 = getelementptr inbounds [100000 x i32], ptr @color, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !9 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load43 = load <4 x i32>, ptr %9, align 16, !tbaa !9 %10 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %11 = icmp eq <4 x i32> %wide.load43, <i32 1, i32 1, i32 1, i32 1> %12 = zext <4 x i1> %10 to <4 x i32> %13 = zext <4 x i1> %11 to <4 x i32> %14 = add <4 x i32> %vec.phi, %12 %15 = add <4 x i32> %vec.phi42, %13 %index.next = add nuw i64 %index, 8 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %15, %14 %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end10, label %for.body6.preheader44 for.body6.preheader44: ; preds = %for.body6.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ] %cnt.038.ph = phi i32 [ 0, %for.body6.preheader ], [ %17, %middle.block ] br label %for.body6 for.body6: ; preds = %for.body6.preheader44, %for.body6 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ %indvars.iv.ph, %for.body6.preheader44 ] %cnt.038 = phi i32 [ %add, %for.body6 ], [ %cnt.038.ph, %for.body6.preheader44 ] %arrayidx = getelementptr inbounds [100000 x i32], ptr @color, i64 0, i64 %indvars.iv %18 = load i32, ptr %arrayidx, align 4, !tbaa !9 %cmp7 = icmp eq i32 %18, 1 %conv = zext i1 %cmp7 to i32 %add = add nuw nsw i32 %cnt.038, %conv %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.end10, label %for.body6, !llvm.loop !21 for.end10: ; preds = %for.body6, %middle.block, %for.end %cnt.0.lcssa = phi i32 [ 0, %for.end ], [ %17, %middle.block ], [ %add, %for.body6 ] %tobool.not = icmp eq i32 %call3, 0 br i1 %tobool.not, label %if.then, label %if.else if.then: ; preds = %for.end10 %conv11 = sext i32 %7 to i64 %sub = add nsw i32 %7, -1 %conv12 = sext i32 %sub to i64 %mul = mul nsw i64 %conv12, %conv11 %div = sdiv i64 %mul, 2 br label %if.end if.else: ; preds = %for.end10 %conv16 = zext i32 %cnt.0.lcssa to i64 %sub17 = sub nsw i32 %7, %cnt.0.lcssa %conv18 = sext i32 %sub17 to i64 %mul19 = mul nsw i64 %conv18, %conv16 br label %if.end if.end: ; preds = %if.else, %if.then %mul19.sink = phi i64 [ %mul19, %if.else ], [ %div, %if.then ] %.sink = load i32, ptr %m, align 4, !tbaa !9 %conv20 = sext i32 %.sink to i64 %sub21 = sub nsw i64 %mul19.sink, %conv20 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub21) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!12, !6, i64 8} !12 = !{!"LIST", !10, i64 0, !6, i64 8} !13 = !{!12, !10, i64 0} !14 = !{i32 0, i32 2} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = distinct !{!17, !16} !18 = distinct !{!18, !16, !19, !20} !19 = !{!"llvm.loop.isvectorized", i32 1} !20 = !{!"llvm.loop.unroll.runtime.disable"} !21 = distinct !{!21, !16, !20, !19}
#include<stdio.h> #define MAX 1000001 #define NUM 100 int main() { int flag[MAX]; int q,n[NUM]; int temp; int i,j; int result; scanf("%d",&q); for(i=0;i<q;i++) { scanf("%d",&n[i]); for(j=0;j<MAX;j++) flag[j]=0; for(result=0;n[i]>9;result++) { temp=(n[i]%10)*(n[i]/10); for(j=100;j<=n[i];j*=10) { if((n[i]%j)*(n[i]/j)>temp) temp=(n[i]%j)*(n[i]/j); } n[i]=temp; //printf("temp: %d\n",n[i]); if(flag[n[i]]==1) { result=-1; break; } else flag[n[i]]=1; } printf("%d\n",result); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198890/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198890/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %flag = alloca [1000001 x i32], align 16 %q = alloca i32, align 4 %n = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4000004, ptr nonnull %flag) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp94 = icmp sgt i32 %0, 0 br i1 %cmp94, label %for.body, label %for.end58 for.body: ; preds = %entry, %for.end54 %indvars.iv = phi i64 [ %indvars.iv.next, %for.end54 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %n, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000004) %flag, i8 0, i64 4000004, i1 false), !tbaa !5 %arrayidx.promoted = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1088 = icmp sgt i32 %arrayidx.promoted, 9 br i1 %cmp1088, label %for.body11, label %for.end54 for.body11: ; preds = %for.body, %if.else %result.090 = phi i32 [ %inc53, %if.else ], [ 0, %for.body ] %temp.0.lcssa8789 = phi i32 [ %temp.0.lcssa, %if.else ], [ %arrayidx.promoted, %for.body ] %rem = urem i32 %temp.0.lcssa8789, 10 %div = udiv i32 %temp.0.lcssa8789, 10 %mul = mul nuw nsw i32 %rem, %div %cmp19.not84 = icmp ult i32 %temp.0.lcssa8789, 100 br i1 %cmp19.not84, label %for.end38, label %for.body20 for.body20: ; preds = %for.body11, %for.body20 %j.186 = phi i32 [ %mul37, %for.body20 ], [ 100, %for.body11 ] %temp.085 = phi i32 [ %spec.select, %for.body20 ], [ %mul, %for.body11 ] %rem23 = urem i32 %temp.0.lcssa8789, %j.186 %div26 = udiv i32 %temp.0.lcssa8789, %j.186 %mul27 = mul nsw i32 %div26, %rem23 %spec.select = call i32 @llvm.smax.i32(i32 %mul27, i32 %temp.085) %mul37 = mul nuw nsw i32 %j.186, 10 %cmp19.not = icmp ugt i32 %mul37, %temp.0.lcssa8789 br i1 %cmp19.not, label %for.end38, label %for.body20, !llvm.loop !9 for.end38: ; preds = %for.body20, %for.body11 %temp.0.lcssa = phi i32 [ %mul, %for.body11 ], [ %spec.select, %for.body20 ] %idxprom43 = sext i32 %temp.0.lcssa to i64 %arrayidx44 = getelementptr inbounds [1000001 x i32], ptr %flag, i64 0, i64 %idxprom43 %1 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %cmp45 = icmp eq i32 %1, 1 br i1 %cmp45, label %for.end54.sink.split, label %if.else if.else: ; preds = %for.end38 store i32 1, ptr %arrayidx44, align 4, !tbaa !5 %inc53 = add nuw nsw i32 %result.090, 1 %cmp10 = icmp sgt i32 %temp.0.lcssa, 9 br i1 %cmp10, label %for.body11, label %for.end54.sink.split, !llvm.loop !11 for.end54.sink.split: ; preds = %if.else, %for.end38 %result.1.ph = phi i32 [ -1, %for.end38 ], [ %inc53, %if.else ] store i32 %temp.0.lcssa, ptr %arrayidx, align 4, !tbaa !5 br label %for.end54 for.end54: ; preds = %for.end54.sink.split, %for.body %result.1 = phi i32 [ 0, %for.body ], [ %result.1.ph, %for.end54.sink.split ] %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.1) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %q, 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.end58, !llvm.loop !12 for.end58: ; preds = %for.end54, %entry call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4000004, ptr nonnull %flag) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <stdlib.h>//random,NULL #include <string.h> #include <time.h> #include <unistd.h>//sleep() #include <math.h> #define true 1 #define false 0 #define rep(i,n) for(int i=0; i<((int)n); i++) #define REP(i,n) for(int i=0; i<=((int)n); i++) #define srep(i,a,n) for(int i=a; i<((int)n); i++) #define SREP(i,a,n) for(int i=a; i<=((int)n); i++) #define rrep(i,n) for(int i=n-1; i>=0; i--) #define RREP(i,n) for(int i=n; i>=0; i--) #define INF 10000000000000 //有向グラフ //cが負の値も取りうることと、N^3はデカすぎることより //bellman_ford法を用いる。 //今回は普通のベルマンではないが。 /* アルゴリズム概要 N-1回実行する間に、頂点Nの値は少なくとも1回更新される。 まずはこのN-1回の中で最大化される時を見つける 次のN会の間に値が更新された時、閉路があるということなので、infになるかを調べる。 次のN回の内(ループは最大でN)、さらに大きくなることがあれば、inf */ //正負を逆にして、一般的なbellman_fordを実装する。 long bellman_ford(int N, int M, int **edge){ long *d=(long *)malloc(sizeof(long)*N); rep(i,N){ d[i]=INF; } d[0]=0; rep(k,N-1){ //int update=false; rep(j,M){ if(d[edge[j][0]]!=INF && d[edge[j][0]]+edge[j][2]<d[edge[j][1]]){ d[edge[j][1]]=d[edge[j][0]]+edge[j][2]; //update=true; } } } // rep(i,N){ // printf("d[%d] = %d, ", i, d[i]); // } // printf("\n"); //この時点で、d[N-1]にはN-1回の内での最小値が入っている。 long record=d[N-1]; rep(k,N){ rep(j,M){ if(d[edge[j][0]]+edge[j][2]<d[edge[j][1]]){ d[edge[j][1]]=d[edge[j][0]]+edge[j][2]; } } } // rep(i,N){ // printf("d[%d] = %d, ", i, d[i]); // } // printf("\n"); if(record>d[N-1]){ return INF*(-1); } else{ return record; } } int main(){ char buf[1024]; int N,M; fgets(buf,sizeof(buf),stdin); sscanf(buf, "%d %d", &N, &M); int *array=(int *)malloc(sizeof(int)*N); rep(i,N){ ; } int **edge=(int **)malloc(sizeof(int *)*M); rep(i,M){ edge[i]=(int *)malloc(sizeof(int)*3); } rep(i,M){ fgets(buf,sizeof(buf),stdin); sscanf(buf, "%d %d %d", &edge[i][0], &edge[i][1], &edge[i][2]); edge[i][0]--; edge[i][1]--; } rep(i,M){ edge[i][2]=edge[i][2]*(-1); } long longest=bellman_ford(N, M, edge)*(-1); if(longest==INF){ printf("inf\n"); } else{ printf("%ld\n", longest); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198933/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198933/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 @str = private unnamed_addr constant [4 x i8] c"inf\00", align 1 ; Function Attrs: nofree nounwind memory(readwrite, argmem: read) uwtable define dso_local i64 @bellman_ford(i32 noundef %N, i32 noundef %M, ptr nocapture noundef readonly %edge) local_unnamed_addr #0 { entry: %conv = sext i32 %N to i64 %mul = shl nsw i64 %conv, 3 %call = tail call noalias ptr @malloc(i64 noundef %mul) #6 %cmp170 = icmp sgt i32 %N, 0 br i1 %cmp170, label %for.body.preheader, label %for.cond.cleanup6.thread202 for.cond.cleanup6.thread202: ; preds = %entry store i64 0, ptr %call, align 8, !tbaa !5 %sub195 = add i32 %N, -1 %idxprom58204 = sext i32 %sub195 to i64 %arrayidx59205 = getelementptr inbounds i64, ptr %call, i64 %idxprom58204 %0 = load i64, ptr %arrayidx59205, align 8, !tbaa !5 br label %for.cond.cleanup64 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %min.iters.check = icmp ult i32 %N, 4 br i1 %min.iters.check, label %for.body.preheader208, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967292 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = getelementptr inbounds i64, ptr %call, i64 %index store <2 x i64> <i64 10000000000000, i64 10000000000000>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 store <2 x i64> <i64 10000000000000, i64 10000000000000>, ptr %2, align 8, !tbaa !5 %index.next = add nuw i64 %index, 4 %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader208 for.body.preheader208: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block store i64 0, ptr %call, align 8, !tbaa !5 %sub = add i32 %N, -1 %cmp4174 = icmp sgt i32 %N, 1 br i1 %cmp4174, label %for.cond8.preheader.lr.ph, label %for.cond.cleanup6 for.cond8.preheader.lr.ph: ; preds = %for.cond.cleanup %cmp9172 = icmp sgt i32 %M, 0 br i1 %cmp9172, label %for.cond8.preheader.us.preheader, label %for.cond67.preheader.lr.ph.thread for.cond67.preheader.lr.ph.thread: ; preds = %for.cond8.preheader.lr.ph %idxprom58199 = zext i32 %sub to i64 %arrayidx59200 = getelementptr inbounds i64, ptr %call, i64 %idxprom58199 %4 = load i64, ptr %arrayidx59200, align 8, !tbaa !5 br label %for.cond.cleanup64 for.cond8.preheader.us.preheader: ; preds = %for.cond8.preheader.lr.ph %wide.trip.count186 = zext i32 %M to i64 br label %for.cond8.preheader.us for.cond8.preheader.us: ; preds = %for.cond8.preheader.us.preheader, %for.cond8.for.cond.cleanup11_crit_edge.us %k.0175.us = phi i32 [ %inc55.us, %for.cond8.for.cond.cleanup11_crit_edge.us ], [ 0, %for.cond8.preheader.us.preheader ] br label %for.body12.us for.body12.us: ; preds = %for.cond8.preheader.us, %for.inc51.us %indvars.iv183 = phi i64 [ 0, %for.cond8.preheader.us ], [ %indvars.iv.next184, %for.inc51.us ] %arrayidx14.us = getelementptr inbounds ptr, ptr %edge, i64 %indvars.iv183 %5 = load ptr, ptr %arrayidx14.us, align 8, !tbaa !13 %6 = load i32, ptr %5, align 4, !tbaa !15 %idxprom16.us = sext i32 %6 to i64 %arrayidx17.us = getelementptr inbounds i64, ptr %call, i64 %idxprom16.us %7 = load i64, ptr %arrayidx17.us, align 8, !tbaa !5 %cmp18.not.us = icmp eq i64 %7, 10000000000000 br i1 %cmp18.not.us, label %for.inc51.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body12.us %arrayidx27.us = getelementptr inbounds i32, ptr %5, i64 2 %8 = load i32, ptr %arrayidx27.us, align 4, !tbaa !15 %conv28.us = sext i32 %8 to i64 %add.us = add nsw i64 %7, %conv28.us %arrayidx31.us = getelementptr inbounds i32, ptr %5, i64 1 %9 = load i32, ptr %arrayidx31.us, align 4, !tbaa !15 %idxprom32.us = sext i32 %9 to i64 %arrayidx33.us = getelementptr inbounds i64, ptr %call, i64 %idxprom32.us %10 = load i64, ptr %arrayidx33.us, align 8, !tbaa !5 %cmp34.us = icmp slt i64 %add.us, %10 br i1 %cmp34.us, label %if.then.us, label %for.inc51.us if.then.us: ; preds = %land.lhs.true.us store i64 %add.us, ptr %arrayidx33.us, align 8, !tbaa !5 br label %for.inc51.us for.inc51.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body12.us %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1 %exitcond187.not = icmp eq i64 %indvars.iv.next184, %wide.trip.count186 br i1 %exitcond187.not, label %for.cond8.for.cond.cleanup11_crit_edge.us, label %for.body12.us, !llvm.loop !17 for.cond8.for.cond.cleanup11_crit_edge.us: ; preds = %for.inc51.us %inc55.us = add nuw nsw i32 %k.0175.us, 1 %exitcond188.not = icmp eq i32 %inc55.us, %sub br i1 %exitcond188.not, label %for.cond.cleanup6, label %for.cond8.preheader.us, !llvm.loop !18 for.body: ; preds = %for.body.preheader208, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader208 ] %arrayidx = getelementptr inbounds i64, ptr %call, i64 %indvars.iv store i64 10000000000000, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !19 for.cond.cleanup6: ; preds = %for.cond8.for.cond.cleanup11_crit_edge.us, %for.cond.cleanup %idxprom58 = sext i32 %sub to i64 %arrayidx59 = getelementptr inbounds i64, ptr %call, i64 %idxprom58 %11 = load i64, ptr %arrayidx59, align 8, !tbaa !5 %cmp68176 = icmp sgt i32 %M, 0 %or.cond = and i1 %cmp170, %cmp68176 br i1 %or.cond, label %for.cond67.preheader.us.preheader, label %for.cond.cleanup64 for.cond67.preheader.us.preheader: ; preds = %for.cond.cleanup6 %wide.trip.count192 = zext i32 %M to i64 %xtraiter = and i64 %wide.trip.count192, 1 %12 = icmp eq i32 %M, 1 %unroll_iter = and i64 %wide.trip.count192, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond67.preheader.us for.cond67.preheader.us: ; preds = %for.cond67.preheader.us.preheader, %for.cond67.for.cond.cleanup70_crit_edge.us %k60.0179.us = phi i32 [ %inc110.us, %for.cond67.for.cond.cleanup70_crit_edge.us ], [ 0, %for.cond67.preheader.us.preheader ] br i1 %12, label %for.cond67.for.cond.cleanup70_crit_edge.us.unr-lcssa, label %for.body71.us for.body71.us: ; preds = %for.cond67.preheader.us, %for.inc106.us.1 %indvars.iv189 = phi i64 [ %indvars.iv.next190.1, %for.inc106.us.1 ], [ 0, %for.cond67.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc106.us.1 ], [ 0, %for.cond67.preheader.us ] %arrayidx73.us = getelementptr inbounds ptr, ptr %edge, i64 %indvars.iv189 %13 = load ptr, ptr %arrayidx73.us, align 8, !tbaa !13 %14 = load i32, ptr %13, align 4, !tbaa !15 %idxprom75.us = sext i32 %14 to i64 %arrayidx76.us = getelementptr inbounds i64, ptr %call, i64 %idxprom75.us %15 = load i64, ptr %arrayidx76.us, align 8, !tbaa !5 %arrayidx79.us = getelementptr inbounds i32, ptr %13, i64 2 %16 = load i32, ptr %arrayidx79.us, align 4, !tbaa !15 %conv80.us = sext i32 %16 to i64 %add81.us = add nsw i64 %15, %conv80.us %arrayidx84.us = getelementptr inbounds i32, ptr %13, i64 1 %17 = load i32, ptr %arrayidx84.us, align 4, !tbaa !15 %idxprom85.us = sext i32 %17 to i64 %arrayidx86.us = getelementptr inbounds i64, ptr %call, i64 %idxprom85.us %18 = load i64, ptr %arrayidx86.us, align 8, !tbaa !5 %cmp87.us = icmp slt i64 %add81.us, %18 br i1 %cmp87.us, label %if.then89.us, label %for.inc106.us if.then89.us: ; preds = %for.body71.us store i64 %add81.us, ptr %arrayidx86.us, align 8, !tbaa !5 br label %for.inc106.us for.inc106.us: ; preds = %if.then89.us, %for.body71.us %indvars.iv.next190 = or i64 %indvars.iv189, 1 %arrayidx73.us.1 = getelementptr inbounds ptr, ptr %edge, i64 %indvars.iv.next190 %19 = load ptr, ptr %arrayidx73.us.1, align 8, !tbaa !13 %20 = load i32, ptr %19, align 4, !tbaa !15 %idxprom75.us.1 = sext i32 %20 to i64 %arrayidx76.us.1 = getelementptr inbounds i64, ptr %call, i64 %idxprom75.us.1 %21 = load i64, ptr %arrayidx76.us.1, align 8, !tbaa !5 %arrayidx79.us.1 = getelementptr inbounds i32, ptr %19, i64 2 %22 = load i32, ptr %arrayidx79.us.1, align 4, !tbaa !15 %conv80.us.1 = sext i32 %22 to i64 %add81.us.1 = add nsw i64 %21, %conv80.us.1 %arrayidx84.us.1 = getelementptr inbounds i32, ptr %19, i64 1 %23 = load i32, ptr %arrayidx84.us.1, align 4, !tbaa !15 %idxprom85.us.1 = sext i32 %23 to i64 %arrayidx86.us.1 = getelementptr inbounds i64, ptr %call, i64 %idxprom85.us.1 %24 = load i64, ptr %arrayidx86.us.1, align 8, !tbaa !5 %cmp87.us.1 = icmp slt i64 %add81.us.1, %24 br i1 %cmp87.us.1, label %if.then89.us.1, label %for.inc106.us.1 if.then89.us.1: ; preds = %for.inc106.us store i64 %add81.us.1, ptr %arrayidx86.us.1, align 8, !tbaa !5 br label %for.inc106.us.1 for.inc106.us.1: ; preds = %if.then89.us.1, %for.inc106.us %indvars.iv.next190.1 = add nuw nsw i64 %indvars.iv189, 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.cond67.for.cond.cleanup70_crit_edge.us.unr-lcssa, label %for.body71.us, !llvm.loop !20 for.cond67.for.cond.cleanup70_crit_edge.us.unr-lcssa: ; preds = %for.inc106.us.1, %for.cond67.preheader.us %indvars.iv189.unr = phi i64 [ 0, %for.cond67.preheader.us ], [ %indvars.iv.next190.1, %for.inc106.us.1 ] br i1 %lcmp.mod.not, label %for.cond67.for.cond.cleanup70_crit_edge.us, label %for.body71.us.epil for.body71.us.epil: ; preds = %for.cond67.for.cond.cleanup70_crit_edge.us.unr-lcssa %arrayidx73.us.epil = getelementptr inbounds ptr, ptr %edge, i64 %indvars.iv189.unr %25 = load ptr, ptr %arrayidx73.us.epil, align 8, !tbaa !13 %26 = load i32, ptr %25, align 4, !tbaa !15 %idxprom75.us.epil = sext i32 %26 to i64 %arrayidx76.us.epil = getelementptr inbounds i64, ptr %call, i64 %idxprom75.us.epil %27 = load i64, ptr %arrayidx76.us.epil, align 8, !tbaa !5 %arrayidx79.us.epil = getelementptr inbounds i32, ptr %25, i64 2 %28 = load i32, ptr %arrayidx79.us.epil, align 4, !tbaa !15 %conv80.us.epil = sext i32 %28 to i64 %add81.us.epil = add nsw i64 %27, %conv80.us.epil %arrayidx84.us.epil = getelementptr inbounds i32, ptr %25, i64 1 %29 = load i32, ptr %arrayidx84.us.epil, align 4, !tbaa !15 %idxprom85.us.epil = sext i32 %29 to i64 %arrayidx86.us.epil = getelementptr inbounds i64, ptr %call, i64 %idxprom85.us.epil %30 = load i64, ptr %arrayidx86.us.epil, align 8, !tbaa !5 %cmp87.us.epil = icmp slt i64 %add81.us.epil, %30 br i1 %cmp87.us.epil, label %if.then89.us.epil, label %for.cond67.for.cond.cleanup70_crit_edge.us if.then89.us.epil: ; preds = %for.body71.us.epil store i64 %add81.us.epil, ptr %arrayidx86.us.epil, align 8, !tbaa !5 br label %for.cond67.for.cond.cleanup70_crit_edge.us for.cond67.for.cond.cleanup70_crit_edge.us: ; preds = %for.body71.us.epil, %if.then89.us.epil, %for.cond67.for.cond.cleanup70_crit_edge.us.unr-lcssa %inc110.us = add nuw nsw i32 %k60.0179.us, 1 %exitcond194.not = icmp eq i32 %inc110.us, %N br i1 %exitcond194.not, label %for.cond.cleanup64.loopexit, label %for.cond67.preheader.us, !llvm.loop !21 for.cond.cleanup64.loopexit: ; preds = %for.cond67.for.cond.cleanup70_crit_edge.us %.pre = load i64, ptr %arrayidx59, align 8, !tbaa !5 br label %for.cond.cleanup64 for.cond.cleanup64: ; preds = %for.cond67.preheader.lr.ph.thread, %for.cond.cleanup6.thread202, %for.cond.cleanup64.loopexit, %for.cond.cleanup6 %31 = phi i64 [ %11, %for.cond.cleanup64.loopexit ], [ %11, %for.cond.cleanup6 ], [ %0, %for.cond.cleanup6.thread202 ], [ %4, %for.cond67.preheader.lr.ph.thread ] %32 = phi i64 [ %.pre, %for.cond.cleanup64.loopexit ], [ %11, %for.cond.cleanup6 ], [ %0, %for.cond.cleanup6.thread202 ], [ %4, %for.cond67.preheader.lr.ph.thread ] %cmp115 = icmp sgt i64 %31, %32 %. = select i1 %cmp115, i64 -10000000000000, i64 %31 ret i64 %. } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %buf = alloca [1024 x i8], align 16 %N = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %buf) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #7 %0 = load ptr, ptr @stdin, align 8, !tbaa !13 %call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 1024, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) #7 %1 = load i32, ptr %M, align 4, !tbaa !15 %conv5 = sext i32 %1 to i64 %mul6 = shl nsw i64 %conv5, 3 %call7 = call noalias ptr @malloc(i64 noundef %mul6) #6 %cmp1090 = icmp sgt i32 %1, 0 br i1 %cmp1090, label %for.body13.preheader, label %for.cond.cleanup51 for.body13.preheader: ; preds = %entry %wide.trip.count = zext i32 %1 to i64 br label %for.body13 for.cond19.preheader: ; preds = %for.body13 br i1 %cmp1090, label %for.body23, label %for.cond.cleanup51 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next, %for.body13 ] %call14 = call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #6 %arrayidx = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv store ptr %call14, ptr %arrayidx, align 8, !tbaa !13 %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.cond19.preheader, label %for.body13, !llvm.loop !22 for.cond48.preheader: ; preds = %for.body23 %cmp4994 = icmp sgt i32 %7, 0 br i1 %cmp4994, label %for.body52.preheader, label %for.cond.cleanup51 for.body52.preheader: ; preds = %for.cond48.preheader %wide.trip.count104 = zext i32 %7 to i64 %xtraiter = and i64 %wide.trip.count104, 3 %2 = icmp ult i32 %7, 4 br i1 %2, label %for.cond.cleanup51.loopexit.unr-lcssa, label %for.body52.preheader.new for.body52.preheader.new: ; preds = %for.body52.preheader %unroll_iter = and i64 %wide.trip.count104, 4294967292 br label %for.body52 for.body23: ; preds = %for.cond19.preheader, %for.body23 %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body23 ], [ 0, %for.cond19.preheader ] %3 = load ptr, ptr @stdin, align 8, !tbaa !13 %call25 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 1024, ptr noundef %3) %arrayidx28 = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv98 %4 = load ptr, ptr %arrayidx28, align 8, !tbaa !13 %arrayidx32 = getelementptr inbounds i32, ptr %4, i64 1 %arrayidx35 = getelementptr inbounds i32, ptr %4, i64 2 %call36 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str.1, ptr noundef %4, ptr noundef nonnull %arrayidx32, ptr noundef nonnull %arrayidx35) #7 %5 = load <2 x i32>, ptr %4, align 4, !tbaa !15 %6 = add nsw <2 x i32> %5, <i32 -1, i32 -1> store <2 x i32> %6, ptr %4, align 4, !tbaa !15 %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %7 = load i32, ptr %M, align 4, !tbaa !15 %8 = sext i32 %7 to i64 %cmp20 = icmp slt i64 %indvars.iv.next99, %8 br i1 %cmp20, label %for.body23, label %for.cond48.preheader, !llvm.loop !23 for.cond.cleanup51.loopexit.unr-lcssa: ; preds = %for.body52, %for.body52.preheader %indvars.iv101.unr = phi i64 [ 0, %for.body52.preheader ], [ %indvars.iv.next102.3, %for.body52 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup51, label %for.body52.epil for.body52.epil: ; preds = %for.cond.cleanup51.loopexit.unr-lcssa, %for.body52.epil %indvars.iv101.epil = phi i64 [ %indvars.iv.next102.epil, %for.body52.epil ], [ %indvars.iv101.unr, %for.cond.cleanup51.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body52.epil ], [ 0, %for.cond.cleanup51.loopexit.unr-lcssa ] %arrayidx54.epil = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv101.epil %9 = load ptr, ptr %arrayidx54.epil, align 8, !tbaa !13 %arrayidx55.epil = getelementptr inbounds i32, ptr %9, i64 2 %10 = load i32, ptr %arrayidx55.epil, align 4, !tbaa !15 %mul56.epil = sub nsw i32 0, %10 store i32 %mul56.epil, ptr %arrayidx55.epil, align 4, !tbaa !15 %indvars.iv.next102.epil = add nuw nsw i64 %indvars.iv101.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.cleanup51, label %for.body52.epil, !llvm.loop !24 for.cond.cleanup51: ; preds = %for.cond.cleanup51.loopexit.unr-lcssa, %for.body52.epil, %entry, %for.cond19.preheader, %for.cond48.preheader %.lcssa108 = phi i32 [ %7, %for.cond48.preheader ], [ %1, %for.cond19.preheader ], [ %1, %entry ], [ %7, %for.body52.epil ], [ %7, %for.cond.cleanup51.loopexit.unr-lcssa ] %11 = load i32, ptr %N, align 4, !tbaa !15 %call63 = call i64 @bellman_ford(i32 noundef %11, i32 noundef %.lcssa108, ptr noundef %call7) %cmp65 = icmp eq i64 %call63, -10000000000000 br i1 %cmp65, label %if.then, label %if.else for.body52: ; preds = %for.body52, %for.body52.preheader.new %indvars.iv101 = phi i64 [ 0, %for.body52.preheader.new ], [ %indvars.iv.next102.3, %for.body52 ] %niter = phi i64 [ 0, %for.body52.preheader.new ], [ %niter.next.3, %for.body52 ] %arrayidx54 = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv101 %12 = load ptr, ptr %arrayidx54, align 8, !tbaa !13 %arrayidx55 = getelementptr inbounds i32, ptr %12, i64 2 %13 = load i32, ptr %arrayidx55, align 4, !tbaa !15 %mul56 = sub nsw i32 0, %13 store i32 %mul56, ptr %arrayidx55, align 4, !tbaa !15 %indvars.iv.next102 = or i64 %indvars.iv101, 1 %arrayidx54.1 = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv.next102 %14 = load ptr, ptr %arrayidx54.1, align 8, !tbaa !13 %arrayidx55.1 = getelementptr inbounds i32, ptr %14, i64 2 %15 = load i32, ptr %arrayidx55.1, align 4, !tbaa !15 %mul56.1 = sub nsw i32 0, %15 store i32 %mul56.1, ptr %arrayidx55.1, align 4, !tbaa !15 %indvars.iv.next102.1 = or i64 %indvars.iv101, 2 %arrayidx54.2 = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv.next102.1 %16 = load ptr, ptr %arrayidx54.2, align 8, !tbaa !13 %arrayidx55.2 = getelementptr inbounds i32, ptr %16, i64 2 %17 = load i32, ptr %arrayidx55.2, align 4, !tbaa !15 %mul56.2 = sub nsw i32 0, %17 store i32 %mul56.2, ptr %arrayidx55.2, align 4, !tbaa !15 %indvars.iv.next102.2 = or i64 %indvars.iv101, 3 %arrayidx54.3 = getelementptr inbounds ptr, ptr %call7, i64 %indvars.iv.next102.2 %18 = load ptr, ptr %arrayidx54.3, align 8, !tbaa !13 %arrayidx55.3 = getelementptr inbounds i32, ptr %18, i64 2 %19 = load i32, ptr %arrayidx55.3, align 4, !tbaa !15 %mul56.3 = sub nsw i32 0, %19 store i32 %mul56.3, ptr %arrayidx55.3, align 4, !tbaa !15 %indvars.iv.next102.3 = add nuw nsw i64 %indvars.iv101, 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.cleanup51.loopexit.unr-lcssa, label %for.body52, !llvm.loop !26 if.then: ; preds = %for.cond.cleanup51 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %for.cond.cleanup51 %mul64 = sub nsw i64 0, %call63 %call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %mul64) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %buf) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind memory(readwrite, argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind } attributes #6 = { nounwind allocsize(0) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"any pointer", !7, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"int", !7, i64 0} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !12, !11} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10} !24 = distinct !{!24, !25} !25 = !{!"llvm.loop.unroll.disable"} !26 = distinct !{!26, !10}
#include<stdio.h> #include<limits.h> int main(){ int M[105][105],d[105],array[105],P[105]; int i,j,ji,n; int ans = 0,ka = 1,min = 0; scanf("%d",&n); for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ scanf("%d",&M[i][j]); } d[i] = INT_MAX; array[i] = 0; } d[0] = 0; array[0] = 1; P[0] = 0; //M[0][0] while(1){ for(i = 0; i < ka ; i++){ for(j = 0 ; j < n ; j++){ if(array[P[i]] == 0 || array[j] == 0){ if(M[P[i]][j] != -1 && d[ka] >= M[P[i]][j]){ d[ka] = M[P[i]][j]; ji = j; } } } } ka++; array[ji] = 1; P[i] = ji; if(ka > n) break; } for(i = 0; i < n; i++){ ans += d[i]; } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199011/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %M = alloca [105 x [105 x i32]], align 16 %d = alloca [105 x i32], align 16 %array = alloca [105 x i32], align 16 %P = alloca [105 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 44100, ptr nonnull %M) #4 call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %array) #4 call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %P) #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 %cmp111 = icmp sgt i32 %0, 0 br i1 %cmp111, label %for.cond1.preheader, label %for.end78 for.cond1.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %4, %for.end ], [ %0, %entry ] %indvars.iv152 = phi i64 [ %indvars.iv.next153, %for.end ], [ 0, %entry ] %cmp2109 = icmp sgt i32 %1, 0 br i1 %cmp2109, label %for.body3, label %for.cond1.preheader.for.end_crit_edge for.cond1.preheader.for.end_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.end for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv149 = phi i64 [ %indvars.iv.next150, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [105 x [105 x i32]], ptr %M, i64 0, i64 %indvars.iv152, i64 %indvars.iv149 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp2 = icmp slt i64 %indvars.iv.next150, %3 br i1 %cmp2, label %for.body3, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body3, %for.cond1.preheader.for.end_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.end_crit_edge ], [ %3, %for.body3 ] %4 = phi i32 [ %1, %for.cond1.preheader.for.end_crit_edge ], [ %2, %for.body3 ] %arrayidx8 = getelementptr inbounds [105 x i32], ptr %d, i64 0, i64 %indvars.iv152 store i32 2147483647, ptr %arrayidx8, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [105 x i32], ptr %array, i64 0, i64 %indvars.iv152 store i32 0, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %cmp = icmp slt i64 %indvars.iv.next153, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.end store i32 0, ptr %d, align 16, !tbaa !5 store i32 1, ptr %array, align 16, !tbaa !5 store i32 0, ptr %P, align 16, !tbaa !5 %cmp21113 = icmp sgt i32 %4, 0 br i1 %cmp21113, label %while.cond.us.preheader, label %for.end78 while.cond.us.preheader: ; preds = %for.end13 %5 = add nuw i32 %4, 1 %wide.trip.count173 = zext i32 %5 to i64 %wide.trip.count158 = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count158, 1 %6 = icmp eq i32 %4, 1 %unroll_iter = and i64 %wide.trip.count158, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %while.cond.us while.cond.us: ; preds = %while.cond.us.preheader, %for.end62.split.us.us %indvars.iv170 = phi i64 [ 1, %while.cond.us.preheader ], [ %indvars.iv.next171, %for.end62.split.us.us ] %ji.0.us = phi i32 [ undef, %while.cond.us.preheader ], [ %.us-phi117.us.us, %for.end62.split.us.us ] %arrayidx39.us = getelementptr inbounds [105 x i32], ptr %d, i64 0, i64 %indvars.iv170 br label %for.cond20.preheader.us.us for.cond20.preheader.us.us: ; preds = %for.cond20.for.inc60_crit_edge.us.us, %while.cond.us %indvars.iv165 = phi i64 [ %indvars.iv.next166, %for.cond20.for.inc60_crit_edge.us.us ], [ 0, %while.cond.us ] %ji.1118.us.us = phi i32 [ %.us-phi117.us.us, %for.cond20.for.inc60_crit_edge.us.us ], [ %ji.0.us, %while.cond.us ] %arrayidx24.us.us = getelementptr inbounds [105 x i32], ptr %P, i64 0, i64 %indvars.iv165 %7 = load i32, ptr %arrayidx24.us.us, align 4, !tbaa !5 %idxprom25.us.us = sext i32 %7 to i64 %arrayidx26.us.us = getelementptr inbounds [105 x i32], ptr %array, i64 0, i64 %idxprom25.us.us %8 = load i32, ptr %arrayidx26.us.us, align 4, !tbaa !5 %cmp27.us.us = icmp eq i32 %8, 0 br i1 %cmp27.us.us, label %for.body22.us.us.us.preheader, label %for.body22.us120.us for.body22.us.us.us.preheader: ; preds = %for.cond20.preheader.us.us br i1 %6, label %for.cond20.for.inc60_crit_edge.us.us.loopexit.unr-lcssa, label %for.body22.us.us.us for.body22.us120.us: ; preds = %for.cond20.preheader.us.us, %for.inc57.us130.us %indvars.iv155 = phi i64 [ %indvars.iv.next156, %for.inc57.us130.us ], [ 0, %for.cond20.preheader.us.us ] %ji.2115.us121.us = phi i32 [ %ji.3.us131.us, %for.inc57.us130.us ], [ %ji.1118.us.us, %for.cond20.preheader.us.us ] %arrayidx29.us.us = getelementptr inbounds [105 x i32], ptr %array, i64 0, i64 %indvars.iv155 %9 = load i32, ptr %arrayidx29.us.us, align 4, !tbaa !5 %cmp30.us.us = icmp eq i32 %9, 0 br i1 %cmp30.us.us, label %if.then.us.us, label %for.inc57.us130.us if.then.us.us: ; preds = %for.body22.us120.us %arrayidx36.us124.us = getelementptr inbounds [105 x [105 x i32]], ptr %M, i64 0, i64 %idxprom25.us.us, i64 %indvars.iv155 %10 = load i32, ptr %arrayidx36.us124.us, align 4, !tbaa !5 %cmp37.not.us125.us = icmp eq i32 %10, -1 br i1 %cmp37.not.us125.us, label %for.inc57.us130.us, label %land.lhs.true.us126.us land.lhs.true.us126.us: ; preds = %if.then.us.us %11 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp46.not.us127.us = icmp slt i32 %11, %10 %spec.store.select.us128.us = call i32 @llvm.smin.i32(i32 %11, i32 %10) store i32 %spec.store.select.us128.us, ptr %arrayidx39.us, align 4 %12 = trunc i64 %indvars.iv155 to i32 %spec.select.us129.us = select i1 %cmp46.not.us127.us, i32 %ji.2115.us121.us, i32 %12 br label %for.inc57.us130.us for.inc57.us130.us: ; preds = %land.lhs.true.us126.us, %if.then.us.us, %for.body22.us120.us %ji.3.us131.us = phi i32 [ %ji.2115.us121.us, %if.then.us.us ], [ %ji.2115.us121.us, %for.body22.us120.us ], [ %spec.select.us129.us, %land.lhs.true.us126.us ] %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1 %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158 br i1 %exitcond159.not, label %for.cond20.for.inc60_crit_edge.us.us, label %for.body22.us120.us, !llvm.loop !13 for.cond20.for.inc60_crit_edge.us.us.loopexit.unr-lcssa: ; preds = %for.inc57.us.us.us.1, %for.body22.us.us.us.preheader %ji.3.us.us.us.lcssa.ph = phi i32 [ undef, %for.body22.us.us.us.preheader ], [ %ji.3.us.us.us.1, %for.inc57.us.us.us.1 ] %indvars.iv160.unr = phi i64 [ 0, %for.body22.us.us.us.preheader ], [ %indvars.iv.next161.1, %for.inc57.us.us.us.1 ] %ji.2115.us.us.us.unr = phi i32 [ %ji.1118.us.us, %for.body22.us.us.us.preheader ], [ %ji.3.us.us.us.1, %for.inc57.us.us.us.1 ] br i1 %lcmp.mod.not, label %for.cond20.for.inc60_crit_edge.us.us, label %for.body22.us.us.us.epil for.body22.us.us.us.epil: ; preds = %for.cond20.for.inc60_crit_edge.us.us.loopexit.unr-lcssa %arrayidx36.us.us.us.epil = getelementptr inbounds [105 x [105 x i32]], ptr %M, i64 0, i64 %idxprom25.us.us, i64 %indvars.iv160.unr %13 = load i32, ptr %arrayidx36.us.us.us.epil, align 4, !tbaa !5 %cmp37.not.us.us.us.epil = icmp eq i32 %13, -1 br i1 %cmp37.not.us.us.us.epil, label %for.cond20.for.inc60_crit_edge.us.us, label %land.lhs.true.us.us.us.epil land.lhs.true.us.us.us.epil: ; preds = %for.body22.us.us.us.epil %14 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp46.not.us.us.us.epil = icmp slt i32 %14, %13 %spec.store.select.us.us.us.epil = call i32 @llvm.smin.i32(i32 %14, i32 %13) store i32 %spec.store.select.us.us.us.epil, ptr %arrayidx39.us, align 4 %15 = trunc i64 %indvars.iv160.unr to i32 %spec.select.us.us.us.epil = select i1 %cmp46.not.us.us.us.epil, i32 %ji.2115.us.us.us.unr, i32 %15 br label %for.cond20.for.inc60_crit_edge.us.us for.cond20.for.inc60_crit_edge.us.us: ; preds = %for.inc57.us130.us, %for.cond20.for.inc60_crit_edge.us.us.loopexit.unr-lcssa, %land.lhs.true.us.us.us.epil, %for.body22.us.us.us.epil %.us-phi117.us.us = phi i32 [ %ji.3.us.us.us.lcssa.ph, %for.cond20.for.inc60_crit_edge.us.us.loopexit.unr-lcssa ], [ %ji.2115.us.us.us.unr, %for.body22.us.us.us.epil ], [ %spec.select.us.us.us.epil, %land.lhs.true.us.us.us.epil ], [ %ji.3.us131.us, %for.inc57.us130.us ] %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1 %exitcond169.not = icmp eq i64 %indvars.iv.next166, %indvars.iv170 br i1 %exitcond169.not, label %for.end62.split.us.us, label %for.cond20.preheader.us.us, !llvm.loop !14 for.body22.us.us.us: ; preds = %for.body22.us.us.us.preheader, %for.inc57.us.us.us.1 %indvars.iv160 = phi i64 [ %indvars.iv.next161.1, %for.inc57.us.us.us.1 ], [ 0, %for.body22.us.us.us.preheader ] %ji.2115.us.us.us = phi i32 [ %ji.3.us.us.us.1, %for.inc57.us.us.us.1 ], [ %ji.1118.us.us, %for.body22.us.us.us.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc57.us.us.us.1 ], [ 0, %for.body22.us.us.us.preheader ] %arrayidx36.us.us.us = getelementptr inbounds [105 x [105 x i32]], ptr %M, i64 0, i64 %idxprom25.us.us, i64 %indvars.iv160 %16 = load i32, ptr %arrayidx36.us.us.us, align 4, !tbaa !5 %cmp37.not.us.us.us = icmp eq i32 %16, -1 br i1 %cmp37.not.us.us.us, label %for.inc57.us.us.us, label %land.lhs.true.us.us.us land.lhs.true.us.us.us: ; preds = %for.body22.us.us.us %17 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp46.not.us.us.us = icmp slt i32 %17, %16 %spec.store.select.us.us.us = call i32 @llvm.smin.i32(i32 %17, i32 %16) store i32 %spec.store.select.us.us.us, ptr %arrayidx39.us, align 4 %18 = trunc i64 %indvars.iv160 to i32 %spec.select.us.us.us = select i1 %cmp46.not.us.us.us, i32 %ji.2115.us.us.us, i32 %18 br label %for.inc57.us.us.us for.inc57.us.us.us: ; preds = %land.lhs.true.us.us.us, %for.body22.us.us.us %ji.3.us.us.us = phi i32 [ %ji.2115.us.us.us, %for.body22.us.us.us ], [ %spec.select.us.us.us, %land.lhs.true.us.us.us ] %indvars.iv.next161 = or i64 %indvars.iv160, 1 %arrayidx36.us.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr %M, i64 0, i64 %idxprom25.us.us, i64 %indvars.iv.next161 %19 = load i32, ptr %arrayidx36.us.us.us.1, align 4, !tbaa !5 %cmp37.not.us.us.us.1 = icmp eq i32 %19, -1 br i1 %cmp37.not.us.us.us.1, label %for.inc57.us.us.us.1, label %land.lhs.true.us.us.us.1 land.lhs.true.us.us.us.1: ; preds = %for.inc57.us.us.us %20 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp46.not.us.us.us.1 = icmp slt i32 %20, %19 %spec.store.select.us.us.us.1 = call i32 @llvm.smin.i32(i32 %20, i32 %19) store i32 %spec.store.select.us.us.us.1, ptr %arrayidx39.us, align 4 %21 = trunc i64 %indvars.iv.next161 to i32 %spec.select.us.us.us.1 = select i1 %cmp46.not.us.us.us.1, i32 %ji.3.us.us.us, i32 %21 br label %for.inc57.us.us.us.1 for.inc57.us.us.us.1: ; preds = %land.lhs.true.us.us.us.1, %for.inc57.us.us.us %ji.3.us.us.us.1 = phi i32 [ %ji.3.us.us.us, %for.inc57.us.us.us ], [ %spec.select.us.us.us.1, %land.lhs.true.us.us.us.1 ] %indvars.iv.next161.1 = add nuw nsw i64 %indvars.iv160, 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.cond20.for.inc60_crit_edge.us.us.loopexit.unr-lcssa, label %for.body22.us.us.us, !llvm.loop !13 for.end62.split.us.us: ; preds = %for.cond20.for.inc60_crit_edge.us.us %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1 %idxprom64.us = sext i32 %.us-phi117.us.us to i64 %arrayidx65.us = getelementptr inbounds [105 x i32], ptr %array, i64 0, i64 %idxprom64.us store i32 1, ptr %arrayidx65.us, align 4, !tbaa !5 %idxprom66.us = and i64 %indvars.iv170, 4294967295 %arrayidx67.us = getelementptr inbounds [105 x i32], ptr %P, i64 0, i64 %idxprom66.us store i32 %.us-phi117.us.us, ptr %arrayidx67.us, align 4, !tbaa !5 %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173 br i1 %exitcond174.not, label %for.cond71.preheader, label %while.cond.us for.cond71.preheader: ; preds = %for.end62.split.us.us br i1 %cmp21113, label %for.body73.preheader, label %for.end78 for.body73.preheader: ; preds = %for.cond71.preheader %wide.trip.count178 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body73.preheader196, label %vector.ph vector.ph: ; preds = %for.body73.preheader %n.vec = and i64 %wide.trip.count158, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ] %vec.phi194 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ] %22 = getelementptr inbounds [105 x i32], ptr %d, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %22, align 16, !tbaa !5 %23 = getelementptr inbounds i32, ptr %22, i64 4 %wide.load195 = load <4 x i32>, ptr %23, align 16, !tbaa !5 %24 = add <4 x i32> %wide.load, %vec.phi %25 = add <4 x i32> %wide.load195, %vec.phi194 %index.next = add nuw i64 %index, 8 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %25, %24 %27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count158 br i1 %cmp.n, label %for.end78, label %for.body73.preheader196 for.body73.preheader196: ; preds = %for.body73.preheader, %middle.block %indvars.iv175.ph = phi i64 [ 0, %for.body73.preheader ], [ %n.vec, %middle.block ] %ans.0140.ph = phi i32 [ 0, %for.body73.preheader ], [ %27, %middle.block ] br label %for.body73 for.body73: ; preds = %for.body73.preheader196, %for.body73 %indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.body73 ], [ %indvars.iv175.ph, %for.body73.preheader196 ] %ans.0140 = phi i32 [ %add, %for.body73 ], [ %ans.0140.ph, %for.body73.preheader196 ] %arrayidx75 = getelementptr inbounds [105 x i32], ptr %d, i64 0, i64 %indvars.iv175 %28 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %add = add nsw i32 %28, %ans.0140 %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %exitcond179.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count178 br i1 %exitcond179.not, label %for.end78, label %for.body73, !llvm.loop !18 for.end78: ; preds = %for.body73, %middle.block, %for.end13, %entry, %for.cond71.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond71.preheader ], [ 0, %entry ], [ 0, %for.end13 ], [ %27, %middle.block ], [ %add, %for.body73 ] %call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %P) #4 call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %array) #4 call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 44100, ptr nonnull %M) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10, !17, !16}
#include <stdio.h> #include <stdlib.h> typedef struct edge { int w, f, t; } edge; edge E[(100*100)/2]; int A[100][100]; int group[100]; int comp(const void *x, const void *y) { return ((edge*)x)->w - ((edge*)y)->w; } int kru(int n) { int i, j, en, s, from, to; for(i=0; i<n; i++) group[i]=i; en=0; for(i=0; i<n; i++) { for(j=0; j<i; j++) { if(A[i][j]!=-1) { E[en].w=A[i][j]; E[en].f=i; E[en].t=j; en++; } } } qsort(E, en, sizeof(edge), comp); s=0; for(i=0; i<en; i++) { from=group[E[i].f]; to=group[E[i].t]; if(from != to) { s+=E[i].w; for(j=0; j<n; j++) { if(group[j]==from) group[j]=to; } for(j=1; j<n && group[j-1]==group[j]; j++); if(j==n) break; } } return s; } int main(int argc,char * argv[]) { int i=0, j, n, s; scanf("%d", &n); for(i=0;i<n;i++){ for(j=0; j<n; j++) { scanf("%d", &A[i][j]); } } s=kru(n); printf("%d\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199077/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199077/source.c" target datalayout = "e-m:e-p270: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.edge = type { i32, i32, i32 } @group = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @A = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @E = dso_local global [5000 x %struct.edge] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @kru(i32 noundef %n) local_unnamed_addr #1 { entry: %cmp126 = icmp sgt i32 %n, 0 br i1 %cmp126, label %for.body.preheader, label %for.end28.thread for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader306, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !10 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !10 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader306 for.body.preheader306: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block br i1 %cmp126, label %for.cond4.preheader.preheader, label %for.end28.thread for.cond4.preheader.preheader: ; preds = %for.cond1.preheader %wide.trip.count219 = zext i32 %n to i64 br label %for.cond4.preheader for.body: ; preds = %for.body.preheader306, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader306 ] %arrayidx = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %indvars.iv %3 = trunc i64 %indvars.iv to i32 store i32 %3, ptr %arrayidx, align 4, !tbaa !10 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !15 for.cond4.preheader: ; preds = %for.cond4.preheader.preheader, %for.inc26 %indvars.iv216 = phi i64 [ 0, %for.cond4.preheader.preheader ], [ %indvars.iv.next217, %for.inc26 ] %en.0132 = phi i32 [ 0, %for.cond4.preheader.preheader ], [ %en.1.lcssa, %for.inc26 ] %cmp5128.not = icmp eq i64 %indvars.iv216, 0 br i1 %cmp5128.not, label %for.inc26, label %for.body6.lr.ph for.body6.lr.ph: ; preds = %for.cond4.preheader %4 = trunc i64 %indvars.iv216 to i32 br label %for.body6 for.body6: ; preds = %for.body6.lr.ph, %for.inc23 %indvars.iv211 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next212, %for.inc23 ] %en.1129 = phi i32 [ %en.0132, %for.body6.lr.ph ], [ %en.2, %for.inc23 ] %arrayidx10 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv216, i64 %indvars.iv211 %5 = load i32, ptr %arrayidx10, align 4, !tbaa !10 %cmp11.not = icmp eq i32 %5, -1 br i1 %cmp11.not, label %for.inc23, label %if.then if.then: ; preds = %for.body6 %idxprom16 = sext i32 %en.1129 to i64 %arrayidx17 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %idxprom16 store i32 %5, ptr %arrayidx17, align 4, !tbaa !5 %f = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %idxprom16, i32 1 store i32 %4, ptr %f, align 4, !tbaa !16 %t = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %idxprom16, i32 2 %6 = trunc i64 %indvars.iv211 to i32 store i32 %6, ptr %t, align 4, !tbaa !17 %inc22 = add nsw i32 %en.1129, 1 br label %for.inc23 for.inc23: ; preds = %for.body6, %if.then %en.2 = phi i32 [ %inc22, %if.then ], [ %en.1129, %for.body6 ] %indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1 %exitcond215.not = icmp eq i64 %indvars.iv.next212, %indvars.iv216 br i1 %exitcond215.not, label %for.inc26, label %for.body6, !llvm.loop !18 for.inc26: ; preds = %for.inc23, %for.cond4.preheader %en.1.lcssa = phi i32 [ %en.0132, %for.cond4.preheader ], [ %en.2, %for.inc23 ] %indvars.iv.next217 = add nuw nsw i64 %indvars.iv216, 1 %exitcond220.not = icmp eq i64 %indvars.iv.next217, %wide.trip.count219 br i1 %exitcond220.not, label %for.end28, label %for.cond4.preheader, !llvm.loop !19 for.end28.thread: ; preds = %for.cond1.preheader, %entry tail call void @qsort(ptr noundef nonnull @E, i64 noundef 0, i64 noundef 12, ptr noundef nonnull @comp) #5 br label %for.end84 for.end28: ; preds = %for.inc26 %conv = sext i32 %en.1.lcssa to i64 tail call void @qsort(ptr noundef nonnull @E, i64 noundef %conv, i64 noundef 12, ptr noundef nonnull @comp) #5 %cmp30141 = icmp sgt i32 %en.1.lcssa, 0 br i1 %cmp30141, label %for.body32.lr.ph, label %for.end84 for.body32.lr.ph: ; preds = %for.end28 %cmp65137 = icmp sgt i32 %n, 1 br i1 %cmp65137, label %for.body32.us.preheader, label %for.body32.lr.ph.split for.body32.us.preheader: ; preds = %for.body32.lr.ph %wide.trip.count255 = zext i32 %en.1.lcssa to i64 %.pre257 = zext i32 %n to i64 %wide.trip.count244 = zext i32 %n to i64 %min.iters.check276 = icmp ult i32 %n, 8 %n.vec279 = and i64 %wide.trip.count, 4294967288 %cmp.n281 = icmp eq i64 %n.vec279, %wide.trip.count br label %for.body32.us for.body32.us: ; preds = %for.body32.us.preheader, %for.inc82.us %indvars.iv252 = phi i64 [ 0, %for.body32.us.preheader ], [ %indvars.iv.next253, %for.inc82.us ] %s.0142.us = phi i32 [ 0, %for.body32.us.preheader ], [ %s.1.us, %for.inc82.us ] %f35.us = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv252, i32 1 %7 = load i32, ptr %f35.us, align 4, !tbaa !16 %idxprom36.us = sext i32 %7 to i64 %arrayidx37.us = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %idxprom36.us %8 = load i32, ptr %arrayidx37.us, align 4, !tbaa !10 %t40.us = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv252, i32 2 %9 = load i32, ptr %t40.us, align 4, !tbaa !17 %idxprom41.us = sext i32 %9 to i64 %arrayidx42.us = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %idxprom41.us %10 = load i32, ptr %arrayidx42.us, align 4, !tbaa !10 %cmp43.not.us = icmp eq i32 %8, %10 br i1 %cmp43.not.us, label %for.inc82.us, label %if.then45.us if.then45.us: ; preds = %for.body32.us %arrayidx34.us = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv252 %11 = load i32, ptr %arrayidx34.us, align 4, !tbaa !5 %add.us = add nsw i32 %11, %s.0142.us br i1 %cmp126, label %for.body52.us.preheader, label %for.cond64.preheader.us for.body52.us.preheader: ; preds = %if.then45.us br i1 %min.iters.check276, label %for.body52.us.preheader300, label %vector.ph277 vector.ph277: ; preds = %for.body52.us.preheader %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %8, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body282 vector.body282: ; preds = %pred.store.continue298, %vector.ph277 %index283 = phi i64 [ 0, %vector.ph277 ], [ %index.next299, %pred.store.continue298 ] %12 = or i64 %index283, 4 %13 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %index283 %wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !10 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load284 = load <4 x i32>, ptr %14, align 16, !tbaa !10 %15 = icmp eq <4 x i32> %wide.load, %broadcast.splat %16 = icmp eq <4 x i32> %wide.load284, %broadcast.splat %17 = extractelement <4 x i1> %15, i64 0 br i1 %17, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body282 %18 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %index283 store i32 %10, ptr %18, align 16, !tbaa !10 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body282 %19 = extractelement <4 x i1> %15, i64 1 br i1 %19, label %pred.store.if285, label %pred.store.continue286 pred.store.if285: ; preds = %pred.store.continue %20 = or i64 %index283, 1 %21 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %20 store i32 %10, ptr %21, align 4, !tbaa !10 br label %pred.store.continue286 pred.store.continue286: ; preds = %pred.store.if285, %pred.store.continue %22 = extractelement <4 x i1> %15, i64 2 br i1 %22, label %pred.store.if287, label %pred.store.continue288 pred.store.if287: ; preds = %pred.store.continue286 %23 = or i64 %index283, 2 %24 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %23 store i32 %10, ptr %24, align 8, !tbaa !10 br label %pred.store.continue288 pred.store.continue288: ; preds = %pred.store.if287, %pred.store.continue286 %25 = extractelement <4 x i1> %15, i64 3 br i1 %25, label %pred.store.if289, label %pred.store.continue290 pred.store.if289: ; preds = %pred.store.continue288 %26 = or i64 %index283, 3 %27 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %26 store i32 %10, ptr %27, align 4, !tbaa !10 br label %pred.store.continue290 pred.store.continue290: ; preds = %pred.store.if289, %pred.store.continue288 %28 = extractelement <4 x i1> %16, i64 0 br i1 %28, label %pred.store.if291, label %pred.store.continue292 pred.store.if291: ; preds = %pred.store.continue290 %29 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %12 store i32 %10, ptr %29, align 16, !tbaa !10 br label %pred.store.continue292 pred.store.continue292: ; preds = %pred.store.if291, %pred.store.continue290 %30 = extractelement <4 x i1> %16, i64 1 br i1 %30, label %pred.store.if293, label %pred.store.continue294 pred.store.if293: ; preds = %pred.store.continue292 %31 = or i64 %index283, 5 %32 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %31 store i32 %10, ptr %32, align 4, !tbaa !10 br label %pred.store.continue294 pred.store.continue294: ; preds = %pred.store.if293, %pred.store.continue292 %33 = extractelement <4 x i1> %16, i64 2 br i1 %33, label %pred.store.if295, label %pred.store.continue296 pred.store.if295: ; preds = %pred.store.continue294 %34 = or i64 %index283, 6 %35 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %34 store i32 %10, ptr %35, align 8, !tbaa !10 br label %pred.store.continue296 pred.store.continue296: ; preds = %pred.store.if295, %pred.store.continue294 %36 = extractelement <4 x i1> %16, i64 3 br i1 %36, label %pred.store.if297, label %pred.store.continue298 pred.store.if297: ; preds = %pred.store.continue296 %37 = or i64 %index283, 7 %38 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %37 store i32 %10, ptr %38, align 4, !tbaa !10 br label %pred.store.continue298 pred.store.continue298: ; preds = %pred.store.if297, %pred.store.continue296 %index.next299 = add nuw i64 %index283, 8 %39 = icmp eq i64 %index.next299, %n.vec279 br i1 %39, label %middle.block274, label %vector.body282, !llvm.loop !20 middle.block274: ; preds = %pred.store.continue298 br i1 %cmp.n281, label %for.cond64.preheader.us, label %for.body52.us.preheader300 for.body52.us.preheader300: ; preds = %for.body52.us.preheader, %middle.block274 %indvars.iv241.ph = phi i64 [ 0, %for.body52.us.preheader ], [ %n.vec279, %middle.block274 ] br label %for.body52.us land.rhs.us: ; preds = %for.cond64.preheader.us, %for.inc74.us %indvars.iv246 = phi i64 [ 1, %for.cond64.preheader.us ], [ %indvars.iv.next247, %for.inc74.us ] %arrayidx70.us = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %indvars.iv246 %40 = load i32, ptr %arrayidx70.us, align 4, !tbaa !10 %cmp71.us = icmp eq i32 %.pre, %40 br i1 %cmp71.us, label %for.inc74.us, label %for.end76.us for.end76.us: ; preds = %land.rhs.us %41 = trunc i64 %indvars.iv246 to i32 %cmp77.us = icmp eq i32 %41, %n br i1 %cmp77.us, label %for.end84, label %for.inc82.us for.inc74.us: ; preds = %land.rhs.us %indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1 %exitcond251.not = icmp eq i64 %indvars.iv.next247, %wide.trip.count250.pre-phi br i1 %exitcond251.not, label %for.end84, label %land.rhs.us, !llvm.loop !21 for.body52.us: ; preds = %for.body52.us.preheader300, %for.inc61.us %indvars.iv241 = phi i64 [ %indvars.iv.next242, %for.inc61.us ], [ %indvars.iv241.ph, %for.body52.us.preheader300 ] %arrayidx54.us = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %indvars.iv241 %42 = load i32, ptr %arrayidx54.us, align 4, !tbaa !10 %cmp55.us = icmp eq i32 %42, %8 br i1 %cmp55.us, label %if.then57.us, label %for.inc61.us if.then57.us: ; preds = %for.body52.us store i32 %10, ptr %arrayidx54.us, align 4, !tbaa !10 br label %for.inc61.us for.inc61.us: ; preds = %if.then57.us, %for.body52.us %indvars.iv.next242 = add nuw nsw i64 %indvars.iv241, 1 %exitcond245.not = icmp eq i64 %indvars.iv.next242, %wide.trip.count244 br i1 %exitcond245.not, label %for.cond64.preheader.us, label %for.body52.us, !llvm.loop !22 for.inc82.us: ; preds = %for.end76.us, %for.body32.us %s.1.us = phi i32 [ %add.us, %for.end76.us ], [ %s.0142.us, %for.body32.us ] %indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1 %exitcond256.not = icmp eq i64 %indvars.iv.next253, %wide.trip.count255 br i1 %exitcond256.not, label %for.end84, label %for.body32.us, !llvm.loop !23 for.cond64.preheader.us: ; preds = %for.inc61.us, %middle.block274, %if.then45.us %wide.trip.count250.pre-phi = phi i64 [ %.pre257, %if.then45.us ], [ %wide.trip.count244, %middle.block274 ], [ %wide.trip.count244, %for.inc61.us ] %.pre = load i32, ptr @group, align 16, !tbaa !10 br label %land.rhs.us for.body32.lr.ph.split: ; preds = %for.body32.lr.ph %cmp77 = icmp eq i32 %n, 1 %wide.trip.count239 = zext i32 %en.1.lcssa to i64 br i1 %cmp126, label %for.body32.us147.preheader, label %for.body32 for.body32.us147.preheader: ; preds = %for.body32.lr.ph.split %group.promoted = load i32, ptr @group, align 16, !tbaa !10 br label %for.body32.us147 for.body32.us147: ; preds = %for.body32.us147.preheader, %for.inc82.us170 %43 = phi i32 [ %49, %for.inc82.us170 ], [ %group.promoted, %for.body32.us147.preheader ] %indvars.iv236 = phi i64 [ %indvars.iv.next237, %for.inc82.us170 ], [ 0, %for.body32.us147.preheader ] %s.0142.us149 = phi i32 [ %s.1.us171, %for.inc82.us170 ], [ 0, %for.body32.us147.preheader ] %f35.us151 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv236, i32 1 %44 = load i32, ptr %f35.us151, align 4, !tbaa !16 %idxprom36.us152 = sext i32 %44 to i64 %arrayidx37.us153 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %idxprom36.us152 %45 = load i32, ptr %arrayidx37.us153, align 4, !tbaa !10 %t40.us154 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv236, i32 2 %46 = load i32, ptr %t40.us154, align 4, !tbaa !17 %idxprom41.us155 = sext i32 %46 to i64 %arrayidx42.us156 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %idxprom41.us155 %47 = load i32, ptr %arrayidx42.us156, align 4, !tbaa !10 %cmp43.not.us157 = icmp eq i32 %45, %47 br i1 %cmp43.not.us157, label %for.inc82.us170, label %if.then45.us158 if.then45.us158: ; preds = %for.body32.us147 %arrayidx34.us159 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv236 %48 = load i32, ptr %arrayidx34.us159, align 4, !tbaa !5 %cmp55.us165 = icmp eq i32 %43, %45 br i1 %cmp55.us165, label %if.then57.us166, label %for.cond49.for.cond64.preheader_crit_edge.us176 if.then57.us166: ; preds = %if.then45.us158 store i32 %47, ptr @group, align 16, !tbaa !10 br label %for.cond49.for.cond64.preheader_crit_edge.us176 for.inc82.us170: ; preds = %for.cond49.for.cond64.preheader_crit_edge.us176, %for.body32.us147 %49 = phi i32 [ %50, %for.cond49.for.cond64.preheader_crit_edge.us176 ], [ %43, %for.body32.us147 ] %s.1.us171 = phi i32 [ %add.us160, %for.cond49.for.cond64.preheader_crit_edge.us176 ], [ %s.0142.us149, %for.body32.us147 ] %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1 %exitcond240.not = icmp eq i64 %indvars.iv.next237, %wide.trip.count239 br i1 %exitcond240.not, label %for.end84, label %for.body32.us147, !llvm.loop !23 for.cond49.for.cond64.preheader_crit_edge.us176: ; preds = %if.then45.us158, %if.then57.us166 %50 = phi i32 [ %43, %if.then45.us158 ], [ %47, %if.then57.us166 ] %add.us160 = add nsw i32 %48, %s.0142.us149 br i1 %cmp77, label %for.end84, label %for.inc82.us170 for.body32: ; preds = %for.body32.lr.ph.split, %for.inc82 %indvars.iv221 = phi i64 [ %indvars.iv.next222, %for.inc82 ], [ 0, %for.body32.lr.ph.split ] %s.0142 = phi i32 [ %s.1, %for.inc82 ], [ 0, %for.body32.lr.ph.split ] %f35 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv221, i32 1 %51 = load i32, ptr %f35, align 4, !tbaa !16 %idxprom36 = sext i32 %51 to i64 %arrayidx37 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %idxprom36 %52 = load i32, ptr %arrayidx37, align 4, !tbaa !10 %t40 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv221, i32 2 %53 = load i32, ptr %t40, align 4, !tbaa !17 %idxprom41 = sext i32 %53 to i64 %arrayidx42 = getelementptr inbounds [100 x i32], ptr @group, i64 0, i64 %idxprom41 %54 = load i32, ptr %arrayidx42, align 4, !tbaa !10 %cmp43.not = icmp eq i32 %52, %54 br i1 %cmp43.not, label %for.inc82, label %if.then45 if.then45: ; preds = %for.body32 %arrayidx34 = getelementptr inbounds [5000 x %struct.edge], ptr @E, i64 0, i64 %indvars.iv221 %55 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %55, %s.0142 br label %for.inc82 for.inc82: ; preds = %if.then45, %for.body32 %s.1 = phi i32 [ %add, %if.then45 ], [ %s.0142, %for.body32 ] %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1 %exitcond225.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count239 br i1 %exitcond225.not, label %for.end84, label %for.body32, !llvm.loop !23 for.end84: ; preds = %for.inc82, %for.inc82.us170, %for.cond49.for.cond64.preheader_crit_edge.us176, %for.inc82.us, %for.end76.us, %for.inc74.us, %for.end28.thread, %for.end28 %s.2 = phi i32 [ 0, %for.end28 ], [ 0, %for.end28.thread ], [ %add.us, %for.inc74.us ], [ %add.us, %for.end76.us ], [ %s.1.us, %for.inc82.us ], [ %add.us160, %for.cond49.for.cond64.preheader_crit_edge.us176 ], [ %s.1.us171, %for.inc82.us170 ], [ %s.1, %for.inc82 ] ret i32 %s.2 } ; 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 declare void @qsort(ptr noundef, i64 noundef, i64 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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.cond1.preheader, label %for.end9 for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %4, %for.inc7 ], [ %0, %entry ] %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.inc7 ], [ 0, %entry ] %cmp216 = icmp sgt i32 %1, 0 br i1 %cmp216, 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 %1 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.iv23, 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 %2 = load i32, ptr %n, align 4, !tbaa !10 %3 = sext i32 %2 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !24 for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %3, %for.body3 ] %4 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %2, %for.body3 ] %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 %cmp = icmp slt i64 %indvars.iv.next24, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !25 for.end9: ; preds = %for.inc7, %entry %.lcssa = phi i32 [ %0, %entry ], [ %4, %for.inc7 ] %call10 = call i32 @kru(i32 noundef %.lcssa) %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call10) 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 #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"edge", !7, i64 0, !7, i64 4, !7, i64 8} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12, !14, !13} !16 = !{!6, !7, i64 4} !17 = !{!6, !7, i64 8} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12} !20 = distinct !{!20, !12, !13, !14} !21 = distinct !{!21, !12} !22 = distinct !{!22, !12, !14, !13} !23 = distinct !{!23, !12} !24 = distinct !{!24, !12} !25 = distinct !{!25, !12, !26} !26 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> int main() { int a, b; scanf("%d", &a); b = a % 10; if (b != 0) { if (b < 6) { a -= b; } else { a = a - b + 10; } } printf("%d", a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19912/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19912/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %rem = srem i32 %0, 10 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %if.end4, label %if.then if.then: ; preds = %entry %cmp1 = icmp slt i32 %rem, 6 br i1 %cmp1, label %if.then2, label %if.else if.then2: ; preds = %if.then %sub = sub nsw i32 %0, %rem store i32 %sub, ptr %a, align 4, !tbaa !5 br label %if.end4 if.else: ; preds = %if.then %sub3 = add i32 %0, 10 %add = sub i32 %sub3, %rem store i32 %add, ptr %a, align 4, !tbaa !5 br label %if.end4 if.end4: ; preds = %if.then2, %if.else, %entry %1 = phi i32 [ %sub, %if.then2 ], [ %add, %if.else ], [ %0, %entry ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1) 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<limits.h> #define N 20001 #define nil -1 #define WHITE 0 #define BLACK 1 int n,G[N][N]; int prim(int , int); int main(){ int i,j,w=-1,r; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&G[i][j]); if(G[i][j]!=-1 && w==-1){ w=G[i][j]; r=i; } } } printf("%d\n",prim(w,r)); return 0; } int prim(int w , int r){ int i,u,v,d[N],pi[N],color[N],mincost,sum=0; for(u=0;u<n;u++){ d[u]=99999999; pi[u]=nil; color[u]=WHITE; } d[r]=0; while(1){ mincost=9999999; for(i=0;i<n;i++){ if(color[i]!=BLACK && d[i]<mincost){ mincost=d[i]; u=i; } } if(mincost==9999999) break; color[u]=BLACK; for(v=0;v<n;v++){ if(G[u][v]!=-1) w=G[u][v]; else continue; if(color[v]!=BLACK && w<d[v]){ pi[v]=u; d[v]=w; } } } for(i=0;i<n;i++) sum+=d[i]; return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199170/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199170/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @G = dso_local global [20001 x [20001 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d.i = alloca [20001 x i32], align 16 %color.i = alloca [20001 x i32], align 16 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i38 = freeze i32 %0 %cmp39 = icmp sgt i32 %.fr.i38, 0 br i1 %cmp39, label %for.cond1.preheader, label %for.end19.thread for.end19.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %d.i) #6 call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %color.i) #6 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc17 %1 = phi i32 [ %.fr.i, %for.inc17 ], [ %.fr.i38, %entry ] %indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.inc17 ], [ 0, %entry ] %r.042 = phi i32 [ %r.1.lcssa, %for.inc17 ], [ undef, %entry ] %w.041 = phi i32 [ %w.1.lcssa, %for.inc17 ], [ -1, %entry ] %cmp233 = icmp sgt i32 %1, 0 br i1 %cmp233, label %for.body3.lr.ph, label %for.inc17 for.body3.lr.ph: ; preds = %for.cond1.preheader %2 = trunc i64 %indvars.iv49 to i32 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.body3 %indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ] %r.136 = phi i32 [ %r.042, %for.body3.lr.ph ], [ %spec.select32, %for.body3 ] %w.135 = phi i32 [ %w.041, %for.body3.lr.ph ], [ %spec.select, %for.body3 ] %arrayidx5 = getelementptr inbounds [20001 x [20001 x i32]], ptr @G, i64 0, i64 %indvars.iv49, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %3 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp11 = icmp ne i32 %3, -1 %cmp12 = icmp eq i32 %w.135, -1 %or.cond = select i1 %cmp11, i1 %cmp12, i1 false %spec.select = select i1 %or.cond, i32 %3, i32 %w.135 %spec.select32 = select i1 %or.cond, i32 %2, i32 %r.136 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr @n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2, label %for.body3, label %for.inc17, !llvm.loop !9 for.inc17: ; preds = %for.body3, %for.cond1.preheader %6 = phi i32 [ %1, %for.cond1.preheader ], [ %4, %for.body3 ] %w.1.lcssa = phi i32 [ %w.041, %for.cond1.preheader ], [ %spec.select, %for.body3 ] %r.1.lcssa = phi i32 [ %r.042, %for.cond1.preheader ], [ %spec.select32, %for.body3 ] %.fr.i = freeze i32 %6 %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %7 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next50, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.inc17 %8 = sext i32 %r.1.lcssa to i64 call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %d.i) #6 call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %color.i) #6 %cmp92.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp92.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end19 %9 = zext i32 %.fr.i to i64 %10 = shl nuw nsw i64 %9, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %10, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %9, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %11 = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 99999999, i32 99999999, i32 99999999, i32 99999999>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 store <4 x i32> <i32 99999999, i32 99999999, i32 99999999, i32 99999999>, ptr %12, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %9 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 99999999, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %9 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !16 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block %arrayidx6.i = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %8 store i32 0, ptr %arrayidx6.i, align 4, !tbaa !5 br label %for.body9.us.i for.end20.us.i: ; preds = %for.inc18.us.i %cmp21.us.i = icmp eq i32 %mincost.1.us.i, 9999999 br i1 %cmp21.us.i, label %for.body58.i.preheader, label %if.end23.us.i for.body58.i.preheader: ; preds = %for.end20.us.i %min.iters.check57 = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check57, label %for.body58.i.preheader68, label %vector.ph58 vector.ph58: ; preds = %for.body58.i.preheader %n.vec60 = and i64 %9, 4294967288 br label %vector.body63 vector.body63: ; preds = %vector.body63, %vector.ph58 %index64 = phi i64 [ 0, %vector.ph58 ], [ %index.next67, %vector.body63 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph58 ], [ %16, %vector.body63 ] %vec.phi65 = phi <4 x i32> [ zeroinitializer, %vector.ph58 ], [ %17, %vector.body63 ] %14 = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %index64 %wide.load = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load66 = load <4 x i32>, ptr %15, align 16, !tbaa !5 %16 = add <4 x i32> %wide.load, %vec.phi %17 = add <4 x i32> %wide.load66, %vec.phi65 %index.next67 = add nuw i64 %index64, 8 %18 = icmp eq i64 %index.next67, %n.vec60 br i1 %18, label %middle.block55, label %vector.body63, !llvm.loop !17 middle.block55: ; preds = %vector.body63 %bin.rdx = add <4 x i32> %17, %16 %19 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n62 = icmp eq i64 %n.vec60, %9 br i1 %cmp.n62, label %prim.exit, label %for.body58.i.preheader68 for.body58.i.preheader68: ; preds = %for.body58.i.preheader, %middle.block55 %indvars.iv154.i.ph = phi i64 [ 0, %for.body58.i.preheader ], [ %n.vec60, %middle.block55 ] %sum.0135.i.ph = phi i32 [ 0, %for.body58.i.preheader ], [ %19, %middle.block55 ] br label %for.body58.i if.end23.us.i: ; preds = %for.end20.us.i %idxprom24.us.i = sext i32 %u.3.us.i to i64 %arrayidx25.us.i = getelementptr inbounds [20001 x i32], ptr %color.i, i64 0, i64 %idxprom24.us.i store i32 1, ptr %arrayidx25.us.i, align 4, !tbaa !5 br label %for.body28.us.i for.body28.us.i: ; preds = %for.inc53.us.i, %if.end23.us.i %indvars.iv149.i = phi i64 [ 0, %if.end23.us.i ], [ %indvars.iv.next150.i, %for.inc53.us.i ] %arrayidx32.us.i = getelementptr inbounds [20001 x [20001 x i32]], ptr @G, i64 0, i64 %idxprom24.us.i, i64 %indvars.iv149.i %20 = load i32, ptr %arrayidx32.us.i, align 4, !tbaa !5 %cmp33.not.us.i = icmp eq i32 %20, -1 br i1 %cmp33.not.us.i, label %for.inc53.us.i, label %if.then34.us.i if.then34.us.i: ; preds = %for.body28.us.i %arrayidx41.us.i = getelementptr inbounds [20001 x i32], ptr %color.i, i64 0, i64 %indvars.iv149.i %21 = load i32, ptr %arrayidx41.us.i, align 4, !tbaa !5 %cmp42.not.us.i = icmp eq i32 %21, 1 br i1 %cmp42.not.us.i, label %for.inc53.us.i, label %land.lhs.true43.us.i land.lhs.true43.us.i: ; preds = %if.then34.us.i %arrayidx45.us.i = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %indvars.iv149.i %22 = load i32, ptr %arrayidx45.us.i, align 4, !tbaa !5 %spec.store.select.us.i = tail call i32 @llvm.smin.i32(i32 %20, i32 %22) store i32 %spec.store.select.us.i, ptr %arrayidx45.us.i, align 4 br label %for.inc53.us.i for.inc53.us.i: ; preds = %land.lhs.true43.us.i, %if.then34.us.i, %for.body28.us.i %indvars.iv.next150.i = add nuw nsw i64 %indvars.iv149.i, 1 %exitcond153.not.i = icmp eq i64 %indvars.iv.next150.i, %9 br i1 %exitcond153.not.i, label %for.body9.us.i.backedge, label %for.body28.us.i, !llvm.loop !18 for.body9.us.i: ; preds = %for.body9.us.i.backedge, %while.cond.us.preheader.i %indvars.iv144.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv144.i.be, %for.body9.us.i.backedge ] %mincost.098.us.i = phi i32 [ 9999999, %while.cond.us.preheader.i ], [ %mincost.098.us.i.be, %for.body9.us.i.backedge ] %u.297.us.i = phi i32 [ %.fr.i, %while.cond.us.preheader.i ], [ %u.3.us.i, %for.body9.us.i.backedge ] %arrayidx11.us.i = getelementptr inbounds [20001 x i32], ptr %color.i, i64 0, i64 %indvars.iv144.i %23 = load i32, ptr %arrayidx11.us.i, align 4, !tbaa !5 %cmp12.not.us.i = icmp eq i32 %23, 1 br i1 %cmp12.not.us.i, label %for.inc18.us.i, label %land.lhs.true.us.i land.lhs.true.us.i: ; preds = %for.body9.us.i %arrayidx14.us.i = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %indvars.iv144.i %24 = load i32, ptr %arrayidx14.us.i, align 4, !tbaa !5 %cmp15.us.i = icmp slt i32 %24, %mincost.098.us.i %25 = trunc i64 %indvars.iv144.i to i32 %spec.select.us.i = select i1 %cmp15.us.i, i32 %25, i32 %u.297.us.i %spec.select91.us.i = tail call i32 @llvm.smin.i32(i32 %24, i32 %mincost.098.us.i) br label %for.inc18.us.i for.inc18.us.i: ; preds = %land.lhs.true.us.i, %for.body9.us.i %u.3.us.i = phi i32 [ %u.297.us.i, %for.body9.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %mincost.1.us.i = phi i32 [ %mincost.098.us.i, %for.body9.us.i ], [ %spec.select91.us.i, %land.lhs.true.us.i ] %indvars.iv.next145.i = add nuw nsw i64 %indvars.iv144.i, 1 %exitcond148.not.i = icmp eq i64 %indvars.iv.next145.i, %9 br i1 %exitcond148.not.i, label %for.end20.us.i, label %for.body9.us.i.backedge for.body9.us.i.backedge: ; preds = %for.inc53.us.i, %for.inc18.us.i %indvars.iv144.i.be = phi i64 [ %indvars.iv.next145.i, %for.inc18.us.i ], [ 0, %for.inc53.us.i ] %mincost.098.us.i.be = phi i32 [ %mincost.1.us.i, %for.inc18.us.i ], [ 9999999, %for.inc53.us.i ] br label %for.body9.us.i, !llvm.loop !18 for.body58.i: ; preds = %for.body58.i.preheader68, %for.body58.i %indvars.iv154.i = phi i64 [ %indvars.iv.next155.i, %for.body58.i ], [ %indvars.iv154.i.ph, %for.body58.i.preheader68 ] %sum.0135.i = phi i32 [ %add.i, %for.body58.i ], [ %sum.0135.i.ph, %for.body58.i.preheader68 ] %arrayidx60.i = getelementptr inbounds [20001 x i32], ptr %d.i, i64 0, i64 %indvars.iv154.i %26 = load i32, ptr %arrayidx60.i, align 4, !tbaa !5 %add.i = add nsw i32 %26, %sum.0135.i %indvars.iv.next155.i = add nuw nsw i64 %indvars.iv154.i, 1 %exitcond158.not.i = icmp eq i64 %indvars.iv.next155.i, %9 br i1 %exitcond158.not.i, label %prim.exit, label %for.body58.i, !llvm.loop !19 prim.exit: ; preds = %for.body58.i, %middle.block55, %for.end19.thread, %for.end19 %sum.0.lcssa.i = phi i32 [ 0, %for.end19 ], [ 0, %for.end19.thread ], [ %19, %middle.block55 ], [ %add.i, %for.body58.i ] call void @llvm.lifetime.end.p0(i64 80004, ptr nonnull %color.i) #6 call void @llvm.lifetime.end.p0(i64 80004, ptr nonnull %d.i) #6 %call21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim(i32 noundef %w, i32 noundef %r) local_unnamed_addr #3 { entry: %d = alloca [20001 x i32], align 16 %color = alloca [20001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %d) #6 call void @llvm.lifetime.start.p0(i64 80004, ptr nonnull %color) #6 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp92 = icmp sgt i32 %.fr, 0 br i1 %cmp92, label %for.body.preheader, label %for.end63 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader177, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 99999999, i32 99999999, i32 99999999, i32 99999999>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 99999999, i32 99999999, i32 99999999, i32 99999999>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader177 for.body.preheader177: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader177, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader177 ] %arrayidx = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 99999999, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !21 for.end: ; preds = %for.body, %middle.block %idxprom5 = sext i32 %r to i64 %arrayidx6 = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %idxprom5 store i32 0, ptr %arrayidx6, align 4, !tbaa !5 br i1 %cmp92, label %while.cond.us.preheader, label %for.end63 while.cond.us.preheader: ; preds = %for.end %wide.trip.count147 = zext i32 %.fr to i64 %wide.trip.count152 = zext i32 %.fr to i64 br label %for.body9.us for.end20.us: ; preds = %for.inc18.us %cmp21.us = icmp eq i32 %mincost.1.us, 9999999 br i1 %cmp21.us, label %for.cond56.preheader, label %if.end23.us if.end23.us: ; preds = %for.end20.us %idxprom24.us = sext i32 %u.3.us to i64 %arrayidx25.us = getelementptr inbounds [20001 x i32], ptr %color, i64 0, i64 %idxprom24.us store i32 1, ptr %arrayidx25.us, align 4, !tbaa !5 br label %for.body28.us for.body28.us: ; preds = %if.end23.us, %for.inc53.us %indvars.iv149 = phi i64 [ 0, %if.end23.us ], [ %indvars.iv.next150, %for.inc53.us ] %arrayidx32.us = getelementptr inbounds [20001 x [20001 x i32]], ptr @G, i64 0, i64 %idxprom24.us, i64 %indvars.iv149 %6 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5 %cmp33.not.us = icmp eq i32 %6, -1 br i1 %cmp33.not.us, label %for.inc53.us, label %if.then34.us if.then34.us: ; preds = %for.body28.us %arrayidx41.us = getelementptr inbounds [20001 x i32], ptr %color, i64 0, i64 %indvars.iv149 %7 = load i32, ptr %arrayidx41.us, align 4, !tbaa !5 %cmp42.not.us = icmp eq i32 %7, 1 br i1 %cmp42.not.us, label %for.inc53.us, label %land.lhs.true43.us land.lhs.true43.us: ; preds = %if.then34.us %arrayidx45.us = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %indvars.iv149 %8 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5 %spec.store.select.us = tail call i32 @llvm.smin.i32(i32 %6, i32 %8) store i32 %spec.store.select.us, ptr %arrayidx45.us, align 4 br label %for.inc53.us for.inc53.us: ; preds = %land.lhs.true43.us, %if.then34.us, %for.body28.us %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %exitcond153.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count152 br i1 %exitcond153.not, label %for.body9.us.backedge, label %for.body28.us, !llvm.loop !18 for.body9.us: ; preds = %for.body9.us.backedge, %while.cond.us.preheader %indvars.iv144 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv144.be, %for.body9.us.backedge ] %mincost.098.us = phi i32 [ 9999999, %while.cond.us.preheader ], [ %mincost.098.us.be, %for.body9.us.backedge ] %u.297.us = phi i32 [ %.fr, %while.cond.us.preheader ], [ %u.3.us, %for.body9.us.backedge ] %arrayidx11.us = getelementptr inbounds [20001 x i32], ptr %color, i64 0, i64 %indvars.iv144 %9 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.not.us = icmp eq i32 %9, 1 br i1 %cmp12.not.us, label %for.inc18.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body9.us %arrayidx14.us = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %indvars.iv144 %10 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.us = icmp slt i32 %10, %mincost.098.us %11 = trunc i64 %indvars.iv144 to i32 %spec.select.us = select i1 %cmp15.us, i32 %11, i32 %u.297.us %spec.select91.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.098.us) br label %for.inc18.us for.inc18.us: ; preds = %land.lhs.true.us, %for.body9.us %u.3.us = phi i32 [ %u.297.us, %for.body9.us ], [ %spec.select.us, %land.lhs.true.us ] %mincost.1.us = phi i32 [ %mincost.098.us, %for.body9.us ], [ %spec.select91.us, %land.lhs.true.us ] %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %exitcond148.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count147 br i1 %exitcond148.not, label %for.end20.us, label %for.body9.us.backedge for.body9.us.backedge: ; preds = %for.inc53.us, %for.inc18.us %indvars.iv144.be = phi i64 [ %indvars.iv.next145, %for.inc18.us ], [ 0, %for.inc53.us ] %mincost.098.us.be = phi i32 [ %mincost.1.us, %for.inc18.us ], [ 9999999, %for.inc53.us ] br label %for.body9.us, !llvm.loop !18 for.cond56.preheader: ; preds = %for.end20.us br i1 %cmp92, label %for.body58.preheader, label %for.end63 for.body58.preheader: ; preds = %for.cond56.preheader %wide.trip.count157 = zext i32 %.fr to i64 %min.iters.check164 = icmp ult i32 %.fr, 8 br i1 %min.iters.check164, label %for.body58.preheader175, label %vector.ph165 vector.ph165: ; preds = %for.body58.preheader %n.vec167 = and i64 %1, 4294967288 br label %vector.body170 vector.body170: ; preds = %vector.body170, %vector.ph165 %index171 = phi i64 [ 0, %vector.ph165 ], [ %index.next174, %vector.body170 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph165 ], [ %14, %vector.body170 ] %vec.phi172 = phi <4 x i32> [ zeroinitializer, %vector.ph165 ], [ %15, %vector.body170 ] %12 = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %index171 %wide.load = load <4 x i32>, ptr %12, align 16, !tbaa !5 %13 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load173 = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = add <4 x i32> %wide.load, %vec.phi %15 = add <4 x i32> %wide.load173, %vec.phi172 %index.next174 = add nuw i64 %index171, 8 %16 = icmp eq i64 %index.next174, %n.vec167 br i1 %16, label %middle.block162, label %vector.body170, !llvm.loop !22 middle.block162: ; preds = %vector.body170 %bin.rdx = add <4 x i32> %15, %14 %17 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n169 = icmp eq i64 %n.vec167, %1 br i1 %cmp.n169, label %for.end63, label %for.body58.preheader175 for.body58.preheader175: ; preds = %for.body58.preheader, %middle.block162 %indvars.iv154.ph = phi i64 [ 0, %for.body58.preheader ], [ %n.vec167, %middle.block162 ] %sum.0135.ph = phi i32 [ 0, %for.body58.preheader ], [ %17, %middle.block162 ] br label %for.body58 for.body58: ; preds = %for.body58.preheader175, %for.body58 %indvars.iv154 = phi i64 [ %indvars.iv.next155, %for.body58 ], [ %indvars.iv154.ph, %for.body58.preheader175 ] %sum.0135 = phi i32 [ %add, %for.body58 ], [ %sum.0135.ph, %for.body58.preheader175 ] %arrayidx60 = getelementptr inbounds [20001 x i32], ptr %d, i64 0, i64 %indvars.iv154 %18 = load i32, ptr %arrayidx60, align 4, !tbaa !5 %add = add nsw i32 %18, %sum.0135 %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %exitcond158.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count157 br i1 %exitcond158.not, label %for.end63, label %for.body58, !llvm.loop !23 for.end63: ; preds = %for.body58, %middle.block162, %entry, %for.end, %for.cond56.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond56.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %17, %middle.block162 ], [ %add, %for.body58 ] call void @llvm.lifetime.end.p0(i64 80004, ptr nonnull %color) #6 call void @llvm.lifetime.end.p0(i64 80004, ptr nonnull %d) #6 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10, !14, !15} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !15, !14} !20 = distinct !{!20, !10, !14, !15} !21 = distinct !{!21, !10, !15, !14} !22 = distinct !{!22, !10, !14, !15} !23 = distinct !{!23, !10, !15, !14}
#include <stdio.h> #include <limits.h> #define NIL -1 #define WHITE 0 #define BLACK 1 #define MAX 100 int matrix[MAX][MAX]; int n; void prim(){ int i; int d[n],pi[n],color[n]; int mincost; int u; int v; int sum = 0; for( i = 0 ; i < n ; i++ ){ d[i] = INT_MAX; pi[i] = NIL; color[i] = WHITE; } d[0] = 0; pi[0] = NIL; while( 1 ){ mincost = INT_MAX; for( i = 0 ; i < n ; i++ ){ if( color[i] != BLACK && d[i] < mincost ){ mincost = d[i]; u = i; } } if( mincost == INT_MAX ){ break; } color[u] = BLACK; for( v = 0 ; v < n ; v++ ){ if( color[v] != BLACK && matrix[u][v] != INT_MAX ){ if( matrix[u][v] < d[v] ){ pi[v] = u; d[v] = matrix[u][v]; } } } } for( i = 0 ; i < n ; i++ ){ if( pi[i] != NIL ){ sum += matrix[i][pi[i]]; } } printf("%d\n",sum); } int main(){ int i,j; scanf("%d",&n); for( i = 0 ; i < n ; i++ ){ for( j = 0 ; j < n ; j++ ){ scanf("%d",&matrix[i][j]); if( matrix[i][j] == NIL ){ matrix[i][j] = INT_MAX; } } } prim(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199213/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199213/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @matrix = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @prim() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %1 = zext i32 %.fr to i64 %vla = alloca i32, i64 %1, align 16 %vla1 = alloca i32, i64 %1, align 16 %vla2 = alloca i32, i64 %1, align 16 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end78 for.body.preheader: ; preds = %entry %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla1, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader175, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds i32, ptr %vla, i64 %index store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader175 for.body.preheader175: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader175, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader175 ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv store i32 2147483647, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %vla, align 16, !tbaa !5 store i32 -1, ptr %vla1, align 16, !tbaa !5 br i1 %cmp111, label %for.body11.us, label %for.end78 for.end22.us: ; preds = %for.inc20.us %cmp23.us = icmp eq i32 %mincost.1.us, 2147483647 br i1 %cmp23.us, label %for.cond62.preheader, label %if.end25.us if.end25.us: ; preds = %for.end22.us %idxprom26.us = sext i32 %u.2.us to i64 %arrayidx27.us = getelementptr inbounds i32, ptr %vla2, i64 %idxprom26.us store i32 1, ptr %arrayidx27.us, align 4, !tbaa !5 br label %for.body30.us for.body30.us: ; preds = %if.end25.us, %for.inc59.us %indvars.iv165 = phi i64 [ 0, %if.end25.us ], [ %indvars.iv.next166, %for.inc59.us ] %arrayidx32.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv165 %6 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5 %cmp33.not.us = icmp eq i32 %6, 1 br i1 %cmp33.not.us, label %for.inc59.us, label %land.lhs.true34.us land.lhs.true34.us: ; preds = %for.body30.us %arrayidx38.us = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %idxprom26.us, i64 %indvars.iv165 %7 = load i32, ptr %arrayidx38.us, align 4, !tbaa !5 %cmp39.not.us = icmp eq i32 %7, 2147483647 br i1 %cmp39.not.us, label %for.inc59.us, label %if.then40.us if.then40.us: ; preds = %land.lhs.true34.us %arrayidx46.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv165 %8 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5 %cmp47.us = icmp slt i32 %7, %8 br i1 %cmp47.us, label %if.then48.us, label %for.inc59.us if.then48.us: ; preds = %if.then40.us %arrayidx50.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv165 store i32 %u.2.us, ptr %arrayidx50.us, align 4, !tbaa !5 store i32 %7, ptr %arrayidx46.us, align 4, !tbaa !5 br label %for.inc59.us for.inc59.us: ; preds = %if.then48.us, %if.then40.us, %land.lhs.true34.us, %for.body30.us %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1 %exitcond169.not = icmp eq i64 %indvars.iv.next166, %1 br i1 %exitcond169.not, label %for.body11.us.backedge, label %for.body30.us, !llvm.loop !14 for.body11.us: ; preds = %for.end, %for.body11.us.backedge %indvars.iv160 = phi i64 [ %indvars.iv160.be, %for.body11.us.backedge ], [ 0, %for.end ] %u.1116.us = phi i32 [ %u.2.us, %for.body11.us.backedge ], [ undef, %for.end ] %mincost.0115.us = phi i32 [ %mincost.0115.us.be, %for.body11.us.backedge ], [ 2147483647, %for.end ] %arrayidx13.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv160 %9 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %9, 1 br i1 %cmp14.not.us, label %for.inc20.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body11.us %arrayidx16.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv160 %10 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 %cmp17.us = icmp slt i32 %10, %mincost.0115.us %spec.select.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.0115.us) %11 = trunc i64 %indvars.iv160 to i32 %spec.select110.us = select i1 %cmp17.us, i32 %11, i32 %u.1116.us br label %for.inc20.us for.inc20.us: ; preds = %land.lhs.true.us, %for.body11.us %mincost.1.us = phi i32 [ %mincost.0115.us, %for.body11.us ], [ %spec.select.us, %land.lhs.true.us ] %u.2.us = phi i32 [ %u.1116.us, %for.body11.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1 %exitcond164.not = icmp eq i64 %indvars.iv.next161, %1 br i1 %exitcond164.not, label %for.end22.us, label %for.body11.us.backedge for.body11.us.backedge: ; preds = %for.inc59.us, %for.inc20.us %indvars.iv160.be = phi i64 [ %indvars.iv.next161, %for.inc20.us ], [ 0, %for.inc59.us ] %mincost.0115.us.be = phi i32 [ %mincost.1.us, %for.inc20.us ], [ 2147483647, %for.inc59.us ] br label %for.body11.us, !llvm.loop !14 for.cond62.preheader: ; preds = %for.end22.us br i1 %cmp111, label %for.body64.preheader, label %for.end78 for.body64.preheader: ; preds = %for.cond62.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end78.loopexit.unr-lcssa, label %for.body64.preheader.new for.body64.preheader.new: ; preds = %for.body64.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body64 for.body64: ; preds = %for.inc76.1, %for.body64.preheader.new %indvars.iv170 = phi i64 [ 0, %for.body64.preheader.new ], [ %indvars.iv.next171.1, %for.inc76.1 ] %sum.0152 = phi i32 [ 0, %for.body64.preheader.new ], [ %sum.1.1, %for.inc76.1 ] %niter = phi i64 [ 0, %for.body64.preheader.new ], [ %niter.next.1, %for.inc76.1 ] %arrayidx66 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv170 %13 = load i32, ptr %arrayidx66, align 8, !tbaa !5 %cmp67.not = icmp eq i32 %13, -1 br i1 %cmp67.not, label %for.inc76, label %if.then68 if.then68: ; preds = %for.body64 %idxprom73 = sext i32 %13 to i64 %arrayidx74 = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %indvars.iv170, i64 %idxprom73 %14 = load i32, ptr %arrayidx74, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0152 br label %for.inc76 for.inc76: ; preds = %for.body64, %if.then68 %sum.1 = phi i32 [ %add, %if.then68 ], [ %sum.0152, %for.body64 ] %indvars.iv.next171 = or i64 %indvars.iv170, 1 %arrayidx66.1 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next171 %15 = load i32, ptr %arrayidx66.1, align 4, !tbaa !5 %cmp67.not.1 = icmp eq i32 %15, -1 br i1 %cmp67.not.1, label %for.inc76.1, label %if.then68.1 if.then68.1: ; preds = %for.inc76 %idxprom73.1 = sext i32 %15 to i64 %arrayidx74.1 = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %indvars.iv.next171, i64 %idxprom73.1 %16 = load i32, ptr %arrayidx74.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc76.1 for.inc76.1: ; preds = %if.then68.1, %for.inc76 %sum.1.1 = phi i32 [ %add.1, %if.then68.1 ], [ %sum.1, %for.inc76 ] %indvars.iv.next171.1 = add nuw nsw i64 %indvars.iv170, 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.end78.loopexit.unr-lcssa, label %for.body64, !llvm.loop !15 for.end78.loopexit.unr-lcssa: ; preds = %for.inc76.1, %for.body64.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body64.preheader ], [ %sum.1.1, %for.inc76.1 ] %indvars.iv170.unr = phi i64 [ 0, %for.body64.preheader ], [ %indvars.iv.next171.1, %for.inc76.1 ] %sum.0152.unr = phi i32 [ 0, %for.body64.preheader ], [ %sum.1.1, %for.inc76.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end78, label %for.body64.epil for.body64.epil: ; preds = %for.end78.loopexit.unr-lcssa %arrayidx66.epil = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv170.unr %17 = load i32, ptr %arrayidx66.epil, align 4, !tbaa !5 %cmp67.not.epil = icmp eq i32 %17, -1 br i1 %cmp67.not.epil, label %for.end78, label %if.then68.epil if.then68.epil: ; preds = %for.body64.epil %idxprom73.epil = sext i32 %17 to i64 %arrayidx74.epil = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %indvars.iv170.unr, i64 %idxprom73.epil %18 = load i32, ptr %arrayidx74.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0152.unr br label %for.end78 for.end78: ; preds = %for.end78.loopexit.unr-lcssa, %if.then68.epil, %for.body64.epil, %entry, %for.end, %for.cond62.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond62.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end78.loopexit.unr-lcssa ], [ %add.epil, %if.then68.epil ], [ %sum.0152.unr, %for.body64.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.cond1.preheader, label %for.end18 for.cond1.preheader: ; preds = %entry, %for.inc16 %1 = phi i32 [ %5, %for.inc16 ], [ %0, %entry ] %indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.inc16 ], [ 0, %entry ] %cmp227 = icmp sgt i32 %1, 0 br i1 %cmp227, label %for.body3, label %for.cond1.preheader.for.inc16_crit_edge for.cond1.preheader.for.inc16_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.inc16 for.body3: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @matrix, i64 0, i64 %indvars.iv33, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp11 = icmp eq i32 %2, -1 br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 2147483647, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc16, !llvm.loop !16 for.inc16: ; preds = %for.inc, %for.cond1.preheader.for.inc16_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc16_crit_edge ], [ %4, %for.inc ] %5 = phi i32 [ %1, %for.cond1.preheader.for.inc16_crit_edge ], [ %3, %for.inc ] %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %cmp = icmp slt i64 %indvars.iv.next34, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end18, !llvm.loop !17 for.end18: ; preds = %for.inc16, %entry tail call void @prim() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> #include<stdlib.h> #define INF 20000 #define WHITE 0 #define BLACK 1 void prim(); int w(int,int); int n,**G,mincost,*d,*pi,*color; int main(){ int a,i,j,totalcost; scanf("%d",&n); G = (int**)malloc(sizeof(int*) * n); // dynamic alloction for(i=0; i<n; i++){ // * G[i] = (int*)malloc(sizeof(int) * n); // * } // * d = (int*)malloc(sizeof(int) * n); // * pi = (int*)malloc(sizeof(int) * n); // * color = (int*)malloc(sizeof(int) * n); // end for(i=0; i<n; i++){ // input data for(j=0; j<n; j++){ // * scanf("%d",&a); // * G[i][j] = (a == -1 ? INF : a); // * } // * } // end prim(); for(i=0,totalcost=0; i<n; i++){ // sum of cost totalcost += d[i]; // * } // end printf("%d\n",totalcost); return 0; } void prim(){ int i,u,v; for(i=0; i<n; i++){ d[i] = INF; pi[i] = INF; color[i] = WHITE; } d[0] = 0; while(1){ mincost = INF; for(i=0; i<n; i++){ if(color[i] != BLACK && d[i] < mincost){ mincost = d[i]; u = i; } } if(mincost == INF){ break; } color[u] = BLACK; for(v=0; v<n; v++){ if(color[v] != BLACK && w(u,v) < d[v]){ pi[v] = u; d[v] = w(u,v); } } } } int w(int i,int j){ return G[i][j]; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199257/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199257/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @G = dso_local local_unnamed_addr global ptr null, align 8 @d = dso_local local_unnamed_addr global ptr null, align 8 @pi = dso_local local_unnamed_addr global ptr null, align 8 @color = dso_local local_unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @mincost = dso_local local_unnamed_addr global i32 0, align 4 ; 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) #7 %call = tail 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, 3 %call1 = tail call noalias ptr @malloc(i64 noundef %mul) #8 store ptr %call1, ptr @G, align 8, !tbaa !9 %cmp60 = icmp sgt i32 %0, 0 %mul4 = shl nsw i64 %conv, 2 br i1 %cmp60, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %wide.trip.count = zext i32 %0 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 ] %call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #8 %1 = load ptr, ptr @G, align 8, !tbaa !9 %arrayidx = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv store ptr %call5, ptr %arrayidx, align 8, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry %call8 = tail call noalias ptr @malloc(i64 noundef %mul4) #8 store ptr %call8, ptr @d, align 8, !tbaa !9 %call11 = tail call noalias ptr @malloc(i64 noundef %mul4) #8 store ptr %call11, ptr @pi, align 8, !tbaa !9 %call14 = tail call noalias ptr @malloc(i64 noundef %mul4) #8 store ptr %call14, ptr @color, align 8, !tbaa !9 br i1 %cmp60, label %for.cond19.preheader, label %for.end.i for.cond19.preheader: ; preds = %for.end, %for.inc33 %2 = phi i32 [ %8, %for.inc33 ], [ %0, %for.end ] %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.inc33 ], [ 0, %for.end ] %cmp2062 = icmp sgt i32 %2, 0 br i1 %cmp2062, label %for.body22, label %for.cond19.preheader.for.inc33_crit_edge for.cond19.preheader.for.inc33_crit_edge: ; preds = %for.cond19.preheader %.pre89 = sext i32 %2 to i64 br label %for.inc33 for.body22: ; preds = %for.cond19.preheader, %for.body22 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body22 ], [ 0, %for.cond19.preheader ] %call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %3 = load i32, ptr %a, align 4 %cmp24 = icmp eq i32 %3, -1 %cond = select i1 %cmp24, i32 20000, i32 %3 %4 = load ptr, ptr @G, align 8, !tbaa !9 %arrayidx27 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv80 %5 = load ptr, ptr %arrayidx27, align 8, !tbaa !9 %arrayidx29 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv77 store i32 %cond, ptr %arrayidx29, align 4, !tbaa !5 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %6 = load i32, ptr @n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp20 = icmp slt i64 %indvars.iv.next78, %7 br i1 %cmp20, label %for.body22, label %for.inc33, !llvm.loop !13 for.inc33: ; preds = %for.body22, %for.cond19.preheader.for.inc33_crit_edge %.pre-phi = phi i64 [ %.pre89, %for.cond19.preheader.for.inc33_crit_edge ], [ %7, %for.body22 ] %8 = phi i32 [ %2, %for.cond19.preheader.for.inc33_crit_edge ], [ %6, %for.body22 ] %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %cmp16 = icmp slt i64 %indvars.iv.next81, %.pre-phi br i1 %cmp16, label %for.cond19.preheader, label %for.end35, !llvm.loop !14 for.end35: ; preds = %for.inc33 %.pre.i.pre = load ptr, ptr @d, align 8, !tbaa !9 %9 = icmp sgt i32 %8, 0 br i1 %9, label %for.body.lr.ph.i, label %for.end.i for.body.lr.ph.i: ; preds = %for.end35 %10 = load ptr, ptr @pi, align 8, !tbaa !9 %11 = load ptr, ptr @color, align 8, !tbaa !9 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr %.pre.i.pre, i64 %indvars.iv.i store i32 20000, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.i store i32 20000, ptr %arrayidx2.i, align 4, !tbaa !5 %arrayidx4.i = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.i store i32 0, ptr %arrayidx4.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp.i = icmp slt i64 %indvars.iv.next.i, %13 br i1 %cmp.i, label %for.body.i, label %for.end.i, !llvm.loop !16 for.end.i: ; preds = %for.body.i, %for.end, %for.end35 %.pre.i92 = phi ptr [ %.pre.i.pre, %for.end35 ], [ %call8, %for.end ], [ %.pre.i.pre, %for.body.i ] store i32 0, ptr %.pre.i92, align 4, !tbaa !5 %14 = load ptr, ptr @color, align 8 %.pre83.i = load i32, ptr @n, align 4, !tbaa !5 store i32 20000, ptr @mincost, align 4, !tbaa !5 %cmp771.i67 = icmp sgt i32 %.pre83.i, 0 br i1 %cmp771.i67, label %for.body8.preheader.i, label %for.end44 while.cond.loopexit.i: ; preds = %for.inc42.i store i32 20000, ptr @mincost, align 4, !tbaa !5 %cmp771.i = icmp sgt i32 %38, 0 br i1 %cmp771.i, label %for.body8.preheader.i, label %for.end44 for.body8.preheader.i: ; preds = %for.end.i, %while.cond.loopexit.i %u.0.i68 = phi i32 [ %u.2.i.lcssa, %while.cond.loopexit.i ], [ undef, %for.end.i ] %15 = phi i32 [ %38, %while.cond.loopexit.i ], [ %.pre83.i, %for.end.i ] %wide.trip.count.i = zext i32 %15 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %16 = icmp eq i32 %15, 1 br i1 %16, label %for.end19.i.unr-lcssa, label %for.body8.preheader.i.new for.body8.preheader.i.new: ; preds = %for.body8.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body8.i for.body8.i: ; preds = %for.inc17.i.1, %for.body8.preheader.i.new %indvars.iv77.i = phi i64 [ 0, %for.body8.preheader.i.new ], [ %indvars.iv.next78.i.1, %for.inc17.i.1 ] %u.173.i = phi i32 [ %u.0.i68, %for.body8.preheader.i.new ], [ %u.2.i.1, %for.inc17.i.1 ] %17 = phi i32 [ 20000, %for.body8.preheader.i.new ], [ %25, %for.inc17.i.1 ] %niter = phi i64 [ 0, %for.body8.preheader.i.new ], [ %niter.next.1, %for.inc17.i.1 ] %arrayidx10.i = getelementptr inbounds i32, ptr %14, i64 %indvars.iv77.i %18 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5 %cmp11.not.i = icmp eq i32 %18, 1 br i1 %cmp11.not.i, label %for.inc17.i, label %land.lhs.true.i land.lhs.true.i: ; preds = %for.body8.i %arrayidx13.i = getelementptr inbounds i32, ptr %.pre.i92, i64 %indvars.iv77.i %19 = load i32, ptr %arrayidx13.i, align 4, !tbaa !5 %cmp14.i = icmp slt i32 %19, %17 br i1 %cmp14.i, label %if.then.i, label %for.inc17.i if.then.i: ; preds = %land.lhs.true.i store i32 %19, ptr @mincost, align 4, !tbaa !5 %20 = trunc i64 %indvars.iv77.i to i32 br label %for.inc17.i for.inc17.i: ; preds = %if.then.i, %land.lhs.true.i, %for.body8.i %21 = phi i32 [ %19, %if.then.i ], [ %17, %land.lhs.true.i ], [ %17, %for.body8.i ] %u.2.i = phi i32 [ %20, %if.then.i ], [ %u.173.i, %land.lhs.true.i ], [ %u.173.i, %for.body8.i ] %indvars.iv.next78.i = or i64 %indvars.iv77.i, 1 %arrayidx10.i.1 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next78.i %22 = load i32, ptr %arrayidx10.i.1, align 4, !tbaa !5 %cmp11.not.i.1 = icmp eq i32 %22, 1 br i1 %cmp11.not.i.1, label %for.inc17.i.1, label %land.lhs.true.i.1 land.lhs.true.i.1: ; preds = %for.inc17.i %arrayidx13.i.1 = getelementptr inbounds i32, ptr %.pre.i92, i64 %indvars.iv.next78.i %23 = load i32, ptr %arrayidx13.i.1, align 4, !tbaa !5 %cmp14.i.1 = icmp slt i32 %23, %21 br i1 %cmp14.i.1, label %if.then.i.1, label %for.inc17.i.1 if.then.i.1: ; preds = %land.lhs.true.i.1 store i32 %23, ptr @mincost, align 4, !tbaa !5 %24 = trunc i64 %indvars.iv.next78.i to i32 br label %for.inc17.i.1 for.inc17.i.1: ; preds = %if.then.i.1, %land.lhs.true.i.1, %for.inc17.i %25 = phi i32 [ %23, %if.then.i.1 ], [ %21, %land.lhs.true.i.1 ], [ %21, %for.inc17.i ] %u.2.i.1 = phi i32 [ %24, %if.then.i.1 ], [ %u.2.i, %land.lhs.true.i.1 ], [ %u.2.i, %for.inc17.i ] %indvars.iv.next78.i.1 = add nuw nsw i64 %indvars.iv77.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end19.i.unr-lcssa, label %for.body8.i, !llvm.loop !17 for.end19.i.unr-lcssa: ; preds = %for.inc17.i.1, %for.body8.preheader.i %.lcssa116.ph = phi i32 [ undef, %for.body8.preheader.i ], [ %25, %for.inc17.i.1 ] %u.2.i.lcssa.ph = phi i32 [ undef, %for.body8.preheader.i ], [ %u.2.i.1, %for.inc17.i.1 ] %indvars.iv77.i.unr = phi i64 [ 0, %for.body8.preheader.i ], [ %indvars.iv.next78.i.1, %for.inc17.i.1 ] %u.173.i.unr = phi i32 [ %u.0.i68, %for.body8.preheader.i ], [ %u.2.i.1, %for.inc17.i.1 ] %.unr = phi i32 [ 20000, %for.body8.preheader.i ], [ %25, %for.inc17.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end19.i, label %for.body8.i.epil for.body8.i.epil: ; preds = %for.end19.i.unr-lcssa %arrayidx10.i.epil = getelementptr inbounds i32, ptr %14, i64 %indvars.iv77.i.unr %26 = load i32, ptr %arrayidx10.i.epil, align 4, !tbaa !5 %cmp11.not.i.epil = icmp eq i32 %26, 1 br i1 %cmp11.not.i.epil, label %for.end19.i, label %land.lhs.true.i.epil land.lhs.true.i.epil: ; preds = %for.body8.i.epil %arrayidx13.i.epil = getelementptr inbounds i32, ptr %.pre.i92, i64 %indvars.iv77.i.unr %27 = load i32, ptr %arrayidx13.i.epil, align 4, !tbaa !5 %cmp14.i.epil = icmp slt i32 %27, %.unr br i1 %cmp14.i.epil, label %if.then.i.epil, label %for.end19.i if.then.i.epil: ; preds = %land.lhs.true.i.epil store i32 %27, ptr @mincost, align 4, !tbaa !5 %28 = trunc i64 %indvars.iv77.i.unr to i32 br label %for.end19.i for.end19.i: ; preds = %for.body8.i.epil, %land.lhs.true.i.epil, %if.then.i.epil, %for.end19.i.unr-lcssa %.lcssa116 = phi i32 [ %.lcssa116.ph, %for.end19.i.unr-lcssa ], [ %27, %if.then.i.epil ], [ %.unr, %land.lhs.true.i.epil ], [ %.unr, %for.body8.i.epil ] %u.2.i.lcssa = phi i32 [ %u.2.i.lcssa.ph, %for.end19.i.unr-lcssa ], [ %28, %if.then.i.epil ], [ %u.173.i.unr, %land.lhs.true.i.epil ], [ %u.173.i.unr, %for.body8.i.epil ] %cmp20.i = icmp eq i32 %.lcssa116, 20000 br i1 %cmp20.i, label %for.body39.preheader, label %if.end22.i if.end22.i: ; preds = %for.end19.i %idxprom23.i = sext i32 %u.2.i.lcssa to i64 %arrayidx24.i = getelementptr inbounds i32, ptr %14, i64 %idxprom23.i store i32 1, ptr %arrayidx24.i, align 4, !tbaa !5 %29 = load i32, ptr @n, align 4, !tbaa !5 %cmp2674.i = icmp sgt i32 %29, 0 br i1 %cmp2674.i, label %for.body27.lr.ph.i, label %while.cond.loopexit.i.thread while.cond.loopexit.i.thread: ; preds = %if.end22.i store i32 20000, ptr @mincost, align 4, !tbaa !5 br label %for.end44 for.body27.lr.ph.i: ; preds = %if.end22.i %30 = load ptr, ptr @G, align 8 %arrayidx.i.i = getelementptr inbounds ptr, ptr %30, i64 %idxprom23.i %31 = load ptr, ptr @pi, align 8 br label %for.body27.i for.body27.i: ; preds = %for.inc42.i, %for.body27.lr.ph.i %32 = phi i32 [ %29, %for.body27.lr.ph.i ], [ %38, %for.inc42.i ] %indvars.iv80.i = phi i64 [ 0, %for.body27.lr.ph.i ], [ %indvars.iv.next81.i, %for.inc42.i ] %arrayidx29.i = getelementptr inbounds i32, ptr %14, i64 %indvars.iv80.i %33 = load i32, ptr %arrayidx29.i, align 4, !tbaa !5 %cmp30.not.i = icmp eq i32 %33, 1 br i1 %cmp30.not.i, label %for.inc42.i, label %land.lhs.true31.i land.lhs.true31.i: ; preds = %for.body27.i %34 = load ptr, ptr %arrayidx.i.i, align 8, !tbaa !9 %arrayidx2.i.i = getelementptr inbounds i32, ptr %34, i64 %indvars.iv80.i %35 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5 %arrayidx33.i = getelementptr inbounds i32, ptr %.pre.i92, i64 %indvars.iv80.i %36 = load i32, ptr %arrayidx33.i, align 4, !tbaa !5 %cmp34.i = icmp slt i32 %35, %36 br i1 %cmp34.i, label %if.then35.i, label %for.inc42.i if.then35.i: ; preds = %land.lhs.true31.i %arrayidx37.i = getelementptr inbounds i32, ptr %31, i64 %indvars.iv80.i store i32 %u.2.i.lcssa, ptr %arrayidx37.i, align 4, !tbaa !5 %37 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5 store i32 %37, ptr %arrayidx33.i, align 4, !tbaa !5 %.pre84.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc42.i for.inc42.i: ; preds = %if.then35.i, %land.lhs.true31.i, %for.body27.i %38 = phi i32 [ %32, %for.body27.i ], [ %32, %land.lhs.true31.i ], [ %.pre84.i, %if.then35.i ] %indvars.iv.next81.i = add nuw nsw i64 %indvars.iv80.i, 1 %39 = sext i32 %38 to i64 %cmp26.i = icmp slt i64 %indvars.iv.next81.i, %39 br i1 %cmp26.i, label %for.body27.i, label %while.cond.loopexit.i, !llvm.loop !18 for.body39.preheader: ; preds = %for.end19.i %wide.trip.count86 = zext i32 %15 to i64 %min.iters.check = icmp ult i32 %15, 8 br i1 %min.iters.check, label %for.body39.preheader113, label %vector.ph vector.ph: ; preds = %for.body39.preheader %n.vec = and i64 %wide.trip.count86, 2147483640 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %42, %vector.body ] %vec.phi111 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %43, %vector.body ] %40 = getelementptr inbounds i32, ptr %.pre.i92, i64 %index %wide.load = load <4 x i32>, ptr %40, align 4, !tbaa !5 %41 = getelementptr inbounds i32, ptr %40, i64 4 %wide.load112 = load <4 x i32>, ptr %41, align 4, !tbaa !5 %42 = add <4 x i32> %wide.load, %vec.phi %43 = add <4 x i32> %wide.load112, %vec.phi111 %index.next = add nuw i64 %index, 8 %44 = icmp eq i64 %index.next, %n.vec br i1 %44, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %43, %42 %45 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count86 br i1 %cmp.n, label %for.end44, label %for.body39.preheader113 for.body39.preheader113: ; preds = %for.body39.preheader, %middle.block %indvars.iv83.ph = phi i64 [ 0, %for.body39.preheader ], [ %n.vec, %middle.block ] %totalcost.071.ph = phi i32 [ 0, %for.body39.preheader ], [ %45, %middle.block ] br label %for.body39 for.body39: ; preds = %for.body39.preheader113, %for.body39 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body39 ], [ %indvars.iv83.ph, %for.body39.preheader113 ] %totalcost.071 = phi i32 [ %add, %for.body39 ], [ %totalcost.071.ph, %for.body39.preheader113 ] %arrayidx41 = getelementptr inbounds i32, ptr %.pre.i92, i64 %indvars.iv83 %46 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %add = add nsw i32 %46, %totalcost.071 %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86 br i1 %exitcond87.not, label %for.end44, label %for.body39, !llvm.loop !22 for.end44: ; preds = %while.cond.loopexit.i, %for.body39, %middle.block, %while.cond.loopexit.i.thread, %for.end.i %totalcost.0.lcssa = phi i32 [ 0, %for.end.i ], [ 0, %while.cond.loopexit.i.thread ], [ %45, %middle.block ], [ %add, %for.body39 ], [ 0, %while.cond.loopexit.i ] %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %totalcost.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @prim() local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp69 = icmp sgt i32 %0, 0 %.pre = load ptr, ptr @d, align 8, !tbaa !9 br i1 %cmp69, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @pi, align 8, !tbaa !9 %2 = load ptr, ptr @color, align 8, !tbaa !9 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 i32, ptr %.pre, i64 %indvars.iv store i32 20000, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv store i32 20000, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx4 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv store i32 0, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16 for.end: ; preds = %for.body, %entry store i32 0, ptr %.pre, align 4, !tbaa !5 %5 = load ptr, ptr @color, align 8 %.pre83 = load i32, ptr @n, align 4, !tbaa !5 store i32 20000, ptr @mincost, align 4, !tbaa !5 %cmp77189 = icmp sgt i32 %.pre83, 0 br i1 %cmp77189, label %for.body8.preheader, label %while.end while.cond.loopexit: ; preds = %for.inc42, %if.end22 %6 = phi i32 [ %21, %if.end22 ], [ %30, %for.inc42 ] store i32 20000, ptr @mincost, align 4, !tbaa !5 %cmp771 = icmp sgt i32 %6, 0 br i1 %cmp771, label %for.body8.preheader, label %while.end for.body8.preheader: ; preds = %for.end, %while.cond.loopexit %u.090 = phi i32 [ %u.2.lcssa, %while.cond.loopexit ], [ undef, %for.end ] %7 = phi i32 [ %6, %while.cond.loopexit ], [ %.pre83, %for.end ] %wide.trip.count = zext i32 %7 to i64 %xtraiter = and i64 %wide.trip.count, 1 %8 = icmp eq i32 %7, 1 br i1 %8, label %for.end19.unr-lcssa, label %for.body8.preheader.new for.body8.preheader.new: ; preds = %for.body8.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body8 for.body8: ; preds = %for.inc17.1, %for.body8.preheader.new %indvars.iv77 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next78.1, %for.inc17.1 ] %u.173 = phi i32 [ %u.090, %for.body8.preheader.new ], [ %u.2.1, %for.inc17.1 ] %9 = phi i32 [ 20000, %for.body8.preheader.new ], [ %17, %for.inc17.1 ] %niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.inc17.1 ] %arrayidx10 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv77 %10 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11.not = icmp eq i32 %10, 1 br i1 %cmp11.not, label %for.inc17, label %land.lhs.true land.lhs.true: ; preds = %for.body8 %arrayidx13 = getelementptr inbounds i32, ptr %.pre, i64 %indvars.iv77 %11 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp slt i32 %11, %9 br i1 %cmp14, label %if.then, label %for.inc17 if.then: ; preds = %land.lhs.true store i32 %11, ptr @mincost, align 4, !tbaa !5 %12 = trunc i64 %indvars.iv77 to i32 br label %for.inc17 for.inc17: ; preds = %for.body8, %land.lhs.true, %if.then %13 = phi i32 [ %11, %if.then ], [ %9, %land.lhs.true ], [ %9, %for.body8 ] %u.2 = phi i32 [ %12, %if.then ], [ %u.173, %land.lhs.true ], [ %u.173, %for.body8 ] %indvars.iv.next78 = or i64 %indvars.iv77, 1 %arrayidx10.1 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv.next78 %14 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %cmp11.not.1 = icmp eq i32 %14, 1 br i1 %cmp11.not.1, label %for.inc17.1, label %land.lhs.true.1 land.lhs.true.1: ; preds = %for.inc17 %arrayidx13.1 = getelementptr inbounds i32, ptr %.pre, i64 %indvars.iv.next78 %15 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5 %cmp14.1 = icmp slt i32 %15, %13 br i1 %cmp14.1, label %if.then.1, label %for.inc17.1 if.then.1: ; preds = %land.lhs.true.1 store i32 %15, ptr @mincost, align 4, !tbaa !5 %16 = trunc i64 %indvars.iv.next78 to i32 br label %for.inc17.1 for.inc17.1: ; preds = %if.then.1, %land.lhs.true.1, %for.inc17 %17 = phi i32 [ %15, %if.then.1 ], [ %13, %land.lhs.true.1 ], [ %13, %for.inc17 ] %u.2.1 = phi i32 [ %16, %if.then.1 ], [ %u.2, %land.lhs.true.1 ], [ %u.2, %for.inc17 ] %indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 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.end19.unr-lcssa, label %for.body8, !llvm.loop !17 for.end19.unr-lcssa: ; preds = %for.inc17.1, %for.body8.preheader %.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %17, %for.inc17.1 ] %u.2.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %u.2.1, %for.inc17.1 ] %indvars.iv77.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next78.1, %for.inc17.1 ] %u.173.unr = phi i32 [ %u.090, %for.body8.preheader ], [ %u.2.1, %for.inc17.1 ] %.unr = phi i32 [ 20000, %for.body8.preheader ], [ %17, %for.inc17.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end19, label %for.body8.epil for.body8.epil: ; preds = %for.end19.unr-lcssa %arrayidx10.epil = getelementptr inbounds i32, ptr %5, i64 %indvars.iv77.unr %18 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %cmp11.not.epil = icmp eq i32 %18, 1 br i1 %cmp11.not.epil, label %for.end19, label %land.lhs.true.epil land.lhs.true.epil: ; preds = %for.body8.epil %arrayidx13.epil = getelementptr inbounds i32, ptr %.pre, i64 %indvars.iv77.unr %19 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5 %cmp14.epil = icmp slt i32 %19, %.unr br i1 %cmp14.epil, label %if.then.epil, label %for.end19 if.then.epil: ; preds = %land.lhs.true.epil store i32 %19, ptr @mincost, align 4, !tbaa !5 %20 = trunc i64 %indvars.iv77.unr to i32 br label %for.end19 for.end19: ; preds = %for.body8.epil, %land.lhs.true.epil, %if.then.epil, %for.end19.unr-lcssa %.lcssa = phi i32 [ %.lcssa.ph, %for.end19.unr-lcssa ], [ %19, %if.then.epil ], [ %.unr, %land.lhs.true.epil ], [ %.unr, %for.body8.epil ] %u.2.lcssa = phi i32 [ %u.2.lcssa.ph, %for.end19.unr-lcssa ], [ %20, %if.then.epil ], [ %u.173.unr, %land.lhs.true.epil ], [ %u.173.unr, %for.body8.epil ] %cmp20 = icmp eq i32 %.lcssa, 20000 br i1 %cmp20, label %while.end, label %if.end22 if.end22: ; preds = %for.end19 %idxprom23 = sext i32 %u.2.lcssa to i64 %arrayidx24 = getelementptr inbounds i32, ptr %5, i64 %idxprom23 store i32 1, ptr %arrayidx24, align 4, !tbaa !5 %21 = load i32, ptr @n, align 4, !tbaa !5 %cmp2674 = icmp sgt i32 %21, 0 br i1 %cmp2674, label %for.body27.lr.ph, label %while.cond.loopexit for.body27.lr.ph: ; preds = %if.end22 %22 = load ptr, ptr @G, align 8 %arrayidx.i = getelementptr inbounds ptr, ptr %22, i64 %idxprom23 %23 = load ptr, ptr @pi, align 8 br label %for.body27 for.body27: ; preds = %for.body27.lr.ph, %for.inc42 %24 = phi i32 [ %21, %for.body27.lr.ph ], [ %30, %for.inc42 ] %indvars.iv80 = phi i64 [ 0, %for.body27.lr.ph ], [ %indvars.iv.next81, %for.inc42 ] %arrayidx29 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv80 %25 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30.not = icmp eq i32 %25, 1 br i1 %cmp30.not, label %for.inc42, label %land.lhs.true31 land.lhs.true31: ; preds = %for.body27 %26 = load ptr, ptr %arrayidx.i, align 8, !tbaa !9 %arrayidx2.i = getelementptr inbounds i32, ptr %26, i64 %indvars.iv80 %27 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %arrayidx33 = getelementptr inbounds i32, ptr %.pre, i64 %indvars.iv80 %28 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %cmp34 = icmp slt i32 %27, %28 br i1 %cmp34, label %if.then35, label %for.inc42 if.then35: ; preds = %land.lhs.true31 %arrayidx37 = getelementptr inbounds i32, ptr %23, i64 %indvars.iv80 store i32 %u.2.lcssa, ptr %arrayidx37, align 4, !tbaa !5 %29 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %29, ptr %arrayidx33, align 4, !tbaa !5 %.pre84 = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc42 for.inc42: ; preds = %for.body27, %land.lhs.true31, %if.then35 %30 = phi i32 [ %24, %for.body27 ], [ %24, %land.lhs.true31 ], [ %.pre84, %if.then35 ] %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %31 = sext i32 %30 to i64 %cmp26 = icmp slt i64 %indvars.iv.next81, %31 br i1 %cmp26, label %for.body27, label %while.cond.loopexit, !llvm.loop !18 while.end: ; preds = %for.end19, %while.cond.loopexit, %for.end ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @w(i32 noundef %i, i32 noundef %j) local_unnamed_addr #5 { entry: %0 = load ptr, ptr @G, align 8, !tbaa !9 %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds ptr, ptr %0, i64 %idxprom %1 = load ptr, ptr %arrayidx, align 8, !tbaa !9 %idxprom1 = sext i32 %j to i64 %arrayidx2 = getelementptr inbounds i32, ptr %1, i64 %idxprom1 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 ret i32 %2 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12, !20, !21} !20 = !{!"llvm.loop.isvectorized", i32 1} !21 = !{!"llvm.loop.unroll.runtime.disable"} !22 = distinct !{!22, !12, !21, !20}
#include<stdio.h> #include<stdlib.h> #define NIL -1 #define MAX 101 int main(){ int A[MAX][MAX]; int V[MAX]={0}; int Aij[MAX]; int E[MAX]={NIL}; int i,j,n,sum=0,max=0,min=0; scanf("%d",&n); for(i=0 ; i<n ; i++){ for(j=0 ; j<n ; j++){ scanf("%d",&A[i][j]); } } Aij[0] = 0; for(i=1; i<n; i++) Aij[i] = 2001; while(max != 2001){ max = 2001; for(i=0 ; i<n ; i++){ if(V[i] != 2 && Aij[i] < max){ max = Aij[i]; min = i; } } V[min] = 2; for(i=0 ; i<n ; i++){ if(A[min][i] != NIL && V[i] != 2 && A[min][i] < Aij[i]){ E[i] = min; Aij[i] = A[min][i]; V[i] = 1; } } } for(i=0 ; i<n ; i++){ if(E[i] != NIL) sum += A[i][E[i]]; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199343/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199343/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [101 x [101 x i32]], align 16 %V = alloca [101 x i32], align 16 %Aij = alloca [101 x i32], align 16 %E = alloca [101 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %V) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %V, i8 0, i64 404, i1 false) call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %Aij) #5 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %E) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %E, i8 0, i64 404, i1 false) store i32 -1, ptr %E, align 16 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 %cmp128 = icmp sgt i32 %0, 0 br i1 %cmp128, label %for.cond1.preheader, label %for.end87 for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %4, %for.inc7 ], [ %0, %entry ] %indvars.iv177 = phi i64 [ %indvars.iv.next178, %for.inc7 ], [ 0, %entry ] %cmp2126 = icmp sgt i32 %1, 0 br i1 %cmp2126, label %for.body3, label %for.cond1.preheader.for.inc7_crit_edge for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader %.pre198 = sext i32 %1 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 [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv177, 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 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %3 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 [ %.pre198, %for.cond1.preheader.for.inc7_crit_edge ], [ %3, %for.body3 ] %4 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %2, %for.body3 ] %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1 %cmp = icmp slt i64 %indvars.iv.next178, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.inc7 store i32 0, ptr %Aij, align 16, !tbaa !5 %cmp12130 = icmp sgt i32 %4, 1 br i1 %cmp12130, label %for.body13.preheader, label %while.cond.preheader for.body13.preheader: ; preds = %for.end9 %wide.trip.count = zext i32 %4 to i64 %5 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %4, 9 br i1 %min.iters.check, label %for.body13.preheader215, label %vector.ph vector.ph: ; preds = %for.body13.preheader %n.vec = and i64 %5, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = or i64 %index, 1 %6 = getelementptr inbounds [101 x i32], ptr %Aij, i64 0, i64 %offset.idx store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %6, align 4, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %7, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %5, %n.vec br i1 %cmp.n, label %while.cond.preheader, label %for.body13.preheader215 for.body13.preheader215: ; preds = %for.body13.preheader, %middle.block %indvars.iv180.ph = phi i64 [ 1, %for.body13.preheader ], [ %ind.end, %middle.block ] br label %for.body13 while.cond.preheader: ; preds = %for.body13, %middle.block, %for.end9 %cmp21132 = icmp sgt i32 %4, 0 br i1 %cmp21132, label %for.cond20.preheader.us.preheader, label %for.end87 for.cond20.preheader.us.preheader: ; preds = %while.cond.preheader %wide.trip.count186 = zext i32 %4 to i64 br label %for.body22.us for.end33.us: ; preds = %for.inc31.us %idxprom34.us = sext i32 %min.2.us to i64 %arrayidx35.us = getelementptr inbounds [101 x i32], ptr %V, i64 0, i64 %idxprom34.us store i32 2, ptr %arrayidx35.us, align 4, !tbaa !5 br label %for.body38.us for.body38.us: ; preds = %for.end33.us, %for.inc68.us %indvars.iv188 = phi i64 [ 0, %for.end33.us ], [ %indvars.iv.next189, %for.inc68.us ] %arrayidx42.us = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %idxprom34.us, i64 %indvars.iv188 %9 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5 %cmp43.not.us = icmp eq i32 %9, -1 br i1 %cmp43.not.us, label %for.inc68.us, label %land.lhs.true44.us land.lhs.true44.us: ; preds = %for.body38.us %arrayidx46.us = getelementptr inbounds [101 x i32], ptr %V, i64 0, i64 %indvars.iv188 %10 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5 %cmp47.not.us = icmp eq i32 %10, 2 br i1 %cmp47.not.us, label %for.inc68.us, label %land.lhs.true48.us land.lhs.true48.us: ; preds = %land.lhs.true44.us %arrayidx54.us = getelementptr inbounds [101 x i32], ptr %Aij, i64 0, i64 %indvars.iv188 %11 = load i32, ptr %arrayidx54.us, align 4, !tbaa !5 %cmp55.us = icmp slt i32 %9, %11 br i1 %cmp55.us, label %if.then56.us, label %for.inc68.us if.then56.us: ; preds = %land.lhs.true48.us %arrayidx58.us = getelementptr inbounds [101 x i32], ptr %E, i64 0, i64 %indvars.iv188 store i32 %min.2.us, ptr %arrayidx58.us, align 4, !tbaa !5 store i32 %9, ptr %arrayidx54.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx46.us, align 4, !tbaa !5 br label %for.inc68.us for.inc68.us: ; preds = %if.then56.us, %land.lhs.true48.us, %land.lhs.true44.us, %for.body38.us %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1 %exitcond192.not = icmp eq i64 %indvars.iv.next189, %wide.trip.count186 br i1 %exitcond192.not, label %for.cond36.while.cond.loopexit_crit_edge.us, label %for.body38.us, !llvm.loop !16 for.body22.us: ; preds = %for.body22.us.backedge, %for.cond20.preheader.us.preheader %indvars.iv183 = phi i64 [ 0, %for.cond20.preheader.us.preheader ], [ %indvars.iv183.be, %for.body22.us.backedge ] %min.1135.us = phi i32 [ 0, %for.cond20.preheader.us.preheader ], [ %min.2.us, %for.body22.us.backedge ] %max.1134.us = phi i32 [ 2001, %for.cond20.preheader.us.preheader ], [ %max.1134.us.be, %for.body22.us.backedge ] %arrayidx24.us = getelementptr inbounds [101 x i32], ptr %V, i64 0, i64 %indvars.iv183 %12 = load i32, ptr %arrayidx24.us, align 4, !tbaa !5 %cmp25.not.us = icmp eq i32 %12, 2 br i1 %cmp25.not.us, label %for.inc31.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body22.us %arrayidx27.us = getelementptr inbounds [101 x i32], ptr %Aij, i64 0, i64 %indvars.iv183 %13 = load i32, ptr %arrayidx27.us, align 4, !tbaa !5 %cmp28.us = icmp slt i32 %13, %max.1134.us %spec.select.us = call i32 @llvm.smin.i32(i32 %13, i32 %max.1134.us) %14 = trunc i64 %indvars.iv183 to i32 %spec.select125.us = select i1 %cmp28.us, i32 %14, i32 %min.1135.us br label %for.inc31.us for.inc31.us: ; preds = %land.lhs.true.us, %for.body22.us %max.2.us = phi i32 [ %max.1134.us, %for.body22.us ], [ %spec.select.us, %land.lhs.true.us ] %min.2.us = phi i32 [ %min.1135.us, %for.body22.us ], [ %spec.select125.us, %land.lhs.true.us ] %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1 %exitcond187.not = icmp eq i64 %indvars.iv.next184, %wide.trip.count186 br i1 %exitcond187.not, label %for.end33.us, label %for.body22.us.backedge for.body22.us.backedge: ; preds = %for.inc31.us, %for.cond36.while.cond.loopexit_crit_edge.us %indvars.iv183.be = phi i64 [ %indvars.iv.next184, %for.inc31.us ], [ 0, %for.cond36.while.cond.loopexit_crit_edge.us ] %max.1134.us.be = phi i32 [ %max.2.us, %for.inc31.us ], [ 2001, %for.cond36.while.cond.loopexit_crit_edge.us ] br label %for.body22.us, !llvm.loop !17 for.cond36.while.cond.loopexit_crit_edge.us: ; preds = %for.inc68.us %cmp19.not.us = icmp eq i32 %max.2.us, 2001 br i1 %cmp19.not.us, label %for.cond71.preheader, label %for.body22.us.backedge for.body13: ; preds = %for.body13.preheader215, %for.body13 %indvars.iv180 = phi i64 [ %indvars.iv.next181, %for.body13 ], [ %indvars.iv180.ph, %for.body13.preheader215 ] %arrayidx15 = getelementptr inbounds [101 x i32], ptr %Aij, i64 0, i64 %indvars.iv180 store i32 2001, ptr %arrayidx15, align 4, !tbaa !5 %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1 %exitcond.not = icmp eq i64 %indvars.iv.next181, %wide.trip.count br i1 %exitcond.not, label %while.cond.preheader, label %for.body13, !llvm.loop !18 for.cond71.preheader: ; preds = %for.cond36.while.cond.loopexit_crit_edge.us br i1 %cmp21132, label %for.body73.preheader, label %for.end87 for.body73.preheader: ; preds = %for.cond71.preheader %xtraiter = and i64 %wide.trip.count186, 1 %15 = icmp eq i32 %4, 1 br i1 %15, label %for.end87.loopexit.unr-lcssa, label %for.body73.preheader.new for.body73.preheader.new: ; preds = %for.body73.preheader %unroll_iter = and i64 %wide.trip.count186, 4294967294 br label %for.body73 for.body73: ; preds = %for.inc85.1, %for.body73.preheader.new %indvars.iv193 = phi i64 [ 0, %for.body73.preheader.new ], [ %indvars.iv.next194.1, %for.inc85.1 ] %sum.0172 = phi i32 [ 0, %for.body73.preheader.new ], [ %sum.1.1, %for.inc85.1 ] %niter = phi i64 [ 0, %for.body73.preheader.new ], [ %niter.next.1, %for.inc85.1 ] %arrayidx75 = getelementptr inbounds [101 x i32], ptr %E, i64 0, i64 %indvars.iv193 %16 = load i32, ptr %arrayidx75, align 8, !tbaa !5 %cmp76.not = icmp eq i32 %16, -1 br i1 %cmp76.not, label %for.inc85, label %if.then77 if.then77: ; preds = %for.body73 %idxprom82 = sext i32 %16 to i64 %arrayidx83 = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv193, i64 %idxprom82 %17 = load i32, ptr %arrayidx83, align 4, !tbaa !5 %add = add nsw i32 %17, %sum.0172 br label %for.inc85 for.inc85: ; preds = %for.body73, %if.then77 %sum.1 = phi i32 [ %add, %if.then77 ], [ %sum.0172, %for.body73 ] %indvars.iv.next194 = or i64 %indvars.iv193, 1 %arrayidx75.1 = getelementptr inbounds [101 x i32], ptr %E, i64 0, i64 %indvars.iv.next194 %18 = load i32, ptr %arrayidx75.1, align 4, !tbaa !5 %cmp76.not.1 = icmp eq i32 %18, -1 br i1 %cmp76.not.1, label %for.inc85.1, label %if.then77.1 if.then77.1: ; preds = %for.inc85 %idxprom82.1 = sext i32 %18 to i64 %arrayidx83.1 = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv.next194, i64 %idxprom82.1 %19 = load i32, ptr %arrayidx83.1, align 4, !tbaa !5 %add.1 = add nsw i32 %19, %sum.1 br label %for.inc85.1 for.inc85.1: ; preds = %if.then77.1, %for.inc85 %sum.1.1 = phi i32 [ %add.1, %if.then77.1 ], [ %sum.1, %for.inc85 ] %indvars.iv.next194.1 = add nuw nsw i64 %indvars.iv193, 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.end87.loopexit.unr-lcssa, label %for.body73, !llvm.loop !19 for.end87.loopexit.unr-lcssa: ; preds = %for.inc85.1, %for.body73.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body73.preheader ], [ %sum.1.1, %for.inc85.1 ] %indvars.iv193.unr = phi i64 [ 0, %for.body73.preheader ], [ %indvars.iv.next194.1, %for.inc85.1 ] %sum.0172.unr = phi i32 [ 0, %for.body73.preheader ], [ %sum.1.1, %for.inc85.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end87, label %for.body73.epil for.body73.epil: ; preds = %for.end87.loopexit.unr-lcssa %arrayidx75.epil = getelementptr inbounds [101 x i32], ptr %E, i64 0, i64 %indvars.iv193.unr %20 = load i32, ptr %arrayidx75.epil, align 4, !tbaa !5 %cmp76.not.epil = icmp eq i32 %20, -1 br i1 %cmp76.not.epil, label %for.end87, label %if.then77.epil if.then77.epil: ; preds = %for.body73.epil %idxprom82.epil = sext i32 %20 to i64 %arrayidx83.epil = getelementptr inbounds [101 x [101 x i32]], ptr %A, i64 0, i64 %indvars.iv193.unr, i64 %idxprom82.epil %21 = load i32, ptr %arrayidx83.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %21, %sum.0172.unr br label %for.end87 for.end87: ; preds = %for.end87.loopexit.unr-lcssa, %if.then77.epil, %for.body73.epil, %entry, %while.cond.preheader, %for.cond71.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond71.preheader ], [ 0, %while.cond.preheader ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end87.loopexit.unr-lcssa ], [ %add.epil, %if.then77.epil ], [ %sum.0172.unr, %for.body73.epil ] %call88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %E) #5 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %Aij) #5 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %V) #5 call void @llvm.lifetime.end.p0(i64 40804, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !15, !14} !19 = distinct !{!19, !10}
#include <stdio.h> #include <limits.h> #define MAX 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 void prim(void); int color[MAX],M[MAX][MAX],d[MAX],p[MAX]; int n; int main(){ int i,j; int sum = 0; scanf("%d",&n); for (i = 0;i < n;i++) for (j = 0;j < n;j++){ scanf("%d",&M[i][j]); } prim(); for (i = 0;i < n;i++){ sum += d[i]; } printf("%d\n",sum); return 0; } void prim(){ int i; int u,mincost; for (i = 0;i < n;i++){ color[i] = WHITE; d[i] = INT_MAX; } d[0] = 0; p[0] = -1; while (1){ mincost = INT_MAX; for (i = 0;i < n;i++) if (color[i] != BLACK && d[i] < mincost){ mincost = d[i]; u = i; } if (mincost == INT_MAX) break; color[u] = BLACK; for (i = 0;i < n;i++) if (color[i] != BLACK && M[u][i] != -1) if (M[u][i] < d[i]){ d[i] = M[u][i]; p[i] = u; color[i] = GRAY; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199387/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199387/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @M = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i29 = freeze i32 %0 %cmp30 = icmp sgt i32 %.fr.i29, 0 br i1 %cmp30, label %for.cond1.preheader, label %prim.exit.thread for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %.fr.i, %for.inc7 ], [ %.fr.i29, %entry ] %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.inc7 ], [ 0, %entry ] %cmp227 = icmp sgt i32 %1, 0 br i1 %cmp227, label %for.body3, 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 @M, i64 0, i64 %indvars.iv39, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3, %for.cond1.preheader %4 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %for.body3 ] %.fr.i = freeze i32 %4 %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %5 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next40, %5 br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.inc7 %cmp84.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp84.i, label %for.body.preheader.i, label %prim.exit.thread prim.exit.thread: ; preds = %for.end9, %entry store i32 0, ptr @d, align 16, !tbaa !5 store i32 -1, ptr @p, align 16, !tbaa !5 br label %for.end17 for.body.preheader.i: ; preds = %for.end9 %6 = zext i32 %.fr.i to i64 %7 = shl nuw nsw i64 %6, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %7, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %6, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %8 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %9, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %6 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx2.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv.i store i32 2147483647, ptr %arrayidx2.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %6 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !16 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr @d, align 16, !tbaa !5 store i32 -1, ptr @p, align 16, !tbaa !5 br label %for.body5.us.i for.end16.us.i: ; preds = %for.inc14.us.i %cmp17.us.i = icmp eq i32 %mincost.1.us.i, 2147483647 br i1 %cmp17.us.i, label %prim.exit, label %if.end19.us.i if.end19.us.i: ; preds = %for.end16.us.i %idxprom20.us.i = sext i32 %u.2.us.i to i64 %arrayidx21.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom20.us.i store i32 2, ptr %arrayidx21.us.i, align 4, !tbaa !5 br label %for.body24.us.i for.body24.us.i: ; preds = %for.inc55.us.i, %if.end19.us.i %indvars.iv136.i = phi i64 [ 0, %if.end19.us.i ], [ %indvars.iv.next137.i, %for.inc55.us.i ] %arrayidx26.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv136.i %11 = load i32, ptr %arrayidx26.us.i, align 4, !tbaa !5 %cmp27.not.us.i = icmp eq i32 %11, 2 br i1 %cmp27.not.us.i, label %for.inc55.us.i, label %land.lhs.true28.us.i land.lhs.true28.us.i: ; preds = %for.body24.us.i %arrayidx32.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom20.us.i, i64 %indvars.iv136.i %12 = load i32, ptr %arrayidx32.us.i, align 4, !tbaa !5 %cmp33.not.us.i = icmp eq i32 %12, -1 br i1 %cmp33.not.us.i, label %for.inc55.us.i, label %if.then34.us.i if.then34.us.i: ; preds = %land.lhs.true28.us.i %arrayidx40.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv136.i %13 = load i32, ptr %arrayidx40.us.i, align 4, !tbaa !5 %cmp41.us.i = icmp slt i32 %12, %13 br i1 %cmp41.us.i, label %if.then42.us.i, label %for.inc55.us.i if.then42.us.i: ; preds = %if.then34.us.i store i32 %12, ptr %arrayidx40.us.i, align 4, !tbaa !5 %arrayidx50.us.i = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv136.i store i32 %u.2.us.i, ptr %arrayidx50.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx26.us.i, align 4, !tbaa !5 br label %for.inc55.us.i for.inc55.us.i: ; preds = %if.then42.us.i, %if.then34.us.i, %land.lhs.true28.us.i, %for.body24.us.i %indvars.iv.next137.i = add nuw nsw i64 %indvars.iv136.i, 1 %exitcond140.not.i = icmp eq i64 %indvars.iv.next137.i, %6 br i1 %exitcond140.not.i, label %for.body5.us.i.backedge, label %for.body24.us.i, !llvm.loop !17 for.body5.us.i: ; preds = %for.body5.us.i.backedge, %while.cond.us.preheader.i %indvars.iv131.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv131.i.be, %for.body5.us.i.backedge ] %mincost.089.us.i = phi i32 [ 2147483647, %while.cond.us.preheader.i ], [ %mincost.089.us.i.be, %for.body5.us.i.backedge ] %u.188.us.i = phi i32 [ undef, %while.cond.us.preheader.i ], [ %u.2.us.i, %for.body5.us.i.backedge ] %arrayidx7.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv131.i %14 = load i32, ptr %arrayidx7.us.i, align 4, !tbaa !5 %cmp8.not.us.i = icmp eq i32 %14, 2 br i1 %cmp8.not.us.i, label %for.inc14.us.i, label %land.lhs.true.us.i land.lhs.true.us.i: ; preds = %for.body5.us.i %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv131.i %15 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.us.i = icmp slt i32 %15, %mincost.089.us.i %16 = trunc i64 %indvars.iv131.i to i32 %spec.select.us.i = select i1 %cmp11.us.i, i32 %16, i32 %u.188.us.i %spec.select83.us.i = tail call i32 @llvm.smin.i32(i32 %15, i32 %mincost.089.us.i) br label %for.inc14.us.i for.inc14.us.i: ; preds = %land.lhs.true.us.i, %for.body5.us.i %u.2.us.i = phi i32 [ %u.188.us.i, %for.body5.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %mincost.1.us.i = phi i32 [ %mincost.089.us.i, %for.body5.us.i ], [ %spec.select83.us.i, %land.lhs.true.us.i ] %indvars.iv.next132.i = add nuw nsw i64 %indvars.iv131.i, 1 %exitcond135.not.i = icmp eq i64 %indvars.iv.next132.i, %6 br i1 %exitcond135.not.i, label %for.end16.us.i, label %for.body5.us.i.backedge for.body5.us.i.backedge: ; preds = %for.inc55.us.i, %for.inc14.us.i %indvars.iv131.i.be = phi i64 [ %indvars.iv.next132.i, %for.inc14.us.i ], [ 0, %for.inc55.us.i ] %mincost.089.us.i.be = phi i32 [ %mincost.1.us.i, %for.inc14.us.i ], [ 2147483647, %for.inc55.us.i ] br label %for.body5.us.i, !llvm.loop !17 prim.exit: ; preds = %for.end16.us.i br i1 %cmp84.i, label %for.body12.preheader, label %for.end17 for.body12.preheader: ; preds = %prim.exit %wide.trip.count = zext i32 %.fr.i to i64 %min.iters.check55 = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check55, label %for.body12.preheader66, label %vector.ph56 vector.ph56: ; preds = %for.body12.preheader %n.vec58 = and i64 %6, 4294967288 br label %vector.body61 vector.body61: ; preds = %vector.body61, %vector.ph56 %index62 = phi i64 [ 0, %vector.ph56 ], [ %index.next65, %vector.body61 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %19, %vector.body61 ] %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %20, %vector.body61 ] %17 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index62 %wide.load = load <4 x i32>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load64 = load <4 x i32>, ptr %18, align 16, !tbaa !5 %19 = add <4 x i32> %wide.load, %vec.phi %20 = add <4 x i32> %wide.load64, %vec.phi63 %index.next65 = add nuw i64 %index62, 8 %21 = icmp eq i64 %index.next65, %n.vec58 br i1 %21, label %middle.block53, label %vector.body61, !llvm.loop !18 middle.block53: ; preds = %vector.body61 %bin.rdx = add <4 x i32> %20, %19 %22 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n60 = icmp eq i64 %n.vec58, %6 br i1 %cmp.n60, label %for.end17, label %for.body12.preheader66 for.body12.preheader66: ; preds = %for.body12.preheader, %middle.block53 %indvars.iv42.ph = phi i64 [ 0, %for.body12.preheader ], [ %n.vec58, %middle.block53 ] %sum.034.ph = phi i32 [ 0, %for.body12.preheader ], [ %22, %middle.block53 ] br label %for.body12 for.body12: ; preds = %for.body12.preheader66, %for.body12 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body12 ], [ %indvars.iv42.ph, %for.body12.preheader66 ] %sum.034 = phi i32 [ %add, %for.body12 ], [ %sum.034.ph, %for.body12.preheader66 ] %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv42 %23 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %add = add nsw i32 %23, %sum.034 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end17, label %for.body12, !llvm.loop !19 for.end17: ; preds = %for.body12, %middle.block53, %prim.exit.thread, %prim.exit %sum.0.lcssa = phi i32 [ 0, %prim.exit ], [ 0, %prim.exit.thread ], [ %22, %middle.block53 ], [ %add, %for.body12 ] %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @prim() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp84 = icmp sgt i32 %.fr, 0 br i1 %cmp84, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %entry store i32 0, ptr @d, align 16, !tbaa !5 store i32 -1, ptr @p, align 16, !tbaa !5 br label %while.end for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader141, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader141 for.body.preheader141: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader141, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader141 ] %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv store i32 2147483647, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !21 for.end: ; preds = %for.body, %middle.block store i32 0, ptr @d, align 16, !tbaa !5 store i32 -1, ptr @p, align 16, !tbaa !5 br i1 %cmp84, label %while.cond.us.preheader, label %while.end while.cond.us.preheader: ; preds = %for.end %wide.trip.count134 = zext i32 %.fr to i64 %wide.trip.count139 = zext i32 %.fr to i64 br label %for.body5.us for.end16.us: ; preds = %for.inc14.us %cmp17.us = icmp eq i32 %mincost.1.us, 2147483647 br i1 %cmp17.us, label %while.end, label %if.end19.us if.end19.us: ; preds = %for.end16.us %idxprom20.us = sext i32 %u.2.us to i64 %arrayidx21.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom20.us store i32 2, ptr %arrayidx21.us, align 4, !tbaa !5 br label %for.body24.us for.body24.us: ; preds = %if.end19.us, %for.inc55.us %indvars.iv136 = phi i64 [ 0, %if.end19.us ], [ %indvars.iv.next137, %for.inc55.us ] %arrayidx26.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv136 %6 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5 %cmp27.not.us = icmp eq i32 %6, 2 br i1 %cmp27.not.us, label %for.inc55.us, label %land.lhs.true28.us land.lhs.true28.us: ; preds = %for.body24.us %arrayidx32.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom20.us, i64 %indvars.iv136 %7 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5 %cmp33.not.us = icmp eq i32 %7, -1 br i1 %cmp33.not.us, label %for.inc55.us, label %if.then34.us if.then34.us: ; preds = %land.lhs.true28.us %arrayidx40.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv136 %8 = load i32, ptr %arrayidx40.us, align 4, !tbaa !5 %cmp41.us = icmp slt i32 %7, %8 br i1 %cmp41.us, label %if.then42.us, label %for.inc55.us if.then42.us: ; preds = %if.then34.us store i32 %7, ptr %arrayidx40.us, align 4, !tbaa !5 %arrayidx50.us = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv136 store i32 %u.2.us, ptr %arrayidx50.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx26.us, align 4, !tbaa !5 br label %for.inc55.us for.inc55.us: ; preds = %if.then42.us, %if.then34.us, %land.lhs.true28.us, %for.body24.us %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count139 br i1 %exitcond140.not, label %for.body5.us.backedge, label %for.body24.us, !llvm.loop !17 for.body5.us: ; preds = %for.body5.us.backedge, %while.cond.us.preheader %indvars.iv131 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv131.be, %for.body5.us.backedge ] %mincost.089.us = phi i32 [ 2147483647, %while.cond.us.preheader ], [ %mincost.089.us.be, %for.body5.us.backedge ] %u.188.us = phi i32 [ undef, %while.cond.us.preheader ], [ %u.2.us, %for.body5.us.backedge ] %arrayidx7.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv131 %9 = load i32, ptr %arrayidx7.us, align 4, !tbaa !5 %cmp8.not.us = icmp eq i32 %9, 2 br i1 %cmp8.not.us, label %for.inc14.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body5.us %arrayidx10.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv131 %10 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp slt i32 %10, %mincost.089.us %11 = trunc i64 %indvars.iv131 to i32 %spec.select.us = select i1 %cmp11.us, i32 %11, i32 %u.188.us %spec.select83.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.089.us) br label %for.inc14.us for.inc14.us: ; preds = %land.lhs.true.us, %for.body5.us %u.2.us = phi i32 [ %u.188.us, %for.body5.us ], [ %spec.select.us, %land.lhs.true.us ] %mincost.1.us = phi i32 [ %mincost.089.us, %for.body5.us ], [ %spec.select83.us, %land.lhs.true.us ] %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134 br i1 %exitcond135.not, label %for.end16.us, label %for.body5.us.backedge for.body5.us.backedge: ; preds = %for.inc55.us, %for.inc14.us %indvars.iv131.be = phi i64 [ %indvars.iv.next132, %for.inc14.us ], [ 0, %for.inc55.us ] %mincost.089.us.be = phi i32 [ %mincost.1.us, %for.inc14.us ], [ 2147483647, %for.inc55.us ] br label %for.body5.us, !llvm.loop !17 while.end: ; preds = %for.end16.us, %for.end, %for.end.thread ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; 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 = { nofree nounwind "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !14, !15} !19 = distinct !{!19, !10, !15, !14} !20 = distinct !{!20, !10, !14, !15} !21 = distinct !{!21, !10, !15, !14}
#include<stdio.h> int main(){ int n,temp; scanf("%d",&n); temp=n%10; if (temp>5) n=n+(10-temp); else n=(n/10)*10; printf("%d",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19943/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19943/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %.fr = freeze i32 %0 %rem = srem i32 %.fr, 10 %cmp = icmp sgt i32 %rem, 5 %reass.sub = add i32 %.fr, 10 %storemerge.v = select i1 %cmp, i32 %reass.sub, i32 %.fr %storemerge = sub i32 %storemerge.v, %rem store i32 %storemerge, ptr %n, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %storemerge) 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> typedef struct{ int p; int color; } Ver; int min(int a,int b){ if(a > b) return b; else return a; } int main(){ int n,i,j,m; int direction,parent,sum = 0; scanf("%d",&n); int M[n+1][n+1]; Ver G[n+1]; for(i = 1;i <= n;i++){ G[i].color = 0; for(j = 1;j <= n;j++){ scanf("%d",&M[i][j]); } } G[1].color = 1; while(1){ m = 2001; direction = 0; for(i = 1;i <= n;i++){ if(G[i].color == 1){ for(j = 1;j <= n;j++){ if(M[i][j] != -1 && G[j].color == 0){ if(m > M[i][j]){ m = M[i][j]; parent = i; direction = j; } } } } } G[direction].color = 1; G[direction].p = parent; if(m == 2001) break; } for(i = 1;i <= n;i++){ if(G[i].color == 1){ for(j = 1;j <= n;j++){ if(M[i][j] != -1 && G[j].color == 1 && G[j].p == i){ sum += M[i][j]; } } } } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199480/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199480/source.c" target datalayout = "e-m:e-p270: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.Ver = type { i32, i32 } @.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 nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %b.a } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %3 = mul nuw i64 %1, %1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %add2 = add nsw i32 %4, 1 %5 = zext i32 %add2 to i64 %vla3 = alloca %struct.Ver, i64 %5, align 16 %cmp.not141 = icmp slt i32 %4, 1 br i1 %cmp.not141, label %for.end102, label %for.body for.body: ; preds = %entry, %for.inc12 %6 = phi i32 [ %10, %for.inc12 ], [ %4, %entry ] %indvars.iv177 = phi i64 [ %indvars.iv.next178, %for.inc12 ], [ 1, %entry ] %color = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv177, i32 1 store i32 0, ptr %color, align 4, !tbaa !9 %cmp5.not139 = icmp slt i32 %6, 1 br i1 %cmp5.not139, label %for.body.for.inc12_crit_edge, label %for.body6.lr.ph for.body.for.inc12_crit_edge: ; preds = %for.body %.pre = sext i32 %6 to i64 br label %for.inc12 for.body6.lr.ph: ; preds = %for.body %7 = mul nuw nsw i64 %indvars.iv177, %1 %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %7 br label %for.body6 for.body6: ; preds = %for.body6.lr.ph, %for.body6 %indvars.iv = phi i64 [ 1, %for.body6.lr.ph ], [ %indvars.iv.next, %for.body6 ] %arrayidx10 = getelementptr inbounds i32, ptr %arrayidx8, i64 %indvars.iv %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp5.not.not = icmp slt i64 %indvars.iv, %9 br i1 %cmp5.not.not, label %for.body6, label %for.inc12, !llvm.loop !11 for.inc12: ; preds = %for.body6, %for.body.for.inc12_crit_edge %.pre-phi = phi i64 [ %.pre, %for.body.for.inc12_crit_edge ], [ %9, %for.body6 ] %10 = phi i32 [ %6, %for.body.for.inc12_crit_edge ], [ %8, %for.body6 ] %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1 %cmp.not.not = icmp slt i64 %indvars.iv177, %.pre-phi br i1 %cmp.not.not, label %for.body, label %for.end14, !llvm.loop !13 for.end14: ; preds = %for.inc12 %color16 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 1, i32 1 store i32 1, ptr %color16, align 4, !tbaa !9 %cmp18.not151 = icmp slt i32 %10, 1 br i1 %cmp18.not151, label %for.end102, label %while.cond.preheader while.cond.preheader: ; preds = %for.end14 %11 = add i32 %10, 1 %wide.trip.count191 = zext i32 %11 to i64 %12 = add nsw i64 %wide.trip.count191, -1 %13 = add nsw i64 %wide.trip.count191, -2 %xtraiter = and i64 %12, 1 %14 = icmp eq i64 %13, 0 %unroll_iter = and i64 %12, -2 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body19 for.body19: ; preds = %for.body19.backedge, %while.cond.preheader %indvars.iv188 = phi i64 [ 1, %while.cond.preheader ], [ %indvars.iv188.be, %for.body19.backedge ] %m.0154 = phi i32 [ 2001, %while.cond.preheader ], [ %m.0154.be, %for.body19.backedge ] %parent.1153 = phi i32 [ undef, %while.cond.preheader ], [ %parent.4, %for.body19.backedge ] %direction.0152 = phi i32 [ 0, %while.cond.preheader ], [ %direction.0152.be, %for.body19.backedge ] %color22 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv188, i32 1 %15 = load i32, ptr %color22, align 4, !tbaa !9 %cmp23 = icmp eq i32 %15, 1 br i1 %cmp23, label %for.cond24.preheader, label %for.inc52 for.cond24.preheader: ; preds = %for.body19 %16 = mul nuw nsw i64 %indvars.iv188, %1 %arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %16 %17 = trunc i64 %indvars.iv188 to i32 br i1 %14, label %for.inc52.loopexit.unr-lcssa, label %for.body26 for.body26: ; preds = %for.cond24.preheader, %for.inc48.1 %indvars.iv183 = phi i64 [ %indvars.iv.next184.1, %for.inc48.1 ], [ 1, %for.cond24.preheader ] %m.1146 = phi i32 [ %m.2.1, %for.inc48.1 ], [ %m.0154, %for.cond24.preheader ] %parent.2145 = phi i32 [ %parent.3.1, %for.inc48.1 ], [ %parent.1153, %for.cond24.preheader ] %direction.1144 = phi i32 [ %direction.2.1, %for.inc48.1 ], [ %direction.0152, %for.cond24.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc48.1 ], [ 0, %for.cond24.preheader ] %arrayidx30 = getelementptr inbounds i32, ptr %arrayidx28, i64 %indvars.iv183 %18 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp31.not = icmp eq i32 %18, -1 br i1 %cmp31.not, label %for.inc48, label %land.lhs.true land.lhs.true: ; preds = %for.body26 %color34 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv183, i32 1 %19 = load i32, ptr %color34, align 4, !tbaa !9 %cmp35 = icmp eq i32 %19, 0 %cmp41 = icmp sgt i32 %m.1146, %18 %or.cond = select i1 %cmp35, i1 %cmp41, i1 false br i1 %or.cond, label %if.then42, label %for.inc48 if.then42: ; preds = %land.lhs.true %20 = trunc i64 %indvars.iv183 to i32 br label %for.inc48 for.inc48: ; preds = %for.body26, %land.lhs.true, %if.then42 %direction.2 = phi i32 [ %20, %if.then42 ], [ %direction.1144, %land.lhs.true ], [ %direction.1144, %for.body26 ] %parent.3 = phi i32 [ %17, %if.then42 ], [ %parent.2145, %land.lhs.true ], [ %parent.2145, %for.body26 ] %m.2 = phi i32 [ %18, %if.then42 ], [ %m.1146, %land.lhs.true ], [ %m.1146, %for.body26 ] %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1 %arrayidx30.1 = getelementptr inbounds i32, ptr %arrayidx28, i64 %indvars.iv.next184 %21 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %cmp31.not.1 = icmp eq i32 %21, -1 br i1 %cmp31.not.1, label %for.inc48.1, label %land.lhs.true.1 land.lhs.true.1: ; preds = %for.inc48 %color34.1 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv.next184, i32 1 %22 = load i32, ptr %color34.1, align 4, !tbaa !9 %cmp35.1 = icmp eq i32 %22, 0 %cmp41.1 = icmp sgt i32 %m.2, %21 %or.cond.1 = select i1 %cmp35.1, i1 %cmp41.1, i1 false br i1 %or.cond.1, label %if.then42.1, label %for.inc48.1 if.then42.1: ; preds = %land.lhs.true.1 %23 = trunc i64 %indvars.iv.next184 to i32 br label %for.inc48.1 for.inc48.1: ; preds = %if.then42.1, %land.lhs.true.1, %for.inc48 %direction.2.1 = phi i32 [ %23, %if.then42.1 ], [ %direction.2, %land.lhs.true.1 ], [ %direction.2, %for.inc48 ] %parent.3.1 = phi i32 [ %17, %if.then42.1 ], [ %parent.3, %land.lhs.true.1 ], [ %parent.3, %for.inc48 ] %m.2.1 = phi i32 [ %21, %if.then42.1 ], [ %m.2, %land.lhs.true.1 ], [ %m.2, %for.inc48 ] %indvars.iv.next184.1 = add nuw nsw i64 %indvars.iv183, 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.inc52.loopexit.unr-lcssa, label %for.body26, !llvm.loop !15 for.inc52.loopexit.unr-lcssa: ; preds = %for.inc48.1, %for.cond24.preheader %direction.2.lcssa.ph = phi i32 [ undef, %for.cond24.preheader ], [ %direction.2.1, %for.inc48.1 ] %parent.3.lcssa.ph = phi i32 [ undef, %for.cond24.preheader ], [ %parent.3.1, %for.inc48.1 ] %m.2.lcssa.ph = phi i32 [ undef, %for.cond24.preheader ], [ %m.2.1, %for.inc48.1 ] %indvars.iv183.unr = phi i64 [ 1, %for.cond24.preheader ], [ %indvars.iv.next184.1, %for.inc48.1 ] %m.1146.unr = phi i32 [ %m.0154, %for.cond24.preheader ], [ %m.2.1, %for.inc48.1 ] %parent.2145.unr = phi i32 [ %parent.1153, %for.cond24.preheader ], [ %parent.3.1, %for.inc48.1 ] %direction.1144.unr = phi i32 [ %direction.0152, %for.cond24.preheader ], [ %direction.2.1, %for.inc48.1 ] br i1 %lcmp.mod.not, label %for.inc52, label %for.body26.epil for.body26.epil: ; preds = %for.inc52.loopexit.unr-lcssa %arrayidx30.epil = getelementptr inbounds i32, ptr %arrayidx28, i64 %indvars.iv183.unr %24 = load i32, ptr %arrayidx30.epil, align 4, !tbaa !5 %cmp31.not.epil = icmp eq i32 %24, -1 br i1 %cmp31.not.epil, label %for.inc52, label %land.lhs.true.epil land.lhs.true.epil: ; preds = %for.body26.epil %color34.epil = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv183.unr, i32 1 %25 = load i32, ptr %color34.epil, align 4, !tbaa !9 %cmp35.epil = icmp eq i32 %25, 0 %cmp41.epil = icmp sgt i32 %m.1146.unr, %24 %or.cond.epil = select i1 %cmp35.epil, i1 %cmp41.epil, i1 false br i1 %or.cond.epil, label %if.then42.epil, label %for.inc52 if.then42.epil: ; preds = %land.lhs.true.epil %26 = trunc i64 %indvars.iv183.unr to i32 br label %for.inc52 for.inc52: ; preds = %for.inc52.loopexit.unr-lcssa, %if.then42.epil, %land.lhs.true.epil, %for.body26.epil, %for.body19 %direction.3 = phi i32 [ %direction.0152, %for.body19 ], [ %direction.2.lcssa.ph, %for.inc52.loopexit.unr-lcssa ], [ %26, %if.then42.epil ], [ %direction.1144.unr, %land.lhs.true.epil ], [ %direction.1144.unr, %for.body26.epil ] %parent.4 = phi i32 [ %parent.1153, %for.body19 ], [ %parent.3.lcssa.ph, %for.inc52.loopexit.unr-lcssa ], [ %17, %if.then42.epil ], [ %parent.2145.unr, %land.lhs.true.epil ], [ %parent.2145.unr, %for.body26.epil ] %m.3 = phi i32 [ %m.0154, %for.body19 ], [ %m.2.lcssa.ph, %for.inc52.loopexit.unr-lcssa ], [ %24, %if.then42.epil ], [ %m.1146.unr, %land.lhs.true.epil ], [ %m.1146.unr, %for.body26.epil ] %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1 %exitcond192.not = icmp eq i64 %indvars.iv.next189, %wide.trip.count191 br i1 %exitcond192.not, label %for.cond17.for.end54_crit_edge.split, label %for.body19.backedge for.body19.backedge: ; preds = %for.inc52, %for.cond17.for.end54_crit_edge.split %indvars.iv188.be = phi i64 [ %indvars.iv.next189, %for.inc52 ], [ 1, %for.cond17.for.end54_crit_edge.split ] %m.0154.be = phi i32 [ %m.3, %for.inc52 ], [ 2001, %for.cond17.for.end54_crit_edge.split ] %direction.0152.be = phi i32 [ %direction.3, %for.inc52 ], [ 0, %for.cond17.for.end54_crit_edge.split ] br label %for.body19, !llvm.loop !16 for.cond17.for.end54_crit_edge.split: ; preds = %for.inc52 %idxprom55 = sext i32 %direction.3 to i64 %arrayidx56 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %idxprom55 %color57 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %idxprom55, i32 1 store i32 1, ptr %color57, align 4, !tbaa !9 store i32 %parent.4, ptr %arrayidx56, align 8, !tbaa !17 %cmp60 = icmp eq i32 %m.3, 2001 br i1 %cmp60, label %for.cond63.preheader, label %for.body19.backedge for.cond63.preheader: ; preds = %for.cond17.for.end54_crit_edge.split br i1 %cmp18.not151, label %for.end102, label %for.body65.preheader for.body65.preheader: ; preds = %for.cond63.preheader %27 = add nuw i32 %10, 1 %wide.trip.count201 = zext i32 %27 to i64 %xtraiter221 = and i64 %12, 1 %28 = icmp eq i64 %13, 0 %unroll_iter224 = and i64 %12, -2 %lcmp.mod222.not = icmp eq i64 %xtraiter221, 0 br label %for.body65 for.body65: ; preds = %for.body65.preheader, %for.inc100 %indvars.iv198 = phi i64 [ 1, %for.body65.preheader ], [ %indvars.iv.next199, %for.inc100 ] %sum.0168 = phi i32 [ 0, %for.body65.preheader ], [ %sum.3, %for.inc100 ] %color68 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv198, i32 1 %29 = load i32, ptr %color68, align 4, !tbaa !9 %cmp69 = icmp eq i32 %29, 1 br i1 %cmp69, label %for.cond71.preheader, label %for.inc100 for.cond71.preheader: ; preds = %for.body65 %30 = mul nuw nsw i64 %indvars.iv198, %1 %arrayidx75 = getelementptr inbounds i32, ptr %vla, i64 %30 br i1 %28, label %for.inc100.loopexit.unr-lcssa, label %for.body73 for.body73: ; preds = %for.cond71.preheader, %for.inc96.1 %indvars.iv193 = phi i64 [ %indvars.iv.next194.1, %for.inc96.1 ], [ 1, %for.cond71.preheader ] %sum.1164 = phi i32 [ %sum.2.1, %for.inc96.1 ], [ %sum.0168, %for.cond71.preheader ] %niter225 = phi i64 [ %niter225.next.1, %for.inc96.1 ], [ 0, %for.cond71.preheader ] %arrayidx77 = getelementptr inbounds i32, ptr %arrayidx75, i64 %indvars.iv193 %31 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %cmp78.not = icmp eq i32 %31, -1 br i1 %cmp78.not, label %for.inc96, label %land.lhs.true79 land.lhs.true79: ; preds = %for.body73 %color82 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv193, i32 1 %32 = load i32, ptr %color82, align 4, !tbaa !9 %cmp83 = icmp eq i32 %32, 1 br i1 %cmp83, label %land.lhs.true84, label %for.inc96 land.lhs.true84: ; preds = %land.lhs.true79 %arrayidx81 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv193 %33 = load i32, ptr %arrayidx81, align 8, !tbaa !17 %34 = zext i32 %33 to i64 %cmp88 = icmp eq i64 %indvars.iv198, %34 %add94 = select i1 %cmp88, i32 %31, i32 0 %spec.select = add nsw i32 %add94, %sum.1164 br label %for.inc96 for.inc96: ; preds = %land.lhs.true84, %for.body73, %land.lhs.true79 %sum.2 = phi i32 [ %sum.1164, %land.lhs.true79 ], [ %sum.1164, %for.body73 ], [ %spec.select, %land.lhs.true84 ] %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1 %arrayidx77.1 = getelementptr inbounds i32, ptr %arrayidx75, i64 %indvars.iv.next194 %35 = load i32, ptr %arrayidx77.1, align 4, !tbaa !5 %cmp78.not.1 = icmp eq i32 %35, -1 br i1 %cmp78.not.1, label %for.inc96.1, label %land.lhs.true79.1 land.lhs.true79.1: ; preds = %for.inc96 %color82.1 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv.next194, i32 1 %36 = load i32, ptr %color82.1, align 4, !tbaa !9 %cmp83.1 = icmp eq i32 %36, 1 br i1 %cmp83.1, label %land.lhs.true84.1, label %for.inc96.1 land.lhs.true84.1: ; preds = %land.lhs.true79.1 %arrayidx81.1 = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv.next194 %37 = load i32, ptr %arrayidx81.1, align 8, !tbaa !17 %38 = zext i32 %37 to i64 %cmp88.1 = icmp eq i64 %indvars.iv198, %38 %add94.1 = select i1 %cmp88.1, i32 %35, i32 0 %spec.select.1 = add nsw i32 %add94.1, %sum.2 br label %for.inc96.1 for.inc96.1: ; preds = %land.lhs.true84.1, %land.lhs.true79.1, %for.inc96 %sum.2.1 = phi i32 [ %sum.2, %land.lhs.true79.1 ], [ %sum.2, %for.inc96 ], [ %spec.select.1, %land.lhs.true84.1 ] %indvars.iv.next194.1 = add nuw nsw i64 %indvars.iv193, 2 %niter225.next.1 = add i64 %niter225, 2 %niter225.ncmp.1 = icmp eq i64 %niter225.next.1, %unroll_iter224 br i1 %niter225.ncmp.1, label %for.inc100.loopexit.unr-lcssa, label %for.body73, !llvm.loop !18 for.inc100.loopexit.unr-lcssa: ; preds = %for.inc96.1, %for.cond71.preheader %sum.2.lcssa.ph = phi i32 [ undef, %for.cond71.preheader ], [ %sum.2.1, %for.inc96.1 ] %indvars.iv193.unr = phi i64 [ 1, %for.cond71.preheader ], [ %indvars.iv.next194.1, %for.inc96.1 ] %sum.1164.unr = phi i32 [ %sum.0168, %for.cond71.preheader ], [ %sum.2.1, %for.inc96.1 ] br i1 %lcmp.mod222.not, label %for.inc100, label %for.body73.epil for.body73.epil: ; preds = %for.inc100.loopexit.unr-lcssa %arrayidx77.epil = getelementptr inbounds i32, ptr %arrayidx75, i64 %indvars.iv193.unr %39 = load i32, ptr %arrayidx77.epil, align 4, !tbaa !5 %cmp78.not.epil = icmp eq i32 %39, -1 br i1 %cmp78.not.epil, label %for.inc100, label %land.lhs.true79.epil land.lhs.true79.epil: ; preds = %for.body73.epil %color82.epil = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv193.unr, i32 1 %40 = load i32, ptr %color82.epil, align 4, !tbaa !9 %cmp83.epil = icmp eq i32 %40, 1 br i1 %cmp83.epil, label %land.lhs.true84.epil, label %for.inc100 land.lhs.true84.epil: ; preds = %land.lhs.true79.epil %arrayidx81.epil = getelementptr inbounds %struct.Ver, ptr %vla3, i64 %indvars.iv193.unr %41 = load i32, ptr %arrayidx81.epil, align 8, !tbaa !17 %42 = zext i32 %41 to i64 %cmp88.epil = icmp eq i64 %indvars.iv198, %42 %add94.epil = select i1 %cmp88.epil, i32 %39, i32 0 %spec.select.epil = add nsw i32 %add94.epil, %sum.1164.unr br label %for.inc100 for.inc100: ; preds = %for.inc100.loopexit.unr-lcssa, %land.lhs.true84.epil, %land.lhs.true79.epil, %for.body73.epil, %for.body65 %sum.3 = phi i32 [ %sum.0168, %for.body65 ], [ %sum.2.lcssa.ph, %for.inc100.loopexit.unr-lcssa ], [ %sum.1164.unr, %land.lhs.true79.epil ], [ %sum.1164.unr, %for.body73.epil ], [ %spec.select.epil, %land.lhs.true84.epil ] %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1 %exitcond202.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count201 br i1 %exitcond202.not, label %for.end102, label %for.body65, !llvm.loop !19 for.end102: ; preds = %for.inc100, %for.end14, %entry, %for.cond63.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond63.preheader ], [ 0, %entry ], [ 0, %for.end14 ], [ %sum.3, %for.inc100 ] %call103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #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 declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 4} !10 = !{!"", !6, i64 0, !6, i64 4} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12, !14} !14 = !{!"llvm.loop.unswitch.partial.disable"} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12} !17 = !{!10, !6, i64 0} !18 = distinct !{!18, !12} !19 = distinct !{!19, !12}
#include <stdio.h> #define INF 222200 #define MAXN 100 #define NIL -1 #define WHITE 0 #define BLACK 1 #define GRAY 2 int MST(void); int G[MAXN][MAXN];//weight を記録した隣接行列 int n = 0;//sum of weight int main(){ int i = 0, j = 0; int m = 0,sum = 0; scanf("%d",&n); for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ scanf("%d",&m); if(m == -1)G[i][j] = INF; else G[i][j] = m; } } sum = MST(); printf("%d\n",sum); return 0; } int MST(){ int d[MAXN];//V-TとTをつなぐ辺の中で重み最小の辺の重み int pi[MAXN];//MSTにおける頂点vの親 int color[MAXN]; int i = 0; int u = 0, v = 0; int mini = 0, sum = 0; for(i = 0; i < n; i++){ d[i] = INF; pi[i] = NIL; color[i] = WHITE; } d[0] = 0; while(1){ mini = INF; u = -1; for(i = 0; i < n; i++){ if(color[i] != BLACK && d[i] < mini){ mini = d[i]; u = i; } } if(u == -1)break; color[u] = BLACK; for(v = 0; v < n; v++){ if(color[v] != BLACK && G[u][v] != INF){ if(G[u][v] < d[v]){ pi[v] = u; d[v] = G[u][v]; color[v] = GRAY; //sum += d[v]; //printf("%d\n",&d[v]); } } } } for(i = 0; i < n; i++){ if(pi[i] != NIL)sum += G[i][pi[i]]; } return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199523/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199523/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @G = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d.i = alloca [100 x i32], align 16 %pi.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 store i32 0, ptr %m, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i25 = freeze i32 %0 %cmp26 = icmp sgt i32 %.fr.i25, 0 br i1 %cmp26, label %for.cond1.preheader, label %for.end14.thread for.end14.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %pi.i) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #6 br label %MST.exit for.cond1.preheader: ; preds = %entry, %for.inc12 %1 = phi i32 [ %.fr.i, %for.inc12 ], [ %.fr.i25, %entry ] %indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.inc12 ], [ 0, %entry ] %cmp223 = icmp sgt i32 %1, 0 br i1 %cmp223, label %for.body3, label %for.inc12 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp5 = icmp eq i32 %2, -1 %spec.select = select i1 %cmp5, i32 222200, i32 %2 %3 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv31, i64 %indvars.iv store i32 %spec.select, ptr %3, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr @n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2, label %for.body3, label %for.inc12, !llvm.loop !9 for.inc12: ; preds = %for.body3, %for.cond1.preheader %6 = phi i32 [ %1, %for.cond1.preheader ], [ %4, %for.body3 ] %.fr.i = freeze i32 %6 %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1 %7 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next32, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end14, !llvm.loop !11 for.end14: ; preds = %for.inc12 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %pi.i) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #6 %cmp111.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp111.i, label %for.body.preheader.i, label %MST.exit for.body.preheader.i: ; preds = %for.end14 %8 = zext i32 %.fr.i to i64 %9 = shl nuw nsw i64 %8, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %pi.i, i8 -1, i64 %9, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %9, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %8, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %10 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 222200, i32 222200, i32 222200, i32 222200>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 store <4 x i32> <i32 222200, i32 222200, i32 222200, i32 222200>, ptr %11, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %8 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 222200, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %8 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !16 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body8.us.i for.end19.us.i: ; preds = %for.inc17.us.i %cmp20.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp20.us.i, label %for.body63.i.preheader, label %if.end22.us.i for.body63.i.preheader: ; preds = %for.end19.us.i %xtraiter = and i64 %8, 1 %13 = icmp eq i32 %.fr.i, 1 br i1 %13, label %MST.exit.loopexit.unr-lcssa, label %for.body63.i.preheader.new for.body63.i.preheader.new: ; preds = %for.body63.i.preheader %unroll_iter = and i64 %8, 4294967294 br label %for.body63.i if.end22.us.i: ; preds = %for.end19.us.i %idxprom23.us.i = sext i32 %u.1.us.i to i64 %arrayidx24.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom23.us.i store i32 1, ptr %arrayidx24.us.i, align 4, !tbaa !5 br label %for.body27.us.i for.body27.us.i: ; preds = %for.inc58.us.i, %if.end22.us.i %indvars.iv163.i = phi i64 [ 0, %if.end22.us.i ], [ %indvars.iv.next164.i, %for.inc58.us.i ] %arrayidx29.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv163.i %14 = load i32, ptr %arrayidx29.us.i, align 4, !tbaa !5 %cmp30.not.us.i = icmp eq i32 %14, 1 br i1 %cmp30.not.us.i, label %for.inc58.us.i, label %land.lhs.true31.us.i land.lhs.true31.us.i: ; preds = %for.body27.us.i %arrayidx35.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom23.us.i, i64 %indvars.iv163.i %15 = load i32, ptr %arrayidx35.us.i, align 4, !tbaa !5 %cmp36.not.us.i = icmp eq i32 %15, 222200 br i1 %cmp36.not.us.i, label %for.inc58.us.i, label %if.then37.us.i if.then37.us.i: ; preds = %land.lhs.true31.us.i %arrayidx43.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv163.i %16 = load i32, ptr %arrayidx43.us.i, align 4, !tbaa !5 %cmp44.us.i = icmp slt i32 %15, %16 br i1 %cmp44.us.i, label %if.then45.us.i, label %for.inc58.us.i if.then45.us.i: ; preds = %if.then37.us.i %arrayidx47.us.i = getelementptr inbounds [100 x i32], ptr %pi.i, i64 0, i64 %indvars.iv163.i store i32 %u.1.us.i, ptr %arrayidx47.us.i, align 4, !tbaa !5 store i32 %15, ptr %arrayidx43.us.i, align 4, !tbaa !5 store i32 2, ptr %arrayidx29.us.i, align 4, !tbaa !5 br label %for.inc58.us.i for.inc58.us.i: ; preds = %if.then45.us.i, %if.then37.us.i, %land.lhs.true31.us.i, %for.body27.us.i %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %8 br i1 %exitcond167.not.i, label %for.body8.us.i.backedge, label %for.body27.us.i, !llvm.loop !17 for.body8.us.i: ; preds = %for.body8.us.i.backedge, %while.cond.us.preheader.i %indvars.iv158.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv158.i.be, %for.body8.us.i.backedge ] %mini.0116.us.i = phi i32 [ 222200, %while.cond.us.preheader.i ], [ %mini.0116.us.i.be, %for.body8.us.i.backedge ] %u.0115.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0115.us.i.be, %for.body8.us.i.backedge ] %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv158.i %17 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.not.us.i = icmp eq i32 %17, 1 br i1 %cmp11.not.us.i, label %for.inc17.us.i, label %land.lhs.true.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %arrayidx13.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv158.i %18 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5 %cmp14.us.i = icmp slt i32 %18, %mini.0116.us.i %19 = trunc i64 %indvars.iv158.i to i32 %spec.select.us.i = select i1 %cmp14.us.i, i32 %19, i32 %u.0115.us.i %spec.select110.us.i = call i32 @llvm.smin.i32(i32 %18, i32 %mini.0116.us.i) br label %for.inc17.us.i for.inc17.us.i: ; preds = %land.lhs.true.us.i, %for.body8.us.i %u.1.us.i = phi i32 [ %u.0115.us.i, %for.body8.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %mini.1.us.i = phi i32 [ %mini.0116.us.i, %for.body8.us.i ], [ %spec.select110.us.i, %land.lhs.true.us.i ] %indvars.iv.next159.i = add nuw nsw i64 %indvars.iv158.i, 1 %exitcond162.not.i = icmp eq i64 %indvars.iv.next159.i, %8 br i1 %exitcond162.not.i, label %for.end19.us.i, label %for.body8.us.i.backedge for.body8.us.i.backedge: ; preds = %for.inc58.us.i, %for.inc17.us.i %indvars.iv158.i.be = phi i64 [ %indvars.iv.next159.i, %for.inc17.us.i ], [ 0, %for.inc58.us.i ] %mini.0116.us.i.be = phi i32 [ %mini.1.us.i, %for.inc17.us.i ], [ 222200, %for.inc58.us.i ] %u.0115.us.i.be = phi i32 [ %u.1.us.i, %for.inc17.us.i ], [ -1, %for.inc58.us.i ] br label %for.body8.us.i, !llvm.loop !17 for.body63.i: ; preds = %for.inc75.i.1, %for.body63.i.preheader.new %indvars.iv168.i = phi i64 [ 0, %for.body63.i.preheader.new ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i = phi i32 [ 0, %for.body63.i.preheader.new ], [ %sum.1.i.1, %for.inc75.i.1 ] %niter = phi i64 [ 0, %for.body63.i.preheader.new ], [ %niter.next.1, %for.inc75.i.1 ] %arrayidx65.i = getelementptr inbounds [100 x i32], ptr %pi.i, i64 0, i64 %indvars.iv168.i %20 = load i32, ptr %arrayidx65.i, align 8, !tbaa !5 %cmp66.not.i = icmp eq i32 %20, -1 br i1 %cmp66.not.i, label %for.inc75.i, label %if.then67.i if.then67.i: ; preds = %for.body63.i %idxprom72.i = sext i32 %20 to i64 %arrayidx73.i = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv168.i, i64 %idxprom72.i %21 = load i32, ptr %arrayidx73.i, align 4, !tbaa !5 %add.i = add nsw i32 %21, %sum.0149.i br label %for.inc75.i for.inc75.i: ; preds = %if.then67.i, %for.body63.i %sum.1.i = phi i32 [ %add.i, %if.then67.i ], [ %sum.0149.i, %for.body63.i ] %indvars.iv.next169.i = or i64 %indvars.iv168.i, 1 %arrayidx65.i.1 = getelementptr inbounds [100 x i32], ptr %pi.i, i64 0, i64 %indvars.iv.next169.i %22 = load i32, ptr %arrayidx65.i.1, align 4, !tbaa !5 %cmp66.not.i.1 = icmp eq i32 %22, -1 br i1 %cmp66.not.i.1, label %for.inc75.i.1, label %if.then67.i.1 if.then67.i.1: ; preds = %for.inc75.i %idxprom72.i.1 = sext i32 %22 to i64 %arrayidx73.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv.next169.i, i64 %idxprom72.i.1 %23 = load i32, ptr %arrayidx73.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %23, %sum.1.i br label %for.inc75.i.1 for.inc75.i.1: ; preds = %if.then67.i.1, %for.inc75.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then67.i.1 ], [ %sum.1.i, %for.inc75.i ] %indvars.iv.next169.i.1 = add nuw nsw i64 %indvars.iv168.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %MST.exit.loopexit.unr-lcssa, label %for.body63.i, !llvm.loop !18 MST.exit.loopexit.unr-lcssa: ; preds = %for.inc75.i.1, %for.body63.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %indvars.iv168.i.unr = phi i64 [ 0, %for.body63.i.preheader ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i.unr = phi i32 [ 0, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %MST.exit, label %for.body63.i.epil for.body63.i.epil: ; preds = %MST.exit.loopexit.unr-lcssa %arrayidx65.i.epil = getelementptr inbounds [100 x i32], ptr %pi.i, i64 0, i64 %indvars.iv168.i.unr %24 = load i32, ptr %arrayidx65.i.epil, align 4, !tbaa !5 %cmp66.not.i.epil = icmp eq i32 %24, -1 br i1 %cmp66.not.i.epil, label %MST.exit, label %if.then67.i.epil if.then67.i.epil: ; preds = %for.body63.i.epil %idxprom72.i.epil = sext i32 %24 to i64 %arrayidx73.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv168.i.unr, i64 %idxprom72.i.epil %25 = load i32, ptr %arrayidx73.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %25, %sum.0149.i.unr br label %MST.exit MST.exit: ; preds = %MST.exit.loopexit.unr-lcssa, %if.then67.i.epil, %for.body63.i.epil, %for.end14.thread, %for.end14 %sum.0.lcssa.i = phi i32 [ 0, %for.end14 ], [ 0, %for.end14.thread ], [ %sum.1.i.lcssa.ph, %MST.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then67.i.epil ], [ %sum.0149.i.unr, %for.body63.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %pi.i) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #6 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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 nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @MST() local_unnamed_addr #3 { entry: %d = alloca [100 x i32], align 16 %pi = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %pi) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #6 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end77 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %pi, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader173, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 222200, i32 222200, i32 222200, i32 222200>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 222200, i32 222200, i32 222200, i32 222200>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader173 for.body.preheader173: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader173, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader173 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 222200, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !20 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 1, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 1 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 222200 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx43.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx43.us, align 4, !tbaa !5 %cmp44.us = icmp slt i32 %7, %8 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us %arrayidx47.us = getelementptr inbounds [100 x i32], ptr %pi, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx47.us, align 4, !tbaa !5 store i32 %7, ptr %arrayidx43.us, align 4, !tbaa !5 store i32 2, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !17 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %mini.0116.us = phi i32 [ 222200, %while.cond.us.preheader ], [ %mini.0116.us.be, %for.body8.us.backedge ] %u.0115.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0115.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.not.us = icmp eq i32 %9, 1 br i1 %cmp11.not.us, label %for.inc17.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.us = icmp slt i32 %10, %mini.0116.us %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.us, i32 %11, i32 %u.0115.us %spec.select110.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mini.0116.us) br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0115.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %mini.1.us = phi i32 [ %mini.0116.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %mini.0116.us.be = phi i32 [ %mini.1.us, %for.inc17.us ], [ 222200, %for.inc58.us ] %u.0115.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !17 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %pi, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0149 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0149, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %pi, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 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.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !18 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %pi, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0149.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0149.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %pi) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #6 ret i32 %sum.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !14, !15} !20 = distinct !{!20, !10, !15, !14}
#include<stdio.h> static const int MAX = 100; static const int IN = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; int m[100][100]; int prim(){ int u,min,t,i, k[MAX],q[MAX],clr[MAX]; for(i=0;i<n;i++){ k[i]=IN; q[i]=-1; clr[i]=WHITE; } k[0]=0; while(1){ min=IN; u=-1; for(i=0;i<n;i++){ if(min>k[i] && clr[i] != BLACK){ u=i; min=k[i]; } } if(u==-1)break; clr[u]=BLACK; for(t=0;t<n;t++){ if(clr[t]!=BLACK && m[u][t] != IN){ if(k[t]>m[u][t]){ k[t]=m[u][t]; q[t]=u; clr[t]=GRAY; } } } } int sum = 0; for(i=0;i<n;i++){ if(q[i]!=-1) sum+=m[i][q[i]]; } return sum; } int main(){ int i,j,e; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); m[i][j]=(e==-1)?IN:e; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199567/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199567/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @m = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %vla112 = alloca [100 x i32], align 16 %vla1113 = alloca [100 x i32], align 16 %vla2114 = alloca [100 x i32], align 16 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp116 = icmp sgt i32 %.fr, 0 br i1 %cmp116, label %for.body.preheader, label %for.end79 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla1113, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2114, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader178, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds i32, ptr %vla112, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader178 for.body.preheader178: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader178, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader178 ] %arrayidx = getelementptr inbounds i32, ptr %vla112, i64 %indvars.iv store i32 2097152, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %vla112, align 16, !tbaa !5 br i1 %cmp116, label %while.cond.us.preheader, label %for.end79 while.cond.us.preheader: ; preds = %for.end %wide.trip.count166 = zext i32 %.fr to i64 %wide.trip.count171 = zext i32 %.fr to i64 br label %for.body10.us for.end21.us: ; preds = %for.inc19.us %cmp22.us = icmp eq i32 %u.1.us, -1 br i1 %cmp22.us, label %for.cond63.preheader, label %if.end24.us if.end24.us: ; preds = %for.end21.us %idxprom25.us = sext i32 %u.1.us to i64 %arrayidx26.us = getelementptr inbounds i32, ptr %vla2114, i64 %idxprom25.us store i32 2, ptr %arrayidx26.us, align 4, !tbaa !5 br label %for.body29.us for.body29.us: ; preds = %if.end24.us, %for.inc60.us %indvars.iv168 = phi i64 [ 0, %if.end24.us ], [ %indvars.iv.next169, %for.inc60.us ] %arrayidx31.us = getelementptr inbounds i32, ptr %vla2114, i64 %indvars.iv168 %6 = load i32, ptr %arrayidx31.us, align 4, !tbaa !5 %cmp32.not.us = icmp eq i32 %6, 2 br i1 %cmp32.not.us, label %for.inc60.us, label %land.lhs.true33.us land.lhs.true33.us: ; preds = %for.body29.us %arrayidx37.us = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %idxprom25.us, i64 %indvars.iv168 %7 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5 %cmp38.not.us = icmp eq i32 %7, 2097152 br i1 %cmp38.not.us, label %for.inc60.us, label %if.then39.us if.then39.us: ; preds = %land.lhs.true33.us %arrayidx41.us = getelementptr inbounds i32, ptr %vla112, i64 %indvars.iv168 %8 = load i32, ptr %arrayidx41.us, align 4, !tbaa !5 %cmp46.us = icmp sgt i32 %8, %7 br i1 %cmp46.us, label %if.then47.us, label %for.inc60.us if.then47.us: ; preds = %if.then39.us store i32 %7, ptr %arrayidx41.us, align 4, !tbaa !5 %arrayidx55.us = getelementptr inbounds i32, ptr %vla1113, i64 %indvars.iv168 store i32 %u.1.us, ptr %arrayidx55.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx31.us, align 4, !tbaa !5 br label %for.inc60.us for.inc60.us: ; preds = %if.then47.us, %if.then39.us, %land.lhs.true33.us, %for.body29.us %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count171 br i1 %exitcond172.not, label %for.body10.us.backedge, label %for.body29.us, !llvm.loop !14 for.body10.us: ; preds = %for.body10.us.backedge, %while.cond.us.preheader %indvars.iv163 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv163.be, %for.body10.us.backedge ] %u.0121.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0121.us.be, %for.body10.us.backedge ] %min.0119.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %min.0119.us.be, %for.body10.us.backedge ] %arrayidx12.us = getelementptr inbounds i32, ptr %vla112, i64 %indvars.iv163 %9 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.us = icmp sgt i32 %min.0119.us, %9 br i1 %cmp13.us, label %land.lhs.true.us, label %for.inc19.us land.lhs.true.us: ; preds = %for.body10.us %arrayidx15.us = getelementptr inbounds i32, ptr %vla2114, i64 %indvars.iv163 %10 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5 %cmp16.not.us = icmp eq i32 %10, 2 %spec.select.us = select i1 %cmp16.not.us, i32 %min.0119.us, i32 %9 %11 = trunc i64 %indvars.iv163 to i32 %spec.select115.us = select i1 %cmp16.not.us, i32 %u.0121.us, i32 %11 br label %for.inc19.us for.inc19.us: ; preds = %land.lhs.true.us, %for.body10.us %min.1.us = phi i32 [ %min.0119.us, %for.body10.us ], [ %spec.select.us, %land.lhs.true.us ] %u.1.us = phi i32 [ %u.0121.us, %for.body10.us ], [ %spec.select115.us, %land.lhs.true.us ] %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.end21.us, label %for.body10.us.backedge for.body10.us.backedge: ; preds = %for.inc60.us, %for.inc19.us %indvars.iv163.be = phi i64 [ %indvars.iv.next164, %for.inc19.us ], [ 0, %for.inc60.us ] %u.0121.us.be = phi i32 [ %u.1.us, %for.inc19.us ], [ -1, %for.inc60.us ] %min.0119.us.be = phi i32 [ %min.1.us, %for.inc19.us ], [ 2097152, %for.inc60.us ] br label %for.body10.us, !llvm.loop !14 for.cond63.preheader: ; preds = %for.end21.us br i1 %cmp116, label %for.body65.preheader, label %for.end79 for.body65.preheader: ; preds = %for.cond63.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end79.loopexit.unr-lcssa, label %for.body65.preheader.new for.body65.preheader.new: ; preds = %for.body65.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body65 for.body65: ; preds = %for.inc77.1, %for.body65.preheader.new %indvars.iv173 = phi i64 [ 0, %for.body65.preheader.new ], [ %indvars.iv.next174.1, %for.inc77.1 ] %sum.0154 = phi i32 [ 0, %for.body65.preheader.new ], [ %sum.1.1, %for.inc77.1 ] %niter = phi i64 [ 0, %for.body65.preheader.new ], [ %niter.next.1, %for.inc77.1 ] %arrayidx67 = getelementptr inbounds i32, ptr %vla1113, i64 %indvars.iv173 %13 = load i32, ptr %arrayidx67, align 8, !tbaa !5 %cmp68.not = icmp eq i32 %13, -1 br i1 %cmp68.not, label %for.inc77, label %if.then69 if.then69: ; preds = %for.body65 %idxprom74 = sext i32 %13 to i64 %arrayidx75 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv173, i64 %idxprom74 %14 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0154 br label %for.inc77 for.inc77: ; preds = %for.body65, %if.then69 %sum.1 = phi i32 [ %add, %if.then69 ], [ %sum.0154, %for.body65 ] %indvars.iv.next174 = or i64 %indvars.iv173, 1 %arrayidx67.1 = getelementptr inbounds i32, ptr %vla1113, i64 %indvars.iv.next174 %15 = load i32, ptr %arrayidx67.1, align 4, !tbaa !5 %cmp68.not.1 = icmp eq i32 %15, -1 br i1 %cmp68.not.1, label %for.inc77.1, label %if.then69.1 if.then69.1: ; preds = %for.inc77 %idxprom74.1 = sext i32 %15 to i64 %arrayidx75.1 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv.next174, i64 %idxprom74.1 %16 = load i32, ptr %arrayidx75.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc77.1 for.inc77.1: ; preds = %if.then69.1, %for.inc77 %sum.1.1 = phi i32 [ %add.1, %if.then69.1 ], [ %sum.1, %for.inc77 ] %indvars.iv.next174.1 = add nuw nsw i64 %indvars.iv173, 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.end79.loopexit.unr-lcssa, label %for.body65, !llvm.loop !15 for.end79.loopexit.unr-lcssa: ; preds = %for.inc77.1, %for.body65.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body65.preheader ], [ %sum.1.1, %for.inc77.1 ] %indvars.iv173.unr = phi i64 [ 0, %for.body65.preheader ], [ %indvars.iv.next174.1, %for.inc77.1 ] %sum.0154.unr = phi i32 [ 0, %for.body65.preheader ], [ %sum.1.1, %for.inc77.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end79, label %for.body65.epil for.body65.epil: ; preds = %for.end79.loopexit.unr-lcssa %arrayidx67.epil = getelementptr inbounds i32, ptr %vla1113, i64 %indvars.iv173.unr %17 = load i32, ptr %arrayidx67.epil, align 4, !tbaa !5 %cmp68.not.epil = icmp eq i32 %17, -1 br i1 %cmp68.not.epil, label %for.end79, label %if.then69.epil if.then69.epil: ; preds = %for.body65.epil %idxprom74.epil = sext i32 %17 to i64 %arrayidx75.epil = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv173.unr, i64 %idxprom74.epil %18 = load i32, ptr %arrayidx75.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0154.unr br label %for.end79 for.end79: ; preds = %for.end79.loopexit.unr-lcssa, %if.then69.epil, %for.body65.epil, %entry, %for.end, %for.cond63.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond63.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end79.loopexit.unr-lcssa ], [ %add.epil, %if.then69.epil ], [ %sum.0154.unr, %for.body65.epil ] ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %vla112.i = alloca [100 x i32], align 16 %vla1113.i = alloca [100 x i32], align 16 %vla2114.i = alloca [100 x i32], align 16 %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vla112.i) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vla1113.i) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vla2114.i) br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 2097152, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vla112.i) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vla1113.i) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %vla2114.i) %cmp116.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp116.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla1113.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2114.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds i32, ptr %vla112.i, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds i32, ptr %vla112.i, i64 %indvars.iv.i store i32 2097152, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %7 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !20 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %vla112.i, align 16, !tbaa !5 br label %for.body10.us.i for.end21.us.i: ; preds = %for.inc19.us.i %cmp22.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp22.us.i, label %for.body65.i.preheader, label %if.end24.us.i for.body65.i.preheader: ; preds = %for.end21.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body65.i.preheader.new for.body65.i.preheader.new: ; preds = %for.body65.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body65.i if.end24.us.i: ; preds = %for.end21.us.i %idxprom25.us.i = sext i32 %u.1.us.i to i64 %arrayidx26.us.i = getelementptr inbounds i32, ptr %vla2114.i, i64 %idxprom25.us.i store i32 2, ptr %arrayidx26.us.i, align 4, !tbaa !5 br label %for.body29.us.i for.body29.us.i: ; preds = %for.inc60.us.i, %if.end24.us.i %indvars.iv168.i = phi i64 [ 0, %if.end24.us.i ], [ %indvars.iv.next169.i, %for.inc60.us.i ] %arrayidx31.us.i = getelementptr inbounds i32, ptr %vla2114.i, i64 %indvars.iv168.i %13 = load i32, ptr %arrayidx31.us.i, align 4, !tbaa !5 %cmp32.not.us.i = icmp eq i32 %13, 2 br i1 %cmp32.not.us.i, label %for.inc60.us.i, label %land.lhs.true33.us.i land.lhs.true33.us.i: ; preds = %for.body29.us.i %arrayidx37.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %idxprom25.us.i, i64 %indvars.iv168.i %14 = load i32, ptr %arrayidx37.us.i, align 4, !tbaa !5 %cmp38.not.us.i = icmp eq i32 %14, 2097152 br i1 %cmp38.not.us.i, label %for.inc60.us.i, label %if.then39.us.i if.then39.us.i: ; preds = %land.lhs.true33.us.i %arrayidx41.us.i = getelementptr inbounds i32, ptr %vla112.i, i64 %indvars.iv168.i %15 = load i32, ptr %arrayidx41.us.i, align 4, !tbaa !5 %cmp46.us.i = icmp sgt i32 %15, %14 br i1 %cmp46.us.i, label %if.then47.us.i, label %for.inc60.us.i if.then47.us.i: ; preds = %if.then39.us.i store i32 %14, ptr %arrayidx41.us.i, align 4, !tbaa !5 %arrayidx55.us.i = getelementptr inbounds i32, ptr %vla1113.i, i64 %indvars.iv168.i store i32 %u.1.us.i, ptr %arrayidx55.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx31.us.i, align 4, !tbaa !5 br label %for.inc60.us.i for.inc60.us.i: ; preds = %if.then47.us.i, %if.then39.us.i, %land.lhs.true33.us.i, %for.body29.us.i %indvars.iv.next169.i = add nuw nsw i64 %indvars.iv168.i, 1 %exitcond172.not.i = icmp eq i64 %indvars.iv.next169.i, %7 br i1 %exitcond172.not.i, label %for.body10.us.i.backedge, label %for.body29.us.i, !llvm.loop !14 for.body10.us.i: ; preds = %for.body10.us.i.backedge, %while.cond.us.preheader.i %indvars.iv163.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv163.i.be, %for.body10.us.i.backedge ] %u.0121.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0121.us.i.be, %for.body10.us.i.backedge ] %min.0119.us.i = phi i32 [ 2097152, %while.cond.us.preheader.i ], [ %min.0119.us.i.be, %for.body10.us.i.backedge ] %arrayidx12.us.i = getelementptr inbounds i32, ptr %vla112.i, i64 %indvars.iv163.i %16 = load i32, ptr %arrayidx12.us.i, align 4, !tbaa !5 %cmp13.us.i = icmp sgt i32 %min.0119.us.i, %16 br i1 %cmp13.us.i, label %land.lhs.true.us.i, label %for.inc19.us.i land.lhs.true.us.i: ; preds = %for.body10.us.i %arrayidx15.us.i = getelementptr inbounds i32, ptr %vla2114.i, i64 %indvars.iv163.i %17 = load i32, ptr %arrayidx15.us.i, align 4, !tbaa !5 %cmp16.not.us.i = icmp eq i32 %17, 2 %spec.select.us.i = select i1 %cmp16.not.us.i, i32 %min.0119.us.i, i32 %16 %18 = trunc i64 %indvars.iv163.i to i32 %spec.select115.us.i = select i1 %cmp16.not.us.i, i32 %u.0121.us.i, i32 %18 br label %for.inc19.us.i for.inc19.us.i: ; preds = %land.lhs.true.us.i, %for.body10.us.i %min.1.us.i = phi i32 [ %min.0119.us.i, %for.body10.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %u.1.us.i = phi i32 [ %u.0121.us.i, %for.body10.us.i ], [ %spec.select115.us.i, %land.lhs.true.us.i ] %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %7 br i1 %exitcond167.not.i, label %for.end21.us.i, label %for.body10.us.i.backedge for.body10.us.i.backedge: ; preds = %for.inc60.us.i, %for.inc19.us.i %indvars.iv163.i.be = phi i64 [ %indvars.iv.next164.i, %for.inc19.us.i ], [ 0, %for.inc60.us.i ] %u.0121.us.i.be = phi i32 [ %u.1.us.i, %for.inc19.us.i ], [ -1, %for.inc60.us.i ] %min.0119.us.i.be = phi i32 [ %min.1.us.i, %for.inc19.us.i ], [ 2097152, %for.inc60.us.i ] br label %for.body10.us.i, !llvm.loop !14 for.body65.i: ; preds = %for.inc77.i.1, %for.body65.i.preheader.new %indvars.iv173.i = phi i64 [ 0, %for.body65.i.preheader.new ], [ %indvars.iv.next174.i.1, %for.inc77.i.1 ] %sum.0154.i = phi i32 [ 0, %for.body65.i.preheader.new ], [ %sum.1.i.1, %for.inc77.i.1 ] %niter = phi i64 [ 0, %for.body65.i.preheader.new ], [ %niter.next.1, %for.inc77.i.1 ] %arrayidx67.i = getelementptr inbounds i32, ptr %vla1113.i, i64 %indvars.iv173.i %19 = load i32, ptr %arrayidx67.i, align 8, !tbaa !5 %cmp68.not.i = icmp eq i32 %19, -1 br i1 %cmp68.not.i, label %for.inc77.i, label %if.then69.i if.then69.i: ; preds = %for.body65.i %idxprom74.i = sext i32 %19 to i64 %arrayidx75.i = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv173.i, i64 %idxprom74.i %20 = load i32, ptr %arrayidx75.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0154.i br label %for.inc77.i for.inc77.i: ; preds = %if.then69.i, %for.body65.i %sum.1.i = phi i32 [ %add.i, %if.then69.i ], [ %sum.0154.i, %for.body65.i ] %indvars.iv.next174.i = or i64 %indvars.iv173.i, 1 %arrayidx67.i.1 = getelementptr inbounds i32, ptr %vla1113.i, i64 %indvars.iv.next174.i %21 = load i32, ptr %arrayidx67.i.1, align 4, !tbaa !5 %cmp68.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp68.not.i.1, label %for.inc77.i.1, label %if.then69.i.1 if.then69.i.1: ; preds = %for.inc77.i %idxprom74.i.1 = sext i32 %21 to i64 %arrayidx75.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv.next174.i, i64 %idxprom74.i.1 %22 = load i32, ptr %arrayidx75.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc77.i.1 for.inc77.i.1: ; preds = %if.then69.i.1, %for.inc77.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then69.i.1 ], [ %sum.1.i, %for.inc77.i ] %indvars.iv.next174.i.1 = add nuw nsw i64 %indvars.iv173.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body65.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc77.i.1, %for.body65.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body65.i.preheader ], [ %sum.1.i.1, %for.inc77.i.1 ] %indvars.iv173.i.unr = phi i64 [ 0, %for.body65.i.preheader ], [ %indvars.iv.next174.i.1, %for.inc77.i.1 ] %sum.0154.i.unr = phi i32 [ 0, %for.body65.i.preheader ], [ %sum.1.i.1, %for.inc77.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body65.i.epil for.body65.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx67.i.epil = getelementptr inbounds i32, ptr %vla1113.i, i64 %indvars.iv173.i.unr %23 = load i32, ptr %arrayidx67.i.epil, align 4, !tbaa !5 %cmp68.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp68.not.i.epil, label %prim.exit, label %if.then69.i.epil if.then69.i.epil: ; preds = %for.body65.i.epil %idxprom74.i.epil = sext i32 %23 to i64 %arrayidx75.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @m, i64 0, i64 %indvars.iv173.i.unr, i64 %idxprom74.i.epil %24 = load i32, ptr %arrayidx75.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0154.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then69.i.epil, %for.body65.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then69.i.epil ], [ %sum.0154.i.unr, %for.body65.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %vla112.i) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %vla1113.i) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %vla2114.i) %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include<stdio.h> int Hira[101][101]; int Sawa[101]; /* 行列の意味 1から2に行きたいときは1行目の2列目を見れば良い */ void tree(int m) { int i, j, k = 1, Ryo[100], kom, min, kei = 0; Ryo[0] = 0; Sawa[0] = 1; for (i = 1; i < m; i++) { Sawa[i] = 0; } for (;;) { kom = 9999; for (i = 0; i < k; i++) { for (j = 0; j < m; j++) { if (Hira[Ryo[i]][j] < kom && Hira[Ryo[i]][j] != -1 && Sawa[j] != 1) { kom = Hira[Ryo[i]][j]; min = j; } } } if (k != m) { Ryo[k] = min; Sawa[min] = 1; kei += kom; k++; } else break; } printf("%d\n", kei); } int main() { int n, i, j; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { scanf("%d", &Hira[i][j]); } } tree(n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199617/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199617/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @Sawa = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @Hira = dso_local global [101 x [101 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @tree(i32 noundef %m) local_unnamed_addr #0 { entry: %Ryo = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %Ryo) #4 store i32 0, ptr %Ryo, align 16, !tbaa !5 store i32 1, ptr @Sawa, align 16, !tbaa !5 %cmp70 = icmp sgt i32 %m, 1 br i1 %cmp70, label %for.cond2.preheader.thread, label %for.cond2.preheader for.cond2.preheader.thread: ; preds = %entry %0 = add nsw i32 %m, -1 %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([101 x i32], ptr @Sawa, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 br label %for.cond2.us.preheader for.cond2.preheader: ; preds = %entry %cmp772 = icmp eq i32 %m, 1 br i1 %cmp772, label %for.cond2.us.preheader, label %for.cond2.preheader82 for.cond2.preheader82: ; preds = %for.cond2.preheader store i32 1, ptr @Sawa, align 16, !tbaa !5 br label %if.then40 for.cond2.us.preheader: ; preds = %for.cond2.preheader.thread, %for.cond2.preheader %3 = zext i32 %m to i64 %xtraiter = and i64 %3, 1 %4 = icmp eq i32 %m, 1 %unroll_iter = and i64 %3, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond2.us for.cond2.us: ; preds = %for.cond2.us.preheader, %if.then40.us %indvars.iv91 = phi i64 [ 1, %for.cond2.us.preheader ], [ %indvars.iv.next92, %if.then40.us ] %min.0.us = phi i32 [ undef, %for.cond2.us.preheader ], [ %min.3.us.us.lcssa, %if.then40.us ] %kei.0.us = phi i32 [ 0, %for.cond2.us.preheader ], [ %add.us, %if.then40.us ] br label %for.cond6.preheader.us.us if.then40.us: ; preds = %for.end38.split.us.us %arrayidx42.us = getelementptr inbounds [100 x i32], ptr %Ryo, i64 0, i64 %indvars.iv91 store i32 %min.3.us.us.lcssa, ptr %arrayidx42.us, align 4, !tbaa !5 %idxprom43.us = sext i32 %min.3.us.us.lcssa to i64 %arrayidx44.us = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %idxprom43.us store i32 1, ptr %arrayidx44.us, align 4, !tbaa !5 %add.us = add nsw i32 %kom.2.us.us.lcssa, %kei.0.us %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 br label %for.cond2.us for.cond6.preheader.us.us: ; preds = %for.cond6.for.inc36_crit_edge.us.us, %for.cond2.us %indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.cond6.for.inc36_crit_edge.us.us ], [ 0, %for.cond2.us ] %min.179.us.us = phi i32 [ %min.3.us.us.lcssa, %for.cond6.for.inc36_crit_edge.us.us ], [ %min.0.us, %for.cond2.us ] %kom.078.us.us = phi i32 [ %kom.2.us.us.lcssa, %for.cond6.for.inc36_crit_edge.us.us ], [ 9999, %for.cond2.us ] %arrayidx10.us.us = getelementptr inbounds [100 x i32], ptr %Ryo, i64 0, i64 %indvars.iv86 %5 = load i32, ptr %arrayidx10.us.us, align 4, !tbaa !5 %idxprom11.us.us = sext i32 %5 to i64 br i1 %4, label %for.cond6.for.inc36_crit_edge.us.us.unr-lcssa, label %for.body8.us.us for.body8.us.us: ; preds = %for.cond6.preheader.us.us, %for.inc33.us.us.1 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc33.us.us.1 ], [ 0, %for.cond6.preheader.us.us ] %min.275.us.us = phi i32 [ %min.3.us.us.1, %for.inc33.us.us.1 ], [ %min.179.us.us, %for.cond6.preheader.us.us ] %kom.174.us.us = phi i32 [ %kom.2.us.us.1, %for.inc33.us.us.1 ], [ %kom.078.us.us, %for.cond6.preheader.us.us ] %niter = phi i64 [ %niter.next.1, %for.inc33.us.us.1 ], [ 0, %for.cond6.preheader.us.us ] %arrayidx14.us.us = getelementptr inbounds [101 x [101 x i32]], ptr @Hira, i64 0, i64 %idxprom11.us.us, i64 %indvars.iv %6 = load i32, ptr %arrayidx14.us.us, align 4, !tbaa !5 %cmp15.us.us = icmp sge i32 %6, %kom.174.us.us %cmp22.not.us.us = icmp eq i32 %6, -1 %or.cond.us.us = or i1 %cmp15.us.us, %cmp22.not.us.us br i1 %or.cond.us.us, label %for.inc33.us.us, label %land.lhs.true23.us.us land.lhs.true23.us.us: ; preds = %for.body8.us.us %arrayidx25.us.us = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx25.us.us, align 8, !tbaa !5 %cmp26.not.us.us = icmp eq i32 %7, 1 %spec.select.us.us = select i1 %cmp26.not.us.us, i32 %kom.174.us.us, i32 %6 %8 = trunc i64 %indvars.iv to i32 %spec.select69.us.us = select i1 %cmp26.not.us.us, i32 %min.275.us.us, i32 %8 br label %for.inc33.us.us for.inc33.us.us: ; preds = %land.lhs.true23.us.us, %for.body8.us.us %kom.2.us.us = phi i32 [ %kom.174.us.us, %for.body8.us.us ], [ %spec.select.us.us, %land.lhs.true23.us.us ] %min.3.us.us = phi i32 [ %min.275.us.us, %for.body8.us.us ], [ %spec.select69.us.us, %land.lhs.true23.us.us ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx14.us.us.1 = getelementptr inbounds [101 x [101 x i32]], ptr @Hira, i64 0, i64 %idxprom11.us.us, i64 %indvars.iv.next %9 = load i32, ptr %arrayidx14.us.us.1, align 4, !tbaa !5 %cmp15.us.us.1 = icmp sge i32 %9, %kom.2.us.us %cmp22.not.us.us.1 = icmp eq i32 %9, -1 %or.cond.us.us.1 = or i1 %cmp15.us.us.1, %cmp22.not.us.us.1 br i1 %or.cond.us.us.1, label %for.inc33.us.us.1, label %land.lhs.true23.us.us.1 land.lhs.true23.us.us.1: ; preds = %for.inc33.us.us %arrayidx25.us.us.1 = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %indvars.iv.next %10 = load i32, ptr %arrayidx25.us.us.1, align 4, !tbaa !5 %cmp26.not.us.us.1 = icmp eq i32 %10, 1 %spec.select.us.us.1 = select i1 %cmp26.not.us.us.1, i32 %kom.2.us.us, i32 %9 %11 = trunc i64 %indvars.iv.next to i32 %spec.select69.us.us.1 = select i1 %cmp26.not.us.us.1, i32 %min.3.us.us, i32 %11 br label %for.inc33.us.us.1 for.inc33.us.us.1: ; preds = %land.lhs.true23.us.us.1, %for.inc33.us.us %kom.2.us.us.1 = phi i32 [ %kom.2.us.us, %for.inc33.us.us ], [ %spec.select.us.us.1, %land.lhs.true23.us.us.1 ] %min.3.us.us.1 = phi i32 [ %min.3.us.us, %for.inc33.us.us ], [ %spec.select69.us.us.1, %land.lhs.true23.us.us.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.cond6.for.inc36_crit_edge.us.us.unr-lcssa, label %for.body8.us.us, !llvm.loop !9 for.cond6.for.inc36_crit_edge.us.us.unr-lcssa: ; preds = %for.inc33.us.us.1, %for.cond6.preheader.us.us %kom.2.us.us.lcssa.ph = phi i32 [ undef, %for.cond6.preheader.us.us ], [ %kom.2.us.us.1, %for.inc33.us.us.1 ] %min.3.us.us.lcssa.ph = phi i32 [ undef, %for.cond6.preheader.us.us ], [ %min.3.us.us.1, %for.inc33.us.us.1 ] %indvars.iv.unr = phi i64 [ 0, %for.cond6.preheader.us.us ], [ %indvars.iv.next.1, %for.inc33.us.us.1 ] %min.275.us.us.unr = phi i32 [ %min.179.us.us, %for.cond6.preheader.us.us ], [ %min.3.us.us.1, %for.inc33.us.us.1 ] %kom.174.us.us.unr = phi i32 [ %kom.078.us.us, %for.cond6.preheader.us.us ], [ %kom.2.us.us.1, %for.inc33.us.us.1 ] br i1 %lcmp.mod.not, label %for.cond6.for.inc36_crit_edge.us.us, label %for.body8.us.us.epil for.body8.us.us.epil: ; preds = %for.cond6.for.inc36_crit_edge.us.us.unr-lcssa %arrayidx14.us.us.epil = getelementptr inbounds [101 x [101 x i32]], ptr @Hira, i64 0, i64 %idxprom11.us.us, i64 %indvars.iv.unr %12 = load i32, ptr %arrayidx14.us.us.epil, align 4, !tbaa !5 %cmp15.us.us.epil = icmp sge i32 %12, %kom.174.us.us.unr %cmp22.not.us.us.epil = icmp eq i32 %12, -1 %or.cond.us.us.epil = or i1 %cmp15.us.us.epil, %cmp22.not.us.us.epil br i1 %or.cond.us.us.epil, label %for.cond6.for.inc36_crit_edge.us.us, label %land.lhs.true23.us.us.epil land.lhs.true23.us.us.epil: ; preds = %for.body8.us.us.epil %arrayidx25.us.us.epil = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %indvars.iv.unr %13 = load i32, ptr %arrayidx25.us.us.epil, align 4, !tbaa !5 %cmp26.not.us.us.epil = icmp eq i32 %13, 1 %spec.select.us.us.epil = select i1 %cmp26.not.us.us.epil, i32 %kom.174.us.us.unr, i32 %12 %14 = trunc i64 %indvars.iv.unr to i32 %spec.select69.us.us.epil = select i1 %cmp26.not.us.us.epil, i32 %min.275.us.us.unr, i32 %14 br label %for.cond6.for.inc36_crit_edge.us.us for.cond6.for.inc36_crit_edge.us.us: ; preds = %for.body8.us.us.epil, %land.lhs.true23.us.us.epil, %for.cond6.for.inc36_crit_edge.us.us.unr-lcssa %kom.2.us.us.lcssa = phi i32 [ %kom.2.us.us.lcssa.ph, %for.cond6.for.inc36_crit_edge.us.us.unr-lcssa ], [ %kom.174.us.us.unr, %for.body8.us.us.epil ], [ %spec.select.us.us.epil, %land.lhs.true23.us.us.epil ] %min.3.us.us.lcssa = phi i32 [ %min.3.us.us.lcssa.ph, %for.cond6.for.inc36_crit_edge.us.us.unr-lcssa ], [ %min.275.us.us.unr, %for.body8.us.us.epil ], [ %spec.select69.us.us.epil, %land.lhs.true23.us.us.epil ] %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next87, %indvars.iv91 br i1 %exitcond90.not, label %for.end38.split.us.us, label %for.cond6.preheader.us.us, !llvm.loop !11 for.end38.split.us.us: ; preds = %for.cond6.for.inc36_crit_edge.us.us %cmp39.not.us = icmp eq i64 %indvars.iv91, %3 br i1 %cmp39.not.us, label %for.end47, label %if.then40.us if.then40: ; preds = %if.then40, %for.cond2.preheader82 br label %if.then40 for.end47: ; preds = %for.end38.split.us.us %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %kei.0.us) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %Ryo) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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: %Ryo.i = alloca [100 x i32], align 16 %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.1, ptr noundef nonnull %n) %.pr = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %.pr, 0 br i1 %cmp17, label %for.cond1.preheader, label %for.cond2.preheader.i.thread for.cond2.preheader.i.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %Ryo.i) #4 br label %for.cond2.preheader82.i for.cond1.preheader: ; preds = %entry, %for.inc7 %0 = phi i32 [ %3, %for.inc7 ], [ %.pr, %entry ] %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.inc7 ], [ 0, %entry ] %cmp215 = icmp sgt i32 %0, 0 br i1 %cmp215, 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 %0 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 [101 x [101 x i32]], ptr @Hira, i64 0, i64 %indvars.iv23, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !12 for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %2, %for.body3 ] %3 = phi i32 [ %0, %for.cond1.preheader.for.inc7_crit_edge ], [ %1, %for.body3 ] %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 %cmp = icmp slt i64 %indvars.iv.next24, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !13 for.end9: ; preds = %for.inc7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %Ryo.i) #4 store i32 0, ptr %Ryo.i, align 16, !tbaa !5 store i32 1, ptr @Sawa, align 16, !tbaa !5 %cmp70.i = icmp sgt i32 %3, 1 br i1 %cmp70.i, label %for.cond2.preheader.thread.i, label %for.cond2.preheader.i for.cond2.preheader.thread.i: ; preds = %for.end9 %4 = add nsw i32 %3, -1 %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([101 x i32], ptr @Sawa, i64 0, i64 1), i8 0, i64 %6, i1 false), !tbaa !5 %7 = zext i32 %3 to i64 br label %for.cond2.us.preheader.i for.cond2.preheader.i: ; preds = %for.end9 %cmp772.i = icmp eq i32 %3, 1 br i1 %cmp772.i, label %for.cond2.us.preheader.i, label %for.cond2.preheader82.i for.cond2.preheader82.i: ; preds = %for.cond2.preheader.i.thread, %for.cond2.preheader.i store i32 1, ptr @Sawa, align 16, !tbaa !5 br label %if.then40.i for.cond2.us.preheader.i: ; preds = %for.cond2.preheader.i, %for.cond2.preheader.thread.i %.lcssa1429 = phi i64 [ 1, %for.cond2.preheader.i ], [ %7, %for.cond2.preheader.thread.i ] %xtraiter = and i64 %.lcssa1429, 1 %8 = icmp eq i64 %.lcssa1429, 1 %unroll_iter = and i64 %.lcssa1429, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond2.us.i for.cond2.us.i: ; preds = %if.then40.us.i, %for.cond2.us.preheader.i %indvars.iv91.i = phi i64 [ 1, %for.cond2.us.preheader.i ], [ %indvars.iv.next92.i, %if.then40.us.i ] %min.0.us.i = phi i32 [ undef, %for.cond2.us.preheader.i ], [ %min.3.us.us.i.lcssa, %if.then40.us.i ] %kei.0.us.i = phi i32 [ 0, %for.cond2.us.preheader.i ], [ %add.us.i, %if.then40.us.i ] br label %for.cond6.preheader.us.us.i if.then40.us.i: ; preds = %for.end38.split.us.us.i %arrayidx42.us.i = getelementptr inbounds [100 x i32], ptr %Ryo.i, i64 0, i64 %indvars.iv91.i store i32 %min.3.us.us.i.lcssa, ptr %arrayidx42.us.i, align 4, !tbaa !5 %idxprom43.us.i = sext i32 %min.3.us.us.i.lcssa to i64 %arrayidx44.us.i = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %idxprom43.us.i store i32 1, ptr %arrayidx44.us.i, align 4, !tbaa !5 %add.us.i = add nsw i32 %kom.2.us.us.i.lcssa, %kei.0.us.i %indvars.iv.next92.i = add nuw nsw i64 %indvars.iv91.i, 1 br label %for.cond2.us.i for.cond6.preheader.us.us.i: ; preds = %for.cond6.for.inc36_crit_edge.us.us.i, %for.cond2.us.i %indvars.iv86.i = phi i64 [ %indvars.iv.next87.i, %for.cond6.for.inc36_crit_edge.us.us.i ], [ 0, %for.cond2.us.i ] %min.179.us.us.i = phi i32 [ %min.3.us.us.i.lcssa, %for.cond6.for.inc36_crit_edge.us.us.i ], [ %min.0.us.i, %for.cond2.us.i ] %kom.078.us.us.i = phi i32 [ %kom.2.us.us.i.lcssa, %for.cond6.for.inc36_crit_edge.us.us.i ], [ 9999, %for.cond2.us.i ] %arrayidx10.us.us.i = getelementptr inbounds [100 x i32], ptr %Ryo.i, i64 0, i64 %indvars.iv86.i %9 = load i32, ptr %arrayidx10.us.us.i, align 4, !tbaa !5 %idxprom11.us.us.i = sext i32 %9 to i64 br i1 %8, label %for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa, label %for.body8.us.us.i for.body8.us.us.i: ; preds = %for.cond6.preheader.us.us.i, %for.inc33.us.us.i.1 %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc33.us.us.i.1 ], [ 0, %for.cond6.preheader.us.us.i ] %min.275.us.us.i = phi i32 [ %min.3.us.us.i.1, %for.inc33.us.us.i.1 ], [ %min.179.us.us.i, %for.cond6.preheader.us.us.i ] %kom.174.us.us.i = phi i32 [ %kom.2.us.us.i.1, %for.inc33.us.us.i.1 ], [ %kom.078.us.us.i, %for.cond6.preheader.us.us.i ] %niter = phi i64 [ %niter.next.1, %for.inc33.us.us.i.1 ], [ 0, %for.cond6.preheader.us.us.i ] %arrayidx14.us.us.i = getelementptr inbounds [101 x [101 x i32]], ptr @Hira, i64 0, i64 %idxprom11.us.us.i, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx14.us.us.i, align 4, !tbaa !5 %cmp15.us.us.i = icmp sge i32 %10, %kom.174.us.us.i %cmp22.not.us.us.i = icmp eq i32 %10, -1 %or.cond.us.us.i = or i1 %cmp15.us.us.i, %cmp22.not.us.us.i br i1 %or.cond.us.us.i, label %for.inc33.us.us.i, label %land.lhs.true23.us.us.i land.lhs.true23.us.us.i: ; preds = %for.body8.us.us.i %arrayidx25.us.us.i = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %indvars.iv.i %11 = load i32, ptr %arrayidx25.us.us.i, align 8, !tbaa !5 %cmp26.not.us.us.i = icmp eq i32 %11, 1 %spec.select.us.us.i = select i1 %cmp26.not.us.us.i, i32 %kom.174.us.us.i, i32 %10 %12 = trunc i64 %indvars.iv.i to i32 %spec.select69.us.us.i = select i1 %cmp26.not.us.us.i, i32 %min.275.us.us.i, i32 %12 br label %for.inc33.us.us.i for.inc33.us.us.i: ; preds = %land.lhs.true23.us.us.i, %for.body8.us.us.i %kom.2.us.us.i = phi i32 [ %kom.174.us.us.i, %for.body8.us.us.i ], [ %spec.select.us.us.i, %land.lhs.true23.us.us.i ] %min.3.us.us.i = phi i32 [ %min.275.us.us.i, %for.body8.us.us.i ], [ %spec.select69.us.us.i, %land.lhs.true23.us.us.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx14.us.us.i.1 = getelementptr inbounds [101 x [101 x i32]], ptr @Hira, i64 0, i64 %idxprom11.us.us.i, i64 %indvars.iv.next.i %13 = load i32, ptr %arrayidx14.us.us.i.1, align 4, !tbaa !5 %cmp15.us.us.i.1 = icmp sge i32 %13, %kom.2.us.us.i %cmp22.not.us.us.i.1 = icmp eq i32 %13, -1 %or.cond.us.us.i.1 = or i1 %cmp15.us.us.i.1, %cmp22.not.us.us.i.1 br i1 %or.cond.us.us.i.1, label %for.inc33.us.us.i.1, label %land.lhs.true23.us.us.i.1 land.lhs.true23.us.us.i.1: ; preds = %for.inc33.us.us.i %arrayidx25.us.us.i.1 = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %indvars.iv.next.i %14 = load i32, ptr %arrayidx25.us.us.i.1, align 4, !tbaa !5 %cmp26.not.us.us.i.1 = icmp eq i32 %14, 1 %spec.select.us.us.i.1 = select i1 %cmp26.not.us.us.i.1, i32 %kom.2.us.us.i, i32 %13 %15 = trunc i64 %indvars.iv.next.i to i32 %spec.select69.us.us.i.1 = select i1 %cmp26.not.us.us.i.1, i32 %min.3.us.us.i, i32 %15 br label %for.inc33.us.us.i.1 for.inc33.us.us.i.1: ; preds = %land.lhs.true23.us.us.i.1, %for.inc33.us.us.i %kom.2.us.us.i.1 = phi i32 [ %kom.2.us.us.i, %for.inc33.us.us.i ], [ %spec.select.us.us.i.1, %land.lhs.true23.us.us.i.1 ] %min.3.us.us.i.1 = phi i32 [ %min.3.us.us.i, %for.inc33.us.us.i ], [ %spec.select69.us.us.i.1, %land.lhs.true23.us.us.i.1 ] %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa, label %for.body8.us.us.i, !llvm.loop !9 for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa: ; preds = %for.inc33.us.us.i.1, %for.cond6.preheader.us.us.i %kom.2.us.us.i.lcssa.ph = phi i32 [ undef, %for.cond6.preheader.us.us.i ], [ %kom.2.us.us.i.1, %for.inc33.us.us.i.1 ] %min.3.us.us.i.lcssa.ph = phi i32 [ undef, %for.cond6.preheader.us.us.i ], [ %min.3.us.us.i.1, %for.inc33.us.us.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.cond6.preheader.us.us.i ], [ %indvars.iv.next.i.1, %for.inc33.us.us.i.1 ] %min.275.us.us.i.unr = phi i32 [ %min.179.us.us.i, %for.cond6.preheader.us.us.i ], [ %min.3.us.us.i.1, %for.inc33.us.us.i.1 ] %kom.174.us.us.i.unr = phi i32 [ %kom.078.us.us.i, %for.cond6.preheader.us.us.i ], [ %kom.2.us.us.i.1, %for.inc33.us.us.i.1 ] br i1 %lcmp.mod.not, label %for.cond6.for.inc36_crit_edge.us.us.i, label %for.body8.us.us.i.epil for.body8.us.us.i.epil: ; preds = %for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa %arrayidx14.us.us.i.epil = getelementptr inbounds [101 x [101 x i32]], ptr @Hira, i64 0, i64 %idxprom11.us.us.i, i64 %indvars.iv.i.unr %16 = load i32, ptr %arrayidx14.us.us.i.epil, align 4, !tbaa !5 %cmp15.us.us.i.epil = icmp sge i32 %16, %kom.174.us.us.i.unr %cmp22.not.us.us.i.epil = icmp eq i32 %16, -1 %or.cond.us.us.i.epil = or i1 %cmp15.us.us.i.epil, %cmp22.not.us.us.i.epil br i1 %or.cond.us.us.i.epil, label %for.cond6.for.inc36_crit_edge.us.us.i, label %land.lhs.true23.us.us.i.epil land.lhs.true23.us.us.i.epil: ; preds = %for.body8.us.us.i.epil %arrayidx25.us.us.i.epil = getelementptr inbounds [101 x i32], ptr @Sawa, i64 0, i64 %indvars.iv.i.unr %17 = load i32, ptr %arrayidx25.us.us.i.epil, align 4, !tbaa !5 %cmp26.not.us.us.i.epil = icmp eq i32 %17, 1 %spec.select.us.us.i.epil = select i1 %cmp26.not.us.us.i.epil, i32 %kom.174.us.us.i.unr, i32 %16 %18 = trunc i64 %indvars.iv.i.unr to i32 %spec.select69.us.us.i.epil = select i1 %cmp26.not.us.us.i.epil, i32 %min.275.us.us.i.unr, i32 %18 br label %for.cond6.for.inc36_crit_edge.us.us.i for.cond6.for.inc36_crit_edge.us.us.i: ; preds = %for.body8.us.us.i.epil, %land.lhs.true23.us.us.i.epil, %for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa %kom.2.us.us.i.lcssa = phi i32 [ %kom.2.us.us.i.lcssa.ph, %for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa ], [ %kom.174.us.us.i.unr, %for.body8.us.us.i.epil ], [ %spec.select.us.us.i.epil, %land.lhs.true23.us.us.i.epil ] %min.3.us.us.i.lcssa = phi i32 [ %min.3.us.us.i.lcssa.ph, %for.cond6.for.inc36_crit_edge.us.us.i.unr-lcssa ], [ %min.275.us.us.i.unr, %for.body8.us.us.i.epil ], [ %spec.select69.us.us.i.epil, %land.lhs.true23.us.us.i.epil ] %indvars.iv.next87.i = add nuw nsw i64 %indvars.iv86.i, 1 %exitcond90.not.i = icmp eq i64 %indvars.iv.next87.i, %indvars.iv91.i br i1 %exitcond90.not.i, label %for.end38.split.us.us.i, label %for.cond6.preheader.us.us.i, !llvm.loop !11 for.end38.split.us.us.i: ; preds = %for.cond6.for.inc36_crit_edge.us.us.i %cmp39.not.us.i = icmp eq i64 %indvars.iv91.i, %.lcssa1429 br i1 %cmp39.not.us.i, label %tree.exit, label %if.then40.us.i if.then40.i: ; preds = %if.then40.i, %for.cond2.preheader82.i br label %if.then40.i tree.exit: ; preds = %for.end38.split.us.us.i %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %kei.0.us.i) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %Ryo.i) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> #define MAX 100 #define INFTY (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; int prim(){ int sum=0,v,i,u,minv; int d[MAX],p[MAX],color[MAX]; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0]=0; while(1){ minv=INFTY; u=-1; for(i=0;i<n;i++){ if(minv>d[i]&&color[i]!=BLACK){ u=i; minv=d[i]; } } if(u==-1)break; color[u]=BLACK; for(v=0;v<n;v++){ if(color[v]!=BLACK && M[u][v] != INFTY){ if(d[v]>M[u][v]){ d[v]=M[u][v]; p[v]=u; color[v]=GRAY; } } } } for(i=0;i<n;i++){ if(p[i]!=-1)sum+=M[i][p[i]]; } return sum; } int main(){ int e,i,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); M[i][j]=(e==-1)?INFTY : e; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199660/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end77 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader173, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader173 for.body.preheader173: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader173, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader173 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 2097152, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 2097152 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %minv.0116.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0116.us.be, %for.body8.us.backedge ] %u.0115.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0115.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %minv.0116.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.0115.us, i32 %11 %spec.select110.us = select i1 %cmp14.not.us, i32 %minv.0116.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0115.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0116.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %minv.0116.us.be = phi i32 [ %minv.1.us, %for.inc17.us ], [ 2097152, %for.inc58.us ] %u.0115.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !14 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0148 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0148 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0148, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 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.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !15 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0148.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0148.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0148.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %d.i = alloca [100 x i32], align 16 %p.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 2097152, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp111.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp111.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 2097152, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %7 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !20 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body8.us.i for.end19.us.i: ; preds = %for.inc17.us.i %cmp20.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp20.us.i, label %for.body63.i.preheader, label %if.end22.us.i for.body63.i.preheader: ; preds = %for.end19.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i.preheader.new for.body63.i.preheader.new: ; preds = %for.body63.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body63.i if.end22.us.i: ; preds = %for.end19.us.i %idxprom23.us.i = sext i32 %u.1.us.i to i64 %arrayidx24.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom23.us.i store i32 2, ptr %arrayidx24.us.i, align 4, !tbaa !5 br label %for.body27.us.i for.body27.us.i: ; preds = %for.inc58.us.i, %if.end22.us.i %indvars.iv163.i = phi i64 [ 0, %if.end22.us.i ], [ %indvars.iv.next164.i, %for.inc58.us.i ] %arrayidx29.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv163.i %13 = load i32, ptr %arrayidx29.us.i, align 4, !tbaa !5 %cmp30.not.us.i = icmp eq i32 %13, 2 br i1 %cmp30.not.us.i, label %for.inc58.us.i, label %land.lhs.true31.us.i land.lhs.true31.us.i: ; preds = %for.body27.us.i %arrayidx35.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us.i, i64 %indvars.iv163.i %14 = load i32, ptr %arrayidx35.us.i, align 4, !tbaa !5 %cmp36.not.us.i = icmp eq i32 %14, 2097152 br i1 %cmp36.not.us.i, label %for.inc58.us.i, label %if.then37.us.i if.then37.us.i: ; preds = %land.lhs.true31.us.i %arrayidx39.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv163.i %15 = load i32, ptr %arrayidx39.us.i, align 4, !tbaa !5 %cmp44.us.i = icmp sgt i32 %15, %14 br i1 %cmp44.us.i, label %if.then45.us.i, label %for.inc58.us.i if.then45.us.i: ; preds = %if.then37.us.i store i32 %14, ptr %arrayidx39.us.i, align 4, !tbaa !5 %arrayidx53.us.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv163.i store i32 %u.1.us.i, ptr %arrayidx53.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us.i, align 4, !tbaa !5 br label %for.inc58.us.i for.inc58.us.i: ; preds = %if.then45.us.i, %if.then37.us.i, %land.lhs.true31.us.i, %for.body27.us.i %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %7 br i1 %exitcond167.not.i, label %for.body8.us.i.backedge, label %for.body27.us.i, !llvm.loop !14 for.body8.us.i: ; preds = %for.body8.us.i.backedge, %while.cond.us.preheader.i %indvars.iv158.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv158.i.be, %for.body8.us.i.backedge ] %minv.0116.us.i = phi i32 [ 2097152, %while.cond.us.preheader.i ], [ %minv.0116.us.i.be, %for.body8.us.i.backedge ] %u.0115.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0115.us.i.be, %for.body8.us.i.backedge ] %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv158.i %16 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.us.i = icmp sgt i32 %minv.0116.us.i, %16 br i1 %cmp11.us.i, label %land.lhs.true.us.i, label %for.inc17.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %arrayidx13.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv158.i %17 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5 %cmp14.not.us.i = icmp eq i32 %17, 2 %18 = trunc i64 %indvars.iv158.i to i32 %spec.select.us.i = select i1 %cmp14.not.us.i, i32 %u.0115.us.i, i32 %18 %spec.select110.us.i = select i1 %cmp14.not.us.i, i32 %minv.0116.us.i, i32 %16 br label %for.inc17.us.i for.inc17.us.i: ; preds = %land.lhs.true.us.i, %for.body8.us.i %u.1.us.i = phi i32 [ %u.0115.us.i, %for.body8.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.0116.us.i, %for.body8.us.i ], [ %spec.select110.us.i, %land.lhs.true.us.i ] %indvars.iv.next159.i = add nuw nsw i64 %indvars.iv158.i, 1 %exitcond162.not.i = icmp eq i64 %indvars.iv.next159.i, %7 br i1 %exitcond162.not.i, label %for.end19.us.i, label %for.body8.us.i.backedge for.body8.us.i.backedge: ; preds = %for.inc58.us.i, %for.inc17.us.i %indvars.iv158.i.be = phi i64 [ %indvars.iv.next159.i, %for.inc17.us.i ], [ 0, %for.inc58.us.i ] %minv.0116.us.i.be = phi i32 [ %minv.1.us.i, %for.inc17.us.i ], [ 2097152, %for.inc58.us.i ] %u.0115.us.i.be = phi i32 [ %u.1.us.i, %for.inc17.us.i ], [ -1, %for.inc58.us.i ] br label %for.body8.us.i, !llvm.loop !14 for.body63.i: ; preds = %for.inc75.i.1, %for.body63.i.preheader.new %indvars.iv168.i = phi i64 [ 0, %for.body63.i.preheader.new ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0148.i = phi i32 [ 0, %for.body63.i.preheader.new ], [ %sum.1.i.1, %for.inc75.i.1 ] %niter = phi i64 [ 0, %for.body63.i.preheader.new ], [ %niter.next.1, %for.inc75.i.1 ] %arrayidx65.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i %19 = load i32, ptr %arrayidx65.i, align 8, !tbaa !5 %cmp66.not.i = icmp eq i32 %19, -1 br i1 %cmp66.not.i, label %for.inc75.i, label %if.then67.i if.then67.i: ; preds = %for.body63.i %idxprom72.i = sext i32 %19 to i64 %arrayidx73.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i, i64 %idxprom72.i %20 = load i32, ptr %arrayidx73.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0148.i br label %for.inc75.i for.inc75.i: ; preds = %if.then67.i, %for.body63.i %sum.1.i = phi i32 [ %add.i, %if.then67.i ], [ %sum.0148.i, %for.body63.i ] %indvars.iv.next169.i = or i64 %indvars.iv168.i, 1 %arrayidx65.i.1 = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv.next169.i %21 = load i32, ptr %arrayidx65.i.1, align 4, !tbaa !5 %cmp66.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp66.not.i.1, label %for.inc75.i.1, label %if.then67.i.1 if.then67.i.1: ; preds = %for.inc75.i %idxprom72.i.1 = sext i32 %21 to i64 %arrayidx73.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169.i, i64 %idxprom72.i.1 %22 = load i32, ptr %arrayidx73.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc75.i.1 for.inc75.i.1: ; preds = %if.then67.i.1, %for.inc75.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then67.i.1 ], [ %sum.1.i, %for.inc75.i ] %indvars.iv.next169.i.1 = add nuw nsw i64 %indvars.iv168.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc75.i.1, %for.body63.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %indvars.iv168.i.unr = phi i64 [ 0, %for.body63.i.preheader ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0148.i.unr = phi i32 [ 0, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body63.i.epil for.body63.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx65.i.epil = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i.unr %23 = load i32, ptr %arrayidx65.i.epil, align 4, !tbaa !5 %cmp66.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp66.not.i.epil, label %prim.exit, label %if.then67.i.epil if.then67.i.epil: ; preds = %for.body63.i.epil %idxprom72.i.epil = sext i32 %23 to i64 %arrayidx73.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i.unr, i64 %idxprom72.i.epil %24 = load i32, ptr %arrayidx73.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0148.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then67.i.epil, %for.body63.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then67.i.epil ], [ %sum.0148.i.unr, %for.body63.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include<stdio.h> #define N 100 #define INF 20000 int g[N][N],n; int mst(void){ int i,j,d[n],judge[n],min,u; for(i=0;i<n;i++){ d[i]=INF; judge[i]=1; } d[0]=0; while(1){ min=INF; for(i=0;i<n;i++){ if(judge[i]!=-1&&d[i]<min){ min=d[i]; u=i; } } if(min==INF)break; judge[u]=-1; for(i=0;i<n;i++){ if(judge[i]!=-1&&g[u][i]!=-1){ if(g[u][i]<d[i]){ d[i]=g[u][i]; judge[i]=0; } } } } min=0; for(i=0;i<n;i++)min+=d[i]; return min; } int main(){ int i,j,k; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&g[i][j]); } } k=mst(); printf("%d\n",k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199710/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @g = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @mst() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %1 = zext i32 %.fr to i64 %vla = alloca i32, i64 %1, align 16 %vla1 = alloca i32, i64 %1, align 16 %cmp95 = icmp sgt i32 %.fr, 0 br i1 %cmp95, label %for.body.preheader, label %for.end65 for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader174, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds i32, ptr %vla, i64 %index store <4 x i32> <i32 20000, i32 20000, i32 20000, i32 20000>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 20000, i32 20000, i32 20000, i32 20000>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %vla1, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %5, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader174 for.body.preheader174: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader174, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader174 ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv store i32 20000, ptr %arrayidx, align 4, !tbaa !5 %arrayidx3 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv store i32 1, ptr %arrayidx3, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %vla, align 16, !tbaa !5 br i1 %cmp95, label %for.body7.us, label %for.end65 for.end18.us: ; preds = %for.inc16.us %cmp19.us = icmp eq i32 %min.1.us, 20000 br i1 %cmp19.us, label %for.cond58.preheader, label %if.end21.us if.end21.us: ; preds = %for.end18.us %idxprom22.us = sext i32 %u.2.us to i64 %arrayidx23.us = getelementptr inbounds i32, ptr %vla1, i64 %idxprom22.us store i32 -1, ptr %arrayidx23.us, align 4, !tbaa !5 br label %for.body26.us for.body26.us: ; preds = %if.end21.us, %for.inc55.us %indvars.iv149 = phi i64 [ 0, %if.end21.us ], [ %indvars.iv.next150, %for.inc55.us ] %arrayidx28.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv149 %7 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %cmp29.not.us = icmp eq i32 %7, -1 br i1 %cmp29.not.us, label %for.inc55.us, label %land.lhs.true30.us land.lhs.true30.us: ; preds = %for.body26.us %arrayidx34.us = getelementptr inbounds [100 x [100 x i32]], ptr @g, i64 0, i64 %idxprom22.us, i64 %indvars.iv149 %8 = load i32, ptr %arrayidx34.us, align 4, !tbaa !5 %cmp35.not.us = icmp eq i32 %8, -1 br i1 %cmp35.not.us, label %for.inc55.us, label %if.then36.us if.then36.us: ; preds = %land.lhs.true30.us %arrayidx42.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv149 %9 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5 %cmp43.us = icmp slt i32 %8, %9 br i1 %cmp43.us, label %if.then44.us, label %for.inc55.us if.then44.us: ; preds = %if.then36.us store i32 %8, ptr %arrayidx42.us, align 4, !tbaa !5 store i32 0, ptr %arrayidx28.us, align 4, !tbaa !5 br label %for.inc55.us for.inc55.us: ; preds = %if.then44.us, %if.then36.us, %land.lhs.true30.us, %for.body26.us %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %exitcond153.not = icmp eq i64 %indvars.iv.next150, %1 br i1 %exitcond153.not, label %for.body7.us.backedge, label %for.body26.us, !llvm.loop !14 for.body7.us: ; preds = %for.end, %for.body7.us.backedge %indvars.iv144 = phi i64 [ %indvars.iv144.be, %for.body7.us.backedge ], [ 0, %for.end ] %u.1100.us = phi i32 [ %u.2.us, %for.body7.us.backedge ], [ undef, %for.end ] %min.099.us = phi i32 [ %min.099.us.be, %for.body7.us.backedge ], [ 20000, %for.end ] %arrayidx9.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv144 %10 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.not.us = icmp eq i32 %10, -1 br i1 %cmp10.not.us, label %for.inc16.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body7.us %arrayidx12.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv144 %11 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.us = icmp slt i32 %11, %min.099.us %spec.select.us = tail call i32 @llvm.smin.i32(i32 %11, i32 %min.099.us) %12 = trunc i64 %indvars.iv144 to i32 %spec.select94.us = select i1 %cmp13.us, i32 %12, i32 %u.1100.us br label %for.inc16.us for.inc16.us: ; preds = %land.lhs.true.us, %for.body7.us %min.1.us = phi i32 [ %min.099.us, %for.body7.us ], [ %spec.select.us, %land.lhs.true.us ] %u.2.us = phi i32 [ %u.1100.us, %for.body7.us ], [ %spec.select94.us, %land.lhs.true.us ] %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %exitcond148.not = icmp eq i64 %indvars.iv.next145, %1 br i1 %exitcond148.not, label %for.end18.us, label %for.body7.us.backedge for.body7.us.backedge: ; preds = %for.inc55.us, %for.inc16.us %indvars.iv144.be = phi i64 [ %indvars.iv.next145, %for.inc16.us ], [ 0, %for.inc55.us ] %min.099.us.be = phi i32 [ %min.1.us, %for.inc16.us ], [ 20000, %for.inc55.us ] br label %for.body7.us, !llvm.loop !14 for.cond58.preheader: ; preds = %for.end18.us br i1 %cmp95, label %for.body60.preheader, label %for.end65 for.body60.preheader: ; preds = %for.cond58.preheader %min.iters.check161 = icmp ult i32 %.fr, 8 br i1 %min.iters.check161, label %for.body60.preheader172, label %vector.ph162 vector.ph162: ; preds = %for.body60.preheader %n.vec164 = and i64 %1, 4294967288 br label %vector.body167 vector.body167: ; preds = %vector.body167, %vector.ph162 %index168 = phi i64 [ 0, %vector.ph162 ], [ %index.next171, %vector.body167 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph162 ], [ %15, %vector.body167 ] %vec.phi169 = phi <4 x i32> [ zeroinitializer, %vector.ph162 ], [ %16, %vector.body167 ] %13 = getelementptr inbounds i32, ptr %vla, i64 %index168 %wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load170 = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = add <4 x i32> %wide.load, %vec.phi %16 = add <4 x i32> %wide.load170, %vec.phi169 %index.next171 = add nuw i64 %index168, 8 %17 = icmp eq i64 %index.next171, %n.vec164 br i1 %17, label %middle.block159, label %vector.body167, !llvm.loop !15 middle.block159: ; preds = %vector.body167 %bin.rdx = add <4 x i32> %16, %15 %18 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n166 = icmp eq i64 %n.vec164, %1 br i1 %cmp.n166, label %for.end65, label %for.body60.preheader172 for.body60.preheader172: ; preds = %for.body60.preheader, %middle.block159 %indvars.iv154.ph = phi i64 [ 0, %for.body60.preheader ], [ %n.vec164, %middle.block159 ] %min.2136.ph = phi i32 [ 0, %for.body60.preheader ], [ %18, %middle.block159 ] br label %for.body60 for.body60: ; preds = %for.body60.preheader172, %for.body60 %indvars.iv154 = phi i64 [ %indvars.iv.next155, %for.body60 ], [ %indvars.iv154.ph, %for.body60.preheader172 ] %min.2136 = phi i32 [ %add, %for.body60 ], [ %min.2136.ph, %for.body60.preheader172 ] %arrayidx62 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv154 %19 = load i32, ptr %arrayidx62, align 4, !tbaa !5 %add = add nsw i32 %19, %min.2136 %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %exitcond158.not = icmp eq i64 %indvars.iv.next155, %1 br i1 %exitcond158.not, label %for.end65, label %for.body60, !llvm.loop !16 for.end65: ; preds = %for.body60, %middle.block159, %entry, %for.end, %for.cond58.preheader %min.2.lcssa = phi i32 [ 0, %for.cond58.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %18, %middle.block159 ], [ %add, %for.body60 ] ret i32 %min.2.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.cond1.preheader, label %for.end9 for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %4, %for.inc7 ], [ %0, %entry ] %indvars.iv22 = phi i64 [ %indvars.iv.next23, %for.inc7 ], [ 0, %entry ] %cmp216 = icmp sgt i32 %1, 0 br i1 %cmp216, 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 %1 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 @g, i64 0, i64 %indvars.iv22, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !17 for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %3, %for.body3 ] %4 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %2, %for.body3 ] %indvars.iv.next23 = add nuw nsw i64 %indvars.iv22, 1 %cmp = icmp slt i64 %indvars.iv.next23, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !18 for.end9: ; preds = %for.inc7, %entry %call10 = tail call i32 @mst() %call11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call10) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !11, !12} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !19} !19 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> #define N 100 #define MAX 1000000 int main(){ int n ,i ,j ,a=0 ,x=0 ,s[N][N] ,al[N] ,r[N] ,m ,l; scanf("%d" ,&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d" ,&s[i][j]); } } for(i=0 ; i<n ; i++){ al[i] = MAX; r[n] = 0; } al[0] = 0; while(1){ m = MAX; for(i=0 ; i<n ;i++){ if(r[i] != 1 && al[i] < m){ m = al[i]; l = i; } } if(m == MAX) break; r[l] = 1; for(i=0 ; i<n ; i++){ if(s[l][i] != -1 && r[i] != 1 && s[l][i] < al[i]) al[i] = s[l][i]; } } for(i=0 ; i<n ; i++){ a += al[i]; } printf("%d\n" ,a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199798/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199798/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %s = alloca [100 x [100 x i32]], align 16 %al = alloca [100 x i32], align 16 %r = 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 40000, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %al) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp113 = icmp sgt i32 %0, 0 br i1 %cmp113, label %for.cond1.preheader, label %for.cond10.preheader for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %7, %for.inc7 ], [ %0, %entry ] %indvars.iv164 = phi i64 [ %indvars.iv.next165, %for.inc7 ], [ 0, %entry ] %cmp2111 = icmp sgt i32 %1, 0 br i1 %cmp2111, 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 %1 to i64 br label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %.lcssa = phi i32 [ %0, %entry ], [ %7, %for.inc7 ] %.lcssa.fr = freeze i32 %.lcssa %cmp11115 = icmp sgt i32 %.lcssa.fr, 0 br i1 %cmp11115, label %for.body12.lr.ph, label %for.end78 for.body12.lr.ph: ; preds = %for.cond10.preheader %idxprom15 = zext i32 %.lcssa.fr to i64 %wide.trip.count = zext i32 %.lcssa.fr to i64 %min.iters.check = icmp ult i32 %.lcssa.fr, 8 br i1 %min.iters.check, label %for.body12.preheader, label %vector.ph vector.ph: ; preds = %for.body12.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds [100 x i32], ptr %al, i64 0, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end19, label %for.body12.preheader for.body12.preheader: ; preds = %for.body12.lr.ph, %middle.block %indvars.iv167.ph = phi i64 [ 0, %for.body12.lr.ph ], [ %n.vec, %middle.block ] br label %for.body12 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 %s, i64 0, i64 %indvars.iv164, 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 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !13 for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %6, %for.body3 ] %7 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %5, %for.body3 ] %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1 %cmp = icmp slt i64 %indvars.iv.next165, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !14 for.body12: ; preds = %for.body12.preheader, %for.body12 %indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.body12 ], [ %indvars.iv167.ph, %for.body12.preheader ] %arrayidx14 = getelementptr inbounds [100 x i32], ptr %al, i64 0, i64 %indvars.iv167 store i32 1000000, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1 %exitcond.not = icmp eq i64 %indvars.iv.next168, %wide.trip.count br i1 %exitcond.not, label %for.end19, label %for.body12, !llvm.loop !16 for.end19: ; preds = %for.body12, %middle.block %arrayidx16 = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %idxprom15 store i32 0, ptr %arrayidx16, align 4, !tbaa !5 store i32 0, ptr %al, align 16, !tbaa !5 br i1 %cmp11115, label %while.cond.us.preheader, label %for.end78 while.cond.us.preheader: ; preds = %for.end19 %wide.trip.count178 = zext i32 %.lcssa.fr to i64 %wide.trip.count183 = zext i32 %.lcssa.fr to i64 br label %for.body23.us for.end34.us: ; preds = %for.inc32.us %cmp35.us = icmp eq i32 %m.1.us, 1000000 br i1 %cmp35.us, label %for.cond71.preheader, label %if.end37.us if.end37.us: ; preds = %for.end34.us %idxprom38.us = sext i32 %l.2.us to i64 %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %idxprom38.us store i32 1, ptr %arrayidx39.us, align 4, !tbaa !5 br label %for.body42.us for.body42.us: ; preds = %if.end37.us, %for.inc68.us %indvars.iv180 = phi i64 [ 0, %if.end37.us ], [ %indvars.iv.next181, %for.inc68.us ] %arrayidx46.us = getelementptr inbounds [100 x [100 x i32]], ptr %s, i64 0, i64 %idxprom38.us, i64 %indvars.iv180 %8 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5 %cmp47.not.us = icmp eq i32 %8, -1 br i1 %cmp47.not.us, label %for.inc68.us, label %land.lhs.true48.us land.lhs.true48.us: ; preds = %for.body42.us %arrayidx50.us = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %indvars.iv180 %9 = load i32, ptr %arrayidx50.us, align 4, !tbaa !5 %cmp51.not.us = icmp eq i32 %9, 1 br i1 %cmp51.not.us, label %for.inc68.us, label %land.lhs.true52.us land.lhs.true52.us: ; preds = %land.lhs.true48.us %arrayidx58.us = getelementptr inbounds [100 x i32], ptr %al, i64 0, i64 %indvars.iv180 %10 = load i32, ptr %arrayidx58.us, align 4, !tbaa !5 %spec.store.select.us = call i32 @llvm.smin.i32(i32 %8, i32 %10) store i32 %spec.store.select.us, ptr %arrayidx58.us, align 4 br label %for.inc68.us for.inc68.us: ; preds = %land.lhs.true52.us, %land.lhs.true48.us, %for.body42.us %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1 %exitcond184.not = icmp eq i64 %indvars.iv.next181, %wide.trip.count183 br i1 %exitcond184.not, label %for.body23.us.backedge, label %for.body42.us, !llvm.loop !17 for.body23.us: ; preds = %for.body23.us.backedge, %while.cond.us.preheader %indvars.iv175 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv175.be, %for.body23.us.backedge ] %l.1120.us = phi i32 [ undef, %while.cond.us.preheader ], [ %l.2.us, %for.body23.us.backedge ] %m.0119.us = phi i32 [ 1000000, %while.cond.us.preheader ], [ %m.0119.us.be, %for.body23.us.backedge ] %arrayidx25.us = getelementptr inbounds [100 x i32], ptr %r, i64 0, i64 %indvars.iv175 %11 = load i32, ptr %arrayidx25.us, align 4, !tbaa !5 %cmp26.not.us = icmp eq i32 %11, 1 br i1 %cmp26.not.us, label %for.inc32.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body23.us %arrayidx28.us = getelementptr inbounds [100 x i32], ptr %al, i64 0, i64 %indvars.iv175 %12 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %cmp29.us = icmp slt i32 %12, %m.0119.us %spec.select.us = call i32 @llvm.smin.i32(i32 %12, i32 %m.0119.us) %13 = trunc i64 %indvars.iv175 to i32 %spec.select110.us = select i1 %cmp29.us, i32 %13, i32 %l.1120.us br label %for.inc32.us for.inc32.us: ; preds = %land.lhs.true.us, %for.body23.us %m.1.us = phi i32 [ %m.0119.us, %for.body23.us ], [ %spec.select.us, %land.lhs.true.us ] %l.2.us = phi i32 [ %l.1120.us, %for.body23.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %exitcond179.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count178 br i1 %exitcond179.not, label %for.end34.us, label %for.body23.us.backedge for.body23.us.backedge: ; preds = %for.inc68.us, %for.inc32.us %indvars.iv175.be = phi i64 [ %indvars.iv.next176, %for.inc32.us ], [ 0, %for.inc68.us ] %m.0119.us.be = phi i32 [ %m.1.us, %for.inc32.us ], [ 1000000, %for.inc68.us ] br label %for.body23.us, !llvm.loop !17 for.cond71.preheader: ; preds = %for.end34.us br i1 %cmp11115, label %for.body73.preheader, label %for.end78 for.body73.preheader: ; preds = %for.cond71.preheader %wide.trip.count188 = zext i32 %.lcssa.fr to i64 %min.iters.check198 = icmp ult i32 %.lcssa.fr, 8 br i1 %min.iters.check198, label %for.body73.preheader209, label %vector.ph199 vector.ph199: ; preds = %for.body73.preheader %n.vec201 = and i64 %wide.trip.count, 4294967288 br label %vector.body204 vector.body204: ; preds = %vector.body204, %vector.ph199 %index205 = phi i64 [ 0, %vector.ph199 ], [ %index.next208, %vector.body204 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph199 ], [ %16, %vector.body204 ] %vec.phi206 = phi <4 x i32> [ zeroinitializer, %vector.ph199 ], [ %17, %vector.body204 ] %14 = getelementptr inbounds [100 x i32], ptr %al, i64 0, i64 %index205 %wide.load = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load207 = load <4 x i32>, ptr %15, align 16, !tbaa !5 %16 = add <4 x i32> %wide.load, %vec.phi %17 = add <4 x i32> %wide.load207, %vec.phi206 %index.next208 = add nuw i64 %index205, 8 %18 = icmp eq i64 %index.next208, %n.vec201 br i1 %18, label %middle.block196, label %vector.body204, !llvm.loop !18 middle.block196: ; preds = %vector.body204 %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n203 = icmp eq i64 %n.vec201, %wide.trip.count br i1 %cmp.n203, label %for.end78, label %for.body73.preheader209 for.body73.preheader209: ; preds = %for.body73.preheader, %middle.block196 %indvars.iv185.ph = phi i64 [ 0, %for.body73.preheader ], [ %n.vec201, %middle.block196 ] %a.0157.ph = phi i32 [ 0, %for.body73.preheader ], [ %19, %middle.block196 ] br label %for.body73 for.body73: ; preds = %for.body73.preheader209, %for.body73 %indvars.iv185 = phi i64 [ %indvars.iv.next186, %for.body73 ], [ %indvars.iv185.ph, %for.body73.preheader209 ] %a.0157 = phi i32 [ %add, %for.body73 ], [ %a.0157.ph, %for.body73.preheader209 ] %arrayidx75 = getelementptr inbounds [100 x i32], ptr %al, i64 0, i64 %indvars.iv185 %20 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %add = add nsw i32 %20, %a.0157 %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1 %exitcond189.not = icmp eq i64 %indvars.iv.next186, %wide.trip.count188 br i1 %exitcond189.not, label %for.end78, label %for.body73, !llvm.loop !19 for.end78: ; preds = %for.body73, %middle.block196, %for.cond10.preheader, %for.end19, %for.cond71.preheader %a.0.lcssa = phi i32 [ 0, %for.cond71.preheader ], [ 0, %for.end19 ], [ 0, %for.cond10.preheader ], [ %19, %middle.block196 ], [ %add, %for.body73 ] %call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %al) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10, !12, !11}
#include<stdio.h> #define Max 100 #define inf (1<<21) #define W 0 #define G 1 #define B 2 int n,M[Max][Max]; int prim(){ int i,u,minv,v; int d[Max],p[Max],col[Max]; for(i=0;i<n;i++){ d[i]=inf; p[i]= -1; col[i] = W; } d[0] = 0; while(1){ minv = inf; u = -1; for(i=0;i<n;i++){ if(minv > d[i] && col[i] != B){ u =i; minv = d[i]; } } if(u == -1)break; col[u] = B; for(v = 0;v < n; v++){ if(col[v] != B && M[u][v] != inf){ if(d[v]>M[u][v]){ d[v] = M[u][v]; p[v] = u; col[v]=G; } } } } int sum = 0; for(i = 0;i<n;i++){ if(p[i] != -1)sum+=M[i][p[i]]; } return sum; } int main(){ int i,j,e; scanf("%d",&n); for(i = 0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); M[i][j] = (e == -1) ? inf : e; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199848/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199848/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %col = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %col) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end77 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %col, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader173, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader173 for.body.preheader173: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader173, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader173 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 2097152, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %col, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %col, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 2097152 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %minv.0116.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0116.us.be, %for.body8.us.backedge ] %u.0115.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0115.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %minv.0116.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %col, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.0115.us, i32 %11 %spec.select110.us = select i1 %cmp14.not.us, i32 %minv.0116.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0115.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0116.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %minv.0116.us.be = phi i32 [ %minv.1.us, %for.inc17.us ], [ 2097152, %for.inc58.us ] %u.0115.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !14 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0149 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0149, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 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.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !15 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0149.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0149.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %col) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %d.i = alloca [100 x i32], align 16 %p.i = alloca [100 x i32], align 16 %col.i = alloca [100 x i32], align 16 %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %col.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 2097152, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %col.i) #5 %cmp111.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp111.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %col.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 2097152, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %7 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !20 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body8.us.i for.end19.us.i: ; preds = %for.inc17.us.i %cmp20.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp20.us.i, label %for.body63.i.preheader, label %if.end22.us.i for.body63.i.preheader: ; preds = %for.end19.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i.preheader.new for.body63.i.preheader.new: ; preds = %for.body63.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body63.i if.end22.us.i: ; preds = %for.end19.us.i %idxprom23.us.i = sext i32 %u.1.us.i to i64 %arrayidx24.us.i = getelementptr inbounds [100 x i32], ptr %col.i, i64 0, i64 %idxprom23.us.i store i32 2, ptr %arrayidx24.us.i, align 4, !tbaa !5 br label %for.body27.us.i for.body27.us.i: ; preds = %for.inc58.us.i, %if.end22.us.i %indvars.iv163.i = phi i64 [ 0, %if.end22.us.i ], [ %indvars.iv.next164.i, %for.inc58.us.i ] %arrayidx29.us.i = getelementptr inbounds [100 x i32], ptr %col.i, i64 0, i64 %indvars.iv163.i %13 = load i32, ptr %arrayidx29.us.i, align 4, !tbaa !5 %cmp30.not.us.i = icmp eq i32 %13, 2 br i1 %cmp30.not.us.i, label %for.inc58.us.i, label %land.lhs.true31.us.i land.lhs.true31.us.i: ; preds = %for.body27.us.i %arrayidx35.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us.i, i64 %indvars.iv163.i %14 = load i32, ptr %arrayidx35.us.i, align 4, !tbaa !5 %cmp36.not.us.i = icmp eq i32 %14, 2097152 br i1 %cmp36.not.us.i, label %for.inc58.us.i, label %if.then37.us.i if.then37.us.i: ; preds = %land.lhs.true31.us.i %arrayidx39.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv163.i %15 = load i32, ptr %arrayidx39.us.i, align 4, !tbaa !5 %cmp44.us.i = icmp sgt i32 %15, %14 br i1 %cmp44.us.i, label %if.then45.us.i, label %for.inc58.us.i if.then45.us.i: ; preds = %if.then37.us.i store i32 %14, ptr %arrayidx39.us.i, align 4, !tbaa !5 %arrayidx53.us.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv163.i store i32 %u.1.us.i, ptr %arrayidx53.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us.i, align 4, !tbaa !5 br label %for.inc58.us.i for.inc58.us.i: ; preds = %if.then45.us.i, %if.then37.us.i, %land.lhs.true31.us.i, %for.body27.us.i %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %7 br i1 %exitcond167.not.i, label %for.body8.us.i.backedge, label %for.body27.us.i, !llvm.loop !14 for.body8.us.i: ; preds = %for.body8.us.i.backedge, %while.cond.us.preheader.i %indvars.iv158.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv158.i.be, %for.body8.us.i.backedge ] %minv.0116.us.i = phi i32 [ 2097152, %while.cond.us.preheader.i ], [ %minv.0116.us.i.be, %for.body8.us.i.backedge ] %u.0115.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0115.us.i.be, %for.body8.us.i.backedge ] %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv158.i %16 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.us.i = icmp sgt i32 %minv.0116.us.i, %16 br i1 %cmp11.us.i, label %land.lhs.true.us.i, label %for.inc17.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %arrayidx13.us.i = getelementptr inbounds [100 x i32], ptr %col.i, i64 0, i64 %indvars.iv158.i %17 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5 %cmp14.not.us.i = icmp eq i32 %17, 2 %18 = trunc i64 %indvars.iv158.i to i32 %spec.select.us.i = select i1 %cmp14.not.us.i, i32 %u.0115.us.i, i32 %18 %spec.select110.us.i = select i1 %cmp14.not.us.i, i32 %minv.0116.us.i, i32 %16 br label %for.inc17.us.i for.inc17.us.i: ; preds = %land.lhs.true.us.i, %for.body8.us.i %u.1.us.i = phi i32 [ %u.0115.us.i, %for.body8.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.0116.us.i, %for.body8.us.i ], [ %spec.select110.us.i, %land.lhs.true.us.i ] %indvars.iv.next159.i = add nuw nsw i64 %indvars.iv158.i, 1 %exitcond162.not.i = icmp eq i64 %indvars.iv.next159.i, %7 br i1 %exitcond162.not.i, label %for.end19.us.i, label %for.body8.us.i.backedge for.body8.us.i.backedge: ; preds = %for.inc58.us.i, %for.inc17.us.i %indvars.iv158.i.be = phi i64 [ %indvars.iv.next159.i, %for.inc17.us.i ], [ 0, %for.inc58.us.i ] %minv.0116.us.i.be = phi i32 [ %minv.1.us.i, %for.inc17.us.i ], [ 2097152, %for.inc58.us.i ] %u.0115.us.i.be = phi i32 [ %u.1.us.i, %for.inc17.us.i ], [ -1, %for.inc58.us.i ] br label %for.body8.us.i, !llvm.loop !14 for.body63.i: ; preds = %for.inc75.i.1, %for.body63.i.preheader.new %indvars.iv168.i = phi i64 [ 0, %for.body63.i.preheader.new ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i = phi i32 [ 0, %for.body63.i.preheader.new ], [ %sum.1.i.1, %for.inc75.i.1 ] %niter = phi i64 [ 0, %for.body63.i.preheader.new ], [ %niter.next.1, %for.inc75.i.1 ] %arrayidx65.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i %19 = load i32, ptr %arrayidx65.i, align 8, !tbaa !5 %cmp66.not.i = icmp eq i32 %19, -1 br i1 %cmp66.not.i, label %for.inc75.i, label %if.then67.i if.then67.i: ; preds = %for.body63.i %idxprom72.i = sext i32 %19 to i64 %arrayidx73.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i, i64 %idxprom72.i %20 = load i32, ptr %arrayidx73.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0149.i br label %for.inc75.i for.inc75.i: ; preds = %if.then67.i, %for.body63.i %sum.1.i = phi i32 [ %add.i, %if.then67.i ], [ %sum.0149.i, %for.body63.i ] %indvars.iv.next169.i = or i64 %indvars.iv168.i, 1 %arrayidx65.i.1 = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv.next169.i %21 = load i32, ptr %arrayidx65.i.1, align 4, !tbaa !5 %cmp66.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp66.not.i.1, label %for.inc75.i.1, label %if.then67.i.1 if.then67.i.1: ; preds = %for.inc75.i %idxprom72.i.1 = sext i32 %21 to i64 %arrayidx73.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169.i, i64 %idxprom72.i.1 %22 = load i32, ptr %arrayidx73.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc75.i.1 for.inc75.i.1: ; preds = %if.then67.i.1, %for.inc75.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then67.i.1 ], [ %sum.1.i, %for.inc75.i ] %indvars.iv.next169.i.1 = add nuw nsw i64 %indvars.iv168.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc75.i.1, %for.body63.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %indvars.iv168.i.unr = phi i64 [ 0, %for.body63.i.preheader ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i.unr = phi i32 [ 0, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body63.i.epil for.body63.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx65.i.epil = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i.unr %23 = load i32, ptr %arrayidx65.i.epil, align 4, !tbaa !5 %cmp66.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp66.not.i.epil, label %prim.exit, label %if.then67.i.epil if.then67.i.epil: ; preds = %for.body63.i.epil %idxprom72.i.epil = sext i32 %23 to i64 %arrayidx73.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i.unr, i64 %idxprom72.i.epil %24 = load i32, ptr %arrayidx73.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0149.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then67.i.epil, %for.body63.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then67.i.epil ], [ %sum.0149.i.unr, %for.body63.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %col.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include<stdio.h> #define MAX 100 #define INFTY (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; int prim(){ int i,v,u,minv; int d[MAX],p[MAX],color[MAX]; for(i = 0;i<n;i++){ d[i] = INFTY; p[i] = -1; color[i] = WHITE; } d[0] = 0; while(1){ minv = INFTY; u = -1; for(i = 0; i<n; i++){ if(minv>d[i] && color[i]!=BLACK){ u = i; minv = d[i]; } } if(u == -1) break; color[u] = BLACK; for(v = 0; v < n; v++){ if(color[v] != BLACK && M[u][v] != INFTY){ if(d[v] > M[u][v]){ d[v] = M[u][v]; p[v] = u; color[v] = GRAY; } } } } int sum = 0; for(i = 0; i<n; i++){ if(p[i]!=-1) sum+=M[i][p[i]]; } return sum; } int main(){ int i,j; scanf("%d",&n); for(i = 0; i<n;i++){ for(j = 0; j<n; j++){ int e; scanf("%d",&e); M[i][j] = (e==-1)?INFTY:e; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199891/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199891/source.c" target datalayout = "e-m:e-p270: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 i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end77 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p, i8 -1, i64 %2, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader173, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader173 for.body.preheader173: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader173, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader173 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 2097152, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 2097152 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %minv.0116.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0116.us.be, %for.body8.us.backedge ] %u.0115.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0115.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %minv.0116.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.0115.us, i32 %11 %spec.select110.us = select i1 %cmp14.not.us, i32 %minv.0116.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0115.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0116.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %minv.0116.us.be = phi i32 [ %minv.1.us, %for.inc17.us ], [ 2097152, %for.inc58.us ] %u.0115.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !14 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0149 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0149, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 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.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !15 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0149.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0149.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %d.i = alloca [100 x i32], align 16 %p.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %e = alloca i32, align 4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 2097152, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp111.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp111.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 2097152, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %7 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !20 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body8.us.i for.end19.us.i: ; preds = %for.inc17.us.i %cmp20.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp20.us.i, label %for.body63.i.preheader, label %if.end22.us.i for.body63.i.preheader: ; preds = %for.end19.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i.preheader.new for.body63.i.preheader.new: ; preds = %for.body63.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body63.i if.end22.us.i: ; preds = %for.end19.us.i %idxprom23.us.i = sext i32 %u.1.us.i to i64 %arrayidx24.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom23.us.i store i32 2, ptr %arrayidx24.us.i, align 4, !tbaa !5 br label %for.body27.us.i for.body27.us.i: ; preds = %for.inc58.us.i, %if.end22.us.i %indvars.iv163.i = phi i64 [ 0, %if.end22.us.i ], [ %indvars.iv.next164.i, %for.inc58.us.i ] %arrayidx29.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv163.i %13 = load i32, ptr %arrayidx29.us.i, align 4, !tbaa !5 %cmp30.not.us.i = icmp eq i32 %13, 2 br i1 %cmp30.not.us.i, label %for.inc58.us.i, label %land.lhs.true31.us.i land.lhs.true31.us.i: ; preds = %for.body27.us.i %arrayidx35.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us.i, i64 %indvars.iv163.i %14 = load i32, ptr %arrayidx35.us.i, align 4, !tbaa !5 %cmp36.not.us.i = icmp eq i32 %14, 2097152 br i1 %cmp36.not.us.i, label %for.inc58.us.i, label %if.then37.us.i if.then37.us.i: ; preds = %land.lhs.true31.us.i %arrayidx39.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv163.i %15 = load i32, ptr %arrayidx39.us.i, align 4, !tbaa !5 %cmp44.us.i = icmp sgt i32 %15, %14 br i1 %cmp44.us.i, label %if.then45.us.i, label %for.inc58.us.i if.then45.us.i: ; preds = %if.then37.us.i store i32 %14, ptr %arrayidx39.us.i, align 4, !tbaa !5 %arrayidx53.us.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv163.i store i32 %u.1.us.i, ptr %arrayidx53.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us.i, align 4, !tbaa !5 br label %for.inc58.us.i for.inc58.us.i: ; preds = %if.then45.us.i, %if.then37.us.i, %land.lhs.true31.us.i, %for.body27.us.i %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %7 br i1 %exitcond167.not.i, label %for.body8.us.i.backedge, label %for.body27.us.i, !llvm.loop !14 for.body8.us.i: ; preds = %for.body8.us.i.backedge, %while.cond.us.preheader.i %indvars.iv158.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv158.i.be, %for.body8.us.i.backedge ] %minv.0116.us.i = phi i32 [ 2097152, %while.cond.us.preheader.i ], [ %minv.0116.us.i.be, %for.body8.us.i.backedge ] %u.0115.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0115.us.i.be, %for.body8.us.i.backedge ] %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv158.i %16 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.us.i = icmp sgt i32 %minv.0116.us.i, %16 br i1 %cmp11.us.i, label %land.lhs.true.us.i, label %for.inc17.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %arrayidx13.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv158.i %17 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5 %cmp14.not.us.i = icmp eq i32 %17, 2 %18 = trunc i64 %indvars.iv158.i to i32 %spec.select.us.i = select i1 %cmp14.not.us.i, i32 %u.0115.us.i, i32 %18 %spec.select110.us.i = select i1 %cmp14.not.us.i, i32 %minv.0116.us.i, i32 %16 br label %for.inc17.us.i for.inc17.us.i: ; preds = %land.lhs.true.us.i, %for.body8.us.i %u.1.us.i = phi i32 [ %u.0115.us.i, %for.body8.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.0116.us.i, %for.body8.us.i ], [ %spec.select110.us.i, %land.lhs.true.us.i ] %indvars.iv.next159.i = add nuw nsw i64 %indvars.iv158.i, 1 %exitcond162.not.i = icmp eq i64 %indvars.iv.next159.i, %7 br i1 %exitcond162.not.i, label %for.end19.us.i, label %for.body8.us.i.backedge for.body8.us.i.backedge: ; preds = %for.inc58.us.i, %for.inc17.us.i %indvars.iv158.i.be = phi i64 [ %indvars.iv.next159.i, %for.inc17.us.i ], [ 0, %for.inc58.us.i ] %minv.0116.us.i.be = phi i32 [ %minv.1.us.i, %for.inc17.us.i ], [ 2097152, %for.inc58.us.i ] %u.0115.us.i.be = phi i32 [ %u.1.us.i, %for.inc17.us.i ], [ -1, %for.inc58.us.i ] br label %for.body8.us.i, !llvm.loop !14 for.body63.i: ; preds = %for.inc75.i.1, %for.body63.i.preheader.new %indvars.iv168.i = phi i64 [ 0, %for.body63.i.preheader.new ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i = phi i32 [ 0, %for.body63.i.preheader.new ], [ %sum.1.i.1, %for.inc75.i.1 ] %niter = phi i64 [ 0, %for.body63.i.preheader.new ], [ %niter.next.1, %for.inc75.i.1 ] %arrayidx65.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i %19 = load i32, ptr %arrayidx65.i, align 8, !tbaa !5 %cmp66.not.i = icmp eq i32 %19, -1 br i1 %cmp66.not.i, label %for.inc75.i, label %if.then67.i if.then67.i: ; preds = %for.body63.i %idxprom72.i = sext i32 %19 to i64 %arrayidx73.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i, i64 %idxprom72.i %20 = load i32, ptr %arrayidx73.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0149.i br label %for.inc75.i for.inc75.i: ; preds = %if.then67.i, %for.body63.i %sum.1.i = phi i32 [ %add.i, %if.then67.i ], [ %sum.0149.i, %for.body63.i ] %indvars.iv.next169.i = or i64 %indvars.iv168.i, 1 %arrayidx65.i.1 = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv.next169.i %21 = load i32, ptr %arrayidx65.i.1, align 4, !tbaa !5 %cmp66.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp66.not.i.1, label %for.inc75.i.1, label %if.then67.i.1 if.then67.i.1: ; preds = %for.inc75.i %idxprom72.i.1 = sext i32 %21 to i64 %arrayidx73.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169.i, i64 %idxprom72.i.1 %22 = load i32, ptr %arrayidx73.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc75.i.1 for.inc75.i.1: ; preds = %if.then67.i.1, %for.inc75.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then67.i.1 ], [ %sum.1.i, %for.inc75.i ] %indvars.iv.next169.i.1 = add nuw nsw i64 %indvars.iv168.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc75.i.1, %for.body63.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %indvars.iv168.i.unr = phi i64 [ 0, %for.body63.i.preheader ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i.unr = phi i32 [ 0, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body63.i.epil for.body63.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx65.i.epil = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i.unr %23 = load i32, ptr %arrayidx65.i.epil, align 4, !tbaa !5 %cmp66.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp66.not.i.epil, label %prim.exit, label %if.then67.i.epil if.then67.i.epil: ; preds = %for.body63.i.epil %idxprom72.i.epil = sext i32 %23 to i64 %arrayidx73.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i.unr, i64 %idxprom72.i.epil %24 = load i32, ptr %arrayidx73.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0149.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then67.i.epil, %for.body63.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then67.i.epil ], [ %sum.0149.i.unr, %for.body63.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include<stdio.h> int main() { int n,m; scanf("%d %d",&n,&m); printf("%d\n",(n-1)*(m-1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199934/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199934/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define ll long long #define rep(i,l,r) for(ll i=(l);i<(r);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define chmax(a,b) ((a)=(a)>(b)?(a):(b)) #define chmin(a,b) ((a)=(a)<(b)?(a):(b)) #define abs(p) ((p)>=(0)?(p):(-(p))) int cmp(const void *a, const void *b); //your code here! int main(void){ ll n, m; scanf("%lld %lld", &n, &m); printf("%lld\n", (n-1)*(m-1)); return 0; } int cmp(const void *a, const void *b){ ll A=*(ll *)a, B=*(ll *)b; if(A==B)return 0; else return A>B ? 1:-1;//昇順ソート }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199978/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %n, align 8, !tbaa !5 %sub = add nsw i64 %0, -1 %1 = load i64, ptr %m, align 8, !tbaa !5 %sub1 = add nsw i64 %1, -1 %mul = mul nsw i64 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp eq i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = select i1 %cmp1, i32 1, i32 -1 %retval.0 = select i1 %cmp, i32 0, i32 %cond ret i32 %retval.0 } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b; scanf("%d%d",&a,&b); printf("%d",(a-1)*(b-1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200018/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200018/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) 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 n, m, x; scanf("%d%d", &n, &m); x = (n-1) * (m-1); printf("%d\n", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200069/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200069/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int r,c,a; scanf("%d%d",&r,&c); if(r>=2 && r<=100 && c>=2 && c<=100) { a=(r-1)*(c-1); printf("%d\n",a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200119/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #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 %r, ptr noundef nonnull %c) %0 = load i32, ptr %r, align 4 %1 = add i32 %0, -2 %or.cond = icmp ult i32 %1, 99 %2 = load i32, ptr %c, align 4 %cmp3 = icmp sgt i32 %2, 1 %or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false %cmp5 = icmp slt i32 %2, 101 %or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false br i1 %or.cond9, label %if.then, label %if.end if.then: ; preds = %entry %sub = add nsw i32 %0, -1 %sub6 = add nsw i32 %2, -1 %mul = mul nuw nsw i32 %sub6, %sub %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end if.end: ; preds = %if.then, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int main(){ int n,m; scanf("%d%d",&n,&m); printf("%d",(n-1)*(m-1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200162/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200162/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdio.h> #include<stdlib.h> int main() { int h, w,m=0, a[505][505],b[505][505]; scanf("%d%d", &h, &w); for (int i = 1; i <= h; i++) { for (int j = 1; j <= w; j++) { scanf("%d", &a[i][j]); b[i][j] = a[i][j]; } } for (int i = 1; i <= h-1; i++) { for (int j = 1; j <= w-1; j++) { if (a[i][j] % 2 == 1) {m++; a[i][j + 1]++; } } if (a[i][w] % 2 == 1) { m++; a[i + 1][w]++; } } for (int j = 1; j <= w - 1; j++) { if (a[h][j] % 2 == 1) { m++; a[h][j + 1]++; } } printf("%d\n", m); for (int i = 1; i <= h - 1; i++) { for (int j = 1; j <= w - 1; j++) { if (b[i][j] % 2 == 1) { printf("%d %d %d %d\n", i, j, i, j+1); b[i][j+1]++; } } if (b[i][w] % 2 == 1) { printf("%d %d %d %d\n", i, w, i+1,w); b[i+1][w]++; } } for (int j = 1; j <= w - 1; j++) { if (b[h][j] % 2 == 1) { printf("%d %d %d %d\n", h,j, h, j+1); b[h][j+1]++; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200205/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200205/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.3 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %a = alloca [505 x [505 x i32]], align 16 %b = alloca [505 x [505 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.start.p0(i64 1020100, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 1020100, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp.not207 = icmp slt i32 %0, 1 %.pre264.pre = load i32, ptr %w, align 4, !tbaa !5 br i1 %cmp.not207, label %for.cond63.preheader, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp slt i32 %.pre264.pre, 1 br i1 %1, label %for.cond20.preheader, label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond.cleanup3 %2 = phi i32 [ %4, %for.cond.cleanup3 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %5, %for.cond.cleanup3 ], [ %.pre264.pre, %for.cond1.preheader.lr.ph ] %indvars.iv233 = phi i64 [ %indvars.iv.next234, %for.cond.cleanup3 ], [ 1, %for.cond1.preheader.lr.ph ] %cmp2.not205 = icmp slt i32 %3, 1 br i1 %cmp2.not205, label %for.cond.cleanup3, label %for.body4 for.cond20.preheader: ; preds = %for.cond.cleanup3, %for.cond1.preheader.lr.ph %.pre264 = phi i32 [ %.pre264.pre, %for.cond1.preheader.lr.ph ], [ %5, %for.cond.cleanup3 ] %.lcssa204 = phi i32 [ %0, %for.cond1.preheader.lr.ph ], [ %4, %for.cond.cleanup3 ] %cmp21.not.not214 = icmp sgt i32 %.lcssa204, 1 br i1 %cmp21.not.not214, label %for.cond25.preheader.lr.ph, label %for.cond63.preheader for.cond25.preheader.lr.ph: ; preds = %for.cond20.preheader %cmp27.not.not209 = icmp sgt i32 %.pre264, 1 %idxprom46 = sext i32 %.pre264 to i64 %wide.trip.count244 = zext i32 %.lcssa204 to i64 %wide.trip.count = zext i32 %.pre264 to i64 br label %for.cond25.preheader for.cond.cleanup3.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %h, align 4, !tbaa !5 br label %for.cond.cleanup3 for.cond.cleanup3: ; preds = %for.cond.cleanup3.loopexit, %for.cond1.preheader %4 = phi i32 [ %.pre, %for.cond.cleanup3.loopexit ], [ %2, %for.cond1.preheader ] %5 = phi i32 [ %8, %for.cond.cleanup3.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next234 = add nuw nsw i64 %indvars.iv233, 1 %6 = sext i32 %4 to i64 %cmp.not.not = icmp slt i64 %indvars.iv233, %6 br i1 %cmp.not.not, label %for.cond1.preheader, label %for.cond20.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond1.preheader, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.cond1.preheader ] %arrayidx6 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %indvars.iv233, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %indvars.iv233, i64 %indvars.iv store i32 %7, ptr %arrayidx15, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %w, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %9 br i1 %cmp2.not.not, label %for.body4, label %for.cond.cleanup3.loopexit, !llvm.loop !12 for.cond25.preheader: ; preds = %for.cond25.preheader.lr.ph, %for.inc59 %indvars.iv240 = phi i64 [ 1, %for.cond25.preheader.lr.ph ], [ %indvars.iv.next241.pre-phi, %for.inc59 ] %m.0215 = phi i32 [ 0, %for.cond25.preheader.lr.ph ], [ %m.3, %for.inc59 ] br i1 %cmp27.not.not209, label %for.body29, label %for.cond.cleanup28 for.cond63.preheader: ; preds = %for.inc59, %entry, %for.cond20.preheader %.lcssa204281 = phi i32 [ %.lcssa204, %for.cond20.preheader ], [ %0, %entry ], [ %.lcssa204, %for.inc59 ] %.pre264280 = phi i32 [ %.pre264, %for.cond20.preheader ], [ %.pre264.pre, %entry ], [ %.pre264, %for.inc59 ] %m.0.lcssa = phi i32 [ 0, %for.cond20.preheader ], [ 0, %entry ], [ %m.3, %for.inc59 ] %cmp65.not.not218 = icmp sgt i32 %.pre264280, 1 br i1 %cmp65.not.not218, label %for.body67.lr.ph, label %for.cond.cleanup66 for.body67.lr.ph: ; preds = %for.cond63.preheader %idxprom68 = sext i32 %.lcssa204281 to i64 %wide.trip.count250 = zext i32 %.pre264280 to i64 br label %for.body67 for.cond.cleanup28: ; preds = %for.inc41, %for.cond25.preheader %m.1.lcssa = phi i32 [ %m.0215, %for.cond25.preheader ], [ %m.2, %for.inc41 ] %arrayidx47 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %indvars.iv240, i64 %idxprom46 %10 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %11 = and i32 %10, -2147483647 %cmp49 = icmp eq i32 %11, 1 br i1 %cmp49, label %if.then50, label %for.cond.cleanup28.for.inc59_crit_edge for.cond.cleanup28.for.inc59_crit_edge: ; preds = %for.cond.cleanup28 %.pre271 = add nuw nsw i64 %indvars.iv240, 1 br label %for.inc59 for.body29: ; preds = %for.cond25.preheader, %for.inc41 %indvars.iv236 = phi i64 [ %indvars.iv.next237.pre-phi, %for.inc41 ], [ 1, %for.cond25.preheader ] %m.1210 = phi i32 [ %m.2, %for.inc41 ], [ %m.0215, %for.cond25.preheader ] %arrayidx33 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %indvars.iv240, i64 %indvars.iv236 %12 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %13 = and i32 %12, -2147483647 %cmp34 = icmp eq i32 %13, 1 br i1 %cmp34, label %if.then, label %for.body29.for.inc41_crit_edge for.body29.for.inc41_crit_edge: ; preds = %for.body29 %.pre270 = add nuw nsw i64 %indvars.iv236, 1 br label %for.inc41 if.then: ; preds = %for.body29 %inc35 = add nsw i32 %m.1210, 1 %14 = add nuw nsw i64 %indvars.iv236, 1 %arrayidx39 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %indvars.iv240, i64 %14 %15 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %inc40 = add nsw i32 %15, 1 store i32 %inc40, ptr %arrayidx39, align 4, !tbaa !5 br label %for.inc41 for.inc41: ; preds = %for.body29.for.inc41_crit_edge, %if.then %indvars.iv.next237.pre-phi = phi i64 [ %.pre270, %for.body29.for.inc41_crit_edge ], [ %14, %if.then ] %m.2 = phi i32 [ %m.1210, %for.body29.for.inc41_crit_edge ], [ %inc35, %if.then ] %exitcond.not = icmp eq i64 %indvars.iv.next237.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup28, label %for.body29, !llvm.loop !13 if.then50: ; preds = %for.cond.cleanup28 %inc51 = add nsw i32 %m.1.lcssa, 1 %16 = add nuw nsw i64 %indvars.iv240, 1 %arrayidx56 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %16, i64 %idxprom46 %17 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %inc57 = add nsw i32 %17, 1 store i32 %inc57, ptr %arrayidx56, align 4, !tbaa !5 br label %for.inc59 for.inc59: ; preds = %for.cond.cleanup28.for.inc59_crit_edge, %if.then50 %indvars.iv.next241.pre-phi = phi i64 [ %.pre271, %for.cond.cleanup28.for.inc59_crit_edge ], [ %16, %if.then50 ] %m.3 = phi i32 [ %m.1.lcssa, %for.cond.cleanup28.for.inc59_crit_edge ], [ %inc51, %if.then50 ] %exitcond245.not = icmp eq i64 %indvars.iv.next241.pre-phi, %wide.trip.count244 br i1 %exitcond245.not, label %for.cond63.preheader, label %for.cond25.preheader, !llvm.loop !14 for.cond.cleanup66: ; preds = %for.inc83, %for.cond63.preheader %m.4.lcssa = phi i32 [ %m.0.lcssa, %for.cond63.preheader ], [ %m.5, %for.inc83 ] %call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %m.4.lcssa) %18 = load i32, ptr %h, align 4, !tbaa !5 %cmp90.not.not225 = icmp sgt i32 %18, 1 %.pre267 = load i32, ptr %w, align 4, !tbaa !5 br i1 %cmp90.not.not225, label %for.cond94.preheader, label %for.cond138.preheader for.body67: ; preds = %for.body67.lr.ph, %for.inc83 %indvars.iv246 = phi i64 [ 1, %for.body67.lr.ph ], [ %indvars.iv.next247.pre-phi, %for.inc83 ] %m.4219 = phi i32 [ %m.0.lcssa, %for.body67.lr.ph ], [ %m.5, %for.inc83 ] %arrayidx71 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %idxprom68, i64 %indvars.iv246 %19 = load i32, ptr %arrayidx71, align 4, !tbaa !5 %20 = and i32 %19, -2147483647 %cmp73 = icmp eq i32 %20, 1 br i1 %cmp73, label %if.then74, label %for.body67.for.inc83_crit_edge for.body67.for.inc83_crit_edge: ; preds = %for.body67 %.pre272 = add nuw nsw i64 %indvars.iv246, 1 br label %for.inc83 if.then74: ; preds = %for.body67 %inc75 = add nsw i32 %m.4219, 1 %21 = add nuw nsw i64 %indvars.iv246, 1 %arrayidx80 = getelementptr inbounds [505 x [505 x i32]], ptr %a, i64 0, i64 %idxprom68, i64 %21 %22 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %inc81 = add nsw i32 %22, 1 store i32 %inc81, ptr %arrayidx80, align 4, !tbaa !5 br label %for.inc83 for.inc83: ; preds = %for.body67.for.inc83_crit_edge, %if.then74 %indvars.iv.next247.pre-phi = phi i64 [ %.pre272, %for.body67.for.inc83_crit_edge ], [ %21, %if.then74 ] %m.5 = phi i32 [ %m.4219, %for.body67.for.inc83_crit_edge ], [ %inc75, %if.then74 ] %exitcond251.not = icmp eq i64 %indvars.iv.next247.pre-phi, %wide.trip.count250 br i1 %exitcond251.not, label %for.cond.cleanup66, label %for.body67, !llvm.loop !15 for.cond94.preheader: ; preds = %for.cond.cleanup66, %for.inc134 %23 = phi i32 [ %41, %for.inc134 ], [ %.pre267, %for.cond.cleanup66 ] %24 = phi i32 [ %42, %for.inc134 ], [ %.pre267, %for.cond.cleanup66 ] %indvars.iv256 = phi i64 [ %31, %for.inc134 ], [ 1, %for.cond.cleanup66 ] %indvars259 = trunc i64 %indvars.iv256 to i32 %cmp96.not.not222 = icmp sgt i32 %24, 1 br i1 %cmp96.not.not222, label %for.body98, label %for.cond94.preheader.for.cond.cleanup97_crit_edge for.cond94.preheader.for.cond.cleanup97_crit_edge: ; preds = %for.cond94.preheader %.pre274 = sext i32 %24 to i64 br label %for.cond.cleanup97 for.cond138.preheader: ; preds = %for.inc134, %for.cond.cleanup66 %25 = phi i32 [ %18, %for.cond.cleanup66 ], [ %43, %for.inc134 ] %26 = phi i32 [ %.pre267, %for.cond.cleanup66 ], [ %41, %for.inc134 ] %cmp140.not.not227 = icmp sgt i32 %26, 1 br i1 %cmp140.not.not227, label %for.body142, label %for.cond.cleanup141 for.cond.cleanup97: ; preds = %for.inc115, %for.cond94.preheader.for.cond.cleanup97_crit_edge %idxprom120.pre-phi = phi i64 [ %.pre274, %for.cond94.preheader.for.cond.cleanup97_crit_edge ], [ %38, %for.inc115 ] %27 = phi i32 [ %23, %for.cond94.preheader.for.cond.cleanup97_crit_edge ], [ %37, %for.inc115 ] %28 = phi i32 [ %24, %for.cond94.preheader.for.cond.cleanup97_crit_edge ], [ %37, %for.inc115 ] %arrayidx121 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %indvars.iv256, i64 %idxprom120.pre-phi %29 = load i32, ptr %arrayidx121, align 4, !tbaa !5 %30 = and i32 %29, -2147483647 %cmp123 = icmp eq i32 %30, 1 %31 = add nuw nsw i64 %indvars.iv256, 1 br i1 %cmp123, label %if.then124, label %for.inc134 for.body98: ; preds = %for.cond94.preheader, %for.inc115 %32 = phi i32 [ %37, %for.inc115 ], [ %23, %for.cond94.preheader ] %indvars.iv252 = phi i64 [ %indvars.iv.next253.pre-phi, %for.inc115 ], [ 1, %for.cond94.preheader ] %arrayidx102 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %indvars.iv256, i64 %indvars.iv252 %33 = load i32, ptr %arrayidx102, align 4, !tbaa !5 %34 = and i32 %33, -2147483647 %cmp104 = icmp eq i32 %34, 1 br i1 %cmp104, label %if.then105, label %for.body98.for.inc115_crit_edge for.body98.for.inc115_crit_edge: ; preds = %for.body98 %.pre273 = add nuw nsw i64 %indvars.iv252, 1 br label %for.inc115 if.then105: ; preds = %for.body98 %indvars255 = trunc i64 %indvars.iv252 to i32 %35 = add nuw nsw i64 %indvars.iv252, 1 %add106 = add nuw nsw i32 %indvars255, 1 %call107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %indvars259, i32 noundef %indvars255, i32 noundef %indvars259, i32 noundef %add106) %arrayidx112 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %indvars.iv256, i64 %35 %36 = load i32, ptr %arrayidx112, align 4, !tbaa !5 %inc113 = add nsw i32 %36, 1 store i32 %inc113, ptr %arrayidx112, align 4, !tbaa !5 %.pre266 = load i32, ptr %w, align 4, !tbaa !5 br label %for.inc115 for.inc115: ; preds = %for.body98.for.inc115_crit_edge, %if.then105 %indvars.iv.next253.pre-phi = phi i64 [ %.pre273, %for.body98.for.inc115_crit_edge ], [ %35, %if.then105 ] %37 = phi i32 [ %32, %for.body98.for.inc115_crit_edge ], [ %.pre266, %if.then105 ] %38 = sext i32 %37 to i64 %cmp96.not.not = icmp slt i64 %indvars.iv.next253.pre-phi, %38 br i1 %cmp96.not.not, label %for.body98, label %for.cond.cleanup97, !llvm.loop !16 if.then124: ; preds = %for.cond.cleanup97 %add125 = add nuw nsw i32 %indvars259, 1 %call126 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %indvars259, i32 noundef %28, i32 noundef %add125, i32 noundef %28) %39 = load i32, ptr %w, align 4, !tbaa !5 %idxprom130 = sext i32 %39 to i64 %arrayidx131 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %31, i64 %idxprom130 %40 = load i32, ptr %arrayidx131, align 4, !tbaa !5 %inc132 = add nsw i32 %40, 1 store i32 %inc132, ptr %arrayidx131, align 4, !tbaa !5 br label %for.inc134 for.inc134: ; preds = %for.cond.cleanup97, %if.then124 %41 = phi i32 [ %39, %if.then124 ], [ %27, %for.cond.cleanup97 ] %42 = phi i32 [ %39, %if.then124 ], [ %28, %for.cond.cleanup97 ] %43 = load i32, ptr %h, align 4, !tbaa !5 %44 = sext i32 %43 to i64 %cmp90.not.not = icmp slt i64 %31, %44 br i1 %cmp90.not.not, label %for.cond94.preheader, label %for.cond138.preheader, !llvm.loop !17 for.cond.cleanup141: ; preds = %for.inc159, %for.cond138.preheader call void @llvm.lifetime.end.p0(i64 1020100, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 1020100, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3 ret i32 0 for.body142: ; preds = %for.cond138.preheader, %for.inc159 %45 = phi i32 [ %52, %for.inc159 ], [ %26, %for.cond138.preheader ] %46 = phi i32 [ %53, %for.inc159 ], [ %25, %for.cond138.preheader ] %indvars.iv260 = phi i64 [ %indvars.iv.next261.pre-phi, %for.inc159 ], [ 1, %for.cond138.preheader ] %idxprom143 = sext i32 %46 to i64 %arrayidx146 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %idxprom143, i64 %indvars.iv260 %47 = load i32, ptr %arrayidx146, align 4, !tbaa !5 %48 = and i32 %47, -2147483647 %cmp148 = icmp eq i32 %48, 1 br i1 %cmp148, label %if.then149, label %for.body142.for.inc159_crit_edge for.body142.for.inc159_crit_edge: ; preds = %for.body142 %.pre276 = add nuw nsw i64 %indvars.iv260, 1 br label %for.inc159 if.then149: ; preds = %for.body142 %indvars263 = trunc i64 %indvars.iv260 to i32 %49 = add nuw nsw i64 %indvars.iv260, 1 %add150 = add nuw nsw i32 %indvars263, 1 %call151 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %46, i32 noundef %indvars263, i32 noundef %46, i32 noundef %add150) %50 = load i32, ptr %h, align 4, !tbaa !5 %idxprom152 = sext i32 %50 to i64 %arrayidx156 = getelementptr inbounds [505 x [505 x i32]], ptr %b, i64 0, i64 %idxprom152, i64 %49 %51 = load i32, ptr %arrayidx156, align 4, !tbaa !5 %inc157 = add nsw i32 %51, 1 store i32 %inc157, ptr %arrayidx156, align 4, !tbaa !5 %.pre268 = load i32, ptr %w, align 4, !tbaa !5 br label %for.inc159 for.inc159: ; preds = %for.body142.for.inc159_crit_edge, %if.then149 %indvars.iv.next261.pre-phi = phi i64 [ %.pre276, %for.body142.for.inc159_crit_edge ], [ %49, %if.then149 ] %52 = phi i32 [ %45, %for.body142.for.inc159_crit_edge ], [ %.pre268, %if.then149 ] %53 = phi i32 [ %46, %for.body142.for.inc159_crit_edge ], [ %50, %if.then149 ] %54 = sext i32 %52 to i64 %cmp140.not.not = icmp slt i64 %indvars.iv.next261.pre-phi, %54 br i1 %cmp140.not.not, label %for.body142, label %for.cond.cleanup141, !llvm.loop !18 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.unswitch.partial.disable"} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include <stdio.h> inline static int gl(void){ int x = 0; for(;;){ unsigned int c = getchar_unlocked() - 48; if(c < 10){ x = x*10 + c; }else{ break; } } return x; } typedef struct{ int y; int x; } pos_t; typedef struct{ int fy; int fx; int ty; int tx; } move_t; char a[512][512]; move_t out[512*512]; int main(void){ int h=gl(), w=gl(); for(int i=0; i<h; i++){ for(int j=0; j<w; j++){ int t = getchar_unlocked() - 48; getchar_unlocked(); a[i][j] = t; } } char haveCoin = 0; int pos = 0; pos_t now, old; for(int i=0; i<h; i++){ now.y = i; for(int j=0; j<w; j++){ now.x = i%2==0 ? j : w-1-j; if(haveCoin){ out[pos].fy=old.y+1; out[pos].fx=old.x+1; out[pos].ty=now.y+1; out[pos].tx=now.x+1; pos++; } haveCoin ^= a[now.y][now.x]&1; old = now; } } printf("%d\n", pos); for(int i=0; i<pos; i++){ printf("%d %d %d %d\n", out[i].fy, out[i].fx, out[i].ty, out[i].tx); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200249/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200249/source.c" target datalayout = "e-m:e-p270: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.move_t = type { i32, i32, i32, i32 } %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @a = dso_local local_unnamed_addr global [512 x [512 x i8]] zeroinitializer, align 16 @out = dso_local local_unnamed_addr global [262144 x %struct.move_t] zeroinitializer, align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %.pre4.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %for.cond.i for.cond.i: ; preds = %getchar_unlocked.exit.i, %entry %0 = phi ptr [ %.pre4.i, %entry ], [ %.pre4.i113, %getchar_unlocked.exit.i ] %x.0.i = phi i32 [ 0, %entry ], [ %add.i, %getchar_unlocked.exit.i ] %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14 %cmp.not.i.i = icmp ult ptr %1, %2 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %for.cond.i %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #3 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i cond.false.i.i: ; preds = %for.cond.i %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %getchar_unlocked.exit.i getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i %.pre4.i113 = phi ptr [ %.pre.i, %cond.true.i.i ], [ %0, %cond.false.i.i ] %cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ] %sub.i = add nsw i32 %cond.i.i, -48 %cmp.i = icmp ult i32 %sub.i, 10 %mul.i = mul nsw i32 %x.0.i, 10 %add.i = add i32 %sub.i, %mul.i br i1 %cmp.i, label %for.cond.i, label %for.cond.i114 for.cond.i114: ; preds = %getchar_unlocked.exit.i, %getchar_unlocked.exit.i122 %4 = phi ptr [ %8, %getchar_unlocked.exit.i122 ], [ %.pre4.i113, %getchar_unlocked.exit.i ] %x.0.i115 = phi i32 [ %add.i127, %getchar_unlocked.exit.i122 ], [ 0, %getchar_unlocked.exit.i ] %_IO_read_ptr.i.i116 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i.i116, align 8, !tbaa !9 %_IO_read_end.i.i117 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i.i117, align 8, !tbaa !14 %cmp.not.i.i118 = icmp ult ptr %5, %6 br i1 %cmp.not.i.i118, label %cond.false.i.i128, label %cond.true.i.i119, !prof !15 cond.true.i.i119: ; preds = %for.cond.i114 %call.i.i120 = tail call i32 @__uflow(ptr noundef nonnull %4) #3 %.pre.i121 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i122 cond.false.i.i128: ; preds = %for.cond.i114 %incdec.ptr.i.i129 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i.i129, ptr %_IO_read_ptr.i.i116, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i.i130 = zext i8 %7 to i32 br label %getchar_unlocked.exit.i122 getchar_unlocked.exit.i122: ; preds = %cond.false.i.i128, %cond.true.i.i119 %8 = phi ptr [ %.pre.i121, %cond.true.i.i119 ], [ %4, %cond.false.i.i128 ] %cond.i.i123 = phi i32 [ %call.i.i120, %cond.true.i.i119 ], [ %conv3.i.i130, %cond.false.i.i128 ] %sub.i124 = add nsw i32 %cond.i.i123, -48 %cmp.i125 = icmp ult i32 %sub.i124, 10 %mul.i126 = mul nsw i32 %x.0.i115, 10 %add.i127 = add i32 %sub.i124, %mul.i126 br i1 %cmp.i125, label %for.cond.i114, label %for.cond.preheader for.cond.preheader: ; preds = %getchar_unlocked.exit.i122 %cmp144 = icmp sgt i32 %x.0.i, 0 %cmp3142 = icmp sgt i32 %x.0.i115, 0 %or.cond = select i1 %cmp144, i1 %cmp3142, i1 false br i1 %or.cond, label %for.cond2.preheader.us.preheader, label %for.cond.cleanup17.thread for.cond2.preheader.us.preheader: ; preds = %for.cond.preheader %wide.trip.count204 = zext i32 %x.0.i to i64 %wide.trip.count = zext i32 %x.0.i115 to i64 br label %for.cond2.preheader.us for.cond2.preheader.us: ; preds = %for.cond2.preheader.us.preheader, %for.cond2.for.cond.cleanup4_crit_edge.us %.pre226 = phi ptr [ %8, %for.cond2.preheader.us.preheader ], [ %.pre226231, %for.cond2.for.cond.cleanup4_crit_edge.us ] %indvars.iv201 = phi i64 [ 0, %for.cond2.preheader.us.preheader ], [ %indvars.iv.next202, %for.cond2.for.cond.cleanup4_crit_edge.us ] br label %for.body5.us for.body5.us: ; preds = %for.cond2.preheader.us, %getchar_unlocked.exit141.us %.pre226230 = phi ptr [ %.pre226, %for.cond2.preheader.us ], [ %.pre226231, %getchar_unlocked.exit141.us ] %9 = phi ptr [ %.pre226, %for.cond2.preheader.us ], [ %16, %getchar_unlocked.exit141.us ] %indvars.iv = phi i64 [ 0, %for.cond2.preheader.us ], [ %indvars.iv.next, %getchar_unlocked.exit141.us ] %_IO_read_ptr.i.us = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1 %10 = load ptr, ptr %_IO_read_ptr.i.us, align 8, !tbaa !9 %_IO_read_end.i.us = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2 %11 = load ptr, ptr %_IO_read_end.i.us, align 8, !tbaa !14 %cmp.not.i.us = icmp ult ptr %10, %11 br i1 %cmp.not.i.us, label %cond.false.i.us, label %cond.true.i.us, !prof !15 cond.true.i.us: ; preds = %for.body5.us %call.i.us = tail call i32 @__uflow(ptr noundef nonnull %9) #3 %.pre227 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i132.us.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre227, i64 0, i32 1 %.pre232 = load ptr, ptr %_IO_read_ptr.i132.us.phi.trans.insert, align 8, !tbaa !9 %_IO_read_end.i133.us.phi.trans.insert = getelementptr inbounds %struct._IO_FILE, ptr %.pre227, i64 0, i32 2 %.pre233 = load ptr, ptr %_IO_read_end.i133.us.phi.trans.insert, align 8, !tbaa !14 br label %getchar_unlocked.exit.us cond.false.i.us: ; preds = %for.body5.us %incdec.ptr.i.us = getelementptr inbounds i8, ptr %10, i64 1 store ptr %incdec.ptr.i.us, ptr %_IO_read_ptr.i.us, align 8, !tbaa !9 %12 = load i8, ptr %10, align 1, !tbaa !16 %conv3.i.us = zext i8 %12 to i32 br label %getchar_unlocked.exit.us getchar_unlocked.exit.us: ; preds = %cond.false.i.us, %cond.true.i.us %13 = phi ptr [ %.pre233, %cond.true.i.us ], [ %11, %cond.false.i.us ] %14 = phi ptr [ %.pre232, %cond.true.i.us ], [ %incdec.ptr.i.us, %cond.false.i.us ] %.pre226229 = phi ptr [ %.pre227, %cond.true.i.us ], [ %.pre226230, %cond.false.i.us ] %15 = phi ptr [ %.pre227, %cond.true.i.us ], [ %9, %cond.false.i.us ] %cond.i.us = phi i32 [ %call.i.us, %cond.true.i.us ], [ %conv3.i.us, %cond.false.i.us ] %cmp.not.i134.us = icmp ult ptr %14, %13 br i1 %cmp.not.i134.us, label %cond.false.i138.us, label %cond.true.i135.us, !prof !15 cond.true.i135.us: ; preds = %getchar_unlocked.exit.us %call.i136.us = tail call i32 @__uflow(ptr noundef nonnull %15) #3 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit141.us cond.false.i138.us: ; preds = %getchar_unlocked.exit.us %_IO_read_ptr.i132.us = getelementptr inbounds %struct._IO_FILE, ptr %15, i64 0, i32 1 %incdec.ptr.i139.us = getelementptr inbounds i8, ptr %14, i64 1 store ptr %incdec.ptr.i139.us, ptr %_IO_read_ptr.i132.us, align 8, !tbaa !9 br label %getchar_unlocked.exit141.us getchar_unlocked.exit141.us: ; preds = %cond.false.i138.us, %cond.true.i135.us %.pre226231 = phi ptr [ %.pre226229, %cond.false.i138.us ], [ %.pre, %cond.true.i135.us ] %16 = phi ptr [ %15, %cond.false.i138.us ], [ %.pre, %cond.true.i135.us ] %17 = trunc i32 %cond.i.us to i8 %conv.us = add i8 %17, -48 %arrayidx9.us = getelementptr inbounds [512 x [512 x i8]], ptr @a, i64 0, i64 %indvars.iv201, i64 %indvars.iv store i8 %conv.us, ptr %arrayidx9.us, align 1, !tbaa !16 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond2.for.cond.cleanup4_crit_edge.us, label %for.body5.us, !llvm.loop !17 for.cond2.for.cond.cleanup4_crit_edge.us: ; preds = %getchar_unlocked.exit141.us %indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1 %exitcond205.not = icmp eq i64 %indvars.iv.next202, %wide.trip.count204 br i1 %exitcond205.not, label %for.cond14.preheader, label %for.cond2.preheader.us, !llvm.loop !19 for.cond14.preheader: ; preds = %for.cond2.for.cond.cleanup4_crit_edge.us %cmp21146 = icmp sgt i32 %x.0.i115, 0 %or.cond243 = select i1 %cmp144, i1 %cmp21146, i1 false br i1 %or.cond243, label %for.cond20.preheader.us.preheader, label %for.cond.cleanup17.thread for.cond20.preheader.us.preheader: ; preds = %for.cond14.preheader %wide.trip.count219 = zext i32 %x.0.i to i64 %wide.trip.count208 = zext i32 %x.0.i115 to i64 %sub28.us.peel = add i32 %x.0.i115, -1 %idxprom49.us184.peel = sext i32 %sub28.us.peel to i64 %exitcond209.peel.not = icmp eq i32 %x.0.i115, 1 %wide.trip.count214 = zext i32 %x.0.i115 to i64 %exitcond215.peel.not = icmp eq i32 %x.0.i115, 1 br label %for.cond20.preheader.us for.cond20.preheader.us: ; preds = %for.cond20.preheader.us.preheader, %for.cond20.for.cond.cleanup23_crit_edge.us %indvars.iv217 = phi i64 [ 0, %for.cond20.preheader.us.preheader ], [ %indvars.iv.next218, %for.cond20.for.cond.cleanup23_crit_edge.us ] %old.sroa.0.0162.us = phi i32 [ undef, %for.cond20.preheader.us.preheader ], [ %18, %for.cond20.for.cond.cleanup23_crit_edge.us ] %old.sroa.4.0161.us = phi i32 [ undef, %for.cond20.preheader.us.preheader ], [ %.us-phi156.us, %for.cond20.for.cond.cleanup23_crit_edge.us ] %pos.0160.us = phi i32 [ 0, %for.cond20.preheader.us.preheader ], [ %.us-phi155.us, %for.cond20.for.cond.cleanup23_crit_edge.us ] %haveCoin.0159.us = phi i8 [ 0, %for.cond20.preheader.us.preheader ], [ %.us-phi.us, %for.cond20.for.cond.cleanup23_crit_edge.us ] %18 = trunc i64 %indvars.iv217 to i32 %rem.us = and i32 %18, 1 %cmp25.us = icmp eq i32 %rem.us, 0 %indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1 %tobool.not.us.us.peel = icmp eq i8 %haveCoin.0159.us, 0 br i1 %cmp25.us, label %for.body24.us.us.preheader, label %for.body24.us165.preheader for.body24.us165.preheader: ; preds = %for.cond20.preheader.us br i1 %tobool.not.us.us.peel, label %if.end.us182.peel, label %if.then.us172.peel if.then.us172.peel: ; preds = %for.body24.us165.preheader %add.us173.peel = add nsw i32 %old.sroa.0.0162.us, 1 %idxprom30.us174.peel = sext i32 %pos.0160.us to i64 %arrayidx31.us175.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174.peel store i32 %add.us173.peel, ptr %arrayidx31.us175.peel, align 16, !tbaa !20 %add33.us176.peel = add nsw i32 %old.sroa.4.0161.us, 1 %fx.us177.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174.peel, i32 1 store i32 %add33.us176.peel, ptr %fx.us177.peel, align 4, !tbaa !22 %ty.us178.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174.peel, i32 2 %19 = trunc i64 %indvars.iv.next218 to i32 store i32 %19, ptr %ty.us178.peel, align 8, !tbaa !23 %tx.us180.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174.peel, i32 3 store i32 %x.0.i115, ptr %tx.us180.peel, align 4, !tbaa !24 %inc44.us181.peel = add nsw i32 %pos.0160.us, 1 br label %if.end.us182.peel if.end.us182.peel: ; preds = %if.then.us172.peel, %for.body24.us165.preheader %pos.2.us183.peel = phi i32 [ %inc44.us181.peel, %if.then.us172.peel ], [ %pos.0160.us, %for.body24.us165.preheader ] %arrayidx50.us185.peel = getelementptr inbounds [512 x [512 x i8]], ptr @a, i64 0, i64 %indvars.iv217, i64 %idxprom49.us184.peel %20 = load i8, ptr %arrayidx50.us185.peel, align 1, !tbaa !16 %21 = and i8 %20, 1 %xor112.us186.peel = xor i8 %21, %haveCoin.0159.us br i1 %exitcond209.peel.not, label %for.cond20.for.cond.cleanup23_crit_edge.us, label %for.body24.us165.peel.next for.body24.us165.peel.next: ; preds = %if.end.us182.peel %22 = trunc i64 %indvars.iv.next218 to i32 br label %for.body24.us165 for.body24.us.us.preheader: ; preds = %for.cond20.preheader.us br i1 %tobool.not.us.us.peel, label %if.end.us.us.peel, label %if.then.us.us.peel if.then.us.us.peel: ; preds = %for.body24.us.us.preheader %add.us.us.peel = add nsw i32 %old.sroa.0.0162.us, 1 %idxprom30.us.us.peel = sext i32 %pos.0160.us to i64 %arrayidx31.us.us.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us.peel store i32 %add.us.us.peel, ptr %arrayidx31.us.us.peel, align 16, !tbaa !20 %add33.us.us.peel = add nsw i32 %old.sroa.4.0161.us, 1 %fx.us.us.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us.peel, i32 1 store i32 %add33.us.us.peel, ptr %fx.us.us.peel, align 4, !tbaa !22 %ty.us.us.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us.peel, i32 2 %23 = trunc i64 %indvars.iv.next218 to i32 store i32 %23, ptr %ty.us.us.peel, align 8, !tbaa !23 %tx.us.us.peel = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us.peel, i32 3 store i32 1, ptr %tx.us.us.peel, align 4, !tbaa !24 %inc44.us.us.peel = add nsw i32 %pos.0160.us, 1 br label %if.end.us.us.peel if.end.us.us.peel: ; preds = %if.then.us.us.peel, %for.body24.us.us.preheader %pos.2.us.us.peel = phi i32 [ %inc44.us.us.peel, %if.then.us.us.peel ], [ %pos.0160.us, %for.body24.us.us.preheader ] %arrayidx50.us.us.peel = getelementptr inbounds [512 x [512 x i8]], ptr @a, i64 0, i64 %indvars.iv217, i64 0 %24 = load i8, ptr %arrayidx50.us.us.peel, align 16, !tbaa !16 %25 = and i8 %24, 1 %xor112.us.us.peel = xor i8 %25, %haveCoin.0159.us br i1 %exitcond215.peel.not, label %for.cond20.for.cond.cleanup23_crit_edge.us.loopexit, label %for.body24.us.us.peel.next for.body24.us.us.peel.next: ; preds = %if.end.us.us.peel %26 = trunc i64 %indvars.iv.next218 to i32 br label %for.body24.us.us for.body24.us165: ; preds = %for.body24.us165.peel.next, %if.end.us182 %indvars.iv206 = phi i64 [ 1, %for.body24.us165.peel.next ], [ %indvars.iv.next207, %if.end.us182 ] %old.sroa.4.1149.us168 = phi i32 [ %sub28.us.peel, %for.body24.us165.peel.next ], [ %sub28.us, %if.end.us182 ] %pos.1148.us169 = phi i32 [ %pos.2.us183.peel, %for.body24.us165.peel.next ], [ %pos.2.us183, %if.end.us182 ] %haveCoin.1147.us170 = phi i8 [ %xor112.us186.peel, %for.body24.us165.peel.next ], [ %xor112.us186, %if.end.us182 ] %27 = trunc i64 %indvars.iv206 to i32 %28 = xor i32 %27, -1 %sub28.us = add i32 %x.0.i115, %28 %tobool.not.us171 = icmp eq i8 %haveCoin.1147.us170, 0 br i1 %tobool.not.us171, label %if.end.us182, label %if.then.us172 if.then.us172: ; preds = %for.body24.us165 %idxprom30.us174 = sext i32 %pos.1148.us169 to i64 %arrayidx31.us175 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174 store i32 %22, ptr %arrayidx31.us175, align 16, !tbaa !20 %add33.us176 = add nsw i32 %old.sroa.4.1149.us168, 1 %fx.us177 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174, i32 1 store i32 %add33.us176, ptr %fx.us177, align 4, !tbaa !22 %ty.us178 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174, i32 2 store i32 %22, ptr %ty.us178, align 8, !tbaa !23 %29 = trunc i64 %indvars.iv206 to i32 %add41.us179 = sub i32 %x.0.i115, %29 %tx.us180 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us174, i32 3 store i32 %add41.us179, ptr %tx.us180, align 4, !tbaa !24 %inc44.us181 = add nsw i32 %pos.1148.us169, 1 br label %if.end.us182 if.end.us182: ; preds = %if.then.us172, %for.body24.us165 %pos.2.us183 = phi i32 [ %inc44.us181, %if.then.us172 ], [ %pos.1148.us169, %for.body24.us165 ] %idxprom49.us184 = sext i32 %sub28.us to i64 %arrayidx50.us185 = getelementptr inbounds [512 x [512 x i8]], ptr @a, i64 0, i64 %indvars.iv217, i64 %idxprom49.us184 %30 = load i8, ptr %arrayidx50.us185, align 1, !tbaa !16 %31 = and i8 %30, 1 %xor112.us186 = xor i8 %31, %haveCoin.1147.us170 %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1 %exitcond209.not = icmp eq i64 %indvars.iv.next207, %wide.trip.count208 br i1 %exitcond209.not, label %for.cond20.for.cond.cleanup23_crit_edge.us, label %for.body24.us165, !llvm.loop !25 for.cond20.for.cond.cleanup23_crit_edge.us.loopexit: ; preds = %if.end.us.us, %if.end.us.us.peel %pos.2.us.us.lcssa = phi i32 [ %pos.2.us.us.peel, %if.end.us.us.peel ], [ %pos.2.us.us, %if.end.us.us ] %xor112.us.us.lcssa = phi i8 [ %xor112.us.us.peel, %if.end.us.us.peel ], [ %xor112.us.us, %if.end.us.us ] %j19.0151.us.us.lcssa.wide = phi i64 [ 0, %if.end.us.us.peel ], [ %indvars.iv211, %if.end.us.us ] %32 = trunc i64 %j19.0151.us.us.lcssa.wide to i32 br label %for.cond20.for.cond.cleanup23_crit_edge.us for.cond20.for.cond.cleanup23_crit_edge.us: ; preds = %if.end.us182, %if.end.us182.peel, %for.cond20.for.cond.cleanup23_crit_edge.us.loopexit %.us-phi.us = phi i8 [ %xor112.us.us.lcssa, %for.cond20.for.cond.cleanup23_crit_edge.us.loopexit ], [ %xor112.us186.peel, %if.end.us182.peel ], [ %xor112.us186, %if.end.us182 ] %.us-phi155.us = phi i32 [ %pos.2.us.us.lcssa, %for.cond20.for.cond.cleanup23_crit_edge.us.loopexit ], [ %pos.2.us183.peel, %if.end.us182.peel ], [ %pos.2.us183, %if.end.us182 ] %.us-phi156.us = phi i32 [ %32, %for.cond20.for.cond.cleanup23_crit_edge.us.loopexit ], [ 0, %if.end.us182.peel ], [ 0, %if.end.us182 ] %exitcond220.not = icmp eq i64 %indvars.iv.next218, %wide.trip.count219 br i1 %exitcond220.not, label %for.cond.cleanup17, label %for.cond20.preheader.us, !llvm.loop !27 for.body24.us.us: ; preds = %for.body24.us.us.peel.next, %if.end.us.us %indvars.iv211 = phi i64 [ 1, %for.body24.us.us.peel.next ], [ %indvars.iv.next212.pre-phi, %if.end.us.us ] %old.sroa.4.1149.us.us = phi i32 [ 0, %for.body24.us.us.peel.next ], [ %37, %if.end.us.us ] %pos.1148.us.us = phi i32 [ %pos.2.us.us.peel, %for.body24.us.us.peel.next ], [ %pos.2.us.us, %if.end.us.us ] %haveCoin.1147.us.us = phi i8 [ %xor112.us.us.peel, %for.body24.us.us.peel.next ], [ %xor112.us.us, %if.end.us.us ] %tobool.not.us.us = icmp eq i8 %haveCoin.1147.us.us, 0 br i1 %tobool.not.us.us, label %for.body24.us.us.if.end.us.us_crit_edge, label %if.then.us.us for.body24.us.us.if.end.us.us_crit_edge: ; preds = %for.body24.us.us %.pre234 = add nuw nsw i64 %indvars.iv211, 1 br label %if.end.us.us if.then.us.us: ; preds = %for.body24.us.us %idxprom30.us.us = sext i32 %pos.1148.us.us to i64 %arrayidx31.us.us = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us store i32 %26, ptr %arrayidx31.us.us, align 16, !tbaa !20 %add33.us.us = add nuw nsw i32 %old.sroa.4.1149.us.us, 1 %fx.us.us = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us, i32 1 store i32 %add33.us.us, ptr %fx.us.us, align 4, !tbaa !22 %ty.us.us = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us, i32 2 store i32 %26, ptr %ty.us.us, align 8, !tbaa !23 %33 = add nuw nsw i64 %indvars.iv211, 1 %tx.us.us = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %idxprom30.us.us, i32 3 %34 = trunc i64 %33 to i32 store i32 %34, ptr %tx.us.us, align 4, !tbaa !24 %inc44.us.us = add nsw i32 %pos.1148.us.us, 1 br label %if.end.us.us if.end.us.us: ; preds = %for.body24.us.us.if.end.us.us_crit_edge, %if.then.us.us %indvars.iv.next212.pre-phi = phi i64 [ %.pre234, %for.body24.us.us.if.end.us.us_crit_edge ], [ %33, %if.then.us.us ] %pos.2.us.us = phi i32 [ %pos.1148.us.us, %for.body24.us.us.if.end.us.us_crit_edge ], [ %inc44.us.us, %if.then.us.us ] %arrayidx50.us.us = getelementptr inbounds [512 x [512 x i8]], ptr @a, i64 0, i64 %indvars.iv217, i64 %indvars.iv211 %35 = load i8, ptr %arrayidx50.us.us, align 1, !tbaa !16 %36 = and i8 %35, 1 %xor112.us.us = xor i8 %36, %haveCoin.1147.us.us %37 = trunc i64 %indvars.iv211 to i32 %exitcond215.not = icmp eq i64 %indvars.iv.next212.pre-phi, %wide.trip.count214 br i1 %exitcond215.not, label %for.cond20.for.cond.cleanup23_crit_edge.us.loopexit, label %for.body24.us.us, !llvm.loop !28 for.cond.cleanup17.thread: ; preds = %for.cond14.preheader, %for.cond.preheader %call60238 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0) br label %for.cond.cleanup65 for.cond.cleanup17: ; preds = %for.cond20.for.cond.cleanup23_crit_edge.us %call60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.us-phi155.us) %cmp63195 = icmp sgt i32 %.us-phi155.us, 0 br i1 %cmp63195, label %for.body66.preheader, label %for.cond.cleanup65 for.body66.preheader: ; preds = %for.cond.cleanup17 %wide.trip.count224 = zext i32 %.us-phi155.us to i64 br label %for.body66 for.cond.cleanup65: ; preds = %for.body66, %for.cond.cleanup17.thread, %for.cond.cleanup17 ret i32 0 for.body66: ; preds = %for.body66.preheader, %for.body66 %indvars.iv221 = phi i64 [ 0, %for.body66.preheader ], [ %indvars.iv.next222, %for.body66 ] %arrayidx68 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %indvars.iv221 %38 = load i32, ptr %arrayidx68, align 16, !tbaa !20 %fx72 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %indvars.iv221, i32 1 %39 = load i32, ptr %fx72, align 4, !tbaa !22 %ty75 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %indvars.iv221, i32 2 %40 = load i32, ptr %ty75, align 8, !tbaa !23 %tx78 = getelementptr inbounds [262144 x %struct.move_t], ptr @out, i64 0, i64 %indvars.iv221, i32 3 %41 = load i32, ptr %tx78, align 4, !tbaa !24 %call79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %38, i32 noundef %39, i32 noundef %40, i32 noundef %41) %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1 %exitcond225.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count224 br i1 %exitcond225.not, label %for.cond.cleanup65, label %for.body66, !llvm.loop !29 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 declare i32 @__uflow(ptr noundef) local_unnamed_addr #2 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 = { nofree nounwind "no-trapping-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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 16} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = distinct !{!19, !18} !20 = !{!21, !11, i64 0} !21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12} !22 = !{!21, !11, i64 4} !23 = !{!21, !11, i64 8} !24 = !{!21, !11, i64 12} !25 = distinct !{!25, !18, !26} !26 = !{!"llvm.loop.peeled.count", i32 1} !27 = distinct !{!27, !18} !28 = distinct !{!28, !18, !26} !29 = distinct !{!29, !18}
#include<stdio.h> #include<math.h> #include<string.h> int main() { int n,k,i,c; scanf("%d%d",&n,&k); int a[n]; for ( i = 0; i < n; i++ ) { a[i] = 0; } c = n; for ( i = 0; i < n; i++ ) { if ( k == 0 ) break; a[i] = c; c--; k--; } c = 1; for ( i = 0; i < n; i++ ) { if ( a[i] == 0 ) { a[i] = c; c++; } } for ( i = 0; i < n; i++ ) { printf("%d ",a[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2003/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2003/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp50 = icmp sgt i32 %3, 0 br i1 %cmp50, label %for.cond1.preheader, label %for.end33 for.cond1.preheader: ; preds = %entry %4 = zext i32 %3 to i64 %5 = shl nuw nsw i64 %4, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %5, i1 false), !tbaa !5 %k.promoted = load i32, ptr %k, align 4 %cmp453 = icmp eq i32 %k.promoted, 0 br i1 %cmp453, label %for.body13.preheader, label %if.end.preheader if.end.preheader: ; preds = %for.cond1.preheader %6 = zext i32 %3 to i64 %7 = add nsw i64 %6, -1 %8 = add i32 %k.promoted, -1 %9 = zext i32 %8 to i64 %umin = call i64 @llvm.umin.i64(i64 %7, i64 %9) %10 = add nuw nsw i64 %umin, 1 %min.iters.check = icmp ult i64 %umin, 7 br i1 %min.iters.check, label %if.end.preheader81, label %vector.ph vector.ph: ; preds = %if.end.preheader %n.vec = and i64 %10, 8589934584 %.cast = trunc i64 %n.vec to i32 %ind.end = sub i32 %3, %.cast %.cast76 = trunc i64 %n.vec to i32 %ind.end77 = sub i32 %k.promoted, %.cast76 %.splatinsert = insertelement <4 x i32> poison, i32 %3, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 -1, i32 -2, i32 -3> br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 -4, i32 -4, i32 -4, i32 -4> %11 = getelementptr inbounds i32, ptr %vla, i64 %index store <4 x i32> %vec.ind, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 store <4 x i32> %step.add, ptr %12, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 -8, i32 -8, i32 -8, i32 -8> %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %10, %n.vec br i1 %cmp.n, label %for.cond11.preheader, label %if.end.preheader81 if.end.preheader81: ; preds = %if.end.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %if.end.preheader ], [ %n.vec, %middle.block ] %c.055.ph = phi i32 [ %3, %if.end.preheader ], [ %ind.end, %middle.block ] %.ph = phi i32 [ %k.promoted, %if.end.preheader ], [ %ind.end77, %middle.block ] br label %if.end for.cond11.preheader: ; preds = %if.end, %middle.block %dec7.lcssa = phi i32 [ %ind.end77, %middle.block ], [ %dec7, %if.end ] store i32 %dec7.lcssa, ptr %k, align 4, !tbaa !5 br i1 %cmp50, label %for.body13.preheader, label %for.end33 for.body13.preheader: ; preds = %for.cond1.preheader, %for.cond11.preheader %wide.trip.count = zext i32 %3 to i64 %xtraiter = and i64 %wide.trip.count, 1 %14 = icmp eq i32 %3, 1 br i1 %14, label %for.cond25.preheader.unr-lcssa, label %for.body13.preheader.new for.body13.preheader.new: ; preds = %for.body13.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body13 if.end: ; preds = %if.end.preheader81, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ %indvars.iv.ph, %if.end.preheader81 ] %c.055 = phi i32 [ %dec, %if.end ], [ %c.055.ph, %if.end.preheader81 ] %15 = phi i32 [ %dec7, %if.end ], [ %.ph, %if.end.preheader81 ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv store i32 %c.055, ptr %arrayidx6, align 4, !tbaa !5 %dec = add nsw i32 %c.055, -1 %dec7 = add nsw i32 %15, -1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp2 = icmp uge i64 %indvars.iv.next, %6 %cmp4 = icmp eq i32 %dec7, 0 %or.cond = select i1 %cmp2, i1 true, i1 %cmp4 br i1 %or.cond, label %for.cond11.preheader, label %if.end, !llvm.loop !13 for.cond25.preheader.unr-lcssa: ; preds = %for.inc22.1, %for.body13.preheader %indvars.iv64.unr = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next65.1, %for.inc22.1 ] %c.158.unr = phi i32 [ 1, %for.body13.preheader ], [ %c.2.1, %for.inc22.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond25.preheader, label %for.body13.epil for.body13.epil: ; preds = %for.cond25.preheader.unr-lcssa %arrayidx15.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv64.unr %16 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5 %cmp16.epil = icmp eq i32 %16, 0 %spec.store.select = select i1 %cmp16.epil, i32 %c.158.unr, i32 %16 store i32 %spec.store.select, ptr %arrayidx15.epil, align 4 br label %for.cond25.preheader for.cond25.preheader: ; preds = %for.cond25.preheader.unr-lcssa, %for.body13.epil br i1 %cmp50, label %for.body27, label %for.end33 for.body13: ; preds = %for.inc22.1, %for.body13.preheader.new %indvars.iv64 = phi i64 [ 0, %for.body13.preheader.new ], [ %indvars.iv.next65.1, %for.inc22.1 ] %c.158 = phi i32 [ 1, %for.body13.preheader.new ], [ %c.2.1, %for.inc22.1 ] %niter = phi i64 [ 0, %for.body13.preheader.new ], [ %niter.next.1, %for.inc22.1 ] %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv64 %17 = load i32, ptr %arrayidx15, align 8, !tbaa !5 %cmp16 = icmp eq i32 %17, 0 br i1 %cmp16, label %if.then17, label %for.inc22 if.then17: ; preds = %for.body13 store i32 %c.158, ptr %arrayidx15, align 8, !tbaa !5 %inc20 = add nsw i32 %c.158, 1 br label %for.inc22 for.inc22: ; preds = %for.body13, %if.then17 %c.2 = phi i32 [ %inc20, %if.then17 ], [ %c.158, %for.body13 ] %indvars.iv.next65 = or i64 %indvars.iv64, 1 %arrayidx15.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next65 %18 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5 %cmp16.1 = icmp eq i32 %18, 0 br i1 %cmp16.1, label %if.then17.1, label %for.inc22.1 if.then17.1: ; preds = %for.inc22 store i32 %c.2, ptr %arrayidx15.1, align 4, !tbaa !5 %inc20.1 = add nsw i32 %c.2, 1 br label %for.inc22.1 for.inc22.1: ; preds = %if.then17.1, %for.inc22 %c.2.1 = phi i32 [ %inc20.1, %if.then17.1 ], [ %c.2, %for.inc22 ] %indvars.iv.next65.1 = add nuw nsw i64 %indvars.iv64, 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.cond25.preheader.unr-lcssa, label %for.body13, !llvm.loop !14 for.body27: ; preds = %for.cond25.preheader, %for.body27 %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body27 ], [ 0, %for.cond25.preheader ] %arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv67 %19 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19) %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %20 = load i32, ptr %n, align 4, !tbaa !5 %21 = sext i32 %20 to i64 %cmp26 = icmp slt i64 %indvars.iv.next68, %21 br i1 %cmp26, label %for.body27, label %for.end33, !llvm.loop !15 for.end33: ; preds = %for.body27, %entry, %for.cond11.preheader, %for.cond25.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> #include<stdlib.h> int asc(const void* a, const void* b) { return *(int*)a - *(int*)b; } int main() { int n; scanf("%d", &n); int i; int a[100005]; for (i = 0; i < n; i++) scanf("%d", &a[i]); qsort(a, n, sizeof(int), asc); int k = 1; int b[3]; b[0] = a[0]; for (i = 1; i < n; i++) { if (a[i] != a[i - 1]) { if (k < 3) { b[k] = a[i]; k++; } else { printf("No\n"); return 0; } } } int count[3]; if (k == 1) { if (a[0] == 0) printf("Yes\n"); else printf("No\n"); } else if (k == 2) { count[0] = count[1] = 0; for (i = 0; i < n; i++) { if (a[i] == b[0]) count[0]++; else count[1]++; } if (a[0] == 0) { if (count[0] * 2 == count[1]) printf("Yes\n"); else printf("No\n"); } else printf("No\n"); } else { count[0] = count[1] = count[2] = 0; for (i = 0; i < n; i++) { if (a[i] == b[0]) count[0]++; else if (a[i] == b[1]) count[1]++; else count[2]++; } if (count[0] == count[1] && count[1] == count[2]) { if ((b[0] ^ b[1] ^ b[2]) == 0) printf("Yes\n"); else printf("No\n"); } else printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200342/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200342/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.9 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.10 = 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 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %a = alloca [100005 x i32], align 16 %b = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %a) #7 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp180 = icmp sgt i32 %0, 0 br i1 %cmp180, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ] call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @asc) #7 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %b) #7 %3 = load i32, ptr %a, align 16, !tbaa !5 store i32 %3, ptr %b, align 4, !tbaa !5 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp5182 = icmp sgt i32 %4, 1 br i1 %cmp5182, label %for.body7.preheader, label %if.then29 for.body7.preheader: ; preds = %for.end %wide.trip.count = zext i32 %4 to i64 br label %for.body7 for.body7: ; preds = %for.body7.preheader, %for.inc24 %5 = phi i32 [ %3, %for.body7.preheader ], [ %6, %for.inc24 ] %indvars.iv202 = phi i64 [ 1, %for.body7.preheader ], [ %indvars.iv.next203, %for.inc24 ] %k.0184 = phi i32 [ 1, %for.body7.preheader ], [ %k.1, %for.inc24 ] %arrayidx9 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv202 %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp12.not = icmp eq i32 %6, %5 br i1 %cmp12.not, label %for.inc24, label %if.then if.then: ; preds = %for.body7 %cmp14 = icmp slt i32 %k.0184, 3 br i1 %cmp14, label %if.then16, label %cleanup if.then16: ; preds = %if.then %idxprom19 = sext i32 %k.0184 to i64 %arrayidx20 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 %idxprom19 store i32 %6, ptr %arrayidx20, align 4, !tbaa !5 %inc21 = add nsw i32 %k.0184, 1 br label %for.inc24 for.inc24: ; preds = %for.body7, %if.then16 %k.1 = phi i32 [ %inc21, %if.then16 ], [ %k.0184, %for.body7 ] %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1 %exitcond.not = icmp eq i64 %indvars.iv.next203, %wide.trip.count br i1 %exitcond.not, label %for.end26, label %for.body7, !llvm.loop !11 for.end26: ; preds = %for.inc24 switch i32 %k.1, label %for.cond83.preheader [ i32 1, label %if.then29 i32 2, label %for.cond44.preheader ] for.cond44.preheader: ; preds = %for.end26 %cmp45187 = icmp sgt i32 %4, 0 br i1 %cmp45187, label %for.body47.lr.ph, label %for.end62.thread for.body47.lr.ph: ; preds = %for.cond44.preheader %7 = load i32, ptr %b, align 4, !tbaa !5 %wide.trip.count209 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body47.preheader, label %vector.ph vector.ph: ; preds = %for.body47.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %7, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ] %vec.phi225 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ] %vec.phi226 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %vec.phi227 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %8 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load228 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = icmp ne <4 x i32> %wide.load, %broadcast.splat %11 = icmp ne <4 x i32> %wide.load228, %broadcast.splat %12 = zext <4 x i1> %10 to <4 x i32> %13 = zext <4 x i1> %11 to <4 x i32> %14 = add <4 x i32> %vec.phi226, %12 %15 = add <4 x i32> %vec.phi227, %13 %16 = xor <4 x i1> %10, <i1 true, i1 true, i1 true, i1 true> %17 = xor <4 x i1> %11, <i1 true, i1 true, i1 true, i1 true> %18 = zext <4 x i1> %16 to <4 x i32> %19 = zext <4 x i1> %17 to <4 x i32> %20 = add <4 x i32> %vec.phi, %18 %21 = add <4 x i32> %vec.phi225, %19 %index.next = add nuw i64 %index, 8 %22 = icmp eq i64 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx229 = add <4 x i32> %15, %14 %23 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx229) %bin.rdx = add <4 x i32> %21, %20 %24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end62, label %for.body47.preheader for.body47.preheader: ; preds = %for.body47.lr.ph, %middle.block %indvars.iv206.ph = phi i64 [ 0, %for.body47.lr.ph ], [ %n.vec, %middle.block ] %count.sroa.0.0190.ph = phi i32 [ 0, %for.body47.lr.ph ], [ %24, %middle.block ] %count.sroa.10.0189.ph = phi i32 [ 0, %for.body47.lr.ph ], [ %23, %middle.block ] br label %for.body47 for.cond83.preheader: ; preds = %for.end26 %cmp84193 = icmp sgt i32 %4, 0 br i1 %cmp84193, label %for.body86.lr.ph, label %for.end111 for.body86.lr.ph: ; preds = %for.cond83.preheader %25 = load i32, ptr %b, align 4, !tbaa !5 %arrayidx98 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 1 %26 = load i32, ptr %arrayidx98, align 4 %xtraiter = and i64 %wide.trip.count, 1 %27 = icmp eq i32 %4, 1 br i1 %27, label %for.end111.loopexit.unr-lcssa, label %for.body86.lr.ph.new for.body86.lr.ph.new: ; preds = %for.body86.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body86 if.then29: ; preds = %for.end, %for.end26 %cmp31 = icmp eq i32 %3, 0 %str.9.str.8 = select i1 %cmp31, ptr @str.9, ptr @str.10 br label %cleanup for.body47: ; preds = %for.body47.preheader, %for.body47 %indvars.iv206 = phi i64 [ %indvars.iv.next207, %for.body47 ], [ %indvars.iv206.ph, %for.body47.preheader ] %count.sroa.0.0190 = phi i32 [ %count.sroa.0.1, %for.body47 ], [ %count.sroa.0.0190.ph, %for.body47.preheader ] %count.sroa.10.0189 = phi i32 [ %count.sroa.10.1, %for.body47 ], [ %count.sroa.10.0189.ph, %for.body47.preheader ] %arrayidx49 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv206 %28 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %cmp51 = icmp ne i32 %28, %7 %inc58 = zext i1 %cmp51 to i32 %count.sroa.10.1 = add nuw nsw i32 %count.sroa.10.0189, %inc58 %not.cmp51 = xor i1 %cmp51, true %inc55 = zext i1 %not.cmp51 to i32 %count.sroa.0.1 = add nuw nsw i32 %count.sroa.0.0190, %inc55 %indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1 %exitcond210.not = icmp eq i64 %indvars.iv.next207, %wide.trip.count209 br i1 %exitcond210.not, label %for.end62, label %for.body47, !llvm.loop !15 for.end62: ; preds = %for.body47, %middle.block %count.sroa.10.1.lcssa = phi i32 [ %23, %middle.block ], [ %count.sroa.10.1, %for.body47 ] %count.sroa.0.1.lcssa = phi i32 [ %24, %middle.block ], [ %count.sroa.0.1, %for.body47 ] %cmp64 = icmp eq i32 %3, 0 br i1 %cmp64, label %if.then66, label %if.else76 for.end62.thread: ; preds = %for.cond44.preheader %cmp64219 = icmp eq i32 %3, 0 br i1 %cmp64219, label %cleanup, label %if.else76 if.then66: ; preds = %for.end62 %29 = shl nuw nsw i32 %count.sroa.0.1.lcssa, 1 %cmp69 = icmp eq i32 %29, %count.sroa.10.1.lcssa %spec.select = select i1 %cmp69, ptr @str.9, ptr @str.10 br label %cleanup if.else76: ; preds = %for.end62.thread, %for.end62 br label %cleanup for.body86: ; preds = %for.inc109.1, %for.body86.lr.ph.new %indvars.iv211 = phi i64 [ 0, %for.body86.lr.ph.new ], [ %indvars.iv.next212.1, %for.inc109.1 ] %count.sroa.0.2197 = phi i32 [ 0, %for.body86.lr.ph.new ], [ %count.sroa.0.3.1, %for.inc109.1 ] %count.sroa.10.2196 = phi i32 [ 0, %for.body86.lr.ph.new ], [ %count.sroa.10.3.1, %for.inc109.1 ] %count.sroa.19.0195 = phi i32 [ 0, %for.body86.lr.ph.new ], [ %count.sroa.19.1.1, %for.inc109.1 ] %niter = phi i64 [ 0, %for.body86.lr.ph.new ], [ %niter.next.1, %for.inc109.1 ] %arrayidx88 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv211 %30 = load i32, ptr %arrayidx88, align 8, !tbaa !5 %cmp90 = icmp eq i32 %30, %25 br i1 %cmp90, label %if.then92, label %if.else95 if.then92: ; preds = %for.body86 %inc94 = add nsw i32 %count.sroa.0.2197, 1 br label %for.inc109 if.else95: ; preds = %for.body86 %cmp99 = icmp eq i32 %30, %26 br i1 %cmp99, label %if.then101, label %if.else104 if.then101: ; preds = %if.else95 %inc103 = add nsw i32 %count.sroa.10.2196, 1 br label %for.inc109 if.else104: ; preds = %if.else95 %inc106 = add nsw i32 %count.sroa.19.0195, 1 br label %for.inc109 for.inc109: ; preds = %if.then92, %if.else104, %if.then101 %count.sroa.19.1 = phi i32 [ %count.sroa.19.0195, %if.then92 ], [ %count.sroa.19.0195, %if.then101 ], [ %inc106, %if.else104 ] %count.sroa.10.3 = phi i32 [ %count.sroa.10.2196, %if.then92 ], [ %inc103, %if.then101 ], [ %count.sroa.10.2196, %if.else104 ] %count.sroa.0.3 = phi i32 [ %inc94, %if.then92 ], [ %count.sroa.0.2197, %if.then101 ], [ %count.sroa.0.2197, %if.else104 ] %indvars.iv.next212 = or i64 %indvars.iv211, 1 %arrayidx88.1 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv.next212 %31 = load i32, ptr %arrayidx88.1, align 4, !tbaa !5 %cmp90.1 = icmp eq i32 %31, %25 br i1 %cmp90.1, label %if.then92.1, label %if.else95.1 if.else95.1: ; preds = %for.inc109 %cmp99.1 = icmp eq i32 %31, %26 br i1 %cmp99.1, label %if.then101.1, label %if.else104.1 if.else104.1: ; preds = %if.else95.1 %inc106.1 = add nsw i32 %count.sroa.19.1, 1 br label %for.inc109.1 if.then101.1: ; preds = %if.else95.1 %inc103.1 = add nsw i32 %count.sroa.10.3, 1 br label %for.inc109.1 if.then92.1: ; preds = %for.inc109 %inc94.1 = add nsw i32 %count.sroa.0.3, 1 br label %for.inc109.1 for.inc109.1: ; preds = %if.then92.1, %if.then101.1, %if.else104.1 %count.sroa.19.1.1 = phi i32 [ %count.sroa.19.1, %if.then92.1 ], [ %count.sroa.19.1, %if.then101.1 ], [ %inc106.1, %if.else104.1 ] %count.sroa.10.3.1 = phi i32 [ %count.sroa.10.3, %if.then92.1 ], [ %inc103.1, %if.then101.1 ], [ %count.sroa.10.3, %if.else104.1 ] %count.sroa.0.3.1 = phi i32 [ %inc94.1, %if.then92.1 ], [ %count.sroa.0.3, %if.then101.1 ], [ %count.sroa.0.3, %if.else104.1 ] %indvars.iv.next212.1 = add nuw nsw i64 %indvars.iv211, 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.end111.loopexit.unr-lcssa, label %for.body86, !llvm.loop !16 for.end111.loopexit.unr-lcssa: ; preds = %for.inc109.1, %for.body86.lr.ph %count.sroa.19.1.lcssa.ph = phi i32 [ undef, %for.body86.lr.ph ], [ %count.sroa.19.1.1, %for.inc109.1 ] %count.sroa.10.3.lcssa.ph = phi i32 [ undef, %for.body86.lr.ph ], [ %count.sroa.10.3.1, %for.inc109.1 ] %count.sroa.0.3.lcssa.ph = phi i32 [ undef, %for.body86.lr.ph ], [ %count.sroa.0.3.1, %for.inc109.1 ] %indvars.iv211.unr = phi i64 [ 0, %for.body86.lr.ph ], [ %indvars.iv.next212.1, %for.inc109.1 ] %count.sroa.0.2197.unr = phi i32 [ 0, %for.body86.lr.ph ], [ %count.sroa.0.3.1, %for.inc109.1 ] %count.sroa.10.2196.unr = phi i32 [ 0, %for.body86.lr.ph ], [ %count.sroa.10.3.1, %for.inc109.1 ] %count.sroa.19.0195.unr = phi i32 [ 0, %for.body86.lr.ph ], [ %count.sroa.19.1.1, %for.inc109.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end111, label %for.body86.epil for.body86.epil: ; preds = %for.end111.loopexit.unr-lcssa %arrayidx88.epil = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv211.unr %32 = load i32, ptr %arrayidx88.epil, align 4, !tbaa !5 %cmp90.epil = icmp eq i32 %32, %25 br i1 %cmp90.epil, label %if.then92.epil, label %if.else95.epil if.else95.epil: ; preds = %for.body86.epil %cmp99.epil = icmp eq i32 %32, %26 br i1 %cmp99.epil, label %if.then101.epil, label %if.else104.epil if.else104.epil: ; preds = %if.else95.epil %inc106.epil = add nsw i32 %count.sroa.19.0195.unr, 1 br label %for.end111 if.then101.epil: ; preds = %if.else95.epil %inc103.epil = add nsw i32 %count.sroa.10.2196.unr, 1 br label %for.end111 if.then92.epil: ; preds = %for.body86.epil %inc94.epil = add nsw i32 %count.sroa.0.2197.unr, 1 br label %for.end111 for.end111: ; preds = %for.end111.loopexit.unr-lcssa, %if.then92.epil, %if.then101.epil, %if.else104.epil, %for.cond83.preheader %count.sroa.19.0.lcssa = phi i32 [ 0, %for.cond83.preheader ], [ %count.sroa.19.1.lcssa.ph, %for.end111.loopexit.unr-lcssa ], [ %count.sroa.19.0195.unr, %if.then92.epil ], [ %count.sroa.19.0195.unr, %if.then101.epil ], [ %inc106.epil, %if.else104.epil ] %count.sroa.10.2.lcssa = phi i32 [ 0, %for.cond83.preheader ], [ %count.sroa.10.3.lcssa.ph, %for.end111.loopexit.unr-lcssa ], [ %count.sroa.10.2196.unr, %if.then92.epil ], [ %inc103.epil, %if.then101.epil ], [ %count.sroa.10.2196.unr, %if.else104.epil ] %count.sroa.0.2.lcssa = phi i32 [ 0, %for.cond83.preheader ], [ %count.sroa.0.3.lcssa.ph, %for.end111.loopexit.unr-lcssa ], [ %inc94.epil, %if.then92.epil ], [ %count.sroa.0.2197.unr, %if.then101.epil ], [ %count.sroa.0.2197.unr, %if.else104.epil ] %cmp114 = icmp eq i32 %count.sroa.0.2.lcssa, %count.sroa.10.2.lcssa %cmp118 = icmp eq i32 %count.sroa.10.2.lcssa, %count.sroa.19.0.lcssa %or.cond = select i1 %cmp114, i1 %cmp118, i1 false br i1 %or.cond, label %if.then120, label %cleanup if.then120: ; preds = %for.end111 %33 = load i32, ptr %b, align 4, !tbaa !5 %arrayidx122 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 1 %34 = load i32, ptr %arrayidx122, align 4, !tbaa !5 %xor = xor i32 %34, %33 %arrayidx123 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 2 %35 = load i32, ptr %arrayidx123, align 4, !tbaa !5 %cmp125 = icmp eq i32 %xor, %35 %str.4.str.3 = select i1 %cmp125, ptr @str.9, ptr @str.10 br label %cleanup cleanup: ; preds = %if.then, %if.then66, %for.end111, %if.then120, %for.end62.thread, %if.then29, %if.else76 %str.8.sink = phi ptr [ @str.10, %if.else76 ], [ %str.9.str.8, %if.then29 ], [ @str.9, %for.end62.thread ], [ %str.4.str.3, %if.then120 ], [ @str.10, %for.end111 ], [ %spec.select, %if.then66 ], [ @str.10, %if.then ] %puts174 = call i32 @puts(ptr nonnull dereferenceable(1) %str.8.sink) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10}
#include<stdio.h> int main() { int n,x,p,ans=0; int i; scanf("%d%d",&p,&n); int h[p+1]; for(i=0;i<=p;i++) h[i] = 0; for(i=0;i<n;i++) { scanf("%d",&x); h[x%p]++; if(h[x%p] >1 ) break; } if(i == n) printf("-1"); else printf("%d",i+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20040/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20040/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 %p = 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 %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %n) %0 = load i32, ptr %p, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %p, align 4, !tbaa !5 %cmp.not27 = icmp slt i32 %3, 0 br i1 %cmp.not27, label %for.cond1.preheader, label %for.body.preheader for.body.preheader: ; preds = %entry %4 = add nuw i32 %3, 1 %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %6, i1 false), !tbaa !5 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.body.preheader, %entry %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp229 = icmp sgt i32 %7, 0 br i1 %cmp229, label %for.body3, label %for.end14 for.body3: ; preds = %for.cond1.preheader, %for.inc12 %i.130 = phi i32 [ %inc13, %for.inc12 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %8 = load i32, ptr %x, align 4, !tbaa !5 %9 = load i32, ptr %p, align 4, !tbaa !5 %rem = srem i32 %8, %9 %idxprom5 = sext i32 %rem to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5 %10 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %inc7 = add nsw i32 %10, 1 store i32 %inc7, ptr %arrayidx6, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %10, 0 %.pre.pre = load i32, ptr %n, align 4, !tbaa !5 br i1 %cmp11, label %for.end14, label %for.inc12 for.inc12: ; preds = %for.body3 %inc13 = add nuw nsw i32 %i.130, 1 %cmp2 = icmp slt i32 %inc13, %.pre.pre br i1 %cmp2, label %for.body3, label %for.end14, !llvm.loop !9 for.end14: ; preds = %for.inc12, %for.body3, %for.cond1.preheader %11 = phi i32 [ %7, %for.cond1.preheader ], [ %.pre.pre, %for.body3 ], [ %.pre.pre, %for.inc12 ] %i.1.lcssa = phi i32 [ 0, %for.cond1.preheader ], [ %inc13, %for.inc12 ], [ %i.130, %for.body3 ] %cmp15 = icmp eq i32 %i.1.lcssa, %11 br i1 %cmp15, label %if.then16, label %if.else if.then16: ; preds = %for.end14 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end20 if.else: ; preds = %for.end14 %add18 = add nuw nsw i32 %i.1.lcssa, 1 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add18) br label %if.end20 if.end20: ; preds = %if.else, %if.then16 call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define min(p,q)((p)<(q)?(p):(q)) int main(){ int a,b,c,d,e,f; scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f); printf("%.9f\n",1.0*min(b-d+f+f,4*f)/min(a-c+e+e,4*e)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200443/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200443/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%.9f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = alloca i32, align 4 %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %f) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %d, align 4, !tbaa !5 %sub = sub i32 %0, %1 %2 = load i32, ptr %f, align 4, !tbaa !5 %reass.add = shl i32 %2, 1 %add1 = add i32 %sub, %reass.add %mul = shl nsw i32 %2, 2 %add1.mul = call i32 @llvm.smin.i32(i32 %add1, i32 %mul) %3 = load i32, ptr %a, align 4, !tbaa !5 %4 = load i32, ptr %c, align 4, !tbaa !5 %sub7 = sub i32 %3, %4 %5 = load i32, ptr %e, align 4, !tbaa !5 %reass.add23 = shl i32 %5, 1 %add9 = add i32 %sub7, %reass.add23 %mul10 = shl nsw i32 %5, 2 %cond20 = call i32 @llvm.smin.i32(i32 %add9, i32 %mul10) %conv = sitofp i32 %add1.mul to double %conv21 = sitofp i32 %cond20 to double %div = fdiv double %conv, %conv21 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #define PI 3.14159265 int main() { double a,b,x; scanf("%lf %lf %lf",&a,&b,&x); getchar(); int volume = a*a*b; if(volume==x){ printf("%.10f\n",0); }else{ if(2*x>=a*a*b){ double m = a; double n = 2*(b-x/(a*a)); double angle = atan2(n,m)* 180 / PI; printf("%.10lf\n",angle); } else{ double m = b; double n = 2*x/(a*b); double angle = atan2(m,n)* 180 / PI; printf("%.10lf\n",angle); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200487/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200487/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1 @.str.2 = private unnamed_addr constant [8 x i8] c"%.10lf\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: %a = alloca double, align 8 %b = alloca double, align 8 %x = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call i32 @getc(ptr noundef %0) %1 = load double, ptr %a, align 8, !tbaa !9 %mul = fmul double %1, %1 %2 = load double, ptr %b, align 8, !tbaa !9 %mul2 = fmul double %mul, %2 %conv = fptosi double %mul2 to i32 %conv3 = sitofp i32 %conv to double %3 = load double, ptr %x, align 8, !tbaa !9 %cmp = fcmp oeq double %3, %conv3 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0) br label %if.end29 if.else: ; preds = %entry %mul6 = fmul double %3, 2.000000e+00 %cmp9 = fcmp ult double %mul6, %mul2 br i1 %cmp9, label %if.else18, label %if.then11 if.then11: ; preds = %if.else %div = fdiv double %3, %mul %sub = fsub double %2, %div %mul13 = fmul double %sub, 2.000000e+00 %call14 = call double @atan2(double noundef %mul13, double noundef %1) #4 %mul15 = fmul double %call14, 1.800000e+02 %div16 = fdiv double %mul15, 0x400921FB53C8D4F1 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div16) br label %if.end29 if.else18: ; preds = %if.else %mul22 = fmul double %1, %2 %div23 = fdiv double %mul6, %mul22 %call25 = call double @atan2(double noundef %2, double noundef %div23) #4 %mul26 = fmul double %call25, 1.800000e+02 %div27 = fdiv double %mul26, 0x400921FB53C8D4F1 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div27) br label %if.end29 if.end29: ; preds = %if.then11, %if.else18, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @atan2(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(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(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"double", !7, i64 0}
#include<stdio.h> #include<string.h> int main() { int len,pow[27],i,k,temp; char str[2000],alpha[27]; unsigned long long int ans=0; scanf("%s%d",str,&k); len=strlen(str); for(i=0;i<='z'-'a';i++) { scanf("%d",&pow[i]); alpha[i]=i+'a'; } for(i=0;i<len;i++) ans+=(i+1)*pow[str[i]-'a']; //printf("%llu\n",ans); temp=0; for(i=1;i<='z'-'a';i++) { //printf("%c ",alpha[i]); if(pow[temp]<pow[i]) temp=i; } for(i=len;i<k+len;i++) { ans+=(i+1)*pow[temp]; //str[i]=alpha[temp]; } printf("%llu",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20053/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20053/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %pow = alloca [27 x i32], align 16 %k = alloca i32, align 4 %str = alloca [2000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %pow) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str, ptr noundef nonnull %k) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %pow) %arrayidx.1 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 1 %call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 2 %call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 3 %call4.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 4 %call4.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 5 %call4.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.5) %arrayidx.6 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 6 %call4.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.6) %arrayidx.7 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 7 %call4.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.7) %arrayidx.8 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 8 %call4.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.8) %arrayidx.9 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 9 %call4.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.9) %arrayidx.10 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 10 %call4.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.10) %arrayidx.11 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 11 %call4.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.11) %arrayidx.12 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 12 %call4.12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.12) %arrayidx.13 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 13 %call4.13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.13) %arrayidx.14 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 14 %call4.14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.14) %arrayidx.15 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 15 %call4.15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.15) %arrayidx.16 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 16 %call4.16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.16) %arrayidx.17 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 17 %call4.17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.17) %arrayidx.18 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 18 %call4.18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.18) %arrayidx.19 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 19 %call4.19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.19) %arrayidx.20 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 20 %call4.20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.20) %arrayidx.21 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 21 %call4.21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.21) %arrayidx.22 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 22 %call4.22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.22) %arrayidx.23 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 23 %call4.23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.23) %arrayidx.24 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 24 %call4.24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.24) %arrayidx.25 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 25 %call4.25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.25) %conv = trunc i64 %call2 to i32 %cmp972 = icmp sgt i32 %conv, 0 br i1 %cmp972, label %for.body11.preheader, label %for.cond23.preheader for.body11.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.cond23.preheader.loopexit.unr-lcssa, label %for.body11.preheader.new for.body11.preheader.new: ; preds = %for.body11.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body11 for.cond23.preheader.loopexit.unr-lcssa: ; preds = %for.body11, %for.body11.preheader %add19.lcssa.ph = phi i64 [ undef, %for.body11.preheader ], [ %add19.1, %for.body11 ] %indvars.iv.unr = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next.1, %for.body11 ] %ans.074.unr = phi i64 [ 0, %for.body11.preheader ], [ %add19.1, %for.body11 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond23.preheader, label %for.body11.epil for.body11.epil: ; preds = %for.cond23.preheader.loopexit.unr-lcssa %arrayidx14.epil = getelementptr inbounds [2000 x i8], ptr %str, i64 0, i64 %indvars.iv.unr %1 = load i8, ptr %arrayidx14.epil, align 1, !tbaa !5 %conv15.epil = sext i8 %1 to i64 %sub.epil = add nsw i64 %conv15.epil, -97 %arrayidx17.epil = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %sub.epil %2 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !8 %3 = trunc i64 %indvars.iv.unr to i32 %4 = add i32 %3, 1 %mul.epil = mul nsw i32 %2, %4 %conv18.epil = sext i32 %mul.epil to i64 %add19.epil = add i64 %ans.074.unr, %conv18.epil br label %for.cond23.preheader for.cond23.preheader: ; preds = %for.body11.epil, %for.cond23.preheader.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %add19.lcssa.ph, %for.cond23.preheader.loopexit.unr-lcssa ], [ %add19.epil, %for.body11.epil ] %5 = load i32, ptr %k, align 4, !tbaa !8 %cmp3877 = icmp sgt i32 %5, 0 br i1 %cmp3877, label %for.body40.lr.ph, label %for.end49 for.body11: ; preds = %for.body11, %for.body11.preheader.new %indvars.iv = phi i64 [ 0, %for.body11.preheader.new ], [ %indvars.iv.next.1, %for.body11 ] %ans.074 = phi i64 [ 0, %for.body11.preheader.new ], [ %add19.1, %for.body11 ] %niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.body11 ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx14 = getelementptr inbounds [2000 x i8], ptr %str, i64 0, i64 %indvars.iv %6 = load i8, ptr %arrayidx14, align 2, !tbaa !5 %conv15 = sext i8 %6 to i64 %sub = add nsw i64 %conv15, -97 %arrayidx17 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %sub %7 = load i32, ptr %arrayidx17, align 4, !tbaa !8 %8 = trunc i64 %indvars.iv.next to i32 %mul = mul nsw i32 %7, %8 %conv18 = sext i32 %mul to i64 %add19 = add i64 %ans.074, %conv18 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx14.1 = getelementptr inbounds [2000 x i8], ptr %str, i64 0, i64 %indvars.iv.next %9 = load i8, ptr %arrayidx14.1, align 1, !tbaa !5 %conv15.1 = sext i8 %9 to i64 %sub.1 = add nsw i64 %conv15.1, -97 %arrayidx17.1 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %sub.1 %10 = load i32, ptr %arrayidx17.1, align 4, !tbaa !8 %11 = trunc i64 %indvars.iv.next.1 to i32 %mul.1 = mul nsw i32 %10, %11 %conv18.1 = sext i32 %mul.1 to i64 %add19.1 = add i64 %add19, %conv18.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.cond23.preheader.loopexit.unr-lcssa, label %for.body11, !llvm.loop !10 for.body40.lr.ph: ; preds = %for.cond23.preheader %add37 = add i32 %5, %conv %12 = load i32, ptr %pow, align 16, !tbaa !8 %13 = load i32, ptr %arrayidx.1, align 4, !tbaa !8 %cmp31 = icmp slt i32 %12, %13 %idxprom27.1 = zext i1 %cmp31 to i64 %arrayidx28.1 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.1 %14 = load i32, ptr %arrayidx28.1, align 4, !tbaa !8 %15 = load i32, ptr %arrayidx.2, align 8, !tbaa !8 %cmp31.1 = icmp slt i32 %14, %15 %spec.select = zext i1 %cmp31 to i32 %spec.select.1 = select i1 %cmp31.1, i32 2, i32 %spec.select %idxprom27.2 = zext i32 %spec.select.1 to i64 %arrayidx28.2 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.2 %16 = load i32, ptr %arrayidx28.2, align 4, !tbaa !8 %17 = load i32, ptr %arrayidx.3, align 4, !tbaa !8 %cmp31.2 = icmp slt i32 %16, %17 %spec.select.2 = select i1 %cmp31.2, i32 3, i32 %spec.select.1 %idxprom27.3 = zext i32 %spec.select.2 to i64 %arrayidx28.3 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.3 %18 = load i32, ptr %arrayidx28.3, align 4, !tbaa !8 %19 = load i32, ptr %arrayidx.4, align 16, !tbaa !8 %cmp31.3 = icmp slt i32 %18, %19 %spec.select.3 = select i1 %cmp31.3, i32 4, i32 %spec.select.2 %idxprom27.4 = zext i32 %spec.select.3 to i64 %arrayidx28.4 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.4 %20 = load i32, ptr %arrayidx28.4, align 4, !tbaa !8 %21 = load i32, ptr %arrayidx.5, align 4, !tbaa !8 %cmp31.4 = icmp slt i32 %20, %21 %spec.select.4 = select i1 %cmp31.4, i32 5, i32 %spec.select.3 %idxprom27.5 = zext i32 %spec.select.4 to i64 %arrayidx28.5 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.5 %22 = load i32, ptr %arrayidx28.5, align 4, !tbaa !8 %23 = load i32, ptr %arrayidx.6, align 8, !tbaa !8 %cmp31.5 = icmp slt i32 %22, %23 %spec.select.5 = select i1 %cmp31.5, i32 6, i32 %spec.select.4 %idxprom27.6 = zext i32 %spec.select.5 to i64 %arrayidx28.6 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.6 %24 = load i32, ptr %arrayidx28.6, align 4, !tbaa !8 %25 = load i32, ptr %arrayidx.7, align 4, !tbaa !8 %cmp31.6 = icmp slt i32 %24, %25 %spec.select.6 = select i1 %cmp31.6, i32 7, i32 %spec.select.5 %idxprom27.7 = zext i32 %spec.select.6 to i64 %arrayidx28.7 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.7 %26 = load i32, ptr %arrayidx28.7, align 4, !tbaa !8 %27 = load i32, ptr %arrayidx.8, align 16, !tbaa !8 %cmp31.7 = icmp slt i32 %26, %27 %spec.select.7 = select i1 %cmp31.7, i32 8, i32 %spec.select.6 %idxprom27.8 = zext i32 %spec.select.7 to i64 %arrayidx28.8 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.8 %28 = load i32, ptr %arrayidx28.8, align 4, !tbaa !8 %29 = load i32, ptr %arrayidx.9, align 4, !tbaa !8 %cmp31.8 = icmp slt i32 %28, %29 %spec.select.8 = select i1 %cmp31.8, i32 9, i32 %spec.select.7 %idxprom27.9 = zext i32 %spec.select.8 to i64 %arrayidx28.9 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.9 %30 = load i32, ptr %arrayidx28.9, align 4, !tbaa !8 %31 = load i32, ptr %arrayidx.10, align 8, !tbaa !8 %cmp31.9 = icmp slt i32 %30, %31 %spec.select.9 = select i1 %cmp31.9, i32 10, i32 %spec.select.8 %idxprom27.10 = zext i32 %spec.select.9 to i64 %arrayidx28.10 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.10 %32 = load i32, ptr %arrayidx28.10, align 4, !tbaa !8 %33 = load i32, ptr %arrayidx.11, align 4, !tbaa !8 %cmp31.10 = icmp slt i32 %32, %33 %spec.select.10 = select i1 %cmp31.10, i32 11, i32 %spec.select.9 %idxprom27.11 = zext i32 %spec.select.10 to i64 %arrayidx28.11 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.11 %34 = load i32, ptr %arrayidx28.11, align 4, !tbaa !8 %35 = load i32, ptr %arrayidx.12, align 16, !tbaa !8 %cmp31.11 = icmp slt i32 %34, %35 %spec.select.11 = select i1 %cmp31.11, i32 12, i32 %spec.select.10 %idxprom27.12 = zext i32 %spec.select.11 to i64 %arrayidx28.12 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.12 %36 = load i32, ptr %arrayidx28.12, align 4, !tbaa !8 %37 = load i32, ptr %arrayidx.13, align 4, !tbaa !8 %cmp31.12 = icmp slt i32 %36, %37 %spec.select.12 = select i1 %cmp31.12, i32 13, i32 %spec.select.11 %idxprom27.13 = zext i32 %spec.select.12 to i64 %arrayidx28.13 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.13 %38 = load i32, ptr %arrayidx28.13, align 4, !tbaa !8 %39 = load i32, ptr %arrayidx.14, align 8, !tbaa !8 %cmp31.13 = icmp slt i32 %38, %39 %spec.select.13 = select i1 %cmp31.13, i32 14, i32 %spec.select.12 %idxprom27.14 = zext i32 %spec.select.13 to i64 %arrayidx28.14 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.14 %40 = load i32, ptr %arrayidx28.14, align 4, !tbaa !8 %41 = load i32, ptr %arrayidx.15, align 4, !tbaa !8 %cmp31.14 = icmp slt i32 %40, %41 %spec.select.14 = select i1 %cmp31.14, i32 15, i32 %spec.select.13 %idxprom27.15 = zext i32 %spec.select.14 to i64 %arrayidx28.15 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.15 %42 = load i32, ptr %arrayidx28.15, align 4, !tbaa !8 %43 = load i32, ptr %arrayidx.16, align 16, !tbaa !8 %cmp31.15 = icmp slt i32 %42, %43 %spec.select.15 = select i1 %cmp31.15, i32 16, i32 %spec.select.14 %idxprom27.16 = zext i32 %spec.select.15 to i64 %arrayidx28.16 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.16 %44 = load i32, ptr %arrayidx28.16, align 4, !tbaa !8 %45 = load i32, ptr %arrayidx.17, align 4, !tbaa !8 %cmp31.16 = icmp slt i32 %44, %45 %spec.select.16 = select i1 %cmp31.16, i32 17, i32 %spec.select.15 %idxprom27.17 = zext i32 %spec.select.16 to i64 %arrayidx28.17 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.17 %46 = load i32, ptr %arrayidx28.17, align 4, !tbaa !8 %47 = load i32, ptr %arrayidx.18, align 8, !tbaa !8 %cmp31.17 = icmp slt i32 %46, %47 %spec.select.17 = select i1 %cmp31.17, i32 18, i32 %spec.select.16 %idxprom27.18 = zext i32 %spec.select.17 to i64 %arrayidx28.18 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.18 %48 = load i32, ptr %arrayidx28.18, align 4, !tbaa !8 %49 = load i32, ptr %arrayidx.19, align 4, !tbaa !8 %cmp31.18 = icmp slt i32 %48, %49 %spec.select.18 = select i1 %cmp31.18, i32 19, i32 %spec.select.17 %idxprom27.19 = zext i32 %spec.select.18 to i64 %arrayidx28.19 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.19 %50 = load i32, ptr %arrayidx28.19, align 4, !tbaa !8 %51 = load i32, ptr %arrayidx.20, align 16, !tbaa !8 %cmp31.19 = icmp slt i32 %50, %51 %spec.select.19 = select i1 %cmp31.19, i32 20, i32 %spec.select.18 %idxprom27.20 = zext i32 %spec.select.19 to i64 %arrayidx28.20 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.20 %52 = load i32, ptr %arrayidx28.20, align 4, !tbaa !8 %53 = load i32, ptr %arrayidx.21, align 4, !tbaa !8 %cmp31.20 = icmp slt i32 %52, %53 %spec.select.20 = select i1 %cmp31.20, i32 21, i32 %spec.select.19 %idxprom27.21 = zext i32 %spec.select.20 to i64 %arrayidx28.21 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.21 %54 = load i32, ptr %arrayidx28.21, align 4, !tbaa !8 %55 = load i32, ptr %arrayidx.22, align 8, !tbaa !8 %cmp31.21 = icmp slt i32 %54, %55 %spec.select.21 = select i1 %cmp31.21, i32 22, i32 %spec.select.20 %idxprom27.22 = zext i32 %spec.select.21 to i64 %arrayidx28.22 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.22 %56 = load i32, ptr %arrayidx28.22, align 4, !tbaa !8 %57 = load i32, ptr %arrayidx.23, align 4, !tbaa !8 %cmp31.22 = icmp slt i32 %56, %57 %spec.select.22 = select i1 %cmp31.22, i32 23, i32 %spec.select.21 %idxprom27.23 = zext i32 %spec.select.22 to i64 %arrayidx28.23 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.23 %58 = load i32, ptr %arrayidx28.23, align 4, !tbaa !8 %59 = load i32, ptr %arrayidx.24, align 16, !tbaa !8 %cmp31.23 = icmp slt i32 %58, %59 %spec.select.23 = select i1 %cmp31.23, i32 24, i32 %spec.select.22 %idxprom27.24 = zext i32 %spec.select.23 to i64 %arrayidx28.24 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom27.24 %60 = load i32, ptr %arrayidx28.24, align 4, !tbaa !8 %61 = load i32, ptr %arrayidx.25, align 4, !tbaa !8 %cmp31.24 = icmp slt i32 %60, %61 %spec.select.24 = select i1 %cmp31.24, i32 25, i32 %spec.select.23 %idxprom42 = zext i32 %spec.select.24 to i64 %arrayidx43 = getelementptr inbounds [27 x i32], ptr %pow, i64 0, i64 %idxprom42 %62 = load i32, ptr %arrayidx43, align 4, !tbaa !8 %sext = shl i64 %call2, 32 %63 = ashr exact i64 %sext, 32 %64 = sext i32 %62 to i64 %65 = add nsw i64 %63, 2 %66 = add i32 %conv, 1 %smax = call i32 @llvm.smax.i32(i32 %add37, i32 %66) %67 = xor i32 %conv, -1 %68 = add i32 %smax, %67 %69 = zext i32 %68 to i64 %70 = mul i64 %65, %69 %71 = add i64 %70, %63 %72 = zext i32 %68 to i64 %73 = add i32 %smax, -2 %74 = sub i32 %73, %conv %75 = zext i32 %74 to i64 %76 = mul nuw i64 %72, %75 %77 = lshr i64 %76, 1 %78 = add i64 %71, %77 %79 = add i64 %78, 1 %80 = mul i64 %79, %64 %81 = add i64 %ans.0.lcssa, %80 br label %for.end49 for.end49: ; preds = %for.body40.lr.ph, %for.cond23.preheader %ans.1.lcssa = phi i64 [ %ans.0.lcssa, %for.cond23.preheader ], [ %81, %for.body40.lr.ph ] %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.1.lcssa) call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %str) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %pow) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> void Rotation_90(void); void Rotation_180(void); void Rotation_270(void); char A[15][15]; int main(void) { int i,j; char str[100]; for(i=0;i<8;i++){ fgets(str,sizeof(str),stdin); for(j=0;j<8;j++) A[i][j]=str[j]; } Rotation_90(); Rotation_180(); Rotation_270(); return 0; } void Rotation_90(void){ int i,j; printf("90\n"); for(i=0;i<8;i++){ for(j=7;j>=0;j--) printf("%c",A[j][i]); printf("\n"); } } void Rotation_180(void){ int i,j; printf("180\n"); for(i=7;i>=0;i--){ for(j=7;j>=0;j--) printf("%c",A[i][j]); printf("\n"); } } void Rotation_270(void){ int i,j; printf("270\n"); for(i=7;i>=0;i--){ for(j=0;j<8;j++) printf("%c",A[j][i]); printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200573/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200573/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @A = dso_local local_unnamed_addr global [15 x [15 x i8]] zeroinitializer, align 16 @str = private unnamed_addr constant [3 x i8] c"90\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"180\00", align 1 @str.6 = private unnamed_addr constant [4 x i8] c"270\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %0) %1 = load i64, ptr %str, align 16, !tbaa !9 store i64 %1, ptr @A, align 16, !tbaa !9 %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.1 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %2) %3 = load i64, ptr %str, align 16, !tbaa !9 store i64 %3, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 0), align 1, !tbaa !9 %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.2 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %4) %5 = load i64, ptr %str, align 16, !tbaa !9 store i64 %5, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 0), align 2, !tbaa !9 %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.3 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %6) %7 = load i64, ptr %str, align 16, !tbaa !9 store i64 %7, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 0), align 1, !tbaa !9 %8 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.4 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %8) %9 = load i64, ptr %str, align 16, !tbaa !9 store i64 %9, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 0), align 4, !tbaa !9 %10 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.5 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %10) %11 = load i64, ptr %str, align 16, !tbaa !9 store i64 %11, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 0), align 1, !tbaa !9 %12 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.6 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %12) %13 = load i64, ptr %str, align 16, !tbaa !9 store i64 %13, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 0), align 2, !tbaa !9 %14 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.7 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %14) %15 = load i64, ptr %str, align 16, !tbaa !9 store i64 %15, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 0), align 1, !tbaa !9 call void @Rotation_90() call void @Rotation_180() call void @Rotation_270() call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @Rotation_90() local_unnamed_addr #0 { entry: %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) %0 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 0), align 1, !tbaa !9 %conv = sext i8 %0 to i32 %putchar14 = tail call i32 @putchar(i32 %conv) %1 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 0), align 2, !tbaa !9 %conv.1 = sext i8 %1 to i32 %putchar14.1 = tail call i32 @putchar(i32 %conv.1) %2 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 0), align 1, !tbaa !9 %conv.2 = sext i8 %2 to i32 %putchar14.2 = tail call i32 @putchar(i32 %conv.2) %3 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 0), align 4, !tbaa !9 %conv.3 = sext i8 %3 to i32 %putchar14.3 = tail call i32 @putchar(i32 %conv.3) %4 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 0), align 1, !tbaa !9 %conv.4 = sext i8 %4 to i32 %putchar14.4 = tail call i32 @putchar(i32 %conv.4) %5 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 0), align 2, !tbaa !9 %conv.5 = sext i8 %5 to i32 %putchar14.5 = tail call i32 @putchar(i32 %conv.5) %6 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 0), align 1, !tbaa !9 %conv.6 = sext i8 %6 to i32 %putchar14.6 = tail call i32 @putchar(i32 %conv.6) %7 = load i8, ptr @A, align 16, !tbaa !9 %conv.7 = sext i8 %7 to i32 %putchar14.7 = tail call i32 @putchar(i32 %conv.7) %putchar = tail call i32 @putchar(i32 10) %8 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 1), align 2, !tbaa !9 %conv.120 = sext i8 %8 to i32 %putchar14.121 = tail call i32 @putchar(i32 %conv.120) %9 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 1), align 1, !tbaa !9 %conv.1.1 = sext i8 %9 to i32 %putchar14.1.1 = tail call i32 @putchar(i32 %conv.1.1) %10 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 1), align 4, !tbaa !9 %conv.2.1 = sext i8 %10 to i32 %putchar14.2.1 = tail call i32 @putchar(i32 %conv.2.1) %11 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 1), align 1, !tbaa !9 %conv.3.1 = sext i8 %11 to i32 %putchar14.3.1 = tail call i32 @putchar(i32 %conv.3.1) %12 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 1), align 2, !tbaa !9 %conv.4.1 = sext i8 %12 to i32 %putchar14.4.1 = tail call i32 @putchar(i32 %conv.4.1) %13 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 1), align 1, !tbaa !9 %conv.5.1 = sext i8 %13 to i32 %putchar14.5.1 = tail call i32 @putchar(i32 %conv.5.1) %14 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 1), align 16, !tbaa !9 %conv.6.1 = sext i8 %14 to i32 %putchar14.6.1 = tail call i32 @putchar(i32 %conv.6.1) %15 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 1), align 1, !tbaa !9 %conv.7.1 = sext i8 %15 to i32 %putchar14.7.1 = tail call i32 @putchar(i32 %conv.7.1) %putchar.1 = tail call i32 @putchar(i32 10) %16 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 2), align 1, !tbaa !9 %conv.223 = sext i8 %16 to i32 %putchar14.224 = tail call i32 @putchar(i32 %conv.223) %17 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 2), align 4, !tbaa !9 %conv.1.2 = sext i8 %17 to i32 %putchar14.1.2 = tail call i32 @putchar(i32 %conv.1.2) %18 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 2), align 1, !tbaa !9 %conv.2.2 = sext i8 %18 to i32 %putchar14.2.2 = tail call i32 @putchar(i32 %conv.2.2) %19 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 2), align 2, !tbaa !9 %conv.3.2 = sext i8 %19 to i32 %putchar14.3.2 = tail call i32 @putchar(i32 %conv.3.2) %20 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 2), align 1, !tbaa !9 %conv.4.2 = sext i8 %20 to i32 %putchar14.4.2 = tail call i32 @putchar(i32 %conv.4.2) %21 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 2), align 16, !tbaa !9 %conv.5.2 = sext i8 %21 to i32 %putchar14.5.2 = tail call i32 @putchar(i32 %conv.5.2) %22 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 2), align 1, !tbaa !9 %conv.6.2 = sext i8 %22 to i32 %putchar14.6.2 = tail call i32 @putchar(i32 %conv.6.2) %23 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 2), align 2, !tbaa !9 %conv.7.2 = sext i8 %23 to i32 %putchar14.7.2 = tail call i32 @putchar(i32 %conv.7.2) %putchar.2 = tail call i32 @putchar(i32 10) %24 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 3), align 4, !tbaa !9 %conv.326 = sext i8 %24 to i32 %putchar14.327 = tail call i32 @putchar(i32 %conv.326) %25 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 3), align 1, !tbaa !9 %conv.1.3 = sext i8 %25 to i32 %putchar14.1.3 = tail call i32 @putchar(i32 %conv.1.3) %26 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 3), align 2, !tbaa !9 %conv.2.3 = sext i8 %26 to i32 %putchar14.2.3 = tail call i32 @putchar(i32 %conv.2.3) %27 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 3), align 1, !tbaa !9 %conv.3.3 = sext i8 %27 to i32 %putchar14.3.3 = tail call i32 @putchar(i32 %conv.3.3) %28 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 3), align 16, !tbaa !9 %conv.4.3 = sext i8 %28 to i32 %putchar14.4.3 = tail call i32 @putchar(i32 %conv.4.3) %29 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 3), align 1, !tbaa !9 %conv.5.3 = sext i8 %29 to i32 %putchar14.5.3 = tail call i32 @putchar(i32 %conv.5.3) %30 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 3), align 2, !tbaa !9 %conv.6.3 = sext i8 %30 to i32 %putchar14.6.3 = tail call i32 @putchar(i32 %conv.6.3) %31 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 3), align 1, !tbaa !9 %conv.7.3 = sext i8 %31 to i32 %putchar14.7.3 = tail call i32 @putchar(i32 %conv.7.3) %putchar.3 = tail call i32 @putchar(i32 10) %32 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 4), align 1, !tbaa !9 %conv.429 = sext i8 %32 to i32 %putchar14.430 = tail call i32 @putchar(i32 %conv.429) %33 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 4), align 2, !tbaa !9 %conv.1.4 = sext i8 %33 to i32 %putchar14.1.4 = tail call i32 @putchar(i32 %conv.1.4) %34 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 4), align 1, !tbaa !9 %conv.2.4 = sext i8 %34 to i32 %putchar14.2.4 = tail call i32 @putchar(i32 %conv.2.4) %35 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 4), align 16, !tbaa !9 %conv.3.4 = sext i8 %35 to i32 %putchar14.3.4 = tail call i32 @putchar(i32 %conv.3.4) %36 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 4), align 1, !tbaa !9 %conv.4.4 = sext i8 %36 to i32 %putchar14.4.4 = tail call i32 @putchar(i32 %conv.4.4) %37 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 4), align 2, !tbaa !9 %conv.5.4 = sext i8 %37 to i32 %putchar14.5.4 = tail call i32 @putchar(i32 %conv.5.4) %38 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 4), align 1, !tbaa !9 %conv.6.4 = sext i8 %38 to i32 %putchar14.6.4 = tail call i32 @putchar(i32 %conv.6.4) %39 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 4), align 4, !tbaa !9 %conv.7.4 = sext i8 %39 to i32 %putchar14.7.4 = tail call i32 @putchar(i32 %conv.7.4) %putchar.4 = tail call i32 @putchar(i32 10) %40 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 5), align 2, !tbaa !9 %conv.532 = sext i8 %40 to i32 %putchar14.533 = tail call i32 @putchar(i32 %conv.532) %41 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 5), align 1, !tbaa !9 %conv.1.5 = sext i8 %41 to i32 %putchar14.1.5 = tail call i32 @putchar(i32 %conv.1.5) %42 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 5), align 16, !tbaa !9 %conv.2.5 = sext i8 %42 to i32 %putchar14.2.5 = tail call i32 @putchar(i32 %conv.2.5) %43 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 5), align 1, !tbaa !9 %conv.3.5 = sext i8 %43 to i32 %putchar14.3.5 = tail call i32 @putchar(i32 %conv.3.5) %44 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 5), align 2, !tbaa !9 %conv.4.5 = sext i8 %44 to i32 %putchar14.4.5 = tail call i32 @putchar(i32 %conv.4.5) %45 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 5), align 1, !tbaa !9 %conv.5.5 = sext i8 %45 to i32 %putchar14.5.5 = tail call i32 @putchar(i32 %conv.5.5) %46 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 5), align 4, !tbaa !9 %conv.6.5 = sext i8 %46 to i32 %putchar14.6.5 = tail call i32 @putchar(i32 %conv.6.5) %47 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 5), align 1, !tbaa !9 %conv.7.5 = sext i8 %47 to i32 %putchar14.7.5 = tail call i32 @putchar(i32 %conv.7.5) %putchar.5 = tail call i32 @putchar(i32 10) %48 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 6), align 1, !tbaa !9 %conv.635 = sext i8 %48 to i32 %putchar14.636 = tail call i32 @putchar(i32 %conv.635) %49 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 6), align 16, !tbaa !9 %conv.1.6 = sext i8 %49 to i32 %putchar14.1.6 = tail call i32 @putchar(i32 %conv.1.6) %50 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 6), align 1, !tbaa !9 %conv.2.6 = sext i8 %50 to i32 %putchar14.2.6 = tail call i32 @putchar(i32 %conv.2.6) %51 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 6), align 2, !tbaa !9 %conv.3.6 = sext i8 %51 to i32 %putchar14.3.6 = tail call i32 @putchar(i32 %conv.3.6) %52 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 6), align 1, !tbaa !9 %conv.4.6 = sext i8 %52 to i32 %putchar14.4.6 = tail call i32 @putchar(i32 %conv.4.6) %53 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 6), align 4, !tbaa !9 %conv.5.6 = sext i8 %53 to i32 %putchar14.5.6 = tail call i32 @putchar(i32 %conv.5.6) %54 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 6), align 1, !tbaa !9 %conv.6.6 = sext i8 %54 to i32 %putchar14.6.6 = tail call i32 @putchar(i32 %conv.6.6) %55 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 6), align 2, !tbaa !9 %conv.7.6 = sext i8 %55 to i32 %putchar14.7.6 = tail call i32 @putchar(i32 %conv.7.6) %putchar.6 = tail call i32 @putchar(i32 10) %56 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 7), align 16, !tbaa !9 %conv.738 = sext i8 %56 to i32 %putchar14.739 = tail call i32 @putchar(i32 %conv.738) %57 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 7), align 1, !tbaa !9 %conv.1.7 = sext i8 %57 to i32 %putchar14.1.7 = tail call i32 @putchar(i32 %conv.1.7) %58 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 7), align 2, !tbaa !9 %conv.2.7 = sext i8 %58 to i32 %putchar14.2.7 = tail call i32 @putchar(i32 %conv.2.7) %59 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 7), align 1, !tbaa !9 %conv.3.7 = sext i8 %59 to i32 %putchar14.3.7 = tail call i32 @putchar(i32 %conv.3.7) %60 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 7), align 4, !tbaa !9 %conv.4.7 = sext i8 %60 to i32 %putchar14.4.7 = tail call i32 @putchar(i32 %conv.4.7) %61 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 7), align 1, !tbaa !9 %conv.5.7 = sext i8 %61 to i32 %putchar14.5.7 = tail call i32 @putchar(i32 %conv.5.7) %62 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 7), align 2, !tbaa !9 %conv.6.7 = sext i8 %62 to i32 %putchar14.6.7 = tail call i32 @putchar(i32 %conv.6.7) %63 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 7), align 1, !tbaa !9 %conv.7.7 = sext i8 %63 to i32 %putchar14.7.7 = tail call i32 @putchar(i32 %conv.7.7) %putchar.7 = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @Rotation_180() local_unnamed_addr #0 { entry: %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %0 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 7), align 16, !tbaa !9 %conv = sext i8 %0 to i32 %putchar15 = tail call i32 @putchar(i32 %conv) %1 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 6), align 1, !tbaa !9 %conv.1 = sext i8 %1 to i32 %putchar15.1 = tail call i32 @putchar(i32 %conv.1) %2 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 5), align 2, !tbaa !9 %conv.2 = sext i8 %2 to i32 %putchar15.2 = tail call i32 @putchar(i32 %conv.2) %3 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 4), align 1, !tbaa !9 %conv.3 = sext i8 %3 to i32 %putchar15.3 = tail call i32 @putchar(i32 %conv.3) %4 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 3), align 4, !tbaa !9 %conv.4 = sext i8 %4 to i32 %putchar15.4 = tail call i32 @putchar(i32 %conv.4) %5 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 2), align 1, !tbaa !9 %conv.5 = sext i8 %5 to i32 %putchar15.5 = tail call i32 @putchar(i32 %conv.5) %6 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 1), align 2, !tbaa !9 %conv.6 = sext i8 %6 to i32 %putchar15.6 = tail call i32 @putchar(i32 %conv.6) %7 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 0), align 1, !tbaa !9 %conv.7 = sext i8 %7 to i32 %putchar15.7 = tail call i32 @putchar(i32 %conv.7) %putchar = tail call i32 @putchar(i32 10) %8 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 7), align 1, !tbaa !9 %conv.121 = sext i8 %8 to i32 %putchar15.122 = tail call i32 @putchar(i32 %conv.121) %9 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 6), align 16, !tbaa !9 %conv.1.1 = sext i8 %9 to i32 %putchar15.1.1 = tail call i32 @putchar(i32 %conv.1.1) %10 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 5), align 1, !tbaa !9 %conv.2.1 = sext i8 %10 to i32 %putchar15.2.1 = tail call i32 @putchar(i32 %conv.2.1) %11 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 4), align 2, !tbaa !9 %conv.3.1 = sext i8 %11 to i32 %putchar15.3.1 = tail call i32 @putchar(i32 %conv.3.1) %12 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 3), align 1, !tbaa !9 %conv.4.1 = sext i8 %12 to i32 %putchar15.4.1 = tail call i32 @putchar(i32 %conv.4.1) %13 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 2), align 4, !tbaa !9 %conv.5.1 = sext i8 %13 to i32 %putchar15.5.1 = tail call i32 @putchar(i32 %conv.5.1) %14 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 1), align 1, !tbaa !9 %conv.6.1 = sext i8 %14 to i32 %putchar15.6.1 = tail call i32 @putchar(i32 %conv.6.1) %15 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 0), align 2, !tbaa !9 %conv.7.1 = sext i8 %15 to i32 %putchar15.7.1 = tail call i32 @putchar(i32 %conv.7.1) %putchar.1 = tail call i32 @putchar(i32 10) %16 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 7), align 2, !tbaa !9 %conv.224 = sext i8 %16 to i32 %putchar15.225 = tail call i32 @putchar(i32 %conv.224) %17 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 6), align 1, !tbaa !9 %conv.1.2 = sext i8 %17 to i32 %putchar15.1.2 = tail call i32 @putchar(i32 %conv.1.2) %18 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 5), align 16, !tbaa !9 %conv.2.2 = sext i8 %18 to i32 %putchar15.2.2 = tail call i32 @putchar(i32 %conv.2.2) %19 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 4), align 1, !tbaa !9 %conv.3.2 = sext i8 %19 to i32 %putchar15.3.2 = tail call i32 @putchar(i32 %conv.3.2) %20 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 3), align 2, !tbaa !9 %conv.4.2 = sext i8 %20 to i32 %putchar15.4.2 = tail call i32 @putchar(i32 %conv.4.2) %21 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 2), align 1, !tbaa !9 %conv.5.2 = sext i8 %21 to i32 %putchar15.5.2 = tail call i32 @putchar(i32 %conv.5.2) %22 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 1), align 4, !tbaa !9 %conv.6.2 = sext i8 %22 to i32 %putchar15.6.2 = tail call i32 @putchar(i32 %conv.6.2) %23 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 0), align 1, !tbaa !9 %conv.7.2 = sext i8 %23 to i32 %putchar15.7.2 = tail call i32 @putchar(i32 %conv.7.2) %putchar.2 = tail call i32 @putchar(i32 10) %24 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 7), align 1, !tbaa !9 %conv.327 = sext i8 %24 to i32 %putchar15.328 = tail call i32 @putchar(i32 %conv.327) %25 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 6), align 2, !tbaa !9 %conv.1.3 = sext i8 %25 to i32 %putchar15.1.3 = tail call i32 @putchar(i32 %conv.1.3) %26 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 5), align 1, !tbaa !9 %conv.2.3 = sext i8 %26 to i32 %putchar15.2.3 = tail call i32 @putchar(i32 %conv.2.3) %27 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 4), align 16, !tbaa !9 %conv.3.3 = sext i8 %27 to i32 %putchar15.3.3 = tail call i32 @putchar(i32 %conv.3.3) %28 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 3), align 1, !tbaa !9 %conv.4.3 = sext i8 %28 to i32 %putchar15.4.3 = tail call i32 @putchar(i32 %conv.4.3) %29 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 2), align 2, !tbaa !9 %conv.5.3 = sext i8 %29 to i32 %putchar15.5.3 = tail call i32 @putchar(i32 %conv.5.3) %30 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 1), align 1, !tbaa !9 %conv.6.3 = sext i8 %30 to i32 %putchar15.6.3 = tail call i32 @putchar(i32 %conv.6.3) %31 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 0), align 4, !tbaa !9 %conv.7.3 = sext i8 %31 to i32 %putchar15.7.3 = tail call i32 @putchar(i32 %conv.7.3) %putchar.3 = tail call i32 @putchar(i32 10) %32 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 7), align 4, !tbaa !9 %conv.430 = sext i8 %32 to i32 %putchar15.431 = tail call i32 @putchar(i32 %conv.430) %33 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 6), align 1, !tbaa !9 %conv.1.4 = sext i8 %33 to i32 %putchar15.1.4 = tail call i32 @putchar(i32 %conv.1.4) %34 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 5), align 2, !tbaa !9 %conv.2.4 = sext i8 %34 to i32 %putchar15.2.4 = tail call i32 @putchar(i32 %conv.2.4) %35 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 4), align 1, !tbaa !9 %conv.3.4 = sext i8 %35 to i32 %putchar15.3.4 = tail call i32 @putchar(i32 %conv.3.4) %36 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 3), align 16, !tbaa !9 %conv.4.4 = sext i8 %36 to i32 %putchar15.4.4 = tail call i32 @putchar(i32 %conv.4.4) %37 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 2), align 1, !tbaa !9 %conv.5.4 = sext i8 %37 to i32 %putchar15.5.4 = tail call i32 @putchar(i32 %conv.5.4) %38 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 1), align 2, !tbaa !9 %conv.6.4 = sext i8 %38 to i32 %putchar15.6.4 = tail call i32 @putchar(i32 %conv.6.4) %39 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 0), align 1, !tbaa !9 %conv.7.4 = sext i8 %39 to i32 %putchar15.7.4 = tail call i32 @putchar(i32 %conv.7.4) %putchar.4 = tail call i32 @putchar(i32 10) %40 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 7), align 1, !tbaa !9 %conv.533 = sext i8 %40 to i32 %putchar15.534 = tail call i32 @putchar(i32 %conv.533) %41 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 6), align 4, !tbaa !9 %conv.1.5 = sext i8 %41 to i32 %putchar15.1.5 = tail call i32 @putchar(i32 %conv.1.5) %42 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 5), align 1, !tbaa !9 %conv.2.5 = sext i8 %42 to i32 %putchar15.2.5 = tail call i32 @putchar(i32 %conv.2.5) %43 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 4), align 2, !tbaa !9 %conv.3.5 = sext i8 %43 to i32 %putchar15.3.5 = tail call i32 @putchar(i32 %conv.3.5) %44 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 3), align 1, !tbaa !9 %conv.4.5 = sext i8 %44 to i32 %putchar15.4.5 = tail call i32 @putchar(i32 %conv.4.5) %45 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 2), align 16, !tbaa !9 %conv.5.5 = sext i8 %45 to i32 %putchar15.5.5 = tail call i32 @putchar(i32 %conv.5.5) %46 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 1), align 1, !tbaa !9 %conv.6.5 = sext i8 %46 to i32 %putchar15.6.5 = tail call i32 @putchar(i32 %conv.6.5) %47 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 0), align 2, !tbaa !9 %conv.7.5 = sext i8 %47 to i32 %putchar15.7.5 = tail call i32 @putchar(i32 %conv.7.5) %putchar.5 = tail call i32 @putchar(i32 10) %48 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 7), align 2, !tbaa !9 %conv.636 = sext i8 %48 to i32 %putchar15.637 = tail call i32 @putchar(i32 %conv.636) %49 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 6), align 1, !tbaa !9 %conv.1.6 = sext i8 %49 to i32 %putchar15.1.6 = tail call i32 @putchar(i32 %conv.1.6) %50 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 5), align 4, !tbaa !9 %conv.2.6 = sext i8 %50 to i32 %putchar15.2.6 = tail call i32 @putchar(i32 %conv.2.6) %51 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 4), align 1, !tbaa !9 %conv.3.6 = sext i8 %51 to i32 %putchar15.3.6 = tail call i32 @putchar(i32 %conv.3.6) %52 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 3), align 2, !tbaa !9 %conv.4.6 = sext i8 %52 to i32 %putchar15.4.6 = tail call i32 @putchar(i32 %conv.4.6) %53 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 2), align 1, !tbaa !9 %conv.5.6 = sext i8 %53 to i32 %putchar15.5.6 = tail call i32 @putchar(i32 %conv.5.6) %54 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 1), align 16, !tbaa !9 %conv.6.6 = sext i8 %54 to i32 %putchar15.6.6 = tail call i32 @putchar(i32 %conv.6.6) %55 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 0), align 1, !tbaa !9 %conv.7.6 = sext i8 %55 to i32 %putchar15.7.6 = tail call i32 @putchar(i32 %conv.7.6) %putchar.6 = tail call i32 @putchar(i32 10) %56 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 7), align 1, !tbaa !9 %conv.739 = sext i8 %56 to i32 %putchar15.740 = tail call i32 @putchar(i32 %conv.739) %57 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 6), align 2, !tbaa !9 %conv.1.7 = sext i8 %57 to i32 %putchar15.1.7 = tail call i32 @putchar(i32 %conv.1.7) %58 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 5), align 1, !tbaa !9 %conv.2.7 = sext i8 %58 to i32 %putchar15.2.7 = tail call i32 @putchar(i32 %conv.2.7) %59 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 4), align 4, !tbaa !9 %conv.3.7 = sext i8 %59 to i32 %putchar15.3.7 = tail call i32 @putchar(i32 %conv.3.7) %60 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 3), align 1, !tbaa !9 %conv.4.7 = sext i8 %60 to i32 %putchar15.4.7 = tail call i32 @putchar(i32 %conv.4.7) %61 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 2), align 2, !tbaa !9 %conv.5.7 = sext i8 %61 to i32 %putchar15.5.7 = tail call i32 @putchar(i32 %conv.5.7) %62 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 1), align 1, !tbaa !9 %conv.6.7 = sext i8 %62 to i32 %putchar15.6.7 = tail call i32 @putchar(i32 %conv.6.7) %63 = load i8, ptr @A, align 16, !tbaa !9 %conv.7.7 = sext i8 %63 to i32 %putchar15.7.7 = tail call i32 @putchar(i32 %conv.7.7) %putchar.7 = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @Rotation_270() local_unnamed_addr #0 { entry: %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %0 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 7), align 1, !tbaa !9 %conv = sext i8 %0 to i32 %putchar14 = tail call i32 @putchar(i32 %conv) %1 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 7), align 2, !tbaa !9 %conv.1 = sext i8 %1 to i32 %putchar14.1 = tail call i32 @putchar(i32 %conv.1) %2 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 7), align 1, !tbaa !9 %conv.2 = sext i8 %2 to i32 %putchar14.2 = tail call i32 @putchar(i32 %conv.2) %3 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 7), align 4, !tbaa !9 %conv.3 = sext i8 %3 to i32 %putchar14.3 = tail call i32 @putchar(i32 %conv.3) %4 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 7), align 1, !tbaa !9 %conv.4 = sext i8 %4 to i32 %putchar14.4 = tail call i32 @putchar(i32 %conv.4) %5 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 7), align 2, !tbaa !9 %conv.5 = sext i8 %5 to i32 %putchar14.5 = tail call i32 @putchar(i32 %conv.5) %6 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 7), align 1, !tbaa !9 %conv.6 = sext i8 %6 to i32 %putchar14.6 = tail call i32 @putchar(i32 %conv.6) %7 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 7), align 16, !tbaa !9 %conv.7 = sext i8 %7 to i32 %putchar14.7 = tail call i32 @putchar(i32 %conv.7) %putchar = tail call i32 @putchar(i32 10) %8 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 6), align 2, !tbaa !9 %conv.120 = sext i8 %8 to i32 %putchar14.121 = tail call i32 @putchar(i32 %conv.120) %9 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 6), align 1, !tbaa !9 %conv.1.1 = sext i8 %9 to i32 %putchar14.1.1 = tail call i32 @putchar(i32 %conv.1.1) %10 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 6), align 4, !tbaa !9 %conv.2.1 = sext i8 %10 to i32 %putchar14.2.1 = tail call i32 @putchar(i32 %conv.2.1) %11 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 6), align 1, !tbaa !9 %conv.3.1 = sext i8 %11 to i32 %putchar14.3.1 = tail call i32 @putchar(i32 %conv.3.1) %12 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 6), align 2, !tbaa !9 %conv.4.1 = sext i8 %12 to i32 %putchar14.4.1 = tail call i32 @putchar(i32 %conv.4.1) %13 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 6), align 1, !tbaa !9 %conv.5.1 = sext i8 %13 to i32 %putchar14.5.1 = tail call i32 @putchar(i32 %conv.5.1) %14 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 6), align 16, !tbaa !9 %conv.6.1 = sext i8 %14 to i32 %putchar14.6.1 = tail call i32 @putchar(i32 %conv.6.1) %15 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 6), align 1, !tbaa !9 %conv.7.1 = sext i8 %15 to i32 %putchar14.7.1 = tail call i32 @putchar(i32 %conv.7.1) %putchar.1 = tail call i32 @putchar(i32 10) %16 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 5), align 1, !tbaa !9 %conv.223 = sext i8 %16 to i32 %putchar14.224 = tail call i32 @putchar(i32 %conv.223) %17 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 5), align 4, !tbaa !9 %conv.1.2 = sext i8 %17 to i32 %putchar14.1.2 = tail call i32 @putchar(i32 %conv.1.2) %18 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 5), align 1, !tbaa !9 %conv.2.2 = sext i8 %18 to i32 %putchar14.2.2 = tail call i32 @putchar(i32 %conv.2.2) %19 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 5), align 2, !tbaa !9 %conv.3.2 = sext i8 %19 to i32 %putchar14.3.2 = tail call i32 @putchar(i32 %conv.3.2) %20 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 5), align 1, !tbaa !9 %conv.4.2 = sext i8 %20 to i32 %putchar14.4.2 = tail call i32 @putchar(i32 %conv.4.2) %21 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 5), align 16, !tbaa !9 %conv.5.2 = sext i8 %21 to i32 %putchar14.5.2 = tail call i32 @putchar(i32 %conv.5.2) %22 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 5), align 1, !tbaa !9 %conv.6.2 = sext i8 %22 to i32 %putchar14.6.2 = tail call i32 @putchar(i32 %conv.6.2) %23 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 5), align 2, !tbaa !9 %conv.7.2 = sext i8 %23 to i32 %putchar14.7.2 = tail call i32 @putchar(i32 %conv.7.2) %putchar.2 = tail call i32 @putchar(i32 10) %24 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 4), align 4, !tbaa !9 %conv.326 = sext i8 %24 to i32 %putchar14.327 = tail call i32 @putchar(i32 %conv.326) %25 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 4), align 1, !tbaa !9 %conv.1.3 = sext i8 %25 to i32 %putchar14.1.3 = tail call i32 @putchar(i32 %conv.1.3) %26 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 4), align 2, !tbaa !9 %conv.2.3 = sext i8 %26 to i32 %putchar14.2.3 = tail call i32 @putchar(i32 %conv.2.3) %27 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 4), align 1, !tbaa !9 %conv.3.3 = sext i8 %27 to i32 %putchar14.3.3 = tail call i32 @putchar(i32 %conv.3.3) %28 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 4), align 16, !tbaa !9 %conv.4.3 = sext i8 %28 to i32 %putchar14.4.3 = tail call i32 @putchar(i32 %conv.4.3) %29 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 4), align 1, !tbaa !9 %conv.5.3 = sext i8 %29 to i32 %putchar14.5.3 = tail call i32 @putchar(i32 %conv.5.3) %30 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 4), align 2, !tbaa !9 %conv.6.3 = sext i8 %30 to i32 %putchar14.6.3 = tail call i32 @putchar(i32 %conv.6.3) %31 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 4), align 1, !tbaa !9 %conv.7.3 = sext i8 %31 to i32 %putchar14.7.3 = tail call i32 @putchar(i32 %conv.7.3) %putchar.3 = tail call i32 @putchar(i32 10) %32 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 3), align 1, !tbaa !9 %conv.429 = sext i8 %32 to i32 %putchar14.430 = tail call i32 @putchar(i32 %conv.429) %33 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 3), align 2, !tbaa !9 %conv.1.4 = sext i8 %33 to i32 %putchar14.1.4 = tail call i32 @putchar(i32 %conv.1.4) %34 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 3), align 1, !tbaa !9 %conv.2.4 = sext i8 %34 to i32 %putchar14.2.4 = tail call i32 @putchar(i32 %conv.2.4) %35 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 3), align 16, !tbaa !9 %conv.3.4 = sext i8 %35 to i32 %putchar14.3.4 = tail call i32 @putchar(i32 %conv.3.4) %36 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 3), align 1, !tbaa !9 %conv.4.4 = sext i8 %36 to i32 %putchar14.4.4 = tail call i32 @putchar(i32 %conv.4.4) %37 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 3), align 2, !tbaa !9 %conv.5.4 = sext i8 %37 to i32 %putchar14.5.4 = tail call i32 @putchar(i32 %conv.5.4) %38 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 3), align 1, !tbaa !9 %conv.6.4 = sext i8 %38 to i32 %putchar14.6.4 = tail call i32 @putchar(i32 %conv.6.4) %39 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 3), align 4, !tbaa !9 %conv.7.4 = sext i8 %39 to i32 %putchar14.7.4 = tail call i32 @putchar(i32 %conv.7.4) %putchar.4 = tail call i32 @putchar(i32 10) %40 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 2), align 2, !tbaa !9 %conv.532 = sext i8 %40 to i32 %putchar14.533 = tail call i32 @putchar(i32 %conv.532) %41 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 2), align 1, !tbaa !9 %conv.1.5 = sext i8 %41 to i32 %putchar14.1.5 = tail call i32 @putchar(i32 %conv.1.5) %42 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 2), align 16, !tbaa !9 %conv.2.5 = sext i8 %42 to i32 %putchar14.2.5 = tail call i32 @putchar(i32 %conv.2.5) %43 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 2), align 1, !tbaa !9 %conv.3.5 = sext i8 %43 to i32 %putchar14.3.5 = tail call i32 @putchar(i32 %conv.3.5) %44 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 2), align 2, !tbaa !9 %conv.4.5 = sext i8 %44 to i32 %putchar14.4.5 = tail call i32 @putchar(i32 %conv.4.5) %45 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 2), align 1, !tbaa !9 %conv.5.5 = sext i8 %45 to i32 %putchar14.5.5 = tail call i32 @putchar(i32 %conv.5.5) %46 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 2), align 4, !tbaa !9 %conv.6.5 = sext i8 %46 to i32 %putchar14.6.5 = tail call i32 @putchar(i32 %conv.6.5) %47 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 2), align 1, !tbaa !9 %conv.7.5 = sext i8 %47 to i32 %putchar14.7.5 = tail call i32 @putchar(i32 %conv.7.5) %putchar.5 = tail call i32 @putchar(i32 10) %48 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 0, i64 1), align 1, !tbaa !9 %conv.635 = sext i8 %48 to i32 %putchar14.636 = tail call i32 @putchar(i32 %conv.635) %49 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 1), align 16, !tbaa !9 %conv.1.6 = sext i8 %49 to i32 %putchar14.1.6 = tail call i32 @putchar(i32 %conv.1.6) %50 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 1), align 1, !tbaa !9 %conv.2.6 = sext i8 %50 to i32 %putchar14.2.6 = tail call i32 @putchar(i32 %conv.2.6) %51 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 1), align 2, !tbaa !9 %conv.3.6 = sext i8 %51 to i32 %putchar14.3.6 = tail call i32 @putchar(i32 %conv.3.6) %52 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 1), align 1, !tbaa !9 %conv.4.6 = sext i8 %52 to i32 %putchar14.4.6 = tail call i32 @putchar(i32 %conv.4.6) %53 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 1), align 4, !tbaa !9 %conv.5.6 = sext i8 %53 to i32 %putchar14.5.6 = tail call i32 @putchar(i32 %conv.5.6) %54 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 1), align 1, !tbaa !9 %conv.6.6 = sext i8 %54 to i32 %putchar14.6.6 = tail call i32 @putchar(i32 %conv.6.6) %55 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 1), align 2, !tbaa !9 %conv.7.6 = sext i8 %55 to i32 %putchar14.7.6 = tail call i32 @putchar(i32 %conv.7.6) %putchar.6 = tail call i32 @putchar(i32 10) %56 = load i8, ptr @A, align 16, !tbaa !9 %conv.738 = sext i8 %56 to i32 %putchar14.739 = tail call i32 @putchar(i32 %conv.738) %57 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 1, i64 0), align 1, !tbaa !9 %conv.1.7 = sext i8 %57 to i32 %putchar14.1.7 = tail call i32 @putchar(i32 %conv.1.7) %58 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 2, i64 0), align 2, !tbaa !9 %conv.2.7 = sext i8 %58 to i32 %putchar14.2.7 = tail call i32 @putchar(i32 %conv.2.7) %59 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 3, i64 0), align 1, !tbaa !9 %conv.3.7 = sext i8 %59 to i32 %putchar14.3.7 = tail call i32 @putchar(i32 %conv.3.7) %60 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 4, i64 0), align 4, !tbaa !9 %conv.4.7 = sext i8 %60 to i32 %putchar14.4.7 = tail call i32 @putchar(i32 %conv.4.7) %61 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 5, i64 0), align 1, !tbaa !9 %conv.5.7 = sext i8 %61 to i32 %putchar14.5.7 = tail call i32 @putchar(i32 %conv.5.7) %62 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 6, i64 0), align 2, !tbaa !9 %conv.6.7 = sext i8 %62 to i32 %putchar14.6.7 = tail call i32 @putchar(i32 %conv.6.7) %63 = load i8, ptr getelementptr inbounds ([15 x [15 x i8]], ptr @A, i64 0, i64 7, i64 0), align 1, !tbaa !9 %conv.7.7 = sext i8 %63 to i32 %putchar14.7.7 = tail call i32 @putchar(i32 %conv.7.7) %putchar.7 = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include<stdio.h> int n, k, s, ans; void dfs(int num,int cnt,int sum){ if(sum==s&&cnt==k) ans++; if(num>n) return; if(cnt==k) return; dfs(num+1, cnt+1, sum+num); dfs(num+1, cnt, sum); } int main(){ while(scanf("%d %d %d", &n, &k, &s), n){ ans=0; dfs(1,0,0); printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200638/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @s = dso_local global i32 0, align 4 @k = dso_local global i32 0, align 4 @ans = dso_local local_unnamed_addr global i32 0, align 4 @n = dso_local global i32 0, align 4 @.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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %num, i32 noundef %cnt, i32 noundef %sum) local_unnamed_addr #0 { entry: %add8 = add nsw i32 %cnt, 1 br label %tailrecurse tailrecurse: ; preds = %if.end7, %entry %num.tr = phi i32 [ %num, %entry ], [ %add, %if.end7 ] %0 = load i32, ptr @s, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %sum %1 = load i32, ptr @k, align 4 %cmp1 = icmp eq i32 %1, %cnt %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %tailrecurse %2 = load i32, ptr @ans, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr @ans, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %tailrecurse %3 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %3, %num.tr %or.cond19 = select i1 %cmp2, i1 true, i1 %cmp1 br i1 %or.cond19, label %return, label %if.end7 if.end7: ; preds = %if.end %add = add nsw i32 %num.tr, 1 %add9 = add nsw i32 %num.tr, %sum tail call void @dfs(i32 noundef %add, i32 noundef %add8, i32 noundef %add9) br label %tailrecurse return: ; preds = %if.end ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k, ptr noundef nonnull @s) %0 = load i32, ptr @n, align 4, !tbaa !5 %tobool.not3 = icmp eq i32 %0, 0 br i1 %tobool.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body store i32 0, ptr @ans, align 4, !tbaa !5 tail call void @dfs(i32 noundef 1, i32 noundef 0, i32 noundef 0) %1 = load i32, ptr @ans, align 4, !tbaa !5 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k, ptr noundef nonnull @s) %2 = load i32, 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, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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> int main(){ int n; scanf("%d",&n); char tarou[1000][150]; char hanako[1000][150]; int a; for(a=0;a<=n-1;a++){ scanf("%*c%s %s",tarou[a],hanako[a]); } int b; int ptt=0,pth=0; for(b=0;b<=n-1;b++){ if(strcmp(tarou[b],hanako[b])>0) ptt+=3; if(strcmp(tarou[b],hanako[b])<0) pth+=3; if(strcmp(tarou[b],hanako[b])==0){ ptt++; pth++; } } printf("%d %d\n",ptt,pth); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200689/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200689/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%*c%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %tarou = alloca [1000 x [150 x i8]], align 16 %hanako = alloca [1000 x [150 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 150000, ptr nonnull %tarou) #4 call void @llvm.lifetime.start.p0(i64 150000, ptr nonnull %hanako) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not58 = icmp sgt i32 %0, 0 br i1 %cmp.not.not58, label %for.body, label %for.end42 for.cond5.preheader: ; preds = %for.body %cmp7.not.not60 = icmp sgt i32 %1, 0 br i1 %cmp7.not.not60, label %for.body8.preheader, label %for.end42 for.body8.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.body8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x [150 x i8]], ptr %tarou, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1000 x [150 x i8]], ptr %hanako, i64 0, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %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.not.not = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp.not.not, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.body8: ; preds = %for.body8.preheader, %for.body8 %indvars.iv68 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next69, %for.body8 ] %pth.063 = phi i32 [ 0, %for.body8.preheader ], [ %pth.2, %for.body8 ] %ptt.062 = phi i32 [ 0, %for.body8.preheader ], [ %ptt.2, %for.body8 ] %arrayidx10 = getelementptr inbounds [1000 x [150 x i8]], ptr %tarou, i64 0, i64 %indvars.iv68 %arrayidx13 = getelementptr inbounds [1000 x [150 x i8]], ptr %hanako, i64 0, i64 %indvars.iv68 %call15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx10, ptr noundef nonnull dereferenceable(1) %arrayidx13) #5 %cmp16 = icmp sgt i32 %call15, 0 %add = add nsw i32 %ptt.062, 3 %spec.select = select i1 %cmp16, i32 %add, i32 %ptt.062 %cmp24 = icmp slt i32 %call15, 0 %add26 = add nsw i32 %pth.063, 3 %pth.1 = select i1 %cmp24, i32 %add26, i32 %pth.063 %cmp35 = icmp eq i32 %call15, 0 %inc37 = zext i1 %cmp35 to i32 %ptt.2 = add nsw i32 %spec.select, %inc37 %pth.2 = add nsw i32 %pth.1, %inc37 %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count br i1 %exitcond.not, label %for.end42, label %for.body8, !llvm.loop !11 for.end42: ; preds = %for.body8, %entry, %for.cond5.preheader %ptt.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %entry ], [ %ptt.2, %for.body8 ] %pth.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %entry ], [ %pth.2, %for.body8 ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ptt.0.lcssa, i32 noundef %pth.0.lcssa) call void @llvm.lifetime.end.p0(i64 150000, ptr nonnull %hanako) #4 call void @llvm.lifetime.end.p0(i64 150000, ptr nonnull %tarou) #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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <string.h> int main(){ char word1[100],word2[100]; int i,n; int sum1=0,sum2=0; scanf("%d",&n); for (i=0; i<n; i++) { scanf("%s %s",word1,word2); if (strcmp(word1,word2)>0) { sum1 += 3; }else if(strcmp(word1,word2)==0){ sum1++; sum2++; }else{ sum2 +=3; } } printf("%d %d\n",sum1,sum2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200731/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200731/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %word1 = alloca [100 x i8], align 16 %word2 = alloca [100 x i8], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %word1) #4 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %word2) #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 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %sum2.026 = phi i32 [ %sum2.1, %for.inc ], [ 0, %entry ] %sum1.025 = phi i32 [ %sum1.1, %for.inc ], [ 0, %entry ] %i.024 = phi i32 [ %inc16, %for.inc ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %word1, ptr noundef nonnull %word2) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %word1, ptr noundef nonnull dereferenceable(1) %word2) #5 %cmp6 = icmp sgt i32 %call5, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nsw i32 %sum1.025, 3 br label %for.inc if.else: ; preds = %for.body %cmp10 = icmp eq i32 %call5, 0 br i1 %cmp10, label %if.then11, label %if.else13 if.then11: ; preds = %if.else %inc = add nsw i32 %sum1.025, 1 %inc12 = add nsw i32 %sum2.026, 1 br label %for.inc if.else13: ; preds = %if.else %add14 = add nsw i32 %sum2.026, 3 br label %for.inc for.inc: ; preds = %if.then, %if.else13, %if.then11 %sum1.1 = phi i32 [ %add, %if.then ], [ %inc, %if.then11 ], [ %sum1.025, %if.else13 ] %sum2.1 = phi i32 [ %sum2.026, %if.then ], [ %inc12, %if.then11 ], [ %add14, %if.else13 ] %inc16 = add nuw nsw i32 %i.024, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc16, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %sum1.0.lcssa = phi i32 [ 0, %entry ], [ %sum1.1, %for.inc ] %sum2.0.lcssa = phi i32 [ 0, %entry ], [ %sum2.1, %for.inc ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum1.0.lcssa, i32 noundef %sum2.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %word2) #4 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %word1) #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 i32 @strcmp(ptr nocapture noundef, 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 = !{!"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); int t_score = 0, h_score = 0; int i; for (i = 0; i < n; i++) { char t_card[101], h_card[101]; scanf("%s", t_card); scanf("%s", h_card); int j; for (j = 0; t_card[j] != '\0' || h_card[j] != '\0'; j++) { if (t_card[j] > h_card[j]) { t_score += 3; break; } else if (t_card[j] < h_card[j]) { h_score += 3; break; } } if (t_card[j] == '\0' && h_card[j] == '\0') { t_score++; h_score++; } } printf("%d %d\n", t_score, h_score); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200775/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200775/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %t_card = alloca [101 x i8], align 16 %h_card = alloca [101 x i8], align 16 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 %cmp74 = icmp sgt i32 %0, 0 br i1 %cmp74, label %for.body, label %for.end48 for.body: ; preds = %entry, %if.end45 %i.077 = phi i32 [ %inc47, %if.end45 ], [ 0, %entry ] %h_score.076 = phi i32 [ %h_score.2, %if.end45 ], [ 0, %entry ] %t_score.075 = phi i32 [ %t_score.2, %if.end45 ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t_card) #3 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %h_card) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t_card) %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h_card) br label %for.cond4 for.cond4: ; preds = %if.else, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %if.else ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [101 x i8], ptr %t_card, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp5.not = icmp eq i8 %1, 0 %arrayidx8 = getelementptr inbounds [101 x i8], ptr %h_card, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx8, align 1, !tbaa !9 %cmp10.not = icmp eq i8 %2, 0 %or.cond = select i1 %cmp5.not, i1 %cmp10.not, i1 false br i1 %or.cond, label %if.then42, label %for.body12 for.body12: ; preds = %for.cond4 %cmp19 = icmp sgt i8 %1, %2 br i1 %cmp19, label %if.then, label %if.else if.then: ; preds = %for.body12 %add = add nsw i32 %t_score.075, 3 br label %for.end if.else: ; preds = %for.body12 %cmp27 = icmp slt i8 %1, %2 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp27, label %if.then29, label %for.cond4, !llvm.loop !10 if.then29: ; preds = %if.else %add30 = add nsw i32 %h_score.076, 3 br label %for.end for.end: ; preds = %if.then29, %if.then %t_score.1 = phi i32 [ %add, %if.then ], [ %t_score.075, %if.then29 ] %h_score.1 = phi i32 [ %h_score.076, %if.then ], [ %add30, %if.then29 ] %cmp40 = icmp eq i8 %2, 0 %or.cond96 = select i1 %cmp5.not, i1 %cmp40, i1 false br i1 %or.cond96, label %if.then42, label %if.end45 if.then42: ; preds = %for.cond4, %for.end %t_score.16591 = phi i32 [ %t_score.1, %for.end ], [ %t_score.075, %for.cond4 ] %h_score.16690 = phi i32 [ %h_score.1, %for.end ], [ %h_score.076, %for.cond4 ] %inc43 = add nsw i32 %t_score.16591, 1 %inc44 = add nsw i32 %h_score.16690, 1 br label %if.end45 if.end45: ; preds = %if.then42, %for.end %t_score.2 = phi i32 [ %inc43, %if.then42 ], [ %t_score.1, %for.end ] %h_score.2 = phi i32 [ %inc44, %if.then42 ], [ %h_score.1, %for.end ] call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %h_card) #3 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t_card) #3 %inc47 = add nuw nsw i32 %i.077, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc47, %3 br i1 %cmp, label %for.body, label %for.end48, !llvm.loop !12 for.end48: ; preds = %if.end45, %entry %t_score.0.lcssa = phi i32 [ 0, %entry ], [ %t_score.2, %if.end45 ] %h_score.0.lcssa = phi i32 [ 0, %entry ], [ %h_score.2, %if.end45 ] %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t_score.0.lcssa, i32 noundef %h_score.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> #include <string.h> int main(int argc, const char * argv[]) { int i,n; int hanako=0,tarou=0; int result; char str1[1000]; char str2[1000]; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%s %s",str1,str2); //str1 str2????????????-1, 0, 1??§??°???????????? result = strcmp(str1,str2); if(result > 0){ tarou += 3; } else if(result < 0) hanako += 3; else{ tarou++; hanako++; } } printf("%d %d\n",tarou, hanako); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200818/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200818/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %str1 = alloca [1000 x i8], align 16 %str2 = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %str1) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %str2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %0, 0 br i1 %cmp21, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.024 = phi i32 [ %inc13, %for.inc ], [ 0, %entry ] %tarou.023 = phi i32 [ %tarou.1, %for.inc ], [ 0, %entry ] %hanako.022 = phi i32 [ %hanako.1, %for.inc ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str1, ptr noundef nonnull %str2) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %str1, ptr noundef nonnull dereferenceable(1) %str2) #5 %cmp6 = icmp sgt i32 %call5, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nsw i32 %tarou.023, 3 br label %for.inc if.else: ; preds = %for.body %cmp7 = icmp slt i32 %call5, 0 br i1 %cmp7, label %if.then8, label %if.else10 if.then8: ; preds = %if.else %add9 = add nsw i32 %hanako.022, 3 br label %for.inc if.else10: ; preds = %if.else %inc = add nsw i32 %tarou.023, 1 %inc11 = add nsw i32 %hanako.022, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else10, %if.then8 %hanako.1 = phi i32 [ %hanako.022, %if.then ], [ %add9, %if.then8 ], [ %inc11, %if.else10 ] %tarou.1 = phi i32 [ %add, %if.then ], [ %tarou.023, %if.then8 ], [ %inc, %if.else10 ] %inc13 = add nuw nsw i32 %i.024, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc13, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %hanako.0.lcssa = phi i32 [ 0, %entry ], [ %hanako.1, %for.inc ] %tarou.0.lcssa = phi i32 [ 0, %entry ], [ %tarou.1, %for.inc ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %tarou.0.lcssa, i32 noundef %hanako.0.lcssa) call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %str2) #4 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %str1) #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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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 = !{!"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> int main(){ int i,n,taro_point=0,hanako_point=0,kachi; char taro[1001],hanako[1001]; scanf("%d",&n); for(i=0;i<n;++i){ scanf("%s",taro); scanf("%s",hanako); kachi=strcmp(taro,hanako); if (kachi>0) taro_point+=3; if (kachi<0) hanako_point+=3; if (kachi==0) { taro_point+=1; hanako_point+=1; } } printf("%d %d\n",taro_point,hanako_point); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200869/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200869/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %taro = alloca [1001 x i8], align 16 %hanako = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %taro) #4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %hanako) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %0, 0 br i1 %cmp25, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.028 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %hanako_point.027 = phi i32 [ %hanako_point.2, %for.body ], [ 0, %entry ] %taro_point.026 = phi i32 [ %taro_point.2, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %taro) %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %hanako) %call6 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %taro, ptr noundef nonnull dereferenceable(1) %hanako) #5 %cmp7 = icmp sgt i32 %call6, 0 %add = add nsw i32 %taro_point.026, 3 %spec.select = select i1 %cmp7, i32 %add, i32 %taro_point.026 %cmp8 = icmp slt i32 %call6, 0 %add10 = add nsw i32 %hanako_point.027, 3 %hanako_point.1 = select i1 %cmp8, i32 %add10, i32 %hanako_point.027 %cmp12 = icmp eq i32 %call6, 0 %add14 = zext i1 %cmp12 to i32 %taro_point.2 = add nsw i32 %spec.select, %add14 %hanako_point.2 = add nsw i32 %hanako_point.1, %add14 %inc = add nuw nsw i32 %i.028, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %taro_point.0.lcssa = phi i32 [ 0, %entry ], [ %taro_point.2, %for.body ] %hanako_point.0.lcssa = phi i32 [ 0, %entry ], [ %hanako_point.2, %for.body ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %taro_point.0.lcssa, i32 noundef %hanako_point.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %hanako) #4 call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %taro) #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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { //変数の宣言 int i, j, n, tp=0, hp=0; char t[101], h[101]; scanf("%d", &n); //ターン数(各持ちカード数 入力 for (i=0; i<n; i++) { scanf("%s %s", t, h); //各々の具体的なカード 入力 for (j=0;;j++) { //延々とiを増やしてく。breakが置いてある if (t[j] > h[j]) {//毎度勝敗を確認して終わり次第breakして次のターンの処理をする tp += 3; break; }else if (t[j] < h[j]) { hp += 3; break; }else if (t[j] + h[j] == 0) { tp += 1; hp += 1; break; } } } //出力 printf("%d %d\n", tp, hp); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200919/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200919/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %t = alloca [101 x i8], align 16 %h = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %h) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp55 = icmp sgt i32 %0, 0 br i1 %cmp55, label %for.body, label %for.end36 for.body: ; preds = %entry, %for.inc34 %hp.058 = phi i32 [ %hp.1, %for.inc34 ], [ 0, %entry ] %tp.057 = phi i32 [ %tp.1, %for.inc34 ], [ 0, %entry ] %i.056 = phi i32 [ %inc35, %for.inc34 ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %h) %1 = load i8, ptr %t, align 16, !tbaa !9 %2 = load i8, ptr %h, align 16, !tbaa !9 %cmp751 = icmp sgt i8 %1, %2 br i1 %cmp751, label %if.then, label %if.else for.cond3: ; preds = %if.else19 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx, align 1, !tbaa !9 %arrayidx5 = getelementptr inbounds [101 x i8], ptr %h, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx5, align 1, !tbaa !9 %cmp7 = icmp sgt i8 %3, %4 br i1 %cmp7, label %if.then, label %if.else if.then: ; preds = %for.cond3, %for.body %add = add nsw i32 %tp.057, 3 br label %for.inc34 if.else: ; preds = %for.body, %for.cond3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond3 ], [ 0, %for.body ] %5 = phi i8 [ %4, %for.cond3 ], [ %2, %for.body ] %6 = phi i8 [ %3, %for.cond3 ], [ %1, %for.body ] %cmp15 = icmp slt i8 %6, %5 br i1 %cmp15, label %if.then17, label %if.else19 if.then17: ; preds = %if.else %add18 = add nsw i32 %hp.058, 3 br label %for.inc34 if.else19: ; preds = %if.else %conv53 = sext i8 %6 to i32 %conv654 = sext i8 %5 to i32 %add26 = sub nsw i32 0, %conv654 %cmp27 = icmp eq i32 %conv53, %add26 br i1 %cmp27, label %if.then29, label %for.cond3 if.then29: ; preds = %if.else19 %add30 = add nsw i32 %tp.057, 1 %add31 = add nsw i32 %hp.058, 1 br label %for.inc34 for.inc34: ; preds = %if.then, %if.then17, %if.then29 %tp.1 = phi i32 [ %add, %if.then ], [ %tp.057, %if.then17 ], [ %add30, %if.then29 ] %hp.1 = phi i32 [ %hp.058, %if.then ], [ %add18, %if.then17 ], [ %add31, %if.then29 ] %inc35 = add nuw nsw i32 %i.056, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc35, %7 br i1 %cmp, label %for.body, label %for.end36, !llvm.loop !10 for.end36: ; preds = %for.inc34, %entry %tp.0.lcssa = phi i32 [ 0, %entry ], [ %tp.1, %for.inc34 ] %hp.0.lcssa = phi i32 [ 0, %entry ], [ %hp.1, %for.inc34 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %tp.0.lcssa, i32 noundef %hp.0.lcssa) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %h) #3 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
/* */ #include <stdio.h> #include <ctype.h> #include <string.h> int main() { int n; int T=0,H=0; int i; char Tcard[101],Hcard[101]; scanf("%d", &n); for(i=0; i<n; i++){ scanf("%s %s", Tcard, Hcard); if(strcmp(Tcard, Hcard)<0){ H+=3; } else if(strcmp(Tcard, Hcard)>0){ T+=3; } else{ T++; H++; } } printf("%d %d\n", T, H); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200962/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200962/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %Tcard = alloca [101 x i8], align 16 %Hcard = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %Tcard) #4 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %Hcard) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.026 = phi i32 [ %inc16, %for.inc ], [ 0, %entry ] %H.025 = phi i32 [ %H.1, %for.inc ], [ 0, %entry ] %T.024 = phi i32 [ %T.1, %for.inc ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %Tcard, ptr noundef nonnull %Hcard) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %Tcard, ptr noundef nonnull dereferenceable(1) %Hcard) #5 %cmp6 = icmp slt i32 %call5, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nsw i32 %H.025, 3 br label %for.inc if.else: ; preds = %for.body %cmp10.not = icmp eq i32 %call5, 0 br i1 %cmp10.not, label %if.else13, label %if.then11 if.then11: ; preds = %if.else %add12 = add nsw i32 %T.024, 3 br label %for.inc if.else13: ; preds = %if.else %inc = add nsw i32 %T.024, 1 %inc14 = add nsw i32 %H.025, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else13, %if.then11 %T.1 = phi i32 [ %T.024, %if.then ], [ %add12, %if.then11 ], [ %inc, %if.else13 ] %H.1 = phi i32 [ %add, %if.then ], [ %H.025, %if.then11 ], [ %inc14, %if.else13 ] %inc16 = add nuw nsw i32 %i.026, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc16, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %T.0.lcssa = phi i32 [ 0, %entry ], [ %T.1, %for.inc ] %H.0.lcssa = phi i32 [ 0, %entry ], [ %H.1, %for.inc ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %T.0.lcssa, i32 noundef %H.0.lcssa) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %Hcard) #4 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %Tcard) #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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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 = !{!"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<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<60) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 17) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 #define PI 3.141592653589793238 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} void cin(ll *n){ scanf("%lld",&(*n)); } void cin2(ll *a, ll *b){ scanf("%lld%lld",&(*a),&(*b)); } void cin3(ll *a, ll *b, ll *c){ scanf("%lld%lld%lld",&(*a),&(*b),&(*c)); } ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll ABS(ll a){return a>=0?a:(-a);} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;} ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); } void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; } int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; } // count i which meets ai==x ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; } int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort ); int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); } void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); } ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; } ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; } typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;} int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;} void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} int main(void){ // fgets(s,sizeof(s),stdin); char s[105],t[105]; ll a=0,b=0,n; // ll ans=0; cin(&n); // cin(&); // cin(&); // cin2(&,&); // cin3(&,&,&); // ll [n]; rep(i,0,n){ scanf("%s",s); scanf("%s",t); if( strcmp(s,t)==0 ){ a++; b++; } if( strcmp(s,t)>0 ) a+=3; if( strcmp(s,t)<0 ) b+=3; } printf("%lld %lld\n",a,b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201011/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lld%lld\00", align 1 @.str.2 = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 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 #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @cin2(ptr noundef %a, ptr noundef %b) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %a, ptr noundef %b) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @cin3(ptr noundef %a, ptr noundef %b, ptr noundef %c) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %a, ptr noundef %b, ptr noundef %c) ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp5 = icmp sgt i64 %n, 0 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ] %b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6) %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp5 = icmp sgt i64 %n, 0 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ] %b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6) %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %div7 = sdiv i64 %n, %p %add = sub i64 1, %div7 %mul = mul nsw i64 %add, %p br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, %p ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #8 { entry: %tobool.not11 = icmp eq i64 %p, 0 br i1 %tobool.not11, label %cond.end, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %p, -2 br label %cond.false cond.false: ; preds = %cond.false.preheader, %POW.exit %indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ] %p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ] %accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ] %1 = xor i64 %indvar, -1 %2 = add i64 %1, %p %sub = add nsw i64 %p.tr13, -1 %cmp3.i = icmp sgt i64 %p.tr13, 1 br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit for.body.i.preheader: ; preds = %cond.false %3 = sub i64 %0, %indvar %xtraiter = and i64 %2, 7 %4 = icmp ult i64 %3, 7 br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %2, -8 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ] %mul.i.7 = mul i64 %c.04.i, 100000000 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18 POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil %c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %c.04.i.epil, 10 %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 %POW.exit, label %for.body.i.epil, !llvm.loop !19 POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false %c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ] %sub1 = sub nsw i64 %len, %p.tr13 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1 %5 = load i8, ptr %arrayidx, align 1, !tbaa !20 %conv = sext i8 %5 to i64 %sub2 = add nsw i64 %conv, -48 %mul = mul nsw i64 %sub2, %c.0.lcssa.i %add = add nsw i64 %mul, %accumulator.tr12 %tobool.not = icmp eq i64 %sub, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool.not, label %cond.end, label %cond.false cond.end: ; preds = %POW.exit, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !21 %1 = load i32, ptr %r, align 4, !tbaa !21 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %cmp1 = icmp slt i64 %am, %val %l.r = select i1 %cmp1, ptr %l, ptr %r %cmp6.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp6.not, ptr %r, ptr %l %l.sink = select i1 %cmp, ptr %l.r, ptr %r.l store i32 %div, ptr %l.sink, align 4, !tbaa !21 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !21 %1 = load i32, ptr %r, align 4, !tbaa !21 %add3 = add nsw i32 %1, %0 %div4 = sdiv i32 %add3, 2 %cmp1.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp1.not, ptr %r, ptr %l %cmp6 = icmp slt i64 %am, %val %l.r = select i1 %cmp6, ptr %l, ptr %r %l.sink = select i1 %cmp, ptr %r.l, ptr %l.r store i32 %div4, ptr %l.sink, align 4, !tbaa !21 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sge i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp sgt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sle i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp slt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub34 = sub nsw i32 %r, %l %cmp35 = icmp sgt i32 %sub34, 1 br i1 %cmp35, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.i.us = icmp slt i64 %0, %val %spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0 %spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us %sub.us = sub nsw i32 %spec.select51, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !23 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.not.i = icmp sgt i64 %1, %val %spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div %spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2 %sub = sub nsw i32 %spec.select53, %spec.select52 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !23 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ] %idxprom1 = sext i32 %l.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_lower.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i17 = icmp eq i64 %2, %val br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom345 = sext i32 %r.addr.0..lcssa to i64 %arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345 %3 = load i64, ptr %arrayidx446, align 8, !tbaa !5 %cmp1.i23 = icmp eq i64 %3, %val br label %cmp_lower.exit26 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp slt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9 cond.false.thread47: ; preds = %cond.true3.i %idxprom348 = sext i32 %r.addr.0..lcssa to i64 %arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348 %4 = load i64, ptr %arrayidx449, align 8, !tbaa !5 %cmp4.not.i19 = icmp sge i64 %4, %val br label %cmp_lower.exit26 cmp_lower.exit: ; preds = %while.end %cmp7.i = icmp sgt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_lower.exit %idxprom3 = sext i32 %r.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i25 = icmp sgt i64 %5, %val br label %cmp_lower.exit26 cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false %cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ] %6 = sext i32 %r.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i20, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub33 = sub nsw i32 %r, %l %cmp34 = icmp sgt i32 %sub33, 1 br i1 %cmp34, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.not.i.us = icmp sgt i64 %0, %val %spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us %spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0 %sub.us = sub nsw i32 %spec.select50, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !24 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.i = icmp slt i64 %1, %val %spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2 %spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div %sub = sub nsw i32 %spec.select52, %spec.select51 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !24 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ] %idxprom1 = sext i32 %r.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_upper.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i = icmp eq i64 %2, %val br i1 %cmp1.i, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom344 = sext i32 %l.addr.0..lcssa to i64 %arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344 %3 = load i64, ptr %arrayidx445, align 8, !tbaa !5 %cmp1.i22 = icmp eq i64 %3, %val br label %cmp_upper.exit25 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp sgt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9 cond.false.thread46: ; preds = %cond.true3.i %idxprom347 = sext i32 %l.addr.0..lcssa to i64 %arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347 %4 = load i64, ptr %arrayidx448, align 8, !tbaa !5 %cmp4.not.i18 = icmp sle i64 %4, %val br label %cmp_upper.exit25 cmp_upper.exit: ; preds = %while.end %cmp7.i = icmp slt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_upper.exit %idxprom3 = sext i32 %l.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i24 = icmp slt i64 %5, %val br label %cmp_upper.exit25 cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false %cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ] %6 = sext i32 %l.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i19, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #8 { entry: %sub34.i = sub nsw i32 %r, %l %cmp35.i = icmp sgt i32 %sub34.i, 1 br i1 %cmp35.i, label %while.body.us.i, label %while.end.i while.body.us.i: ; preds = %entry, %while.body.us.i %l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ] %r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ] %add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i %div.us.i = sdiv i32 %add.us.i, 2 %idxprom.us.i = sext i32 %div.us.i to i64 %arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i %0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5 %cmp1.i.us.i = icmp slt i64 %0, %x %spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i %spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i %sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i %cmp.us.i = icmp sgt i32 %sub.us.i, 1 br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !23 while.end.i: ; preds = %while.body.us.i, %entry %r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ] %l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ] %idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i %1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %cmp1.i17.i = icmp eq i64 %1, %x br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i cond.false.thread.i: ; preds = %while.end.i %idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64 %arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i %2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5 %cmp1.i23.i = icmp eq i64 %2, %x %.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1 br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i %conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ] %conv = trunc i64 %conv.pre-phi.i to i32 %cmp = icmp eq i32 %conv, -1 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %lower_bound.exit %sub33.i = sub nsw i32 %r, %conv %cmp34.i = icmp sgt i32 %sub33.i, 1 br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9 while.body.us.i18: ; preds = %cond.false, %while.body.us.i18 %l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ] %r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ] %add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19 %div.us.i22 = sdiv i32 %add.us.i21, 2 %idxprom.us.i23 = sext i32 %div.us.i22 to i64 %arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23 %3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5 %cmp1.not.i.us.i = icmp sgt i64 %3, %x %spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22 %spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20 %sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25 %cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1 br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !24 while.end.i9: ; preds = %while.body.us.i18, %cond.false %r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ] %l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ] %idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64 %arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12 %4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5 %cmp1.i.i = icmp eq i64 %4, %x br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14 cond.false.thread.i14: ; preds = %while.end.i9 %idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64 %arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i %5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5 %cmp1.i22.i = icmp eq i64 %5, %x %.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1 br label %upper_bound.exit upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14 %conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ] %reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i %add = add nsw i64 %reass.sub, 1 br label %cond.end cond.end: ; preds = %lower_bound.exit, %upper_bound.exit %cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ] ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #10 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #10 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #11 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #12 ; 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) #10 { entry: %0 = load i8, ptr %a, align 1, !tbaa !20 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !20 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #17 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #17 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #2 { entry: %0 = zext i32 %size to i64 %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #17 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #2 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #16 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #17 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #12 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #14 { entry: %cmp8 = icmp sgt i64 %n, 1 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ] %0 = mul nsw i64 %i.010, %size %arrayidx = getelementptr inbounds i8, ptr %s, i64 %0 %sub = add nsw i64 %i.010, -1 %1 = mul nsw i64 %sub, %size %arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #16 %tobool.not = icmp ne i32 %call, 0 %inc = zext i1 %tobool.not to i64 %spec.select = add nuw nsw i64 %ans.09, %inc %inc2 = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc2, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !25 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #8 { entry: %cmp9 = icmp sgt i64 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = add i64 %n, -1 %min.iters.check = icmp ult i64 %n, 5 br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ] %vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = getelementptr i64, ptr %1, i64 -1 %wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = getelementptr i64, ptr %1, i64 1 %wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5 %5 = icmp ne <2 x i64> %wide.load, %wide.load14 %6 = icmp ne <2 x i64> %wide.load13, %wide.load15 %7 = zext <2 x i1> %5 to <2 x i64> %8 = zext <2 x i1> %6 to <2 x i64> %9 = add <2 x i64> %vec.phi, %7 %10 = add <2 x i64> %vec.phi12, %8 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !26 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16 for.body.preheader16: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %for.body.preheader16, %for.body %i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ] %ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011 %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1 %14 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp2.not = icmp ne i64 %13, %14 %inc = zext i1 %cmp2.not to i64 %spec.select = add nuw nsw i64 %ans.010, %inc %inc3 = add nuw nsw i64 %i.011, 1 %exitcond.not = icmp eq i64 %inc3, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !27 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #10 { entry: %0 = load i64, ptr %p, align 8, !tbaa !28 %1 = load i64, ptr %q, align 8, !tbaa !28 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #10 { entry: %0 = load i64, ptr %q, align 8, !tbaa !28 %1 = load i64, ptr %p, align 8, !tbaa !28 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #17 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #17 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %s = alloca [105 x i8], align 16 %t = alloca [105 x i8], align 16 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 105, ptr nonnull %s) #17 call void @llvm.lifetime.start.p0(i64 105, ptr nonnull %t) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #17 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp28 = icmp sgt i64 %0, 0 br i1 %cmp28, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %a.0.lcssa = phi i64 [ 0, %entry ], [ %a.2, %for.body ] %b.0.lcssa = phi i64 [ 0, %entry ], [ %b.2, %for.body ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %a.0.lcssa, i64 noundef %b.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #17 call void @llvm.lifetime.end.p0(i64 105, ptr nonnull %t) #17 call void @llvm.lifetime.end.p0(i64 105, ptr nonnull %s) #17 ret i32 0 for.body: ; preds = %entry, %for.body %i.031 = phi i64 [ %inc21, %for.body ], [ 0, %entry ] %b.030 = phi i64 [ %b.2, %for.body ], [ 0, %entry ] %a.029 = phi i64 [ %a.2, %for.body ], [ 0, %entry ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %t) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %t) #16 %cmp6 = icmp eq i32 %call5, 0 %inc = zext i1 %cmp6 to i64 %a.1 = add nsw i64 %a.029, %inc %b.1 = add nsw i64 %b.030, %inc %cmp11 = icmp sgt i32 %call5, 0 %add = add nsw i64 %a.1, 3 %a.2 = select i1 %cmp11, i64 %add, i64 %a.1 %cmp17 = icmp slt i32 %call5, 0 %add19 = add nsw i64 %b.1, 3 %b.2 = select i1 %cmp17, i64 %add19, i64 %b.1 %inc21 = add nuw nsw i64 %i.031, 1 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc21, %1 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !30 } ; 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 i64 @llvm.smax.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #15 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 #5 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { 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 #8 = { 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 #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { 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 #11 = { 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 #12 = { 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 #13 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #14 = { nofree nounwind 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 #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nounwind willreturn memory(read) } attributes #17 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !17} !20 = !{!7, !7, i64 0} !21 = !{!22, !22, i64 0} !22 = !{!"int", !7, i64 0} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10, !11, !12} !27 = distinct !{!27, !10, !12, !11} !28 = !{!29, !6, i64 0} !29 = !{!"", !6, i64 0, !6, i64 8} !30 = distinct !{!30, !10}
#include <stdio.h> int main(void){ int i,j,cnt; char str1[101]; char str2[101]; int p[2] = {}; scanf( "%d" , &cnt ); for( i = 0 ; i < cnt ; i ++ ){ scanf( "%s %s" , str1 , str2 ); //printf("%s %s\n" , str1 , str2 ); for( j = 0 ; ; j++ ){ if( str1[j] == '\0' && str2[j] == '\0' ){ p[0]++; p[1]++; //printf(" 1 1:%s - %s\n" , str1,str2); break; }else if( str1[j] > str2[j] || str2[j] == '\0' ){ p[0] += 3; //printf(" 3 0:%s - %s\n" , str1,str2); break; }else if( str1[j] < str2[j] || str1[j] == '\0' ){ p[1] += 3; //printf(" 0 3:%s - %s\n" , str1,str2); break; } } } printf( "%d %d\n" , p[0] , p[1] ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201055/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %cnt = alloca i32, align 4 %str1 = alloca [101 x i8], align 16 %str2 = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %cnt) #3 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str1) #3 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str2) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cnt) %0 = load i32, ptr %cnt, align 4, !tbaa !5 %cmp72 = icmp sgt i32 %0, 0 br i1 %cmp72, label %for.body, label %for.end52 for.body: ; preds = %entry, %for.inc50 %p.sroa.8.075 = phi i32 [ %p.sroa.8.1, %for.inc50 ], [ 0, %entry ] %p.sroa.0.074 = phi i32 [ %p.sroa.0.1, %for.inc50 ], [ 0, %entry ] %i.073 = phi i32 [ %inc51, %for.inc50 ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str1, ptr noundef nonnull %str2) br label %for.cond3 for.cond3: ; preds = %if.else29, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %if.else29 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [101 x i8], ptr %str1, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp4 = icmp eq i8 %1, 0 %arrayidx7 = getelementptr inbounds [101 x i8], ptr %str2, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx7, align 1, !tbaa !9 %cmp9 = icmp eq i8 %2, 0 %or.cond78 = select i1 %cmp4, i1 %cmp9, i1 false br i1 %or.cond78, label %if.then, label %if.else if.then: ; preds = %for.cond3 %inc = add nsw i32 %p.sroa.0.074, 1 %inc13 = add nsw i32 %p.sroa.8.075, 1 br label %for.inc50 if.else: ; preds = %for.cond3 %cmp20 = icmp sgt i8 %1, %2 %cmp25 = icmp eq i8 %2, 0 %or.cond = or i1 %cmp20, %cmp25 br i1 %or.cond, label %if.then27, label %if.else29 if.then27: ; preds = %if.else %add = add nsw i32 %p.sroa.0.074, 3 br label %for.inc50 if.else29: ; preds = %if.else %cmp36 = icmp slt i8 %1, %2 %or.cond71 = or i1 %cmp4, %cmp36 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %or.cond71, label %if.then44, label %for.cond3 if.then44: ; preds = %if.else29 %add46 = add nsw i32 %p.sroa.8.075, 3 br label %for.inc50 for.inc50: ; preds = %if.then, %if.then27, %if.then44 %p.sroa.0.1 = phi i32 [ %inc, %if.then ], [ %add, %if.then27 ], [ %p.sroa.0.074, %if.then44 ] %p.sroa.8.1 = phi i32 [ %inc13, %if.then ], [ %p.sroa.8.075, %if.then27 ], [ %add46, %if.then44 ] %inc51 = add nuw nsw i32 %i.073, 1 %3 = load i32, ptr %cnt, align 4, !tbaa !5 %cmp = icmp slt i32 %inc51, %3 br i1 %cmp, label %for.body, label %for.end52, !llvm.loop !10 for.end52: ; preds = %for.inc50, %entry %p.sroa.0.0.lcssa = phi i32 [ 0, %entry ], [ %p.sroa.0.1, %for.inc50 ] %p.sroa.8.0.lcssa = phi i32 [ 0, %entry ], [ %p.sroa.8.1, %for.inc50 ] %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p.sroa.0.0.lcssa, i32 noundef %p.sroa.8.0.lcssa) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str2) #3 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cnt) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(){ int i,a,t=0,h=0; char A[201],B[201]; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%s %s",A,B); if(strcmp(A,B)>0)t=t+3; else if(strcmp(A,B)<0)h=h+3; else{ t++; h++; } } printf("%d %d\n",t,h); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201099/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201099/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %A = alloca [201 x i8], align 16 %B = alloca [201 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %h.026 = phi i32 [ %h.1, %for.inc ], [ 0, %entry ] %t.025 = phi i32 [ %t.1, %for.inc ], [ 0, %entry ] %i.024 = phi i32 [ %inc16, %for.inc ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %A, ptr noundef nonnull dereferenceable(1) %B) #5 %cmp6 = icmp sgt i32 %call5, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nsw i32 %t.025, 3 br label %for.inc if.else: ; preds = %for.body %cmp10 = icmp slt i32 %call5, 0 br i1 %cmp10, label %if.then11, label %if.else13 if.then11: ; preds = %if.else %add12 = add nsw i32 %h.026, 3 br label %for.inc if.else13: ; preds = %if.else %inc = add nsw i32 %t.025, 1 %inc14 = add nsw i32 %h.026, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else13, %if.then11 %t.1 = phi i32 [ %add, %if.then ], [ %t.025, %if.then11 ], [ %inc, %if.else13 ] %h.1 = phi i32 [ %h.026, %if.then ], [ %add12, %if.then11 ], [ %inc14, %if.else13 ] %inc16 = add nuw nsw i32 %i.024, 1 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %inc16, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %t.0.lcssa = phi i32 [ 0, %entry ], [ %t.1, %for.inc ] %h.0.lcssa = phi i32 [ 0, %entry ], [ %h.1, %for.inc ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t.0.lcssa, i32 noundef %h.0.lcssa) call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %A) #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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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 = !{!"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> int main(){ char a[101]; char b[101]; int i,c,x=0,y=0; scanf("%d\n",&c); for(i=0;i<c;i++){ scanf("%s %s\n",a,b); if(strcmp(a,b)>0){ x=x+3; } else if(strcmp(a,b)==0){ x++; y++; } else{ y=y+3; } } printf("%d %d\n",x,y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201141/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201141/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%s %s\0A\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [101 x i8], align 16 %b = alloca [101 x i8], align 16 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 101, 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 %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %y.026 = phi i32 [ %y.1, %for.inc ], [ 0, %entry ] %x.025 = phi i32 [ %x.1, %for.inc ], [ 0, %entry ] %i.024 = phi i32 [ %inc16, %for.inc ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #5 %cmp6 = icmp sgt i32 %call5, 0 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nsw i32 %x.025, 3 br label %for.inc if.else: ; preds = %for.body %cmp10 = icmp eq i32 %call5, 0 br i1 %cmp10, label %if.then11, label %if.else13 if.then11: ; preds = %if.else %inc = add nsw i32 %x.025, 1 %inc12 = add nsw i32 %y.026, 1 br label %for.inc if.else13: ; preds = %if.else %add14 = add nsw i32 %y.026, 3 br label %for.inc for.inc: ; preds = %if.then, %if.else13, %if.then11 %x.1 = phi i32 [ %add, %if.then ], [ %inc, %if.then11 ], [ %x.025, %if.else13 ] %y.1 = phi i32 [ %y.026, %if.then ], [ %inc12, %if.then11 ], [ %add14, %if.else13 ] %inc16 = add nuw nsw i32 %i.024, 1 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp slt i32 %inc16, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %entry %x.0.lcssa = phi i32 [ 0, %entry ], [ %x.1, %for.inc ] %y.0.lcssa = phi i32 [ 0, %entry ], [ %y.1, %for.inc ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %x.0.lcssa, i32 noundef %y.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 101, 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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define N_MAX 1000000 char s[N_MAX + 1]; int main(void){ int p = 0; char l = 0; int j,o,i; int a = 0; scanf("%s",s); j = o = i = 0; while(s[p]){ switch(s[p]){ case 'J': o = i = 0; if(l != 'J')j = 0; j++; break; case 'O': i = 0; if(l != 'O')o = 0; if(l == 'I')j = 0; o++; break; case 'I': if(!o || o > j)break; i++; if(i == o && i > a)a = i; break; } l = s[p]; p++; } printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201192/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201192/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @s = dso_local global [1000001 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s) %0 = load i8, ptr @s, align 16, !tbaa !5 %tobool.not49 = icmp eq i8 %0, 0 br i1 %tobool.not49, label %while.end, label %while.body while.body: ; preds = %entry, %sw.epilog %indvars.iv = phi i64 [ %indvars.iv.next, %sw.epilog ], [ 0, %entry ] %1 = phi i8 [ %4, %sw.epilog ], [ %0, %entry ] %a.055 = phi i32 [ %a.1, %sw.epilog ], [ 0, %entry ] %i.054 = phi i32 [ %i.1, %sw.epilog ], [ 0, %entry ] %o.053 = phi i32 [ %o.2, %sw.epilog ], [ 0, %entry ] %j.052 = phi i32 [ %j.3, %sw.epilog ], [ 0, %entry ] %l.051 = phi i8 [ %1, %sw.epilog ], [ 0, %entry ] %conv = sext i8 %1 to i32 switch i32 %conv, label %sw.epilog [ i32 74, label %sw.bb i32 79, label %sw.bb5 i32 73, label %sw.bb17 ] sw.bb: ; preds = %while.body %cmp.not = icmp eq i8 %l.051, 74 %2 = add nsw i32 %j.052, 1 %inc = select i1 %cmp.not, i32 %2, i32 1 br label %sw.epilog sw.bb5: ; preds = %while.body %cmp7.not = icmp eq i8 %l.051, 79 %3 = add nsw i32 %o.053, 1 %cmp12 = icmp eq i8 %l.051, 73 %j.2 = select i1 %cmp12, i32 0, i32 %j.052 %inc16 = select i1 %cmp7.not, i32 %3, i32 1 br label %sw.epilog sw.bb17: ; preds = %while.body %tobool18.not = icmp eq i32 %o.053, 0 br i1 %tobool18.not, label %sw.epilog, label %lor.lhs.false lor.lhs.false: ; preds = %sw.bb17 %cmp19 = icmp sgt i32 %o.053, %j.052 br i1 %cmp19, label %sw.epilog, label %if.end22 if.end22: ; preds = %lor.lhs.false %inc23 = add nsw i32 %i.054, 1 %cmp24 = icmp ne i32 %inc23, %o.053 %cmp26.not = icmp slt i32 %i.054, %a.055 %or.cond = select i1 %cmp24, i1 true, i1 %cmp26.not %spec.select48 = select i1 %or.cond, i32 %a.055, i32 %inc23 br label %sw.epilog sw.epilog: ; preds = %if.end22, %sw.bb17, %lor.lhs.false, %while.body, %sw.bb5, %sw.bb %j.3 = phi i32 [ %j.052, %while.body ], [ %j.052, %lor.lhs.false ], [ %j.052, %sw.bb17 ], [ %j.2, %sw.bb5 ], [ %inc, %sw.bb ], [ %j.052, %if.end22 ] %o.2 = phi i32 [ %o.053, %while.body ], [ %o.053, %lor.lhs.false ], [ 0, %sw.bb17 ], [ %inc16, %sw.bb5 ], [ 0, %sw.bb ], [ %o.053, %if.end22 ] %i.1 = phi i32 [ %i.054, %while.body ], [ %i.054, %lor.lhs.false ], [ %i.054, %sw.bb17 ], [ 0, %sw.bb5 ], [ 0, %sw.bb ], [ %inc23, %if.end22 ] %a.1 = phi i32 [ %a.055, %while.body ], [ %a.055, %lor.lhs.false ], [ %a.055, %sw.bb17 ], [ %a.055, %sw.bb5 ], [ %a.055, %sw.bb ], [ %spec.select48, %if.end22 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1000001 x i8], ptr @s, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %4, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %sw.epilog, %entry %a.0.lcssa = phi i32 [ 0, %entry ], [ %a.1, %sw.epilog ] %call33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> typedef long long int int64; const int mod=1000000007; int comb(int n,int k){ int res=1; int inv[31]; inv[1]=1; int i; for(i=1;i<=k;i++){ if(i>=2) inv[i]=mod-(int64)(mod/i)*inv[mod%i]%mod; res=(int64)res*(n+1-i)%mod*inv[i]%mod; } return res; } void run(void){ int n,m; scanf("%d%d",&n,&m); int ans=1; int k; for(k=2;k*k<=m;k++){ if(m%k==0){ int c=0; while(m%k==0){ c++; m/=k; } ans=(int64)ans*comb(n-1+c,c)%mod; } } if(m>1) ans=(int64)ans*comb(n-1+1,1)%mod; printf("%d\n",ans); } int main(void){ run(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201264/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201264/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mod = dso_local local_unnamed_addr constant i32 1000000007, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @comb(i32 noundef %n, i32 noundef %k) local_unnamed_addr #0 { entry: %inv = alloca [31 x i32], align 16 call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %inv) #4 %arrayidx = getelementptr inbounds [31 x i32], ptr %inv, i64 0, i64 1 store i32 1, ptr %arrayidx, align 4, !tbaa !5 %cmp.not27 = icmp slt i32 %k, 1 br i1 %cmp.not27, label %for.end, label %if.end.peel if.end.peel: ; preds = %entry %add = add nsw i32 %n, 1 %0 = add nuw i32 %k, 1 %wide.trip.count = zext i32 %0 to i64 %rem12.peel33 = srem i32 %n, 1000000007 %exitcond.peel.not = icmp eq i32 %0, 2 br i1 %exitcond.peel.not, label %for.end, label %if.end.preheader if.end.preheader: ; preds = %if.end.peel %rem12.peel.sext = sext i32 %rem12.peel33 to i64 br label %if.end if.end: ; preds = %if.end.preheader, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.preheader ] %res.028 = phi i64 [ %rem17, %if.end ], [ %rem12.peel.sext, %if.end.preheader ] %1 = trunc i64 %indvars.iv to i32 %div = udiv i32 1000000007, %1 %conv = zext i32 %div to i64 %rem = urem i32 1000000007, %1 %idxprom = zext i32 %rem to i64 %arrayidx2 = getelementptr inbounds [31 x i32], ptr %inv, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %conv3 = sext i32 %2 to i64 %mul = mul nsw i64 %conv3, %conv %rem4 = srem i64 %mul, 1000000007 %3 = trunc i64 %rem4 to i32 %conv5 = sub nsw i32 1000000007, %3 %arrayidx7 = getelementptr inbounds [31 x i32], ptr %inv, i64 0, i64 %indvars.iv store i32 %conv5, ptr %arrayidx7, align 4, !tbaa !5 %sub9 = sub i32 %add, %1 %conv10 = sext i32 %sub9 to i64 %mul11 = mul nsw i64 %res.028, %conv10 %rem12 = srem i64 %mul11, 1000000007 %conv15 = zext i32 %conv5 to i64 %mul16 = mul nsw i64 %rem12, %conv15 %rem17 = srem i64 %mul16, 1000000007 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end.loopexit.loopexit, label %if.end, !llvm.loop !9 for.end.loopexit.loopexit: ; preds = %if.end %4 = trunc i64 %rem17 to i32 br label %for.end for.end: ; preds = %if.end.peel, %for.end.loopexit.loopexit, %entry %res.0.lcssa = phi i32 [ 1, %entry ], [ %rem12.peel33, %if.end.peel ], [ %4, %for.end.loopexit.loopexit ] call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %inv) #4 ret i32 %res.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 void @run() local_unnamed_addr #2 { entry: %inv.i = alloca [31 x i32], align 16 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %m.promoted47 = load i32, ptr %m, align 4, !tbaa !5 %cmp.not51 = icmp slt i32 %m.promoted47, 4 br i1 %cmp.not51, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %0 = load i32, ptr %n, align 4 %arrayidx.i = getelementptr inbounds [31 x i32], ptr %inv.i, i64 0, i64 1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %k.054 = phi i32 [ 2, %for.body.lr.ph ], [ %inc9, %for.inc ] %ans.053 = phi i32 [ 1, %for.body.lr.ph ], [ %ans.1, %for.inc ] %div.lcssa5052 = phi i32 [ %m.promoted47, %for.body.lr.ph ], [ %div.lcssa48, %for.inc ] %rem = srem i32 %div.lcssa5052, %k.054 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %while.body, label %for.inc while.body: ; preds = %for.body, %while.body %c.046 = phi i32 [ %inc, %while.body ], [ 0, %for.body ] %div4245 = phi i32 [ %div, %while.body ], [ %div.lcssa5052, %for.body ] %inc = add nuw nsw i32 %c.046, 1 %div = sdiv i32 %div4245, %k.054 %rem2 = srem i32 %div, %k.054 %cmp3 = icmp eq i32 %rem2, 0 br i1 %cmp3, label %while.body, label %if.end.peel.i, !llvm.loop !12 if.end.peel.i: ; preds = %while.body store i32 %div, ptr %m, align 4, !tbaa !5 %conv = sext i32 %ans.053 to i64 call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %inv.i) #4 store i32 1, ptr %arrayidx.i, align 4, !tbaa !5 %add = add i32 %c.046, %0 %add.i = add i32 %0, %inc %1 = add nuw i32 %c.046, 2 %wide.trip.count.i = zext i32 %1 to i64 %rem12.peel33.i = srem i32 %add, 1000000007 %rem12.peel.sext.i = sext i32 %rem12.peel33.i to i64 %exitcond.peel.not.i = icmp eq i32 %c.046, 0 br i1 %exitcond.peel.not.i, label %comb.exit, label %if.end.i if.end.i: ; preds = %if.end.peel.i, %if.end.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 2, %if.end.peel.i ] %res.028.i = phi i64 [ %rem17.i, %if.end.i ], [ %rem12.peel.sext.i, %if.end.peel.i ] %2 = trunc i64 %indvars.iv.i to i32 %div.i = udiv i32 1000000007, %2 %conv.i = zext i32 %div.i to i64 %rem.i = urem i32 1000000007, %2 %idxprom.i = zext i32 %rem.i to i64 %arrayidx2.i = getelementptr inbounds [31 x i32], ptr %inv.i, i64 0, i64 %idxprom.i %3 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %conv3.i = sext i32 %3 to i64 %mul.i = mul nsw i64 %conv3.i, %conv.i %rem4.i = srem i64 %mul.i, 1000000007 %4 = trunc i64 %rem4.i to i32 %conv5.i = sub nsw i32 1000000007, %4 %arrayidx7.i = getelementptr inbounds [31 x i32], ptr %inv.i, i64 0, i64 %indvars.iv.i store i32 %conv5.i, ptr %arrayidx7.i, align 4, !tbaa !5 %sub9.i = sub i32 %add.i, %2 %conv10.i = sext i32 %sub9.i to i64 %mul11.i = mul nsw i64 %res.028.i, %conv10.i %rem12.i = srem i64 %mul11.i, 1000000007 %conv15.i = zext i32 %conv5.i to i64 %mul16.i = mul nsw i64 %rem12.i, %conv15.i %rem17.i = srem i64 %mul16.i, 1000000007 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %comb.exit, label %if.end.i, !llvm.loop !9 comb.exit: ; preds = %if.end.i, %if.end.peel.i %res.0.lcssa.i = phi i64 [ %rem12.peel.sext.i, %if.end.peel.i ], [ %rem17.i, %if.end.i ] call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %inv.i) #4 %mul6 = mul nsw i64 %res.0.lcssa.i, %conv %rem7 = srem i64 %mul6, 1000000007 %conv8 = trunc i64 %rem7 to i32 br label %for.inc for.inc: ; preds = %for.body, %comb.exit %div.lcssa48 = phi i32 [ %div, %comb.exit ], [ %div.lcssa5052, %for.body ] %ans.1 = phi i32 [ %conv8, %comb.exit ], [ %ans.053, %for.body ] %inc9 = add nuw nsw i32 %k.054, 1 %mul = mul nsw i32 %inc9, %inc9 %cmp.not = icmp sgt i32 %mul, %div.lcssa48 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.inc, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1, %for.inc ] %.lcssa = phi i32 [ %m.promoted47, %entry ], [ %div.lcssa48, %for.inc ] %cmp10 = icmp sgt i32 %.lcssa, 1 br i1 %cmp10, label %if.then12, label %if.end21 if.then12: ; preds = %for.end %conv13 = sext i32 %ans.0.lcssa to i64 %5 = load i32, ptr %n, align 4, !tbaa !5 %rem12.peel33.i36 = srem i32 %5, 1000000007 %conv17 = sext i32 %rem12.peel33.i36 to i64 %mul18 = mul nsw i64 %conv17, %conv13 %rem19 = srem i64 %mul18, 1000000007 %conv20 = trunc i64 %rem19 to i32 br label %if.end21 if.end21: ; preds = %if.then12, %for.end %ans.2 = phi i32 [ %conv20, %if.then12 ], [ %ans.0.lcssa, %for.end ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: tail call void @run() ret i32 0 } 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main (void) { int lake; int home; int i; int distance=0; scanf("%d", &lake); scanf("%d", &home); int house[home]; int walk[home]; int max_walk=0, max; for (i=0; i<home; i++) scanf("%d", &house[i]); for (i=0; i<home - 1; i++) { walk[i] = house[i+1] - house[i]; if (walk[i] > max_walk) { max_walk = walk[i]; max = i; } } walk[home - 1] = house[0] + (lake - house[home - 1]); if (walk[home - 1] > max_walk) { max_walk = walk[home-1]; max = home-1; } for (i=0; i<max; i++) distance += walk[i]; for (i=max+1; i<home; i++) distance += walk[i]; printf("%d\n",distance); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201314/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201314/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %lake = alloca i32, align 4 %home = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %lake) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %home) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %lake) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %home) %0 = load i32, ptr %home, 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 %home, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla2 = alloca i32, i64 %4, align 16 %cmp83 = icmp sgt i32 %3, 0 br i1 %cmp83, label %for.body, label %for.cond4.preheader.thread for.cond4.preheader.thread: ; preds = %entry %sub117 = add i32 %3, -1 br label %for.cond4.preheader.for.end21_crit_edge for.cond4.preheader: ; preds = %for.body %sub = add i32 %6, -1 %cmp585 = icmp sgt i32 %6, 1 br i1 %cmp585, label %for.body6.preheader, label %for.cond4.preheader.for.end21_crit_edge for.cond4.preheader.for.end21_crit_edge: ; preds = %for.cond4.preheader.thread, %for.cond4.preheader %sub122 = phi i32 [ %sub117, %for.cond4.preheader.thread ], [ %sub, %for.cond4.preheader ] %.lcssa120 = phi i32 [ %3, %for.cond4.preheader.thread ], [ %6, %for.cond4.preheader ] %.pre115 = load i32, ptr %vla, align 16, !tbaa !5 br label %for.end21 for.body6.preheader: ; preds = %for.cond4.preheader %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %vla, align 16, !tbaa !5 %xtraiter = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %sub, 1 br i1 %5, label %for.end21.loopexit.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %home, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.body6: ; preds = %for.body6, %for.body6.preheader.new %8 = phi i32 [ %.pre, %for.body6.preheader.new ], [ %11, %for.body6 ] %indvars.iv103 = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next104.1, %for.body6 ] %max.088 = phi i32 [ undef, %for.body6.preheader.new ], [ %spec.select81.1, %for.body6 ] %max_walk.087 = phi i32 [ 0, %for.body6.preheader.new ], [ %spec.select.1, %for.body6 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.body6 ] %indvars.iv.next104 = or i64 %indvars.iv103, 1 %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next104 %9 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %sub11 = sub nsw i32 %9, %8 %arrayidx13 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv103 store i32 %sub11, ptr %arrayidx13, align 8, !tbaa !5 %cmp16 = icmp sgt i32 %sub11, %max_walk.087 %spec.select = call i32 @llvm.smax.i32(i32 %sub11, i32 %max_walk.087) %10 = trunc i64 %indvars.iv103 to i32 %spec.select81 = select i1 %cmp16, i32 %10, i32 %max.088 %indvars.iv.next104.1 = add nuw nsw i64 %indvars.iv103, 2 %arrayidx8.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next104.1 %11 = load i32, ptr %arrayidx8.1, align 8, !tbaa !5 %sub11.1 = sub nsw i32 %11, %9 %arrayidx13.1 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next104 store i32 %sub11.1, ptr %arrayidx13.1, align 4, !tbaa !5 %cmp16.1 = icmp sgt i32 %sub11.1, %spec.select %spec.select.1 = call i32 @llvm.smax.i32(i32 %sub11.1, i32 %spec.select) %12 = trunc i64 %indvars.iv.next104 to i32 %spec.select81.1 = select i1 %cmp16.1, i32 %12, i32 %spec.select81 %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.end21.loopexit.unr-lcssa, label %for.body6, !llvm.loop !11 for.end21.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %spec.select.1, %for.body6 ] %.unr = phi i32 [ %.pre, %for.body6.preheader ], [ %11, %for.body6 ] %indvars.iv103.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next104.1, %for.body6 ] %max.088.unr = phi i32 [ undef, %for.body6.preheader ], [ %spec.select81.1, %for.body6 ] %max_walk.087.unr = phi i32 [ 0, %for.body6.preheader ], [ %spec.select.1, %for.body6 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end21, label %for.body6.epil for.body6.epil: ; preds = %for.end21.loopexit.unr-lcssa %13 = getelementptr i32, ptr %vla, i64 %indvars.iv103.unr %arrayidx8.epil = getelementptr i32, ptr %13, i64 1 %14 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %sub11.epil = sub nsw i32 %14, %.unr %arrayidx13.epil = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv103.unr store i32 %sub11.epil, ptr %arrayidx13.epil, align 4, !tbaa !5 %cmp16.epil = icmp sgt i32 %sub11.epil, %max_walk.087.unr %spec.select.epil = call i32 @llvm.smax.i32(i32 %sub11.epil, i32 %max_walk.087.unr) %15 = trunc i64 %indvars.iv103.unr to i32 %spec.select81.epil = select i1 %cmp16.epil, i32 %15, i32 %max.088.unr br label %for.end21 for.end21: ; preds = %for.body6.epil, %for.end21.loopexit.unr-lcssa, %for.cond4.preheader.for.end21_crit_edge %sub121 = phi i32 [ %sub122, %for.cond4.preheader.for.end21_crit_edge ], [ %sub, %for.end21.loopexit.unr-lcssa ], [ %sub, %for.body6.epil ] %.lcssa119 = phi i32 [ %.lcssa120, %for.cond4.preheader.for.end21_crit_edge ], [ %6, %for.end21.loopexit.unr-lcssa ], [ %6, %for.body6.epil ] %16 = phi i32 [ %.pre115, %for.cond4.preheader.for.end21_crit_edge ], [ %.pre, %for.end21.loopexit.unr-lcssa ], [ %.pre, %for.body6.epil ] %max_walk.0.lcssa = phi i32 [ 0, %for.cond4.preheader.for.end21_crit_edge ], [ %spec.select.lcssa.ph, %for.end21.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body6.epil ] %max.0.lcssa = phi i32 [ undef, %for.cond4.preheader.for.end21_crit_edge ], [ %max.088.unr, %for.end21.loopexit.unr-lcssa ], [ %spec.select81.epil, %for.body6.epil ] %17 = load i32, ptr %lake, align 4, !tbaa !5 %idxprom24 = sext i32 %sub121 to i64 %arrayidx25 = getelementptr inbounds i32, ptr %vla, i64 %idxprom24 %18 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %sub26 = sub nsw i32 %17, %18 %add27 = add nsw i32 %sub26, %16 %arrayidx30 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom24 store i32 %add27, ptr %arrayidx30, align 4, !tbaa !5 %cmp34 = icmp sgt i32 %add27, %max_walk.0.lcssa %spec.select82 = select i1 %cmp34, i32 %sub121, i32 %max.0.lcssa %cmp4292 = icmp sgt i32 %spec.select82, 0 br i1 %cmp4292, label %for.body43.preheader, label %for.cond51.preheader for.body43.preheader: ; preds = %for.end21 %wide.trip.count109 = zext i32 %spec.select82 to i64 %min.iters.check = icmp ult i32 %spec.select82, 8 br i1 %min.iters.check, label %for.body43.preheader144, label %vector.ph vector.ph: ; preds = %for.body43.preheader %n.vec = and i64 %wide.trip.count109, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ] %vec.phi123 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ] %19 = getelementptr inbounds i32, ptr %vla2, i64 %index %wide.load = load <4 x i32>, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 %wide.load124 = load <4 x i32>, ptr %20, align 16, !tbaa !5 %21 = add <4 x i32> %wide.load, %vec.phi %22 = add <4 x i32> %wide.load124, %vec.phi123 %index.next = add nuw i64 %index, 8 %23 = icmp eq i64 %index.next, %n.vec br i1 %23, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %22, %21 %24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count109 br i1 %cmp.n, label %for.cond51.preheader, label %for.body43.preheader144 for.body43.preheader144: ; preds = %for.body43.preheader, %middle.block %indvars.iv106.ph = phi i64 [ 0, %for.body43.preheader ], [ %n.vec, %middle.block ] %distance.093.ph = phi i32 [ 0, %for.body43.preheader ], [ %24, %middle.block ] br label %for.body43 for.cond51.preheader: ; preds = %for.body43, %middle.block, %for.end21 %distance.0.lcssa = phi i32 [ 0, %for.end21 ], [ %24, %middle.block ], [ %add46, %for.body43 ] %i.396 = add nsw i32 %spec.select82, 1 %cmp5297 = icmp slt i32 %i.396, %.lcssa119 br i1 %cmp5297, label %for.body53.preheader, label %for.end59 for.body53.preheader: ; preds = %for.cond51.preheader %25 = sext i32 %i.396 to i64 %26 = add i32 %.lcssa119, -2 %27 = sub i32 %26, %spec.select82 %28 = zext i32 %27 to i64 %29 = add nuw nsw i64 %28, 1 %min.iters.check127 = icmp ult i32 %27, 7 br i1 %min.iters.check127, label %for.body53.preheader142, label %vector.ph128 vector.ph128: ; preds = %for.body53.preheader %n.vec130 = and i64 %29, 8589934584 %ind.end = add nsw i64 %n.vec130, %25 %30 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %distance.0.lcssa, i64 0 %invariant.gep = getelementptr i32, ptr %vla2, i64 %25 br label %vector.body133 vector.body133: ; preds = %vector.body133, %vector.ph128 %index134 = phi i64 [ 0, %vector.ph128 ], [ %index.next139, %vector.body133 ] %vec.phi135 = phi <4 x i32> [ %30, %vector.ph128 ], [ %32, %vector.body133 ] %vec.phi136 = phi <4 x i32> [ zeroinitializer, %vector.ph128 ], [ %33, %vector.body133 ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index134 %wide.load137 = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %31 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load138 = load <4 x i32>, ptr %31, align 4, !tbaa !5 %32 = add <4 x i32> %wide.load137, %vec.phi135 %33 = add <4 x i32> %wide.load138, %vec.phi136 %index.next139 = add nuw i64 %index134, 8 %34 = icmp eq i64 %index.next139, %n.vec130 br i1 %34, label %middle.block125, label %vector.body133, !llvm.loop !15 middle.block125: ; preds = %vector.body133 %bin.rdx140 = add <4 x i32> %33, %32 %35 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx140) %cmp.n132 = icmp eq i64 %29, %n.vec130 br i1 %cmp.n132, label %for.end59, label %for.body53.preheader142 for.body53.preheader142: ; preds = %for.body53.preheader, %middle.block125 %indvars.iv111.ph = phi i64 [ %25, %for.body53.preheader ], [ %ind.end, %middle.block125 ] %distance.198.ph = phi i32 [ %distance.0.lcssa, %for.body53.preheader ], [ %35, %middle.block125 ] br label %for.body53 for.body43: ; preds = %for.body43.preheader144, %for.body43 %indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body43 ], [ %indvars.iv106.ph, %for.body43.preheader144 ] %distance.093 = phi i32 [ %add46, %for.body43 ], [ %distance.093.ph, %for.body43.preheader144 ] %arrayidx45 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv106 %36 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %add46 = add nsw i32 %36, %distance.093 %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1 %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109 br i1 %exitcond110.not, label %for.cond51.preheader, label %for.body43, !llvm.loop !16 for.body53: ; preds = %for.body53.preheader142, %for.body53 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body53 ], [ %indvars.iv111.ph, %for.body53.preheader142 ] %distance.198 = phi i32 [ %add56, %for.body53 ], [ %distance.198.ph, %for.body53.preheader142 ] %arrayidx55 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv111 %37 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %add56 = add nsw i32 %37, %distance.198 %indvars.iv.next112 = add nsw i64 %indvars.iv111, 1 %lftr.wideiv = trunc i64 %indvars.iv.next112 to i32 %exitcond114.not = icmp eq i32 %.lcssa119, %lftr.wideiv br i1 %exitcond114.not, label %for.end59, label %for.body53, !llvm.loop !17 for.end59: ; preds = %for.body53, %middle.block125, %for.cond51.preheader %distance.1.lcssa = phi i32 [ %distance.0.lcssa, %for.cond51.preheader ], [ %35, %middle.block125 ], [ %add56, %for.body53 ] %call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %distance.1.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %home) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %lake) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !13, !14} !16 = distinct !{!16, !10, !14, !13} !17 = distinct !{!17, !10, !14, !13}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int k,n; int *a; char line[10000000]; char space[] = " "; if(fgets(line,sizeof(line),stdin)!=NULL){} sscanf(line,"%d%d",&k,&n); a = (int *)malloc(sizeof(int)*n); if(fgets(line,sizeof(line),stdin)!=NULL){} int i; int max_distance = 0; char *temp; temp = strtok(line,space); for(i=0;i<n;i++){ a[i] = atoi(temp); temp = strtok(NULL,space); if(i!=0){ if(a[i]-a[i-1]>max_distance){ max_distance = a[i] - a[i-1]; } } } if(k-a[n-1]+a[0] > max_distance){ max_distance = k - a[n-1]+a[0]; } printf("%d",k-max_distance); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201358/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201358/source.c" target datalayout = "e-m:e-p270: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.space = private unnamed_addr constant [2 x i8] c" \00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %n = alloca i32, align 4 %line = alloca [10000000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 10000000, ptr nonnull %line) #6 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 10000000, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n) #6 %1 = load i32, ptr %n, align 4, !tbaa !9 %conv = sext i32 %1 to i64 %mul = shl nsw i64 %conv, 2 %call3 = call noalias ptr @malloc(i64 noundef %mul) #7 %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call5 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 10000000, ptr noundef %2) %call12 = call ptr @strtok(ptr noundef nonnull %line, ptr noundef nonnull @__const.main.space) #6 %3 = load i32, ptr %n, align 4, !tbaa !9 %cmp1372 = icmp sgt i32 %3, 0 br i1 %cmp1372, label %for.inc.peel, label %for.end for.inc.peel: ; preds = %entry %call.i.peel = call i64 @strtol(ptr nocapture noundef nonnull %call12, ptr noundef null, i32 noundef 10) #6 %conv.i.peel = trunc i64 %call.i.peel to i32 store i32 %conv.i.peel, ptr %call3, align 4, !tbaa !9 %call17.peel = call ptr @strtok(ptr noundef null, ptr noundef nonnull @__const.main.space) #6 %4 = load i32, ptr %n, align 4, !tbaa !9 %cmp13.peel = icmp sgt i32 %4, 1 br i1 %cmp13.peel, label %for.body.peel.next, label %for.end for.body.peel.next: ; preds = %for.inc.peel %invariant.gep = getelementptr i32, ptr %call3, i64 -1 br label %for.inc for.inc: ; preds = %for.body.peel.next, %for.inc %indvars.iv = phi i64 [ 1, %for.body.peel.next ], [ %indvars.iv.next, %for.inc ] %temp.075 = phi ptr [ %call17.peel, %for.body.peel.next ], [ %call17, %for.inc ] %max_distance.074 = phi i32 [ 0, %for.body.peel.next ], [ %spec.select, %for.inc ] %call.i = call i64 @strtol(ptr nocapture noundef nonnull %temp.075, ptr noundef null, i32 noundef 10) #6 %conv.i = trunc i64 %call.i to i32 %arrayidx = getelementptr inbounds i32, ptr %call3, i64 %indvars.iv store i32 %conv.i, ptr %arrayidx, align 4, !tbaa !9 %call17 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @__const.main.space) #6 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %5 = load i32, ptr %gep, align 4, !tbaa !9 %sub25 = sub nsw i32 %conv.i, %5 %spec.select = call i32 @llvm.smax.i32(i32 %sub25, i32 %max_distance.074) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !9 %7 = sext i32 %6 to i64 %cmp13 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp13, label %for.inc, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc, %for.inc.peel, %entry %8 = phi i32 [ undef, %entry ], [ %conv.i.peel, %for.inc.peel ], [ %conv.i.peel, %for.inc ] %max_distance.0.lcssa = phi i32 [ 0, %entry ], [ 0, %for.inc.peel ], [ %spec.select, %for.inc ] %.lcssa = phi i32 [ %3, %entry ], [ %4, %for.inc.peel ], [ %6, %for.inc ] %9 = load i32, ptr %k, align 4, !tbaa !9 %sub37 = add nsw i32 %.lcssa, -1 %idxprom38 = sext i32 %sub37 to i64 %arrayidx39 = getelementptr inbounds i32, ptr %call3, i64 %idxprom38 %10 = load i32, ptr %arrayidx39, align 4, !tbaa !9 %sub40 = sub i32 %9, %10 %add = add nsw i32 %sub40, %8 %spec.select71 = call i32 @llvm.smax.i32(i32 %add, i32 %max_distance.0.lcssa) %sub52 = sub nsw i32 %9, %spec.select71 %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub52) call void @llvm.lifetime.end.p0(i64 10000000, ptr nonnull %line) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12, !13} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef long long ll; int hikaku(const void *n1,const void *n2) { return *(int*)n1-*(int*)n2; } int main() { int k,n,ans=0; scanf("%d %d",&k,&n); int a[n],b[n]; for(int i=0;i<n;i++) { scanf("%d",&a[i]); } qsort(a,n,sizeof(int),hikaku); for(int i=0;i<n-1;i++) { b[i]=a[i+1]-a[i]; } b[n-1]=k-a[n-1]+a[0]; qsort(b,n,sizeof(int),hikaku); ans=k-b[n-1]; printf("%d\n",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201400/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201400/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @hikaku(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 { entry: %0 = load i32, ptr %n1, align 4, !tbaa !5 %1 = load i32, ptr %n2, 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: %k = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp41 = icmp sgt i32 %3, 0 br i1 %cmp41, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre52 = sext i32 %3 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre52, %entry.for.cond.cleanup_crit_edge ], [ %17, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @hikaku) #6 %5 = load i32, ptr %n, align 4, !tbaa !5 %sub = add i32 %5, -1 %cmp543 = icmp sgt i32 %5, 1 br i1 %cmp543, label %for.body8.preheader, label %for.cond.cleanup.for.cond.cleanup7_crit_edge for.cond.cleanup.for.cond.cleanup7_crit_edge: ; preds = %for.cond.cleanup %.pre51 = load i32, ptr %vla, align 16, !tbaa !5 br label %for.cond.cleanup7 for.body8.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %vla, align 16, !tbaa !5 %min.iters.check = icmp ult i32 %5, 9 br i1 %min.iters.check, label %for.body8.preheader54, label %vector.ph vector.ph: ; preds = %for.body8.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load53, %vector.body ] %6 = or i64 %index, 1 %7 = getelementptr inbounds i32, ptr %vla, i64 %6 %wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load53 = load <4 x i32>, ptr %8, align 4, !tbaa !5 %9 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %10 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load53, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %11 = sub nsw <4 x i32> %wide.load, %9 %12 = sub nsw <4 x i32> %wide.load53, %10 %13 = getelementptr inbounds i32, ptr %vla1, i64 %index store <4 x i32> %11, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 store <4 x i32> %12, ptr %14, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count %vector.recur.extract = extractelement <4 x i32> %wide.load53, i64 3 br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader54 for.body8.preheader54: ; preds = %for.body8.preheader, %middle.block %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body8.preheader ] %indvars.iv48.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body8.preheader ] br label %for.body8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %16 = load i32, ptr %n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp = icmp slt i64 %indvars.iv.next, %17 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13 for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond.cleanup.for.cond.cleanup7_crit_edge %18 = phi i32 [ %.pre51, %for.cond.cleanup.for.cond.cleanup7_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body8 ] %19 = load i32, ptr %k, align 4, !tbaa !5 %idxprom20 = sext i32 %sub to i64 %arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %idxprom20 %20 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %sub22 = sub i32 %19, %20 %add24 = add nsw i32 %sub22, %18 %arrayidx27 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom20 store i32 %add24, ptr %arrayidx27, align 4, !tbaa !5 %conv28 = sext i32 %5 to i64 call void @qsort(ptr noundef nonnull %vla1, i64 noundef %conv28, i64 noundef 4, ptr noundef nonnull @hikaku) #6 %21 = load i32, ptr %k, align 4, !tbaa !5 %22 = load i32, ptr %n, align 4, !tbaa !5 %sub29 = add nsw i32 %22, -1 %idxprom30 = sext i32 %sub29 to i64 %arrayidx31 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom30 %23 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %sub32 = sub nsw i32 %21, %23 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub32) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 ret i32 0 for.body8: ; preds = %for.body8.preheader54, %for.body8 %scalar.recur = phi i32 [ %24, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader54 ] %indvars.iv48 = phi i64 [ %indvars.iv.next49, %for.body8 ], [ %indvars.iv48.ph, %for.body8.preheader54 ] %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1 %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next49 %24 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %sub13 = sub nsw i32 %24, %scalar.recur %arrayidx15 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv48 store i32 %sub13, ptr %arrayidx15, align 4, !tbaa !5 %exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
/* とりあえずソースコード見る前に推し見ていってください。 ` ....J&wZTUUWc `...JZY"!~-._<~~~~_d' ` ..-Z"=~`..._~___::~~~_J\ ........ ` ..dY=````..~~__::::::::~_J\ .KY"=<<<<<<<?77"YTXa-.. ` .JY=`````.-<~--::<<~~~~<:<_d^ W,~~~_______<~-..`.. ?7TG+...` ` ` ` ` .... ` .v"~`````.-<~-JT1__........_-d' T,_~:::;:<z+-~~~~<-..``.`._?TSJ.. ..JVYT7TTTTTY"=<<<?7"TQJ=~`.``...?~~__(<~_......... .#` (h_~:<::((+v___._.~~?<.`````.`_?TG-__...___.__....` ..?~```.` .J!~~_..-~<7_......._ .P .W,_~~~_?71-.````` _~~?i..````````.``.```..```````._```.. .J>_~_` ?<<__....... (% ?p _..._._-z., ``` _~_?<- .`.````````````.``.````` _<1>_~~~~._ --(i-......._ .V! .W, ......(>~<~+-....~~~(t<!`.`.`.`.``.```.``.``` ` .<-~~((?1~?=_......_ .J= 7e .........!_.C~-(>(?` ` ```````````````````` ` ?(~_`` ``.... `.-Y .W, .......```` ~(<` ` ` ` `````````` ` ` ?-_. ``` .J" `?h. ` ` .~J! ` ` ` ` ` ` ` ` ` ` ` ` 1__ ..J= 7a, .~_J` ` ` ` ` `` ` ` ` ` ` ` ` 1-_ (d=` ?TGgJ<<_J`` ` ` ` - ` ```` ``` ` `( ` ` ` .wWc<W_ .5g-$` ` > ````` ``` ` ` (- ` ` ` _7HHXb. .@H=` ` `.l` ```` ` ```` `(<-` _ ` ` ` j ?NHm,` `.dHMF ` ` ` . `.$```` ` `` ````(~(.(<J- ` ` ` ( W7HHm, `.@Ht,P` ` ._ (1_. ` ` ` `` .(T!_<-`?W+ ` ````( d, (UHh.` ` .M#! b`` ` ,Sv7TOo. ` ` ` _~. <`` <. ({` `` ` .< h .UH&` `.MD` O-`````vl v.1__ ``` ``````.;.:``` 1 J1 ` ````.i! ` J; ?Mh. .WF .n...``.?- > ->.-`````````..I+.`` ..e:(- . ```.V- `.b UN. ` `(F (C<~(<..l(1c` ?z1---....._jjA.JJadHYW@.> < ``.c(} ` d. ?N. `.@` .@ <((-_vM#HmQmq8?1&-~~~(J!` WHMHMb `.>.> ._J~(!` ``(] ,b ` ,> d!` ` v+(_`.HHMMb. `????```` XxdHMH~` >(iJO!_(> ```_ K ,` . .F` ` ``.c1s..HdMMH~````````````(BXVY=``.O>`.c_(>_````(-W `J{;``` ``(+> `-77"= ```.```````````` ````..+>~~_````.}d H(:```````.3 ..````````.````````````` `.` .>~~~({__ ``.Pd ` Dd_```.....I ``````````_````````````````.v~~:~:(P_~_ ((bK WM{ ...~~~~(o.``````````````` ..````` .?`(<:~(-+#_~~_1dH% dvr-l..~~_s_w7+.``.<(-. ?!``~~..-<1.?!` J<+~:(iWH~::(kWF X_w~~~(jM:Wc_O?42``` ?&+-;+<~``.(:` .4~(D~(Id!H~_(V!! .hdm_~(d?hdNz-_(>``.._(_.(>_..``(:`` (1H%(uV! HV"! 7:?4uD.K~.._?z>`.._(JSjk-__`.`(C<<!_7H#"! .dI:__-.I?&Jv=_+?>?l_?4v?> -< ...?h. ` .JHz?1<:::J<(l ` J?1J<1_ `(:..?_...._Jb `..v"!``(>(1+:(>~~(1.<(1<iJ><..C<_--1(:::+CJN. J=````.` (a+g0Ws:::_:_::(<___<(~___(C~:<z<1>-Ta,` `?e````.z@! X<:::::::<+:::::?1+jdYTYAaZ!``` ?4a.` ` (n.````Oe .D_~~~:::::::::::::(W! ?U, ````.To. ` .4,````?Hka.f_....__~~::~:~:~~~_d; (W,`` `` 7a. ?N, `-_4D..............~.~..._W, ?NJ. ` ` ?4dYBh, ` JD?- +_......................W. _TS&, ` ` TmJN` .UR-...<z+-_-............-__-((dL _Wn. ` .! (t ` ` J8!_.2____<?<<<+(-(--(+<<1<<(_<jL .N..`.J! ?W& d&J?` ~?<+-_(-~(-:(_: <.<(-(<7!_?o ?B9Tn.` (4kdb ` `.dY! ` `./` ` _(????!!~!` ``(_``..?L .4,m,iW. .U, `.! ` ! `` `. `` ` < `...?r Wd?BY` (N&.`.!` ` < ```` _ ` ```(_`..(JV` ` ` `(8-.?=<?1+-..+... ```(.......f<~?r ` ` ...... .K`.?<-. __(K<D__<?TC~~~~__```.-S. ....-&ZY""777?77""9GJ,` ` `J}````` _??<d= J{~~~~~(i.....-<<~`(Y77<~_``.```.```````.`.(XHa. ` ` .K`````````.d^ X~~.~.~~_1. ````.`` I_....```.````.``.`````_dWqHm, `(%``.`.```.Y R~~~.~.~~~<-`````.``(-~~.....`.`````.``.``.(dWqkHh .K_```.``.J^ S_~~~~~.~~~?:``.``.`.l~~~~...``.`.``````.``_zWkqkHb` ` .d'`..```.Y` q{~.~.~~.~.~(i ````.`(/.~~.....```.``.```.`.dWqqqqH[ .d!`~~_-.J^ .b_~.~~.~~~~~_1. ..``?+~~~~....````````.` (WkHHM#H# d!` __?(f` ?n~~~.~~.~~~~~?i_.````?/~~.~..`.``.``.``._jkY"7= ` .D``` `.% ?h,~~~~.~..~~~~1, ``` j_~~....``.``.``.-V=` `(}` (\ Tm,~~~~~.~.~~~?- `` .>~~....``.``..JY` ` ` .g` (' ?W&-~~~~~.~.~(> ` 1_~~....`..JT^ d=< .,Nx THaJ-_~~~~~(l (o.(((JZ"^` ` .@ `?`.H. _"YBHmggk<!`` > W> 4eJ>:1.(t W+.<(. .(D ` ({?<!~db W$<<jY4F` ,h. _`.W` (5..J=.d` ` 7TUY"` 4,...(Y! ~~` ` でかいですね。 更にかわいいときた。 うん。好き。 */ /* include */ #include <assert.h> #include <ctype.h> #include <errno.h> #include <locale.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <setjmp.h> #include <string.h> #include <signal.h> #include <stdarg.h> #include <stdbool.h> /* typedef */ typedef long long ll; typedef char string[100]; typedef int array[100]; /* define */ /* define funcs */ #define sort_d(array,end){int size=end-array;qsort(array,size,sizeof(int),intcmp);} #define sort_c(array,end){int size=end-array;qsort(array,size,sizeof(char),charcmp);} #define rand_range(min,max) (min)+(rand())%((max)-(min)+(1)) #define rep(i,j) for(int i=0;i<j;i++) #define loop(i,j,z) for(int i=j;i<z;i++) #define swap(a,b) ((a!=b)&&(a+=b,b=a-b,a-= b)) #define getarray_d(array,size){array=(int *)malloc(sizeof(int)*size);} #define getarray_c(array,size){array=(char *)malloc(sizeof(char)*size);} #define fill(array,end,val){int size=end-array;rep(i,size)array[i]=val;} #define min(a,b) (a>b)?b:a /* otter (Otter) カワウソッ! */ #define intptr int * #define random srand((unsigned)time(NULL)) #define ON 1 #define OFF 0 #define TREE_SIZE 1000 /* prototype Declaration */ int intcmp(const void* a, const void* b); int charcmp(const void* a, const void* b); bool is_sorted(const int* start, const int* end); int count(const int* start, const int* end, int target); void shuffle(int* start, int* end); void tree_init(void); int tree_root(int x); void unite(int x, int y); bool same(int x, int y); /* scan */ #define sd(a) scanf("%d",&a) #define sc(a) scanf("%c",&a), getchar() #define sf(a) scanf("%f",&a) #define ss(a) scanf("%s",a) #define sld(a) scanf("%lld",&a) /* print */ #define odn(a) printf("%d\n",a) #define oldn(a) printf("%lld\n",a) #define ocn(a) printf("%c\n",a) #define ofn(a) printf("%f\n",a) #define osn(a) printf("%s\n",a) #define od(a) printf("%d ",a) #define old(a) printf("%lld\n",a) #define oc(a) printf("%c ",a) #define of(a) printf("%f ",a) #define os(a) printf("%s ",a) /* struct */ typedef struct { int first; int second; }pair; /* local val */ int tree[TREE_SIZE]; int cnts=0; /* funcs (local)*/ /* main program */ int main(void){ int K,N; int A[200005]; sd(K),sd(N); rep(i,N) sd(A[i]); int m_len=INT_MAX; rep(i,N){ if(i!=N-1) m_len=min(m_len,K-(A[i+1]-A[i])); else m_len=min(m_len,A[N-1]-A[0]); } od(m_len); } /* funcs (global)*/ void sort_first(pair* b, pair* e) { int* dec; int s2 = e - b; int size = e - b; getarray_d(dec, size); rep(i, size) dec[i] = b[i].first; sort_d(dec, dec + s2); rep(i, size) b[i].first = dec[i]; } void sort_second(pair* b, pair* e) { int* dec; int s2 = e - b; int size = e - b; getarray_d(dec, size); rep(i, size) dec[i] = b[i].second; sort_d(dec, dec + s2); rep(i, size) b[i].second = dec[i]; } int intcmp(const void* a, const void* b) { return *(int*)a - *(int*)b; } int charcmp(const void* a, const void* b) { return *(char*)a - *(char*)b; } bool is_sorted(const int* start, const int* end) { while (start != end) { if (*start > * (start + 1)) return false; start++; } return true; } int count(const int* start, const int* end, int target) { int cnt = 0; int* array; int* p; array = (int*)malloc((end - start) * sizeof(int)); if (array == NULL) { printf("Err0r"); exit(-1); } memcpy(array, start, sizeof(int) * (end - start)); sort_d(array, array + (end - start)); p = (int*)bsearch(&target, array, end - start, sizeof(int), intcmp); if (p == NULL) { free(array); return 0; } while (*p == target) p++; p--; while (*p == target) { cnt++; p--; } free(array); return cnt; } void shuffle(int* start, int* end) { random; int a, b; int size = end - start; rep(i, 500) { a = rand_range(0, size - 1); b = rand_range(0, size - 1); swap(start[a], start[b]); } } /* tree */ void tree_init(void) { for (int i = 0; i < TREE_SIZE; i++) tree[i] = i; } int tree_root(int x) { if (tree[x] == x) return x; return tree[x] = tree_root(tree[x]); } void unite(int x, int y) { int rx = tree_root(x); int ry = tree_root(y); if (rx == ry) return; tree[rx] = ry; } bool same(int x, int y) { int rx = tree_root(x); int ry = tree_root(y); return rx == ry; } ll pow_mod(ll n, ll k, ll m) { if (k == 0) return 1; else if (k % 2) return pow_mod(n, k - 1, m) * n % m; else { int t = pow_mod(n, k / 2, m); return t * t % m; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201451/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201451/source.c" target datalayout = "e-m:e-p270: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.pair = type { i32, i32 } @cnts = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"Err0r\00", align 1 @tree = dso_local local_unnamed_addr global [1000 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 %N = alloca i32, align 4 %A = alloca [200005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #17 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #17 call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %A) #17 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.cond.cleanup6 for.cond4.preheader: ; preds = %for.body %cmp556 = icmp sgt i32 %4, 0 br i1 %cmp556, label %for.body7.lr.ph, label %for.cond.cleanup6 for.body7.lr.ph: ; preds = %for.cond4.preheader %sub = add nsw i32 %4, -1 %1 = load i32, ptr %K, align 4 %idxprom24 = zext i32 %sub to i64 %arrayidx25 = getelementptr inbounds [200005 x i32], ptr %A, i64 0, i64 %idxprom24 %2 = load i32, ptr %A, align 16 %3 = zext i32 %sub to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200005 x i32], ptr %A, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.cond4.preheader, !llvm.loop !9 for.cond.cleanup6: ; preds = %for.inc38, %entry, %for.cond4.preheader %m_len.0.lcssa = phi i32 [ 2147483647, %for.cond4.preheader ], [ 2147483647, %entry ], [ %m_len.1, %for.inc38 ] %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m_len.0.lcssa) call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %A) #17 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #17 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #17 ret i32 0 for.body7: ; preds = %for.body7.lr.ph, %for.inc38 %indvars.iv62 = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next63.pre-phi, %for.inc38 ] %m_len.057 = phi i32 [ 2147483647, %for.body7.lr.ph ], [ %m_len.1, %for.inc38 ] %cmp8.not = icmp eq i64 %indvars.iv62, %3 br i1 %cmp8.not, label %if.else, label %if.then if.then: ; preds = %for.body7 %6 = add nuw nsw i64 %indvars.iv62, 1 %arrayidx10 = getelementptr inbounds [200005 x i32], ptr %A, i64 0, i64 %6 %7 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [200005 x i32], ptr %A, i64 0, i64 %indvars.iv62 %8 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %sub13.neg = sub i32 %1, %7 %sub14 = add i32 %sub13.neg, %8 %sub14.m_len.0 = call i32 @llvm.smin.i32(i32 %m_len.057, i32 %sub14) br label %for.inc38 if.else: ; preds = %for.body7 %9 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %sub27 = sub nsw i32 %9, %2 %sub27.m_len.0 = call i32 @llvm.smin.i32(i32 %m_len.057, i32 %sub27) %.pre = add nuw nsw i64 %indvars.iv62, 1 br label %for.inc38 for.inc38: ; preds = %if.then, %if.else %indvars.iv.next63.pre-phi = phi i64 [ %6, %if.then ], [ %.pre, %if.else ] %m_len.1 = phi i32 [ %sub14.m_len.0, %if.then ], [ %sub27.m_len.0, %if.else ] %exitcond.not = icmp eq i64 %indvars.iv.next63.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup6, label %for.body7, !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: nofree nounwind uwtable define dso_local void @sort_first(ptr noundef %b, ptr noundef %e) local_unnamed_addr #0 { entry: %sub.ptr.lhs.cast = ptrtoint ptr %e to i64 %sub.ptr.rhs.cast = ptrtoint ptr %b to i64 %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %sub.ptr.div = lshr exact i64 %sub.ptr.sub, 3 %conv = trunc i64 %sub.ptr.div to i32 %sext = shl i64 %sub.ptr.sub, 29 %conv6 = ashr i64 %sext, 32 %mul = shl nsw i64 %conv6, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #18 %cmp47 = icmp sgt i32 %conv, 0 br i1 %cmp47, label %for.body.preheader, label %for.cond.cleanup.thread for.cond.cleanup.thread: ; preds = %entry tail call void @qsort(ptr noundef %call, i64 noundef %conv6, i64 noundef 4, ptr noundef nonnull @intcmp) #17 br label %for.cond.cleanup21 for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %sub.ptr.div, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 9 br i1 %min.iters.check, label %for.body.preheader59, label %vector.ph for.body.preheader59: ; preds = %vector.body, %for.body.preheader %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %vector.body ] br label %for.body vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %sub.ptr.div, 7 %0 = icmp eq i64 %n.mod.vf, 0 %1 = select i1 %0, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %wide.trip.count, %1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = or i64 %index, 4 %3 = getelementptr inbounds %struct.pair, ptr %b, i64 %index %4 = getelementptr inbounds %struct.pair, ptr %b, i64 %2 %wide.vec = load <8 x i32>, ptr %3, align 4, !tbaa !12 %wide.vec57 = load <8 x i32>, ptr %4, align 4, !tbaa !12 %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec58 = shufflevector <8 x i32> %wide.vec57, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %5 = getelementptr inbounds i32, ptr %call, i64 %index store <4 x i32> %strided.vec, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 store <4 x i32> %strided.vec58, ptr %6, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %for.body.preheader59, label %vector.body, !llvm.loop !14 for.cond.cleanup: ; preds = %for.body tail call void @qsort(ptr noundef nonnull %call, i64 noundef %conv6, i64 noundef 4, ptr noundef nonnull @intcmp) #17 br i1 %cmp47, label %for.body22.preheader, label %for.cond.cleanup21 for.body22.preheader: ; preds = %for.cond.cleanup %8 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %sub.ptr.div, 3 %9 = icmp ult i64 %8, 3 br i1 %9, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body22 for.body: ; preds = %for.body.preheader59, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader59 ] %arrayidx = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv %10 = load i32, ptr %arrayidx, align 4, !tbaa !12 %arrayidx9 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %10, ptr %arrayidx9, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !17 for.cond.cleanup21.loopexit.unr-lcssa: ; preds = %for.body22, %for.body22.preheader %indvars.iv52.unr = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next53.3, %for.body22 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup21, label %for.body22.epil for.body22.epil: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil %indvars.iv52.epil = phi i64 [ %indvars.iv.next53.epil, %for.body22.epil ], [ %indvars.iv52.unr, %for.cond.cleanup21.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond.cleanup21.loopexit.unr-lcssa ] %arrayidx24.epil = getelementptr inbounds i32, ptr %call, i64 %indvars.iv52.epil %11 = load i32, ptr %arrayidx24.epil, align 4, !tbaa !5 %arrayidx26.epil = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv52.epil store i32 %11, ptr %arrayidx26.epil, align 4, !tbaa !12 %indvars.iv.next53.epil = add nuw nsw i64 %indvars.iv52.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup21, label %for.body22.epil, !llvm.loop !18 for.cond.cleanup21: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil, %for.cond.cleanup.thread, %for.cond.cleanup ret void for.body22: ; preds = %for.body22, %for.body22.preheader.new %indvars.iv52 = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next53.3, %for.body22 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.3, %for.body22 ] %arrayidx24 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv52 %12 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %arrayidx26 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv52 store i32 %12, ptr %arrayidx26, align 4, !tbaa !12 %indvars.iv.next53 = or i64 %indvars.iv52, 1 %arrayidx24.1 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next53 %13 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5 %arrayidx26.1 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv.next53 store i32 %13, ptr %arrayidx26.1, align 4, !tbaa !12 %indvars.iv.next53.1 = or i64 %indvars.iv52, 2 %arrayidx24.2 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next53.1 %14 = load i32, ptr %arrayidx24.2, align 4, !tbaa !5 %arrayidx26.2 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv.next53.1 store i32 %14, ptr %arrayidx26.2, align 4, !tbaa !12 %indvars.iv.next53.2 = or i64 %indvars.iv52, 3 %arrayidx24.3 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next53.2 %15 = load i32, ptr %arrayidx24.3, align 4, !tbaa !5 %arrayidx26.3 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv.next53.2 store i32 %15, ptr %arrayidx26.3, align 4, !tbaa !12 %indvars.iv.next53.3 = add nuw nsw i64 %indvars.iv52, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22, !llvm.loop !20 } ; 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 declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @intcmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_second(ptr noundef %b, ptr noundef %e) local_unnamed_addr #0 { entry: %sub.ptr.lhs.cast = ptrtoint ptr %e to i64 %sub.ptr.rhs.cast = ptrtoint ptr %b to i64 %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %sub.ptr.div = lshr exact i64 %sub.ptr.sub, 3 %conv = trunc i64 %sub.ptr.div to i32 %sext = shl i64 %sub.ptr.sub, 29 %conv6 = ashr i64 %sext, 32 %mul = shl nsw i64 %conv6, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #18 %cmp47 = icmp sgt i32 %conv, 0 br i1 %cmp47, label %for.body.preheader, label %for.cond.cleanup.thread for.cond.cleanup.thread: ; preds = %entry tail call void @qsort(ptr noundef %call, i64 noundef %conv6, i64 noundef 4, ptr noundef nonnull @intcmp) #17 br label %for.cond.cleanup21 for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %sub.ptr.div, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 9 br i1 %min.iters.check, label %for.body.preheader59, label %vector.ph for.body.preheader59: ; preds = %vector.body, %for.body.preheader %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %vector.body ] br label %for.body vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %sub.ptr.div, 7 %0 = icmp eq i64 %n.mod.vf, 0 %1 = select i1 %0, i64 8, i64 %n.mod.vf %n.vec = sub nsw i64 %wide.trip.count, %1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = or i64 %index, 4 %3 = getelementptr inbounds %struct.pair, ptr %b, i64 %index, i32 1 %4 = getelementptr inbounds %struct.pair, ptr %b, i64 %2, i32 1 %wide.vec = load <8 x i32>, ptr %3, align 4, !tbaa !21 %wide.vec57 = load <8 x i32>, ptr %4, align 4, !tbaa !21 %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec58 = shufflevector <8 x i32> %wide.vec57, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %5 = getelementptr inbounds i32, ptr %call, i64 %index store <4 x i32> %strided.vec, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 store <4 x i32> %strided.vec58, ptr %6, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %for.body.preheader59, label %vector.body, !llvm.loop !22 for.cond.cleanup: ; preds = %for.body tail call void @qsort(ptr noundef nonnull %call, i64 noundef %conv6, i64 noundef 4, ptr noundef nonnull @intcmp) #17 br i1 %cmp47, label %for.body22.preheader, label %for.cond.cleanup21 for.body22.preheader: ; preds = %for.cond.cleanup %8 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %sub.ptr.div, 3 %9 = icmp ult i64 %8, 3 br i1 %9, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body22 for.body: ; preds = %for.body.preheader59, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader59 ] %second = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv, i32 1 %10 = load i32, ptr %second, align 4, !tbaa !21 %arrayidx9 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %10, ptr %arrayidx9, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !23 for.cond.cleanup21.loopexit.unr-lcssa: ; preds = %for.body22, %for.body22.preheader %indvars.iv52.unr = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next53.3, %for.body22 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup21, label %for.body22.epil for.body22.epil: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil %indvars.iv52.epil = phi i64 [ %indvars.iv.next53.epil, %for.body22.epil ], [ %indvars.iv52.unr, %for.cond.cleanup21.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond.cleanup21.loopexit.unr-lcssa ] %arrayidx24.epil = getelementptr inbounds i32, ptr %call, i64 %indvars.iv52.epil %11 = load i32, ptr %arrayidx24.epil, align 4, !tbaa !5 %second27.epil = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv52.epil, i32 1 store i32 %11, ptr %second27.epil, align 4, !tbaa !21 %indvars.iv.next53.epil = add nuw nsw i64 %indvars.iv52.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup21, label %for.body22.epil, !llvm.loop !24 for.cond.cleanup21: ; preds = %for.cond.cleanup21.loopexit.unr-lcssa, %for.body22.epil, %for.cond.cleanup.thread, %for.cond.cleanup ret void for.body22: ; preds = %for.body22, %for.body22.preheader.new %indvars.iv52 = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next53.3, %for.body22 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.3, %for.body22 ] %arrayidx24 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv52 %12 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %second27 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv52, i32 1 store i32 %12, ptr %second27, align 4, !tbaa !21 %indvars.iv.next53 = or i64 %indvars.iv52, 1 %arrayidx24.1 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next53 %13 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5 %second27.1 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv.next53, i32 1 store i32 %13, ptr %second27.1, align 4, !tbaa !21 %indvars.iv.next53.1 = or i64 %indvars.iv52, 2 %arrayidx24.2 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next53.1 %14 = load i32, ptr %arrayidx24.2, align 4, !tbaa !5 %second27.2 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv.next53.1, i32 1 store i32 %14, ptr %second27.2, align 4, !tbaa !21 %indvars.iv.next53.2 = or i64 %indvars.iv52, 3 %arrayidx24.3 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next53.2 %15 = load i32, ptr %arrayidx24.3, align 4, !tbaa !5 %second27.3 = getelementptr inbounds %struct.pair, ptr %b, i64 %indvars.iv.next53.2, i32 1 store i32 %15, ptr %second27.3, align 4, !tbaa !21 %indvars.iv.next53.3 = add nuw nsw i64 %indvars.iv52, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond.cleanup21.loopexit.unr-lcssa, label %for.body22, !llvm.loop !25 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @charcmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i8, ptr %a, align 1, !tbaa !26 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !26 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local zeroext i1 @is_sorted(ptr noundef readonly %start, ptr noundef readnone %end) local_unnamed_addr #6 { entry: br label %while.cond while.cond: ; preds = %while.body, %entry %start.addr.0 = phi ptr [ %start, %entry ], [ %add.ptr, %while.body ] %cmp.not = icmp eq ptr %start.addr.0, %end br i1 %cmp.not, label %return, label %while.body while.body: ; preds = %while.cond %0 = load i32, ptr %start.addr.0, align 4, !tbaa !5 %add.ptr = getelementptr inbounds i32, ptr %start.addr.0, i64 1 %1 = load i32, ptr %add.ptr, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %0, %1 br i1 %cmp1, label %return, label %while.cond, !llvm.loop !27 return: ; preds = %while.cond, %while.body ret i1 %cmp.not } ; Function Attrs: nounwind uwtable define dso_local i32 @count(ptr noundef %start, ptr noundef %end, i32 noundef %target) local_unnamed_addr #7 { entry: %sub.ptr.lhs.cast = ptrtoint ptr %end to i64 %sub.ptr.rhs.cast = ptrtoint ptr %start to i64 %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %call = tail call noalias ptr @malloc(i64 noundef %sub.ptr.sub) #18 %cmp = icmp eq ptr %call, null br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) tail call void @exit(i32 noundef -1) #19 unreachable if.end: ; preds = %entry tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %call, ptr align 4 %start, i64 %sub.ptr.sub, i1 false) %sext = shl i64 %sub.ptr.sub, 30 %conv15 = ashr i64 %sext, 32 tail call void @qsort(ptr noundef nonnull %call, i64 noundef %conv15, i64 noundef 4, ptr noundef nonnull @intcmp) #17 %cmp18.not.i = icmp eq ptr %end, %start br i1 %cmp18.not.i, label %if.then23, label %while.body.i.preheader while.body.i.preheader: ; preds = %if.end %sub.ptr.div = ashr exact i64 %sub.ptr.sub, 2 br label %while.body.i while.body.i: ; preds = %while.body.i.preheader, %if.end6.i %__l.020.i = phi i64 [ %__l.1.i, %if.end6.i ], [ 0, %while.body.i.preheader ] %__u.019.i = phi i64 [ %__u.1.i, %if.end6.i ], [ %sub.ptr.div, %while.body.i.preheader ] %add.i = add i64 %__u.019.i, %__l.020.i %div17.i = lshr i64 %add.i, 1 %mul.i = shl i64 %div17.i, 2 %add.ptr.i = getelementptr inbounds i8, ptr %call, i64 %mul.i %0 = load i32, ptr %add.ptr.i, align 4, !tbaa !5 %cmp1.i = icmp sgt i32 %0, %target br i1 %cmp1.i, label %if.end6.i, label %if.else.i if.else.i: ; preds = %while.body.i %cmp2.not.i = icmp eq i32 %0, %target br i1 %cmp2.not.i, label %while.cond.preheader, label %if.then3.i while.cond.preheader: ; preds = %if.else.i %add.ptr.i.le = getelementptr inbounds i8, ptr %call, i64 %mul.i br label %while.cond if.then3.i: ; preds = %if.else.i %add4.i = add nuw i64 %div17.i, 1 br label %if.end6.i if.end6.i: ; preds = %if.then3.i, %while.body.i %__u.1.i = phi i64 [ %__u.019.i, %if.then3.i ], [ %div17.i, %while.body.i ] %__l.1.i = phi i64 [ %add4.i, %if.then3.i ], [ %__l.020.i, %while.body.i ] %cmp.i = icmp ult i64 %__l.1.i, %__u.1.i br i1 %cmp.i, label %while.body.i, label %if.then23, !llvm.loop !28 if.then23: ; preds = %if.end6.i, %if.end tail call void @free(ptr noundef nonnull %call) #17 br label %cleanup while.cond: ; preds = %while.cond, %while.cond.preheader %p.0 = phi ptr [ %incdec.ptr, %while.cond ], [ %add.ptr.i.le, %while.cond.preheader ] %1 = load i32, ptr %p.0, align 4, !tbaa !5 %cmp25 = icmp eq i32 %1, %target %incdec.ptr = getelementptr inbounds i32, ptr %p.0, i64 1 br i1 %cmp25, label %while.cond, label %while.cond28, !llvm.loop !29 while.cond28: ; preds = %while.cond, %while.cond28 %cnt.0 = phi i32 [ %inc, %while.cond28 ], [ 0, %while.cond ] %p.0.pn = phi ptr [ %p.1, %while.cond28 ], [ %p.0, %while.cond ] %p.1 = getelementptr inbounds i32, ptr %p.0.pn, i64 -1 %2 = load i32, ptr %p.1, align 4, !tbaa !5 %cmp29 = icmp eq i32 %2, %target %inc = add nuw nsw i32 %cnt.0, 1 br i1 %cmp29, label %while.cond28, label %while.end33, !llvm.loop !30 while.end33: ; preds = %while.cond28 tail call void @free(ptr noundef %call) #17 br label %cleanup cleanup: ; preds = %while.end33, %if.then23 %retval.0 = phi i32 [ 0, %if.then23 ], [ %cnt.0, %while.end33 ] ret i32 %retval.0 } ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #8 ; 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) #9 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #10 ; Function Attrs: nounwind uwtable define dso_local void @shuffle(ptr noundef %start, ptr noundef %end) local_unnamed_addr #7 { entry: %call = tail call i64 @time(ptr noundef null) #17 %conv = trunc i64 %call to i32 tail call void @srand(i32 noundef %conv) #17 %sub.ptr.lhs.cast = ptrtoint ptr %end to i64 %sub.ptr.rhs.cast = ptrtoint ptr %start to i64 %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %sub.ptr.div = lshr exact i64 %sub.ptr.sub, 2 %conv1 = trunc i64 %sub.ptr.div to i32 br label %for.body for.cond.cleanup: ; preds = %land.end ret void for.body: ; preds = %entry, %land.end %i.052 = phi i32 [ 0, %entry ], [ %inc, %land.end ] %call3 = tail call i32 @rand() #17 %rem = srem i32 %call3, %conv1 %call6 = tail call i32 @rand() #17 %rem10 = srem i32 %call6, %conv1 %idxprom = sext i32 %rem to i64 %arrayidx = getelementptr inbounds i32, ptr %start, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom12 = sext i32 %rem10 to i64 %arrayidx13 = getelementptr inbounds i32, ptr %start, i64 %idxprom12 %1 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14.not = icmp eq i32 %0, %1 br i1 %cmp14.not, label %land.end, label %land.rhs land.rhs: ; preds = %for.body %add20 = add nsw i32 %1, %0 store i32 %add20, ptr %arrayidx, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %sub25 = sub nsw i32 %add20, %2 store i32 %sub25, ptr %arrayidx13, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %sub32 = sub nsw i32 %3, %sub25 store i32 %sub32, ptr %arrayidx, align 4, !tbaa !5 br label %land.end land.end: ; preds = %land.rhs, %for.body %inc = add nuw nsw i32 %i.052, 1 %exitcond.not = icmp eq i32 %inc, 500 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !31 } ; Function Attrs: nounwind declare void @srand(i32 noundef) local_unnamed_addr #11 ; Function Attrs: nounwind declare i64 @time(ptr noundef) local_unnamed_addr #11 ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #11 ; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @tree_init() local_unnamed_addr #12 { entry: br label %vector.body vector.body: ; preds = %vector.body.1, %entry %index = phi i64 [ 0, %entry ], [ %index.next.1, %vector.body.1 ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %entry ], [ %vec.ind.next.1, %vector.body.1 ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [1000 x i32], ptr @tree, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !5 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !5 %index.next = or i64 %index, 8 %2 = icmp eq i64 %index.next, 1000 br i1 %2, label %for.cond.cleanup, label %vector.body.1, !llvm.loop !32 vector.body.1: ; preds = %vector.body %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %step.add.1 = add <4 x i32> %vec.ind, <i32 12, i32 12, i32 12, i32 12> %3 = getelementptr inbounds [1000 x i32], ptr @tree, i64 0, i64 %index.next store <4 x i32> %vec.ind.next, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> %step.add.1, ptr %4, align 16, !tbaa !5 %index.next.1 = add nuw nsw i64 %index, 16 %vec.ind.next.1 = add <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16> br label %vector.body for.cond.cleanup: ; preds = %vector.body ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @tree_root(i32 noundef %x) local_unnamed_addr #13 { entry: %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [1000 x i32], ptr @tree, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %x br i1 %cmp, label %common.ret9, label %if.end common.ret9: ; preds = %entry, %if.end %common.ret9.op = phi i32 [ %call, %if.end ], [ %x, %entry ] ret i32 %common.ret9.op if.end: ; preds = %entry %call = tail call i32 @tree_root(i32 noundef %0) store i32 %call, ptr %arrayidx, align 4, !tbaa !5 br label %common.ret9 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @unite(i32 noundef %x, i32 noundef %y) local_unnamed_addr #14 { entry: %call = tail call i32 @tree_root(i32 noundef %x) %call1 = tail call i32 @tree_root(i32 noundef %y) %cmp = icmp eq i32 %call, %call1 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %idxprom = sext i32 %call to i64 %arrayidx = getelementptr inbounds [1000 x i32], ptr @tree, i64 0, i64 %idxprom store i32 %call1, ptr %arrayidx, align 4, !tbaa !5 br label %cleanup cleanup: ; preds = %entry, %if.end ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local zeroext i1 @same(i32 noundef %x, i32 noundef %y) local_unnamed_addr #14 { entry: %call = tail call i32 @tree_root(i32 noundef %x) %call1 = tail call i32 @tree_root(i32 noundef %y) %cmp = icmp eq i32 %call, %call1 ret i1 %cmp } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @pow_mod(i64 noundef %n, i64 noundef %k, i64 noundef %m) local_unnamed_addr #15 { entry: %cmp = icmp eq i64 %k, 0 br i1 %cmp, label %common.ret, label %if.else if.else: ; preds = %entry %0 = and i64 %k, 1 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %if.else3, label %if.then1 common.ret.sink.split: ; preds = %if.then1, %if.else3 %conv6.sink = phi i64 [ %conv6, %if.else3 ], [ %mul, %if.then1 ] %rem7 = srem i64 %conv6.sink, %m br label %common.ret common.ret: ; preds = %common.ret.sink.split, %entry %common.ret.op = phi i64 [ 1, %entry ], [ %rem7, %common.ret.sink.split ] ret i64 %common.ret.op if.then1: ; preds = %if.else %sub = add nsw i64 %k, -1 %call = tail call i64 @pow_mod(i64 noundef %n, i64 noundef %sub, i64 noundef %m) %mul = mul nsw i64 %call, %n br label %common.ret.sink.split if.else3: ; preds = %if.else %div = sdiv i64 %k, 2 %call4 = tail call i64 @pow_mod(i64 noundef %n, i64 noundef %div, i64 noundef %m) %mul5 = mul i64 %call4, %call4 %conv6 = and i64 %mul5, 4294967295 br label %common.ret.sink.split } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #16 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { 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 #9 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #10 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { 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 #14 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #15 = { 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 #16 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #17 = { nounwind } attributes #18 = { nounwind allocsize(0) } attributes #19 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !6, i64 0} !13 = !{!"", !6, i64 0, !6, i64 4} !14 = distinct !{!14, !10, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !10, !16, !15} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.unroll.disable"} !20 = distinct !{!20, !10} !21 = !{!13, !6, i64 4} !22 = distinct !{!22, !10, !15, !16} !23 = distinct !{!23, !10, !16, !15} !24 = distinct !{!24, !19} !25 = distinct !{!25, !10} !26 = !{!7, !7, i64 0} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = distinct !{!31, !10} !32 = distinct !{!32, !10, !15, !16}
#include<stdio.h> int main() { long long int k; long long int n; long long int a=0; long long int b=0; long long int c=0; long long int max=0; long long int p=0; long long int q=0; scanf("%lld %lld", &k, &n); for(long long int i=1;i<=n;i++) { a=b; scanf("%lld", &b); c=b-a; if(max<c) max=c; if(i==1) p=b; if(i==n) q=b; } if(max<p+k-q) max=p+k-q; printf("%lld", k-max); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201495/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201495/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i64, align 8 %n = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 store i64 0, ptr %b, align 8, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not26 = icmp slt i64 %0, 1 br i1 %cmp.not26, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) %1 = load i64, ptr %b, align 8 %spec.select25.peel = call i64 @llvm.smax.i64(i64 %1, i64 0) %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp6.peel = icmp eq i64 %2, 1 %q.1.peel = select i1 %cmp6.peel, i64 %1, i64 0 %cmp.not.not.peel = icmp sgt i64 %2, 1 br i1 %cmp.not.not.peel, label %for.body, label %for.cond.cleanup.loopexit for.cond.cleanup.loopexit: ; preds = %for.body, %for.body.preheader %spec.select25.lcssa = phi i64 [ %spec.select25.peel, %for.body.preheader ], [ %spec.select25, %for.body ] %q.1.lcssa = phi i64 [ %q.1.peel, %for.body.preheader ], [ %q.1, %for.body ] %3 = sub i64 %1, %q.1.lcssa br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %max.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select25.lcssa, %for.cond.cleanup.loopexit ] %add = phi i64 [ 0, %entry ], [ %3, %for.cond.cleanup.loopexit ] %4 = load i64, ptr %k, align 8, !tbaa !5 %sub9 = add i64 %add, %4 %spec.select = call i64 @llvm.smax.i64(i64 %max.0.lcssa, i64 %sub9) %sub15 = sub nsw i64 %4, %spec.select %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub15) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 ret i32 0 for.body: ; preds = %for.body.preheader, %for.body %5 = phi i64 [ %6, %for.body ], [ %1, %for.body.preheader ] %i.030 = phi i64 [ %inc, %for.body ], [ 2, %for.body.preheader ] %q.029 = phi i64 [ %q.1, %for.body ], [ %q.1.peel, %for.body.preheader ] %max.027 = phi i64 [ %spec.select25, %for.body ], [ %spec.select25.peel, %for.body.preheader ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) %6 = load i64, ptr %b, align 8 %sub = sub nsw i64 %6, %5 %spec.select25 = call i64 @llvm.smax.i64(i64 %max.027, i64 %sub) %7 = load i64, ptr %n, align 8, !tbaa !5 %cmp6 = icmp eq i64 %i.030, %7 %q.1 = select i1 %cmp6, i64 %6, i64 %q.029 %inc = add nuw nsw i64 %i.030, 1 %cmp.not.not = icmp slt i64 %i.030, %7 br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> int compare(const void *a, const void *b) { return *(int *)a - *(int *)b; } int main(void) { int K = 0; int N = 0; int A[1000000]; scanf("%d %d", &K,&N); int n = 0;//一時置き換え while (n < N) { scanf("%d",&A[n]); n++; } qsort(A,N, sizeof(int), compare); int dis[1000000]; int i,MAX=0; for (i = 0; i < N; i++) { if(i!=N-1){ dis[i] = A[i + 1] - A[i]; } else dis[i] = K+A[0] - A[i]; if(MAX<dis[i]){ MAX = dis[i]; } } printf("%d\n", K - MAX); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201538/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201538/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %K = alloca i32, align 4 %N = alloca i32, align 4 %A = alloca [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #6 store i32 0, ptr %K, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 store i32 0, ptr %N, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %while.body, label %entry.while.end_crit_edge entry.while.end_crit_edge: ; preds = %entry %.pre58 = sext i32 %0 to i64 br label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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 %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry.while.end_crit_edge %conv.pre-phi = phi i64 [ %.pre58, %entry.while.end_crit_edge ], [ %2, %while.body ] call void @qsort(ptr noundef nonnull %A, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #6 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp247 = icmp sgt i32 %3, 0 %.pre = load i32, ptr %K, align 4 br i1 %cmp247, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %while.end %sub = add nsw i32 %3, -1 %4 = load i32, ptr %A, align 16 %add14 = add nsw i32 %4, %.pre %5 = zext i32 %sub to i64 %wide.trip.count = zext i32 %3 to i64 %arrayidx16 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %5 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.end %indvars.iv53 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next54.pre-phi, %if.end ] %MAX.049 = phi i32 [ 0, %for.body.lr.ph ], [ %spec.select, %if.end ] %cmp4.not = icmp eq i64 %indvars.iv53, %5 br i1 %cmp4.not, label %if.else, label %if.then if.then: ; preds = %for.body %6 = add nuw nsw i64 %indvars.iv53, 1 %arrayidx7 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %6 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %arrayidx9 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv53 %8 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %sub10 = sub nsw i32 %7, %8 br label %if.end if.else: ; preds = %for.body %9 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %sub17 = sub i32 %add14, %9 %.pre57 = add nuw nsw i64 %indvars.iv53, 1 br label %if.end if.end: ; preds = %if.else, %if.then %indvars.iv.next54.pre-phi = phi i64 [ %.pre57, %if.else ], [ %6, %if.then ] %sub10.sink = phi i32 [ %sub17, %if.else ], [ %sub10, %if.then ] %spec.select = call i32 @llvm.smax.i32(i32 %MAX.049, i32 %sub10.sink) %exitcond.not = icmp eq i64 %indvars.iv.next54.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %if.end, %while.end %MAX.0.lcssa = phi i32 [ 0, %while.end ], [ %spec.select, %if.end ] %sub29 = sub nsw i32 %.pre, %MAX.0.lcssa %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub29) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits.h> int main(void) { int k, n, min = INT_MAX; int arr[200000] = { 0, }; scanf("%d %d", &k, &n); for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); } for (int i = 0; i < n - 1; i++) { int dist = arr[i + 1] - arr[i]; min = (k - dist < min) ? k - dist : min; } min = (arr[n - 1] - arr[0] < min) ? arr[n - 1] - arr[0] : min; printf("%d", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201581/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201581/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %n = alloca i32, align 4 %arr = alloca [200000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %arr) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %arr, i8 0, i64 800000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %0, 0 br i1 %cmp44, label %for.body, label %for.cond3.preheader.thread for.cond3.preheader.thread: ; preds = %entry %sub58 = add i32 %0, -1 br label %for.cond3.preheader.for.cond.cleanup5_crit_edge for.cond3.preheader: ; preds = %for.body %sub = add i32 %15, -1 %cmp446 = icmp sgt i32 %15, 1 br i1 %cmp446, label %for.body6.lr.ph, label %for.cond3.preheader.for.cond.cleanup5_crit_edge for.cond3.preheader.for.cond.cleanup5_crit_edge: ; preds = %for.cond3.preheader.thread, %for.cond3.preheader %sub61 = phi i32 [ %sub58, %for.cond3.preheader.thread ], [ %sub, %for.cond3.preheader ] %.pre56 = load i32, ptr %arr, align 16, !tbaa !5 br label %for.cond.cleanup5 for.body6.lr.ph: ; preds = %for.cond3.preheader %1 = load i32, ptr %k, align 4 %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %arr, align 16, !tbaa !5 %min.iters.check = icmp ult i32 %15, 9 br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph vector.ph: ; preds = %for.body6.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load63, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %11, %vector.body ] %vec.phi62 = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %12, %vector.body ] %2 = or i64 %index, 1 %3 = getelementptr inbounds [200000 x i32], ptr %arr, i64 0, i64 %2 %wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 %wide.load63 = load <4 x i32>, ptr %4, align 4, !tbaa !5 %5 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %6 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load63, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %7 = sub <4 x i32> %5, %wide.load %8 = sub <4 x i32> %6, %wide.load63 %9 = add <4 x i32> %7, %broadcast.splat %10 = add <4 x i32> %8, %broadcast.splat %11 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %9, <4 x i32> %vec.phi) %12 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %10, <4 x i32> %vec.phi62) %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %11, <4 x i32> %12) %14 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count %vector.recur.extract = extractelement <4 x i32> %wide.load63, i64 3 br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader for.body6.preheader: ; preds = %for.body6.lr.ph, %middle.block %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body6.lr.ph ] %indvars.iv53.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body6.lr.ph ] %min.048.ph = phi i32 [ %14, %middle.block ], [ 2147483647, %for.body6.lr.ph ] br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200000 x i32], ptr %arr, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp = icmp slt i64 %indvars.iv.next, %16 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13 for.cond.cleanup5: ; preds = %for.body6, %middle.block, %for.cond3.preheader.for.cond.cleanup5_crit_edge %sub60 = phi i32 [ %sub61, %for.cond3.preheader.for.cond.cleanup5_crit_edge ], [ %sub, %middle.block ], [ %sub, %for.body6 ] %17 = phi i32 [ %.pre56, %for.cond3.preheader.for.cond.cleanup5_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body6 ] %min.0.lcssa = phi i32 [ 2147483647, %for.cond3.preheader.for.cond.cleanup5_crit_edge ], [ %14, %middle.block ], [ %cond, %for.body6 ] %idxprom19 = sext i32 %sub60 to i64 %arrayidx20 = getelementptr inbounds [200000 x i32], ptr %arr, i64 0, i64 %idxprom19 %18 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %sub22 = sub nsw i32 %18, %17 %sub22.min.0 = call i32 @llvm.smin.i32(i32 %sub22, i32 %min.0.lcssa) %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub22.min.0) call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %arr) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 ret i32 0 for.body6: ; preds = %for.body6.preheader, %for.body6 %scalar.recur = phi i32 [ %19, %for.body6 ], [ %scalar.recur.ph, %for.body6.preheader ] %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body6 ], [ %indvars.iv53.ph, %for.body6.preheader ] %min.048 = phi i32 [ %cond, %for.body6 ], [ %min.048.ph, %for.body6.preheader ] %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %arrayidx8 = getelementptr inbounds [200000 x i32], ptr %arr, i64 0, i64 %indvars.iv.next54 %19 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %sub11.neg = sub i32 %scalar.recur, %19 %sub12 = add i32 %sub11.neg, %1 %cond = call i32 @llvm.smin.i32(i32 %sub12, i32 %min.048) %exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include <stdio.h> int a,b; int main() { scanf("%d %d",&a,&b); a = a % 3; b = b % 3; int c=(a+b)%3; if(a==0){printf("Possible\n");} else{ if(b==0){printf("Possible\n");} else{ if(c==0){printf("Possible\n");} else{ printf("Impossible\n");} }} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201624/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201624/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @a = dso_local global i32 0, align 4 @b = dso_local global i32 0, align 4 @str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 @str.5 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b) %0 = load i32, ptr @a, align 4, !tbaa !5 %rem = srem i32 %0, 3 store i32 %rem, ptr @a, align 4, !tbaa !5 %1 = load i32, ptr @b, align 4, !tbaa !5 %rem1 = srem i32 %1, 3 store i32 %rem1, ptr @b, align 4, !tbaa !5 %add = add nsw i32 %rem1, %rem %rem2.lhs.trunc = trunc i32 %add to i8 %rem218 = srem i8 %rem2.lhs.trunc, 3 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %if.end14, label %if.else if.else: ; preds = %entry %cmp4 = icmp eq i32 %rem1, 0 br i1 %cmp4, label %if.end14, label %if.else7 if.else7: ; preds = %if.else %cmp8 = icmp eq i8 %rem218, 0 %str.3.str = select i1 %cmp8, ptr @str.5, ptr @str br label %if.end14 if.end14: ; preds = %if.else7, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %if.else ], [ %str.3.str, %if.else7 ] %puts16 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int A , B ; scanf("%d%d",&A,&B); if((A+B)%3==0 || A %3 ==0 || B%3 == 0){ printf("Possible"); }else{ printf("Impossible"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201675/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201675/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1 @.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %rem = srem i32 %add, 3 %cmp = icmp eq i32 %rem, 0 %rem1 = srem i32 %0, 3 %cmp2 = icmp eq i32 %rem1, 0 %or.cond = or i1 %cmp2, %cmp %rem4 = srem i32 %1, 3 %cmp5 = icmp eq i32 %rem4, 0 %or.cond8 = or i1 %cmp5, %or.cond %.str.1..str.2 = select i1 %or.cond8, ptr @.str.1, ptr @.str.2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> int main() { int a, b, c; int moda, modb, modc; scanf("%d%d", &a, &b); c = a + b; moda = a % 3; modb = b % 3; modc = c % 3; if (moda == 0 || modb == 0 || modc == 0) { printf("Possible\n"); } else { printf("Impossible\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201725/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201725/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 @str.3 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %rem = srem i32 %0, 3 %rem1 = srem i32 %1, 3 %rem2 = srem i32 %add, 3 %cmp = icmp eq i32 %rem, 0 %cmp3 = icmp eq i32 %rem1, 0 %or.cond = select i1 %cmp, i1 true, i1 %cmp3 %cmp5 = icmp eq i32 %rem2, 0 %or.cond8 = select i1 %or.cond, i1 true, i1 %cmp5 %str.3.str = select i1 %or.cond8, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,s; scanf("%d %d",&a,&b); if(a==3 || b==3) printf("Possible\n"); else if(a<3 && b<3) { s=a+b; if(s%3==0) printf("Possible\n"); else printf("Impossible\n"); } else if(a>3 || b>3) { if(a%3==0) printf("Possible\n"); else if(b%3==0) printf("Possible\n"); else if((a>3 && b<3)||(a<3 && b>3)) { s=a+b; if(s%3==0) printf("Possible\n"); else printf("Impossible\n"); } else if(a>3 && b>3) { s=a+b; if(s%3==0) printf("Possible\n"); else printf("Impossible\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201776/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201776/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.8 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 @str.10 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 3 %1 = load i32, ptr %b, align 4 %cmp1 = icmp eq i32 %1, 3 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %if.end61.sink.split, label %if.else if.else: ; preds = %entry %cmp3 = icmp slt i32 %0, 3 %cmp4 = icmp slt i32 %1, 3 %or.cond62 = select i1 %cmp3, i1 %cmp4, i1 false br i1 %or.cond62, label %if.then5, label %if.else11 if.then5: ; preds = %if.else %add = add nsw i32 %1, %0 %rem = srem i32 %add, 3 %cmp6 = icmp eq i32 %rem, 0 %str.9.str.8 = select i1 %cmp6, ptr @str.10, ptr @str.8 br label %if.end61.sink.split if.else11: ; preds = %if.else %cmp12 = icmp sgt i32 %0, 3 %cmp14 = icmp sgt i32 %1, 3 %or.cond63 = select i1 %cmp12, i1 true, i1 %cmp14 br i1 %or.cond63, label %if.then15, label %if.end61 if.then15: ; preds = %if.else11 %rem16 = srem i32 %0, 3 %cmp17 = icmp eq i32 %rem16, 0 br i1 %cmp17, label %if.end61.sink.split, label %if.else20 if.else20: ; preds = %if.then15 %rem21 = srem i32 %1, 3 %cmp22 = icmp eq i32 %rem21, 0 br i1 %cmp22, label %if.end61.sink.split, label %if.else25 if.else25: ; preds = %if.else20 %or.cond64 = select i1 %cmp12, i1 %cmp4, i1 false %or.cond65 = select i1 %cmp3, i1 %cmp14, i1 false %or.cond78 = select i1 %or.cond64, i1 true, i1 %or.cond65 br i1 %or.cond78, label %if.then33, label %if.else42 if.then33: ; preds = %if.else25 %add34 = add nsw i32 %1, %0 %rem35 = srem i32 %add34, 3 %cmp36 = icmp eq i32 %rem35, 0 %str.5.str.4 = select i1 %cmp36, ptr @str.10, ptr @str.8 br label %if.end61.sink.split if.else42: ; preds = %if.else25 %or.cond66 = select i1 %cmp12, i1 %cmp14, i1 false br i1 %or.cond66, label %if.then46, label %if.end61 if.then46: ; preds = %if.else42 %add47 = add nuw nsw i32 %1, %0 %rem4879 = urem i32 %add47, 3 %cmp49 = icmp eq i32 %rem4879, 0 %str.3.str = select i1 %cmp49, ptr @str.10, ptr @str.8 br label %if.end61.sink.split if.end61.sink.split: ; preds = %if.then46, %if.then33, %if.else20, %if.then15, %if.then5, %entry %str.8.sink = phi ptr [ @str.10, %entry ], [ %str.9.str.8, %if.then5 ], [ @str.10, %if.then15 ], [ @str.10, %if.else20 ], [ %str.5.str.4, %if.then33 ], [ %str.3.str, %if.then46 ] %puts75 = call i32 @puts(ptr nonnull dereferenceable(1) %str.8.sink) br label %if.end61 if.end61: ; preds = %if.end61.sink.split, %if.else42, %if.else11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> #include<math.h> int ara[100000]; char ara1[100000]; int main() { int i,j,k,a,b,l,n,t,df,v; while(scanf("%d %d",&a,&b)!=EOF) { v=0; l=a+b; if(a%3==0) { printf("Possible\n"); } else if(b%3==0) { printf("Possible\n"); } else if(l%3==0) { printf("Possible\n"); } else { printf("Impossible\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201826/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201826/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @ara = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 @ara1 = dso_local local_unnamed_addr global [100000 x i8] zeroinitializer, align 16 @str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 @str.5 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not20 = icmp eq i32 %call19, -1 br i1 %cmp.not20, label %while.end, label %while.body while.body: ; preds = %entry, %if.end15 %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %rem = srem i32 %0, 3 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %if.end15, label %if.else if.else: ; preds = %while.body %rem3 = srem i32 %1, 3 %cmp4 = icmp eq i32 %rem3, 0 br i1 %cmp4, label %if.end15, label %if.else7 if.else7: ; preds = %if.else %rem8 = srem i32 %add, 3 %cmp9 = icmp eq i32 %rem8, 0 %str.3.str = select i1 %cmp9, ptr @str.5, ptr @str br label %if.end15 if.end15: ; preds = %if.else7, %if.else, %while.body %str.4.sink = phi ptr [ @str.5, %while.body ], [ @str.5, %if.else ], [ %str.3.str, %if.else7 ] %puts17 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end15, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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() { long long int n, k; int times; scanf("%d", &times); getchar(); while (times--) { long long int all = 1, copy = 1; long long int i = 0; scanf("%lld%lld", &n, &k); getchar(); while (all < n) { all += copy; i++; if (copy < k) copy *= 2; if (copy >= k) { copy = k; long long int remain = n - all; if (remain <= 0) goto space; if (remain <= copy) { i++; goto space; } else { if (remain % k == 0) i += (remain / k); else i += ((remain / k) + 1); goto space; } } } space: printf("%lld\n", i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20187/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20187/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @stdin = 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 i64, align 8 %k = alloca i64, align 8 %times = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %times) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %times) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call i32 @getc(ptr noundef %0) %1 = load i32, ptr %times, align 4, !tbaa !9 %dec47 = add nsw i32 %1, -1 store i32 %dec47, ptr %times, align 4, !tbaa !9 %tobool.not48 = icmp eq i32 %1, 0 br i1 %tobool.not48, label %while.end25, label %while.body while.body: ; preds = %entry, %space %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k) %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i43 = call i32 @getc(ptr noundef %2) %3 = load i64, ptr %n, align 8, !tbaa !11 %4 = load i64, ptr %k, align 8 br label %while.cond4 while.cond4: ; preds = %while.body5, %while.body %all.0 = phi i64 [ 1, %while.body ], [ %add, %while.body5 ] %copy.0 = phi i64 [ 1, %while.body ], [ %spec.select, %while.body5 ] %i.0 = phi i64 [ 0, %while.body ], [ %inc, %while.body5 ] %cmp = icmp slt i64 %all.0, %3 br i1 %cmp, label %while.body5, label %space while.body5: ; preds = %while.cond4 %add = add nsw i64 %copy.0, %all.0 %inc = add nuw nsw i64 %i.0, 1 %cmp6 = icmp slt i64 %copy.0, %4 %mul = zext i1 %cmp6 to i64 %spec.select = shl nsw i64 %copy.0, %mul %cmp7.not = icmp slt i64 %spec.select, %4 br i1 %cmp7.not, label %while.cond4, label %if.then8, !llvm.loop !13 if.then8: ; preds = %while.body5 %sub = sub nsw i64 %3, %add %cmp9 = icmp slt i64 %sub, 1 br i1 %cmp9, label %space, label %if.end11 if.end11: ; preds = %if.then8 %cmp12.not = icmp sgt i64 %sub, %4 br i1 %cmp12.not, label %if.else, label %if.then13 if.then13: ; preds = %if.end11 %inc14 = add nuw nsw i64 %i.0, 2 br label %space if.else: ; preds = %if.end11 %rem = srem i64 %sub, %4 %cmp15 = icmp ne i64 %rem, 0 %div = sdiv i64 %sub, %4 %add20 = zext i1 %cmp15 to i64 %div.pn = add nsw i64 %div, %add20 %i.1 = add nsw i64 %div.pn, %inc br label %space space: ; preds = %while.cond4, %if.then13, %if.else, %if.then8 %i.3 = phi i64 [ %inc14, %if.then13 ], [ %i.1, %if.else ], [ %inc, %if.then8 ], [ %i.0, %while.cond4 ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %i.3) %5 = load i32, ptr %times, align 4, !tbaa !9 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %times, align 4, !tbaa !9 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %while.end25, label %while.body, !llvm.loop !15 while.end25: ; preds = %space, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %times) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @getc(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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14}
#include <stdio.h> int main(){ int A, B; scanf("%d %d", &A, &B); if(A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0) { printf("Possible"); } else { printf("Impossible"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201912/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201912/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"Possible\00", align 1 @.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %rem = srem i32 %0, 3 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %if.end, label %lor.lhs.false lor.lhs.false: ; preds = %entry %1 = load i32, ptr %B, align 4, !tbaa !5 %rem1 = srem i32 %1, 3 %cmp2 = icmp eq i32 %rem1, 0 br i1 %cmp2, label %if.end, label %lor.lhs.false3 lor.lhs.false3: ; preds = %lor.lhs.false %add = add nsw i32 %1, %0 %rem4 = srem i32 %add, 3 %cmp5 = icmp eq i32 %rem4, 0 %spec.select = select i1 %cmp5, ptr @.str.1, ptr @.str.2 br label %if.end if.end: ; preds = %lor.lhs.false3, %entry, %lor.lhs.false %.str.2.sink = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c,d,e,f=0; scanf("%d %d %d %d %d",&a,&b,&c,&d,&e); if(a>0)f=(b-a)*e; else if(a<0)f=(0-a)*c+d+b*e; else f=d+b*e; printf("%d\n",f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201956/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201956/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %1, %0 %2 = load i32, ptr %e, align 4, !tbaa !5 %mul = mul nsw i32 %sub, %2 br label %if.end10 if.else: ; preds = %entry %cmp1 = icmp slt i32 %0, 0 br i1 %cmp1, label %if.then2, label %if.else7 if.then2: ; preds = %if.else %3 = load i32, ptr %c, align 4, !tbaa !5 %4 = mul i32 %3, %0 %5 = load i32, ptr %d, align 4, !tbaa !5 %add = sub i32 %5, %4 %6 = load i32, ptr %b, align 4, !tbaa !5 %7 = load i32, ptr %e, align 4, !tbaa !5 %mul5 = mul nsw i32 %7, %6 %add6 = add nsw i32 %add, %mul5 br label %if.end10 if.else7: ; preds = %if.else %8 = load i32, ptr %d, align 4, !tbaa !5 %9 = load i32, ptr %b, align 4, !tbaa !5 %10 = load i32, ptr %e, align 4, !tbaa !5 %mul8 = mul nsw i32 %10, %9 %add9 = add nsw i32 %mul8, %8 br label %if.end10 if.end10: ; preds = %if.then2, %if.else7, %if.then %f.0 = phi i32 [ %mul, %if.then ], [ %add6, %if.then2 ], [ %add9, %if.else7 ] %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 %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 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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,d,e,x,y,z; scanf("%d %d %d %d %d",&a,&b,&c,&d,&e); if(a<0){ x=a*c*-1; y=b*e; z=x+y+d; } else if(a>0){ x=b-a; z=x*e; } else{ x=b*e; z=x+d; } printf("%d\n",z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202005/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202005/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %1 = load i32, ptr %c, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %b, align 4, !tbaa !5 %3 = load i32, ptr %e, align 4, !tbaa !5 %mul2 = mul nsw i32 %3, %2 %add = sub i32 %mul2, %mul %4 = load i32, ptr %d, align 4, !tbaa !5 %add3 = add nsw i32 %add, %4 br label %if.end10 if.else: ; preds = %entry %cmp4.not = icmp eq i32 %0, 0 %5 = load i32, ptr %b, align 4, !tbaa !5 br i1 %cmp4.not, label %if.else7, label %if.then5 if.then5: ; preds = %if.else %sub = sub nsw i32 %5, %0 %6 = load i32, ptr %e, align 4, !tbaa !5 %mul6 = mul nsw i32 %sub, %6 br label %if.end10 if.else7: ; preds = %if.else %7 = load i32, ptr %e, align 4, !tbaa !5 %mul8 = mul nsw i32 %7, %5 %8 = load i32, ptr %d, align 4, !tbaa !5 %add9 = add nsw i32 %mul8, %8 br label %if.end10 if.end10: ; preds = %if.then5, %if.else7, %if.then %z.0 = phi i32 [ %add3, %if.then ], [ %mul6, %if.then5 ], [ %add9, %if.else7 ] %call11 = 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 %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 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 can; int i; while (scanf("%d", &can) != EOF){ if (can % 39 == 0){ printf("3C39\n"); } else if (can % 39 < 10){ printf("3C0%d\n", can % 39); } else { printf("3C%d\n", can % 39); } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202049/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202049/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"3C0%d\0A\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"3C%d\0A\00", align 1 @str = private unnamed_addr constant [5 x i8] c"3C39\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %can = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %can) #4 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %can) %cmp.not13 = icmp eq i32 %call12, -1 br i1 %cmp.not13, label %while.end, label %while.body while.body: ; preds = %entry, %if.end11 %0 = load i32, ptr %can, align 4, !tbaa !5 %rem = srem i32 %0, 39 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end11 if.else: ; preds = %while.body %cmp4 = icmp slt i32 %rem, 10 br i1 %cmp4, label %if.then5, label %if.else8 if.then5: ; preds = %if.else %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %rem) br label %if.end11 if.else8: ; preds = %if.else %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %rem) br label %if.end11 if.end11: ; preds = %if.then5, %if.else8, %if.then %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %can) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end11, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %can) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int n,k,d,s,i,t,a[110000]; scanf ("%d%d%d",&n,&s,&t); for (i=1;i<=n;i++) scanf("%d",&a[i]); d=s; k=0; while (d!=t) { d=a[d]; k++; if (k>n) {k=-1;break;} } printf("%d",k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2021/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2021/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca i32, align 4 %t = alloca i32, align 4 %a = alloca [110000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 440000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s, ptr noundef nonnull %t) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not13 = icmp slt i32 %0, 1 br i1 %cmp.not13, label %while.cond.preheader, label %for.body while.cond.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] %1 = load i32, ptr %t, align 4, !tbaa !5 %smax = call i32 @llvm.smax.i32(i32 %.lcssa, i32 0) br label %while.cond for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [110000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.cond: ; preds = %while.cond.preheader, %while.body %k.0 = phi i32 [ %inc5, %while.body ], [ 0, %while.cond.preheader ] %d.0.in = phi ptr [ %arrayidx4, %while.body ], [ %s, %while.cond.preheader ] %d.0 = load i32, ptr %d.0.in, align 4, !tbaa !5 %cmp2.not = icmp eq i32 %d.0, %1 br i1 %cmp2.not, label %while.end, label %while.body while.body: ; preds = %while.cond %idxprom3 = sext i32 %d.0 to i64 %arrayidx4 = getelementptr inbounds [110000 x i32], ptr %a, i64 0, i64 %idxprom3 %inc5 = add nuw i32 %k.0, 1 %exitcond.not = icmp eq i32 %k.0, %smax br i1 %exitcond.not, label %while.end, label %while.cond, !llvm.loop !11 while.end: ; preds = %while.body, %while.cond %k.1 = phi i32 [ %k.0, %while.cond ], [ -1, %while.body ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.1) call void @llvm.lifetime.end.p0(i64 440000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
// Aizu Vol-2 0201: Wrought Gold Master // 2017.8.17 bal4u@uu // ??¢?????????????????????????????\????????????????????£????????? #include <stdio.h> #include <string.h> #define HSIZ 499 typedef struct { char *w; int k; } HASH; HASH hash[HSIZ + 5]; int lookup(char *w) { int i, l; HASH *tp; i = (101 * *w + 103 * *(w + (l = strlen(w)) - 1) + 107 * l) % HSIZ; tp = hash + i; if (tp->w != NULL) { int inc = *w + (*(w + 1) << 1); while (1) { if (!strcmp(tp->w, w)) return tp->k; i += inc; if (i >= HSIZ) i -= HSIZ; tp = hash + i; if (tp->w == NULL) break; } } return -1; } int insert(char *w, int k) { int i, l; HASH *tp; i = (101 * *w + 103 * *(w + (l = strlen(w)) - 1) + 107 * l) % HSIZ; tp = hash + i; if (tp->w != NULL) { int inc = *w + (*(w + 1) << 1); while (1) { if (!strcmp(tp->w, w)) return -1; i += inc; if (i >= HSIZ) i -= HSIZ; tp = hash + i; if (tp->w == NULL) break; } } tp->w = w, tp->k = k; return 0; } typedef struct { char a[102]; int m, k, i[102]; } MONO; MONO mono[205]; int no; int combi(int a) { int i, k, c = -1; k = mono[a].k; if (k > 0) for (c = i = 0; i < k; i++) c += combi(mono[a].i[i]); if (c < 0 || (mono[a].m >= 0 && mono[a].m < c)) c = mono[a].m; return c; } int main() { int i, j, k, N, M; char b[102]; while (scanf("%d", &N) == 1 && N) { memset(hash, 0, sizeof(hash)), no = 0; while (N-- > 0) { scanf("%s%d", mono[no].a, &(mono[no].m)); mono[no].k = 0; insert(mono[no].a, no); no++; } scanf("%d", &M); while (M--) { scanf("%s%d", mono[no].a, &k); if ((i = lookup(mono[no].a)) < 0) insert(mono[no].a, no), mono[no].m = -1, i = no++; mono[i].k = k; for (j = 0; j < mono[i].k; j++) scanf("%s", b), mono[i].i[j] = lookup(b); } scanf("%s", b); printf("%d\n", combi(lookup(b))); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202193/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202193/source.c" target datalayout = "e-m:e-p270: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.HASH = type { ptr, i32 } %struct.MONO = type { [102 x i8], i32, i32, [102 x i32] } @hash = dso_local local_unnamed_addr global [504 x %struct.HASH] zeroinitializer, align 16 @mono = dso_local global [205 x %struct.MONO] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @no = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @lookup(ptr nocapture noundef readonly %w) local_unnamed_addr #0 { entry: %0 = load i8, ptr %w, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %mul = mul nsw i32 %conv, 101 %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %w) #8 %conv1 = trunc i64 %call to i32 %sext = shl i64 %call, 32 %idx.ext = ashr exact i64 %sext, 32 %add.ptr = getelementptr inbounds i8, ptr %w, i64 %idx.ext %add.ptr2 = getelementptr inbounds i8, ptr %add.ptr, i64 -1 %1 = load i8, ptr %add.ptr2, align 1, !tbaa !5 %conv3 = sext i8 %1 to i32 %mul4 = mul nsw i32 %conv3, 103 %mul5 = mul nsw i32 %conv1, 107 %add = add i32 %mul5, %mul %add6 = add i32 %add, %mul4 %rem = srem i32 %add6, 499 %idx.ext7 = sext i32 %rem to i64 %add.ptr8 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext7 %2 = load ptr, ptr %add.ptr8, align 16, !tbaa !8 %cmp.not = icmp eq ptr %2, null br i1 %cmp.not, label %cleanup31, label %if.then if.then: ; preds = %entry %add.ptr12 = getelementptr inbounds i8, ptr %w, i64 1 %3 = load i8, ptr %add.ptr12, align 1, !tbaa !5 %conv13 = sext i8 %3 to i32 %shl = shl nsw i32 %conv13, 1 %add14 = add nsw i32 %shl, %conv %call1651 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %w) #8 %tobool.not.not52 = icmp eq i32 %call1651, 0 br i1 %tobool.not.not52, label %cleanup.thread, label %if.end while.cond: ; preds = %if.end %call16 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %w) #8 %tobool.not.not = icmp eq i32 %call16, 0 br i1 %tobool.not.not, label %cleanup.thread, label %if.end cleanup.thread: ; preds = %while.cond, %if.then %.lcssa = phi i64 [ %idx.ext7, %if.then ], [ %idx.ext23, %while.cond ] %k = getelementptr inbounds %struct.HASH, ptr @hash, i64 %.lcssa, i32 1 %4 = load i32, ptr %k, align 8, !tbaa !12 br label %cleanup31 if.end: ; preds = %if.then, %while.cond %i.053 = phi i32 [ %spec.select, %while.cond ], [ %rem, %if.then ] %add18 = add nsw i32 %add14, %i.053 %cmp19 = icmp sgt i32 %add18, 498 %sub = add nsw i32 %add18, -499 %spec.select = select i1 %cmp19, i32 %sub, i32 %add18 %idx.ext23 = sext i32 %spec.select to i64 %add.ptr24 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23 %5 = load ptr, ptr %add.ptr24, align 16, !tbaa !8 %cmp26 = icmp eq ptr %5, null br i1 %cmp26, label %cleanup31, label %while.cond cleanup31: ; preds = %if.end, %entry, %cleanup.thread %retval.1 = phi i32 [ %4, %cleanup.thread ], [ -1, %entry ], [ -1, %if.end ] ret i32 %retval.1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #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 memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @insert(ptr noundef %w, i32 noundef %k) local_unnamed_addr #3 { entry: %0 = load i8, ptr %w, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %mul = mul nsw i32 %conv, 101 %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %w) #8 %conv1 = trunc i64 %call to i32 %sext = shl i64 %call, 32 %idx.ext = ashr exact i64 %sext, 32 %add.ptr = getelementptr inbounds i8, ptr %w, i64 %idx.ext %add.ptr2 = getelementptr inbounds i8, ptr %add.ptr, i64 -1 %1 = load i8, ptr %add.ptr2, align 1, !tbaa !5 %conv3 = sext i8 %1 to i32 %mul4 = mul nsw i32 %conv3, 103 %mul5 = mul nsw i32 %conv1, 107 %add = add i32 %mul5, %mul %add6 = add i32 %add, %mul4 %rem = srem i32 %add6, 499 %idx.ext7 = sext i32 %rem to i64 %add.ptr8 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext7 %2 = load ptr, ptr %add.ptr8, align 16, !tbaa !8 %cmp.not = icmp eq ptr %2, null br i1 %cmp.not, label %if.end30, label %if.then if.then: ; preds = %entry %add.ptr12 = getelementptr inbounds i8, ptr %w, i64 1 %3 = load i8, ptr %add.ptr12, align 1, !tbaa !5 %conv13 = sext i8 %3 to i32 %shl = shl nsw i32 %conv13, 1 %add14 = add nsw i32 %shl, %conv br label %while.cond while.cond: ; preds = %if.end, %if.then %4 = phi ptr [ %2, %if.then ], [ %5, %if.end ] %i.0 = phi i32 [ %rem, %if.then ], [ %spec.select, %if.end ] %call16 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %w) #8 %tobool.not.not = icmp eq i32 %call16, 0 br i1 %tobool.not.not, label %cleanup33, label %if.end if.end: ; preds = %while.cond %add18 = add nsw i32 %add14, %i.0 %cmp19 = icmp sgt i32 %add18, 498 %sub = add nsw i32 %add18, -499 %spec.select = select i1 %cmp19, i32 %sub, i32 %add18 %idx.ext23 = sext i32 %spec.select to i64 %add.ptr24 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23 %5 = load ptr, ptr %add.ptr24, align 16, !tbaa !8 %cmp26 = icmp eq ptr %5, null br i1 %cmp26, label %if.end30, label %while.cond if.end30: ; preds = %if.end, %entry %tp.2 = phi ptr [ %add.ptr8, %entry ], [ %add.ptr24, %if.end ] store ptr %w, ptr %tp.2, align 8, !tbaa !8 %k32 = getelementptr inbounds %struct.HASH, ptr %tp.2, i64 0, i32 1 store i32 %k, ptr %k32, align 8, !tbaa !12 br label %cleanup33 cleanup33: ; preds = %while.cond, %if.end30 %retval.1 = phi i32 [ 0, %if.end30 ], [ -1, %while.cond ] ret i32 %retval.1 } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @combi(i32 noundef %a) local_unnamed_addr #4 { entry: %idxprom = sext i32 %a to i64 %k1 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom, i32 2 %0 = load i32, ptr %k1, align 4, !tbaa !13 %cmp = icmp sgt i32 %0, 0 br i1 %cmp, label %for.body.preheader, label %if.then16 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %c.035 = phi i32 [ 0, %for.body.preheader ], [ %add, %for.body ] %arrayidx7 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom, i32 3, i64 %indvars.iv %1 = load i32, ptr %arrayidx7, align 4, !tbaa !15 %call = tail call i32 @combi(i32 noundef %1) %add = add nsw i32 %call, %c.035 %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 %if.end, label %for.body, !llvm.loop !16 if.end: ; preds = %for.body %cmp8 = icmp slt i32 %add, 0 br i1 %cmp8, label %if.then16, label %lor.lhs.false lor.lhs.false: ; preds = %if.end %m = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom, i32 1 %2 = load i32, ptr %m, align 8, !tbaa !18 %cmp11 = icmp sgt i32 %2, -1 %cmp15 = icmp slt i32 %2, %add %or.cond = and i1 %cmp11, %cmp15 br i1 %or.cond, label %if.then16, label %if.end20 if.then16: ; preds = %entry, %lor.lhs.false, %if.end %m19 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom, i32 1 %3 = load i32, ptr %m19, align 8, !tbaa !18 br label %if.end20 if.end20: ; preds = %if.then16, %lor.lhs.false %c.2 = phi i32 [ %3, %if.then16 ], [ %add, %lor.lhs.false ] ret i32 %c.2 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %k = alloca i32, align 4 %N = alloca i32, align 4 %M = alloca i32, align 4 %b = alloca [102 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #9 call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %b) #9 %invariant.gep244 = getelementptr i8, ptr %b, i64 -1 %call246 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp247 = icmp eq i32 %call246, 1 %0 = load i32, ptr %N, align 4 %tobool248 = icmp ne i32 %0, 0 %1 = select i1 %cmp247, i1 %tobool248, i1 false br i1 %1, label %while.body.lr.ph, label %while.end64 while.body.lr.ph: ; preds = %entry %add.ptr12.i161 = getelementptr inbounds i8, ptr %b, i64 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %lookup.exit218 %2 = phi i32 [ %0, %while.body.lr.ph ], [ %37, %lookup.exit218 ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8064) @hash, i8 0, i64 8064, i1 false) store i32 0, ptr @no, align 4, !tbaa !15 %dec226 = add nsw i32 %2, -1 store i32 %dec226, ptr %N, align 4, !tbaa !15 %cmp2227 = icmp sgt i32 %2, 0 br i1 %cmp2227, label %while.body3, label %while.end while.body3: ; preds = %while.body, %insert.exit %storemerge228 = phi i32 [ %inc, %insert.exit ], [ 0, %while.body ] %idxprom = sext i32 %storemerge228 to i64 %arrayidx = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom %m = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom, i32 1 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %m) %3 = load i32, ptr @no, align 4, !tbaa !15 %idxprom7 = sext i32 %3 to i64 %k9 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom7, i32 2 store i32 0, ptr %k9, align 4, !tbaa !13 %arrayidx11 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom7 %4 = load i8, ptr %arrayidx11, align 8, !tbaa !5 %conv.i = sext i8 %4 to i32 %mul.i = mul nsw i32 %conv.i, 101 %call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx11) #8 %conv1.i = trunc i64 %call.i to i32 %sext.i = shl i64 %call.i, 32 %idx.ext.i = ashr exact i64 %sext.i, 32 %add.ptr.i = getelementptr inbounds i8, ptr %arrayidx11, i64 %idx.ext.i %add.ptr2.i = getelementptr inbounds i8, ptr %add.ptr.i, i64 -1 %5 = load i8, ptr %add.ptr2.i, align 1, !tbaa !5 %conv3.i = sext i8 %5 to i32 %mul4.i = mul nsw i32 %conv3.i, 103 %mul5.i = mul nsw i32 %conv1.i, 107 %add.i = add i32 %mul5.i, %mul.i %add6.i = add i32 %add.i, %mul4.i %rem.i = srem i32 %add6.i, 499 %idx.ext7.i = sext i32 %rem.i to i64 %add.ptr8.i = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext7.i %6 = load ptr, ptr %add.ptr8.i, align 16, !tbaa !8 %cmp.not.i = icmp eq ptr %6, null br i1 %cmp.not.i, label %if.end30.i, label %if.then.i if.then.i: ; preds = %while.body3 %add.ptr12.i = getelementptr inbounds i8, ptr %arrayidx11, i64 1 %7 = load i8, ptr %add.ptr12.i, align 1, !tbaa !5 %conv13.i = sext i8 %7 to i32 %shl.i = shl nsw i32 %conv13.i, 1 %add14.i = add nsw i32 %shl.i, %conv.i br label %while.cond.i while.cond.i: ; preds = %if.end.i, %if.then.i %8 = phi ptr [ %6, %if.then.i ], [ %9, %if.end.i ] %i.0.i = phi i32 [ %rem.i, %if.then.i ], [ %spec.select.i, %if.end.i ] %call16.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) %arrayidx11) #8 %tobool.not.not.i = icmp eq i32 %call16.i, 0 br i1 %tobool.not.not.i, label %insert.exit, label %if.end.i if.end.i: ; preds = %while.cond.i %add18.i = add nsw i32 %add14.i, %i.0.i %cmp19.i = icmp sgt i32 %add18.i, 498 %sub.i = add nsw i32 %add18.i, -499 %spec.select.i = select i1 %cmp19.i, i32 %sub.i, i32 %add18.i %idx.ext23.i = sext i32 %spec.select.i to i64 %add.ptr24.i = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23.i %9 = load ptr, ptr %add.ptr24.i, align 16, !tbaa !8 %cmp26.i = icmp eq ptr %9, null br i1 %cmp26.i, label %if.end30.i, label %while.cond.i if.end30.i: ; preds = %if.end.i, %while.body3 %tp.2.i = phi ptr [ %add.ptr8.i, %while.body3 ], [ %add.ptr24.i, %if.end.i ] store ptr %arrayidx11, ptr %tp.2.i, align 8, !tbaa !8 %k32.i = getelementptr inbounds %struct.HASH, ptr %tp.2.i, i64 0, i32 1 store i32 %3, ptr %k32.i, align 8, !tbaa !12 br label %insert.exit insert.exit: ; preds = %while.cond.i, %if.end30.i %inc = add nsw i32 %3, 1 %.pr = load i32, ptr %N, align 4, !tbaa !15 store i32 %inc, ptr @no, align 4, !tbaa !15 %dec = add nsw i32 %.pr, -1 store i32 %dec, ptr %N, align 4, !tbaa !15 %cmp2 = icmp sgt i32 %.pr, 0 br i1 %cmp2, label %while.body3, label %while.end, !llvm.loop !19 while.end: ; preds = %insert.exit, %while.body %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M) %10 = load i32, ptr %M, align 4, !tbaa !15 %dec17238 = add nsw i32 %10, -1 store i32 %dec17238, ptr %M, align 4, !tbaa !15 %tobool18.not239 = icmp eq i32 %10, 0 br i1 %tobool18.not239, label %while.end57, label %while.body19 while.cond16.loopexit: ; preds = %lookup.exit180, %if.end %11 = load i32, ptr %M, align 4, !tbaa !15 %dec17 = add nsw i32 %11, -1 store i32 %dec17, ptr %M, align 4, !tbaa !15 %tobool18.not = icmp eq i32 %11, 0 br i1 %tobool18.not, label %while.end57, label %while.body19, !llvm.loop !20 while.body19: ; preds = %while.end, %while.cond16.loopexit %12 = load i32, ptr @no, align 4, !tbaa !15 %idxprom20 = sext i32 %12 to i64 %arrayidx21 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom20 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx21, ptr noundef nonnull %k) %13 = load i32, ptr @no, align 4, !tbaa !15 %idxprom25 = sext i32 %13 to i64 %arrayidx26 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom25 %14 = load i8, ptr %arrayidx26, align 8, !tbaa !5 %conv.i69 = sext i8 %14 to i32 %mul.i70 = mul nsw i32 %conv.i69, 101 %call.i71 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx26) #8 %conv1.i72 = trunc i64 %call.i71 to i32 %sext.i73 = shl i64 %call.i71, 32 %idx.ext.i74 = ashr exact i64 %sext.i73, 32 %add.ptr.i75 = getelementptr inbounds i8, ptr %arrayidx26, i64 %idx.ext.i74 %add.ptr2.i76 = getelementptr inbounds i8, ptr %add.ptr.i75, i64 -1 %15 = load i8, ptr %add.ptr2.i76, align 1, !tbaa !5 %conv3.i77 = sext i8 %15 to i32 %mul4.i78 = mul nsw i32 %conv3.i77, 103 %mul5.i79 = mul nsw i32 %conv1.i72, 107 %add.i80 = add i32 %mul5.i79, %mul.i70 %add6.i81 = add i32 %add.i80, %mul4.i78 %rem.i82 = srem i32 %add6.i81, 499 %idx.ext7.i83 = sext i32 %rem.i82 to i64 %add.ptr8.i84 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext7.i83 %16 = load ptr, ptr %add.ptr8.i84, align 16, !tbaa !8 %cmp.not.i85 = icmp eq ptr %16, null br i1 %cmp.not.i85, label %if.end30.i138, label %if.then.i86 if.then.i86: ; preds = %while.body19 %add.ptr12.i87 = getelementptr inbounds i8, ptr %arrayidx26, i64 1 %17 = load i8, ptr %add.ptr12.i87, align 1, !tbaa !5 %conv13.i88 = sext i8 %17 to i32 %shl.i89 = shl nsw i32 %conv13.i88, 1 %add14.i90 = add nsw i32 %shl.i89, %conv.i69 %call16.i93229 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) %arrayidx26) #8 %tobool.not.not.i94230 = icmp eq i32 %call16.i93229, 0 br i1 %tobool.not.not.i94230, label %lookup.exit, label %if.end.i95 while.cond.i91: ; preds = %if.end.i95 %call16.i93 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %18, ptr noundef nonnull dereferenceable(1) %arrayidx26) #8 %tobool.not.not.i94 = icmp eq i32 %call16.i93, 0 br i1 %tobool.not.not.i94, label %lookup.exit, label %if.end.i95 if.end.i95: ; preds = %if.then.i86, %while.cond.i91 %i.0.i92231 = phi i32 [ %spec.select.i99, %while.cond.i91 ], [ %rem.i82, %if.then.i86 ] %add18.i96 = add nsw i32 %add14.i90, %i.0.i92231 %cmp19.i97 = icmp sgt i32 %add18.i96, 498 %sub.i98 = add nsw i32 %add18.i96, -499 %spec.select.i99 = select i1 %cmp19.i97, i32 %sub.i98, i32 %add18.i96 %idx.ext23.i100 = sext i32 %spec.select.i99 to i64 %add.ptr24.i101 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23.i100 %18 = load ptr, ptr %add.ptr24.i101, align 16, !tbaa !8 %cmp26.i102 = icmp eq ptr %18, null br i1 %cmp26.i102, label %while.cond.i126.preheader, label %while.cond.i91 lookup.exit: ; preds = %while.cond.i91, %if.then.i86 %.lcssa = phi i64 [ %idx.ext7.i83, %if.then.i86 ], [ %idx.ext23.i100, %while.cond.i91 ] %k.i = getelementptr inbounds %struct.HASH, ptr @hash, i64 %.lcssa, i32 1 %19 = load i32, ptr %k.i, align 8, !tbaa !12 %cmp30 = icmp slt i32 %19, 0 br i1 %cmp30, label %while.cond.i126.preheader, label %lookup.exit.if.end_crit_edge while.cond.i126.preheader: ; preds = %if.end.i95, %lookup.exit br label %while.cond.i126 lookup.exit.if.end_crit_edge: ; preds = %lookup.exit %.pre = zext i32 %19 to i64 br label %if.end while.cond.i126: ; preds = %while.cond.i126.preheader, %if.end.i130 %20 = phi ptr [ %21, %if.end.i130 ], [ %16, %while.cond.i126.preheader ] %i.0.i127 = phi i32 [ %spec.select.i134, %if.end.i130 ], [ %rem.i82, %while.cond.i126.preheader ] %call16.i128 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) %arrayidx26) #8 %tobool.not.not.i129 = icmp eq i32 %call16.i128, 0 br i1 %tobool.not.not.i129, label %insert.exit142, label %if.end.i130 if.end.i130: ; preds = %while.cond.i126 %add18.i131 = add nsw i32 %add14.i90, %i.0.i127 %cmp19.i132 = icmp sgt i32 %add18.i131, 498 %sub.i133 = add nsw i32 %add18.i131, -499 %spec.select.i134 = select i1 %cmp19.i132, i32 %sub.i133, i32 %add18.i131 %idx.ext23.i135 = sext i32 %spec.select.i134 to i64 %add.ptr24.i136 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23.i135 %21 = load ptr, ptr %add.ptr24.i136, align 16, !tbaa !8 %cmp26.i137 = icmp eq ptr %21, null br i1 %cmp26.i137, label %if.end30.i138, label %while.cond.i126 if.end30.i138: ; preds = %if.end.i130, %while.body19 %tp.2.i139 = phi ptr [ %add.ptr8.i84, %while.body19 ], [ %add.ptr24.i136, %if.end.i130 ] store ptr %arrayidx26, ptr %tp.2.i139, align 8, !tbaa !8 %k32.i140 = getelementptr inbounds %struct.HASH, ptr %tp.2.i139, i64 0, i32 1 store i32 %13, ptr %k32.i140, align 8, !tbaa !12 br label %insert.exit142 insert.exit142: ; preds = %while.cond.i126, %if.end30.i138 %m38 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom25, i32 1 store i32 -1, ptr %m38, align 8, !tbaa !18 %inc39 = add nsw i32 %13, 1 store i32 %inc39, ptr @no, align 4, !tbaa !15 br label %if.end if.end: ; preds = %lookup.exit.if.end_crit_edge, %insert.exit142 %idxprom40.pre-phi = phi i64 [ %.pre, %lookup.exit.if.end_crit_edge ], [ %idxprom25, %insert.exit142 ] %22 = load i32, ptr %k, align 4, !tbaa !15 %k42 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom40.pre-phi, i32 2 store i32 %22, ptr %k42, align 4, !tbaa !13 %cmp46236 = icmp sgt i32 %22, 0 br i1 %cmp46236, label %for.body, label %while.cond16.loopexit for.body: ; preds = %if.end, %lookup.exit180 %indvars.iv = phi i64 [ %indvars.iv.next, %lookup.exit180 ], [ 0, %if.end ] %call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %b) %23 = load i8, ptr %b, align 16, !tbaa !5 %conv.i143 = sext i8 %23 to i32 %mul.i144 = mul nsw i32 %conv.i143, 101 %call.i145 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #8 %conv1.i146 = trunc i64 %call.i145 to i32 %sext.i147 = shl i64 %call.i145, 32 %idx.ext.i148 = ashr exact i64 %sext.i147, 32 %gep = getelementptr i8, ptr %invariant.gep244, i64 %idx.ext.i148 %24 = load i8, ptr %gep, align 1, !tbaa !5 %conv3.i151 = sext i8 %24 to i32 %mul4.i152 = mul nsw i32 %conv3.i151, 103 %mul5.i153 = mul nsw i32 %conv1.i146, 107 %add.i154 = add i32 %mul5.i153, %mul.i144 %add6.i155 = add i32 %add.i154, %mul4.i152 %rem.i156 = srem i32 %add6.i155, 499 %idx.ext7.i157 = sext i32 %rem.i156 to i64 %add.ptr8.i158 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext7.i157 %25 = load ptr, ptr %add.ptr8.i158, align 16, !tbaa !8 %cmp.not.i159 = icmp eq ptr %25, null br i1 %cmp.not.i159, label %lookup.exit180, label %if.then.i160 if.then.i160: ; preds = %for.body %26 = load i8, ptr %add.ptr12.i161, align 1, !tbaa !5 %conv13.i162 = sext i8 %26 to i32 %shl.i163 = shl nsw i32 %conv13.i162, 1 %add14.i164 = add nsw i32 %shl.i163, %conv.i143 %call16.i167232 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %25, ptr noundef nonnull dereferenceable(1) %b) #8 %tobool.not.not.i168233 = icmp eq i32 %call16.i167232, 0 br i1 %tobool.not.not.i168233, label %cleanup.thread.i178, label %if.end.i169 while.cond.i165: ; preds = %if.end.i169 %call16.i167 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %28, ptr noundef nonnull dereferenceable(1) %b) #8 %tobool.not.not.i168 = icmp eq i32 %call16.i167, 0 br i1 %tobool.not.not.i168, label %cleanup.thread.i178, label %if.end.i169 cleanup.thread.i178: ; preds = %while.cond.i165, %if.then.i160 %.lcssa222 = phi i64 [ %idx.ext7.i157, %if.then.i160 ], [ %idx.ext23.i174, %while.cond.i165 ] %k.i179 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %.lcssa222, i32 1 %27 = load i32, ptr %k.i179, align 8, !tbaa !12 br label %lookup.exit180 if.end.i169: ; preds = %if.then.i160, %while.cond.i165 %i.0.i166234 = phi i32 [ %spec.select.i173, %while.cond.i165 ], [ %rem.i156, %if.then.i160 ] %add18.i170 = add nsw i32 %add14.i164, %i.0.i166234 %cmp19.i171 = icmp sgt i32 %add18.i170, 498 %sub.i172 = add nsw i32 %add18.i170, -499 %spec.select.i173 = select i1 %cmp19.i171, i32 %sub.i172, i32 %add18.i170 %idx.ext23.i174 = sext i32 %spec.select.i173 to i64 %add.ptr24.i175 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23.i174 %28 = load ptr, ptr %add.ptr24.i175, align 16, !tbaa !8 %cmp26.i176 = icmp eq ptr %28, null br i1 %cmp26.i176, label %lookup.exit180, label %while.cond.i165 lookup.exit180: ; preds = %if.end.i169, %for.body, %cleanup.thread.i178 %retval.1.i177 = phi i32 [ %27, %cleanup.thread.i178 ], [ -1, %for.body ], [ -1, %if.end.i169 ] %arrayidx55 = getelementptr inbounds [205 x %struct.MONO], ptr @mono, i64 0, i64 %idxprom40.pre-phi, i32 3, i64 %indvars.iv store i32 %retval.1.i177, ptr %arrayidx55, align 4, !tbaa !15 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %29 = load i32, ptr %k42, align 4, !tbaa !13 %30 = sext i32 %29 to i64 %cmp46 = icmp slt i64 %indvars.iv.next, %30 br i1 %cmp46, label %for.body, label %while.cond16.loopexit, !llvm.loop !21 while.end57: ; preds = %while.cond16.loopexit, %while.end %call59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %b) %31 = load i8, ptr %b, align 16, !tbaa !5 %conv.i181 = sext i8 %31 to i32 %mul.i182 = mul nsw i32 %conv.i181, 101 %call.i183 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #8 %conv1.i184 = trunc i64 %call.i183 to i32 %sext.i185 = shl i64 %call.i183, 32 %idx.ext.i186 = ashr exact i64 %sext.i185, 32 %gep245 = getelementptr i8, ptr %invariant.gep244, i64 %idx.ext.i186 %32 = load i8, ptr %gep245, align 1, !tbaa !5 %conv3.i189 = sext i8 %32 to i32 %mul4.i190 = mul nsw i32 %conv3.i189, 103 %mul5.i191 = mul nsw i32 %conv1.i184, 107 %add.i192 = add i32 %mul5.i191, %mul.i182 %add6.i193 = add i32 %add.i192, %mul4.i190 %rem.i194 = srem i32 %add6.i193, 499 %idx.ext7.i195 = sext i32 %rem.i194 to i64 %add.ptr8.i196 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext7.i195 %33 = load ptr, ptr %add.ptr8.i196, align 16, !tbaa !8 %cmp.not.i197 = icmp eq ptr %33, null br i1 %cmp.not.i197, label %lookup.exit218, label %if.then.i198 if.then.i198: ; preds = %while.end57 %34 = load i8, ptr %add.ptr12.i161, align 1, !tbaa !5 %conv13.i200 = sext i8 %34 to i32 %shl.i201 = shl nsw i32 %conv13.i200, 1 %add14.i202 = add nsw i32 %shl.i201, %conv.i181 %call16.i205240 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %33, ptr noundef nonnull dereferenceable(1) %b) #8 %tobool.not.not.i206241 = icmp eq i32 %call16.i205240, 0 br i1 %tobool.not.not.i206241, label %cleanup.thread.i216, label %if.end.i207 while.cond.i203: ; preds = %if.end.i207 %call16.i205 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %36, ptr noundef nonnull dereferenceable(1) %b) #8 %tobool.not.not.i206 = icmp eq i32 %call16.i205, 0 br i1 %tobool.not.not.i206, label %cleanup.thread.i216, label %if.end.i207 cleanup.thread.i216: ; preds = %while.cond.i203, %if.then.i198 %.lcssa224 = phi i64 [ %idx.ext7.i195, %if.then.i198 ], [ %idx.ext23.i212, %while.cond.i203 ] %k.i217 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %.lcssa224, i32 1 %35 = load i32, ptr %k.i217, align 8, !tbaa !12 br label %lookup.exit218 if.end.i207: ; preds = %if.then.i198, %while.cond.i203 %i.0.i204242 = phi i32 [ %spec.select.i211, %while.cond.i203 ], [ %rem.i194, %if.then.i198 ] %add18.i208 = add nsw i32 %add14.i202, %i.0.i204242 %cmp19.i209 = icmp sgt i32 %add18.i208, 498 %sub.i210 = add nsw i32 %add18.i208, -499 %spec.select.i211 = select i1 %cmp19.i209, i32 %sub.i210, i32 %add18.i208 %idx.ext23.i212 = sext i32 %spec.select.i211 to i64 %add.ptr24.i213 = getelementptr inbounds %struct.HASH, ptr @hash, i64 %idx.ext23.i212 %36 = load ptr, ptr %add.ptr24.i213, align 16, !tbaa !8 %cmp26.i214 = icmp eq ptr %36, null br i1 %cmp26.i214, label %lookup.exit218, label %while.cond.i203 lookup.exit218: ; preds = %if.end.i207, %while.end57, %cleanup.thread.i216 %retval.1.i215 = phi i32 [ %35, %cleanup.thread.i216 ], [ -1, %while.end57 ], [ -1, %if.end.i207 ] %call62 = call i32 @combi(i32 noundef %retval.1.i215) %call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %call62) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp = icmp eq i32 %call, 1 %37 = load i32, ptr %N, align 4 %tobool = icmp ne i32 %37, 0 %38 = select i1 %cmp, i1 %tobool, i1 false br i1 %38, label %while.body, label %while.end64, !llvm.loop !22 while.end64: ; preds = %lookup.exit218, %entry call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %b) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #9 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 attributes #0 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { nounwind willreturn memory(read) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !10, i64 0} !9 = !{!"", !10, i64 0, !11, i64 8} !10 = !{!"any pointer", !6, i64 0} !11 = !{!"int", !6, i64 0} !12 = !{!9, !11, i64 8} !13 = !{!14, !11, i64 108} !14 = !{!"", !6, i64 0, !11, i64 104, !11, i64 108, !6, i64 112} !15 = !{!11, !11, i64 0} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = !{!14, !11, i64 104} !19 = distinct !{!19, !17} !20 = distinct !{!20, !17} !21 = distinct !{!21, !17} !22 = distinct !{!22, !17}
#include <stdio.h> int main(){ int antennas[5], k; int aux = 1; for (int i = 0; i < 5; i++){ scanf("%d", &antennas[i]); } scanf("%d", &k); for (int i = 0; i<5; i++){ for (int j = 0; j<i; j++){ if ((antennas[j] - antennas[i]) > k || (antennas[i] - antennas[j]) > k){ aux =0; } } } if (aux){ printf("Yay!\n"); } else { printf(":(\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202243/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202243/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c":(\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.cond.cleanup9.4: %antennas = alloca [5 x i32], align 16 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %antennas) #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 %antennas) %arrayidx.1 = getelementptr inbounds [5 x i32], ptr %antennas, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [5 x i32], ptr %antennas, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [5 x i32], ptr %antennas, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [5 x i32], ptr %antennas, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4 %1 = load <4 x i32>, ptr %antennas, align 16 %2 = insertelement <4 x i32> poison, i32 %0, i64 0 %3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer %4 = load <2 x i32>, ptr %arrayidx.1, align 4, !tbaa !5 %5 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 poison, i32 1, i32 poison, i32 poison> %6 = shufflevector <4 x i32> %1, <4 x i32> %5, <4 x i32> <i32 0, i32 5, i32 poison, i32 poison> %7 = shufflevector <4 x i32> %6, <4 x i32> %1, <4 x i32> <i32 0, i32 1, i32 poison, i32 5> %8 = shufflevector <4 x i32> %7, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 3> %9 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison> %10 = shufflevector <4 x i32> %9, <4 x i32> %1, <4 x i32> <i32 0, i32 4, i32 5, i32 poison> %11 = shufflevector <4 x i32> %10, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 1> %12 = sub nsw <4 x i32> %8, %11 %13 = icmp sgt <4 x i32> %12, %3 %14 = load i32, ptr %antennas, align 16, !tbaa !5 %15 = load <4 x i32>, ptr %antennas, align 16, !tbaa !5 %16 = load <4 x i32>, ptr %arrayidx.1, align 4, !tbaa !5 %17 = shufflevector <4 x i32> %16, <4 x i32> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 poison, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %18 = shufflevector <4 x i32> %15, <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %19 = shufflevector <16 x i32> %17, <16 x i32> %18, <16 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 4, i32 poison, i32 16, i32 poison, i32 18, i32 19, i32 17, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %20 = insertelement <16 x i32> %19, i32 %14, i64 12 %21 = shufflevector <2 x i32> %4, <2 x i32> poison, <16 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %22 = shufflevector <16 x i32> %20, <16 x i32> %21, <16 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 4, i32 poison, i32 6, i32 poison, i32 8, i32 9, i32 10, i32 poison, i32 12, i32 poison, i32 16, i32 17> %23 = shufflevector <16 x i32> %22, <16 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 0, i32 4, i32 0, i32 6, i32 0, i32 8, i32 9, i32 10, i32 9, i32 12, i32 9, i32 14, i32 15> %24 = shufflevector <4 x i32> %16, <4 x i32> poison, <16 x i32> <i32 2, i32 3, i32 poison, i32 1, i32 poison, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %25 = shufflevector <4 x i32> %15, <4 x i32> poison, <16 x i32> <i32 0, i32 3, i32 2, i32 poison, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %26 = shufflevector <16 x i32> %24, <16 x i32> %25, <16 x i32> <i32 0, i32 1, i32 poison, i32 3, i32 poison, i32 5, i32 poison, i32 16, i32 17, i32 18, i32 poison, i32 20, i32 poison, i32 poison, i32 poison, i32 poison> %27 = insertelement <16 x i32> %26, i32 %14, i64 13 %28 = shufflevector <2 x i32> %4, <2 x i32> poison, <16 x i32> <i32 1, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %29 = shufflevector <16 x i32> %27, <16 x i32> %28, <16 x i32> <i32 0, i32 1, i32 poison, i32 3, i32 poison, i32 5, i32 poison, i32 7, i32 8, i32 9, i32 poison, i32 11, i32 poison, i32 13, i32 16, i32 17> %30 = shufflevector <16 x i32> %29, <16 x i32> poison, <16 x i32> <i32 0, i32 1, i32 1, i32 3, i32 1, i32 5, i32 1, i32 7, i32 8, i32 9, i32 8, i32 11, i32 8, i32 13, i32 14, i32 15> %31 = sub nsw <16 x i32> %23, %30 %32 = insertelement <16 x i32> poison, i32 %0, i64 0 %33 = shufflevector <16 x i32> %32, <16 x i32> poison, <16 x i32> zeroinitializer %34 = icmp sgt <16 x i32> %31, %33 %35 = freeze <16 x i1> %34 %36 = bitcast <16 x i1> %35 to i16 %37 = icmp ne i16 %36, 0 %38 = freeze <4 x i1> %13 %39 = bitcast <4 x i1> %38 to i4 %40 = icmp ne i4 %39, 0 %op.rdx = or i1 %37, %40 %str.str.3 = select i1 %op.rdx, 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 %k) #4 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %antennas) #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,d,e,k; scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&k); if(e-a>k) printf(":("); else printf("Yay!"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202287/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202287/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c":(\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = 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 %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %d, ptr noundef nonnull %e, ptr noundef nonnull %k) %0 = load i32, ptr %e, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp = icmp sgt i32 %sub, %2 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 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 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { long long int a, b, c, i, j; scanf("%lld %lld", &a, &b); c = (b-a+1) / 2; if(c >= 1) { printf("YES\n"); for(i=a,j=i+1;i<b;i+=2,j+=2) { printf("%lld %lld\n", i, j); } } else printf("NO\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.2 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\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: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %puts12 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) %2 = load i64, ptr %a, align 8, !tbaa !5 %3 = load i64, ptr %b, align 8, !tbaa !5 %cmp313 = icmp slt i64 %2, %3 br i1 %cmp313, label %for.body.preheader, label %if.end for.body.preheader: ; preds = %if.then %add2 = add nsw i64 %2, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %j.015 = phi i64 [ %add6, %for.body ], [ %add2, %for.body.preheader ] %i.014 = phi i64 [ %add5, %for.body ], [ %2, %for.body.preheader ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %i.014, i64 noundef %j.015) %add5 = add nsw i64 %i.014, 2 %add6 = add nsw i64 %j.015, 2 %4 = load i64, ptr %b, align 8, !tbaa !5 %cmp3 = icmp slt i64 %add5, %4 br i1 %cmp3, label %for.body, label %if.end, !llvm.loop !9 if.else: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %for.body, %if.then, %if.else call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = !{!"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> #include<stdlib.h> int main() { int i,j,k[6],f=0; for(i = 0; i < 6; i++) scanf("%d",&k[i]); //一番遠いところからループを回す。 //全探索 for(i = 4; i > 0; i--) { if(f==1) break; for(j = i-1; j >= 0; j--) { if(f==1) break; if(k[i]-k[j]>k[5]) { f++; printf(":("); break; } } } if(f==0) printf("Yay!"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202373/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202373/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c":(\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca [6 x i32], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %arrayidx.1 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %0 = load i32, ptr %arrayidx.5, align 4 %arrayidx12 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 4 %1 = load i32, ptr %arrayidx12, align 16, !tbaa !5 %arrayidx14 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 3 %2 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %sub15 = sub nsw i32 %1, %2 %cmp17 = icmp sgt i32 %sub15, %0 br i1 %cmp17, label %if.end30, label %if.end10.1, !llvm.loop !9 if.end10.1: ; preds = %entry %3 = load i32, ptr %arrayidx12, align 16, !tbaa !5 %arrayidx14.1 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 2 %4 = load i32, ptr %arrayidx14.1, align 8, !tbaa !5 %sub15.1 = sub nsw i32 %3, %4 %cmp17.1 = icmp sgt i32 %sub15.1, %0 br i1 %cmp17.1, label %if.end30, label %if.end10.2, !llvm.loop !9 if.end10.2: ; preds = %if.end10.1 %5 = load i32, ptr %arrayidx12, align 16, !tbaa !5 %arrayidx14.2 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 1 %6 = load i32, ptr %arrayidx14.2, align 4, !tbaa !5 %sub15.2 = sub nsw i32 %5, %6 %cmp17.2 = icmp sgt i32 %sub15.2, %0 br i1 %cmp17.2, label %if.end30, label %if.end10.3, !llvm.loop !9 if.end10.3: ; preds = %if.end10.2 %7 = load i32, ptr %arrayidx12, align 16, !tbaa !5 %8 = load i32, ptr %k, align 16, !tbaa !5 %sub15.3 = sub nsw i32 %7, %8 %cmp17.3 = icmp sgt i32 %sub15.3, %0 br i1 %cmp17.3, label %if.end30, label %for.inc24, !llvm.loop !9 for.inc24: ; preds = %if.end10.3 %arrayidx12.1 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 3 %9 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5 %arrayidx14.162 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 2 %10 = load i32, ptr %arrayidx14.162, align 8, !tbaa !5 %sub15.163 = sub nsw i32 %9, %10 %cmp17.164 = icmp sgt i32 %sub15.163, %0 br i1 %cmp17.164, label %if.end30, label %if.end10.1.1, !llvm.loop !9 if.end10.1.1: ; preds = %for.inc24 %11 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5 %arrayidx14.1.1 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 1 %12 = load i32, ptr %arrayidx14.1.1, align 4, !tbaa !5 %sub15.1.1 = sub nsw i32 %11, %12 %cmp17.1.1 = icmp sgt i32 %sub15.1.1, %0 br i1 %cmp17.1.1, label %if.end30, label %if.end10.2.1, !llvm.loop !9 if.end10.2.1: ; preds = %if.end10.1.1 %13 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5 %14 = load i32, ptr %k, align 16, !tbaa !5 %sub15.2.1 = sub nsw i32 %13, %14 %cmp17.2.1 = icmp sgt i32 %sub15.2.1, %0 br i1 %cmp17.2.1, label %if.end30, label %for.inc24.1, !llvm.loop !9 for.inc24.1: ; preds = %if.end10.2.1 %arrayidx12.2 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 2 %15 = load i32, ptr %arrayidx12.2, align 8, !tbaa !5 %arrayidx14.267 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 1 %16 = load i32, ptr %arrayidx14.267, align 4, !tbaa !5 %sub15.268 = sub nsw i32 %15, %16 %cmp17.269 = icmp sgt i32 %sub15.268, %0 br i1 %cmp17.269, label %if.end30, label %if.end10.1.2, !llvm.loop !9 if.end10.1.2: ; preds = %for.inc24.1 %17 = load i32, ptr %arrayidx12.2, align 8, !tbaa !5 %18 = load i32, ptr %k, align 16, !tbaa !5 %sub15.1.2 = sub nsw i32 %17, %18 %cmp17.1.2 = icmp sgt i32 %sub15.1.2, %0 br i1 %cmp17.1.2, label %if.end30, label %for.inc24.2, !llvm.loop !9 for.inc24.2: ; preds = %if.end10.1.2 %arrayidx12.3 = getelementptr inbounds [6 x i32], ptr %k, i64 0, i64 1 %19 = load i32, ptr %arrayidx12.3, align 4, !tbaa !5 %20 = load i32, ptr %k, align 16, !tbaa !5 %sub15.373 = sub nsw i32 %19, %20 %cmp17.374 = icmp sgt i32 %sub15.373, %0 %spec.select = select i1 %cmp17.374, ptr @.str.1, ptr @.str.2 br label %if.end30, !llvm.loop !9 if.end30: ; preds = %for.inc24.2, %if.end10.1.2, %for.inc24.1, %if.end10.2.1, %if.end10.1.1, %for.inc24, %entry, %if.end10.1, %if.end10.2, %if.end10.3 %.str.1.sink = phi ptr [ @.str.1, %if.end10.3 ], [ @.str.1, %if.end10.2 ], [ @.str.1, %if.end10.1 ], [ @.str.1, %entry ], [ @.str.1, %for.inc24 ], [ @.str.1, %if.end10.1.1 ], [ @.str.1, %if.end10.2.1 ], [ @.str.1, %for.inc24.1 ], [ @.str.1, %if.end10.1.2 ], [ %spec.select, %for.inc24.2 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %k) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int a, b, c, d, e, k; scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &k); printf("%s", (e - a <= k) ? "Yay!" : ":("); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202416/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202416/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = 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 %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %d, ptr noundef nonnull %e, ptr noundef nonnull %k) %0 = load i32, ptr %e, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %sub, %2 %cond = select i1 %cmp.not, ptr @.str.3, ptr @.str.2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 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 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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[5],k,i,j,x,s=0; for(i=0;i<5;i++){ scanf("%d",&a[i]); } scanf("%d",&k); for(i=0;i<5;i++){ for(j=i+1;j<5;j++){ x=a[j]-a[i]; if(x<=k){ }else{ s++; } } } if(s==0){ printf("Yay!"); }else{ printf(":("); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202467/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202467/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.cond2.loopexit.4: %a = alloca [5 x i32], align 16 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %a) #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) %arrayidx.1 = getelementptr inbounds [5 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 [5 x i32], ptr %a, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4 %1 = load <4 x i32>, ptr %a, align 16 %2 = load <4 x i32>, ptr %arrayidx.1, align 4, !tbaa !5 %3 = shufflevector <4 x i32> %1, <4 x i32> poison, <4 x i32> zeroinitializer %4 = sub nsw <4 x i32> %2, %3 %5 = insertelement <4 x i32> poison, i32 %0, i64 0 %6 = shufflevector <4 x i32> %5, <4 x i32> poison, <4 x i32> zeroinitializer %7 = icmp sgt <4 x i32> %4, %6 %8 = load <2 x i32>, ptr %arrayidx.2, align 8, !tbaa !5 %9 = load <2 x i32>, ptr %arrayidx.3, align 4, !tbaa !5 %10 = load <2 x i32>, ptr %arrayidx.1, align 4, !tbaa !5 %11 = shufflevector <2 x i32> %10, <2 x i32> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1> %12 = shufflevector <2 x i32> %8, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison> %13 = shufflevector <2 x i32> %9, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison> %14 = shufflevector <4 x i32> %12, <4 x i32> %13, <4 x i32> <i32 0, i32 1, i32 4, i32 5> %15 = sub nsw <4 x i32> %14, %11 %16 = icmp sgt <4 x i32> %15, %6 %17 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %18 = extractelement <2 x i32> %10, i64 1 %sub.2.1 = sub nsw i32 %17, %18 %cmp12.not.2.1 = icmp sgt i32 %sub.2.1, %0 %inc13.2.1 = zext i1 %cmp12.not.2.1 to i32 %19 = bitcast <4 x i1> %7 to i4 %20 = call i4 @llvm.ctpop.i4(i4 %19), !range !9 %21 = bitcast <4 x i1> %16 to i4 %22 = call i4 @llvm.ctpop.i4(i4 %21), !range !9 %narrow = add nuw i4 %20, %22 %op.rdx = zext i4 %narrow to i32 %op.rdx67 = add nuw nsw i32 %op.rdx, %inc13.2.1 %23 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %sub.3 = sub nsw i32 %17, %23 %cmp12.not.3 = icmp sgt i32 %sub.3, %0 %inc13.3.neg = sext i1 %cmp12.not.3 to i32 %cmp20 = icmp eq i32 %op.rdx67, %inc13.3.neg %.str.1..str.2 = select i1 %cmp20, ptr @.str.1, ptr @.str.2 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 20, 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 i4 @llvm.ctpop.i4(i4) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i4 0, i4 5}
#include<stdio.h> int main(void) { int i,j,num,array[5]; num=0; for(i=0;i<6;i++){ scanf("%d",&array[i]); } for(i=0;i<5;i++){ for(j=i+1;j<5;j++){ if(array[j]-array[i]>num) num = array[j]-array[i]; } } if(num>array[5]) printf(":(\n"); else printf("Yay!\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202517/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202517/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.cond1.loopexit.4: %array = alloca [5 x i32], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %array) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %array) %arrayidx.1 = getelementptr inbounds [5 x i32], ptr %array, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [5 x i32], ptr %array, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [5 x i32], ptr %array, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [5 x i32], ptr %array, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [5 x i32], ptr %array, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %0 = load <4 x i32>, ptr %array, align 16 %1 = load <4 x i32>, ptr %arrayidx.1, align 4, !tbaa !5 %2 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> zeroinitializer %3 = sub nsw <4 x i32> %1, %2 %4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %5 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %sub.1 = sub nsw i32 %5, %4 %6 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %sub.1.1 = sub nsw i32 %6, %4 %7 = load i32, ptr %arrayidx.4, align 16, !tbaa !5 %sub.1.2 = sub nsw i32 %7, %4 %sub.2 = sub nsw i32 %6, %5 %sub.2.1 = sub nsw i32 %7, %5 %sub.3 = sub nsw i32 %7, %6 %8 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %3) %9 = call i32 @llvm.smax.i32(i32 %8, i32 %sub.1) %10 = call i32 @llvm.smax.i32(i32 %sub.1.1, i32 %sub.1.2) %11 = call i32 @llvm.smax.i32(i32 %sub.2, i32 %sub.2.1) %12 = call i32 @llvm.smax.i32(i32 %9, i32 %10) %13 = call i32 @llvm.smax.i32(i32 %sub.3, i32 %11) %14 = call i32 @llvm.smax.i32(i32 %13, i32 %12) %15 = call i32 @llvm.smax.i32(i32 %14, i32 0) %16 = load i32, ptr %arrayidx.5, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %15, %16 %str.3.str = select i1 %cmp24, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %array) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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"}