Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <string.h> int main(){ char s[101]; scanf("%s",&s); for(int i=0;i<strlen(s);i++){ printf("x"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123511/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123511/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %char0 = load i8, ptr %s, align 16 %cmp6.not = icmp eq i8 %char0, 0 br i1 %cmp6.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp = icmp ugt i64 %call1, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !5 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define NUMBER 200 int main(void) { char s[NUMBER]; int i = 0; scanf("%s",s); while (s[i]){ s[i] = 'x'; i++; } printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123555/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123555/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %tobool.not7 = icmp eq i8 %0, 0 br i1 %tobool.not7, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx9 = phi ptr [ %arrayidx, %while.body ], [ %s, %entry ] store i8 120, ptr %arrayidx9, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [200 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %1, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void) { char S[120]; int i; scanf("%s", S); for (i=0; i<strlen(S); i++) printf("x"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123599/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123599/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [120 x i8], align 16 call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %char0 = load i8, ptr %S, align 16 %cmp7.not = icmp eq i8 %char0, 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 ] %putchar = call i32 @putchar(i32 120) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !5 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %S) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void) { char s[100]; int i; scanf("%s", s); for (i = 0; s[i] != '\0'; i ++) { s[i] = 'x'; } printf("%s", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123641/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123641/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not8 = icmp eq i8 %0, 0 br i1 %cmp.not8, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx10 = phi ptr [ %arrayidx, %for.body ], [ %s, %entry ] store i8 120, ptr %arrayidx10, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %entry %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int a[100095],b[100095]; int main () { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) scanf("%d",&b[i]); int i=1,flag=0; while(1) { if(a[i]==b[i]) { if(a[i]!=0) {flag=a[i];break;} i++; if(i==n+1) break; } else break; } if(flag==0&&i<=n) printf("NO\n"); else { if(flag==0||i==n) printf("YES\n"); else { for(int j=i+1;j<=n;j++) { if(flag==1&&a[j]<=b[j]||flag==-1&&a[j]>=b[j]) { if(j==n) {printf("YES\n");break;} if(flag==a[j]) continue; else if(a[j]==-flag) {printf("YES\n");break;} } else { printf("NO\n"); break;} } } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1237/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1237/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [100095 x i32] zeroinitializer, align 16 @b = dso_local global [100095 x i32] zeroinitializer, align 16 @str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec138 = add nsw i32 %0, -1 store i32 %dec138, ptr %t, align 4, !tbaa !5 %tobool.not139 = icmp eq i32 %0, 0 br i1 %tobool.not139, label %while.end88, label %while.body while.body: ; preds = %entry, %if.end87 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4 %cmp.not134 = icmp slt i32 %1, 1 br i1 %cmp.not134, label %while.cond15.preheader, label %for.body for.cond4.preheader: ; preds = %for.body %cmp5.not136 = icmp slt i32 %2, 1 br i1 %cmp5.not136, label %while.cond15.preheader, label %for.body7 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.body ] %arrayidx = getelementptr inbounds [100095 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 %2 = load i32, ptr %n, align 4 %3 = sext i32 %2 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9 while.cond15.preheader: ; preds = %for.body7, %while.body, %for.cond4.preheader %.lcssa = phi i32 [ %2, %for.cond4.preheader ], [ %1, %while.body ], [ %6, %for.body7 ] %4 = zext i32 %.lcssa to i64 %5 = add i32 %.lcssa, 1 br label %while.cond15 for.body7: ; preds = %for.cond4.preheader, %for.body7 %indvars.iv145 = phi i64 [ %indvars.iv.next146, %for.body7 ], [ 1, %for.cond4.preheader ] %arrayidx9 = getelementptr inbounds [100095 x i32], ptr @b, i64 0, i64 %indvars.iv145 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1 %6 = load i32, ptr %n, align 4 %7 = sext i32 %6 to i64 %cmp5.not.not = icmp slt i64 %indvars.iv145, %7 br i1 %cmp5.not.not, label %for.body7, label %while.cond15.preheader, !llvm.loop !11 while.cond15: ; preds = %while.cond15.preheader, %if.end %indvars.iv148 = phi i64 [ 1, %while.cond15.preheader ], [ %indvars.iv.next149, %if.end ] %arrayidx18 = getelementptr inbounds [100095 x i32], ptr @a, i64 0, i64 %indvars.iv148 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %arrayidx20 = getelementptr inbounds [100095 x i32], ptr @b, i64 0, i64 %indvars.iv148 %9 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %8, %9 br i1 %cmp21, label %if.then, label %while.end.split.loop.exit if.then: ; preds = %while.cond15 %cmp24.not = icmp eq i32 %8, 0 br i1 %cmp24.not, label %if.end, label %if.else37 if.end: ; preds = %if.then %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %cmp29 = icmp eq i64 %indvars.iv148, %4 br i1 %cmp29, label %while.end, label %while.cond15 while.end.split.loop.exit: ; preds = %while.cond15 %10 = trunc i64 %indvars.iv148 to i32 br label %while.end while.end: ; preds = %if.end, %while.end.split.loop.exit %i14.1 = phi i32 [ %10, %while.end.split.loop.exit ], [ %5, %if.end ] %cmp34.not = icmp sgt i32 %i14.1, %.lcssa br i1 %cmp34.not, label %if.then40, label %if.end87.sink.split if.else37: ; preds = %if.then %11 = trunc i64 %indvars.iv148 to i32 %cmp39 = icmp eq i32 %.lcssa, %11 br i1 %cmp39, label %if.then40, label %for.cond44.preheader for.cond44.preheader: ; preds = %if.else37 %sub = sub nsw i32 0, %8 %sext = shl i64 %indvars.iv148, 32 %12 = ashr exact i64 %sext, 32 %smax = call i32 @llvm.smax.i32(i32 %11, i32 %.lcssa) %wide.trip.count = sext i32 %smax to i64 br label %for.cond44 if.then40: ; preds = %while.end, %if.else37 br label %if.end87.sink.split for.cond44: ; preds = %for.cond44.preheader, %if.end67 %indvars.iv151 = phi i64 [ %12, %for.cond44.preheader ], [ %indvars.iv.next152, %if.end67 ] %indvars.iv.next152 = add nsw i64 %indvars.iv151, 1 %exitcond.not = icmp eq i64 %indvars.iv151, %wide.trip.count br i1 %exitcond.not, label %if.end87, label %for.body47 for.body47: ; preds = %for.cond44 switch i32 %8, label %if.end87.sink.split [ i32 1, label %land.lhs.true49 i32 -1, label %land.lhs.true57 ] land.lhs.true49: ; preds = %for.body47 %arrayidx51 = getelementptr inbounds [100095 x i32], ptr @a, i64 0, i64 %indvars.iv.next152 %13 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %arrayidx53 = getelementptr inbounds [100095 x i32], ptr @b, i64 0, i64 %indvars.iv.next152 %14 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %cmp54.not = icmp sgt i32 %13, %14 br i1 %cmp54.not, label %if.end87.sink.split, label %if.then63 land.lhs.true57: ; preds = %for.body47 %arrayidx59 = getelementptr inbounds [100095 x i32], ptr @a, i64 0, i64 %indvars.iv.next152 %15 = load i32, ptr %arrayidx59, align 4, !tbaa !5 %arrayidx61 = getelementptr inbounds [100095 x i32], ptr @b, i64 0, i64 %indvars.iv.next152 %16 = load i32, ptr %arrayidx61, align 4, !tbaa !5 %cmp62.not = icmp slt i32 %15, %16 br i1 %cmp62.not, label %if.end87.sink.split, label %if.then63 if.then63: ; preds = %land.lhs.true57, %land.lhs.true49 %17 = phi i32 [ %15, %land.lhs.true57 ], [ %13, %land.lhs.true49 ] %18 = trunc i64 %indvars.iv.next152 to i32 %cmp64 = icmp eq i32 %.lcssa, %18 br i1 %cmp64, label %if.end87.sink.split, label %if.end67 if.end67: ; preds = %if.then63 %cmp70 = icmp ne i32 %8, %17 %cmp75 = icmp eq i32 %17, %sub %or.cond121 = select i1 %cmp70, i1 %cmp75, i1 false br i1 %or.cond121, label %if.end87.sink.split, label %for.cond44, !llvm.loop !12 if.end87.sink.split: ; preds = %land.lhs.true57, %for.body47, %land.lhs.true49, %if.end67, %if.then63, %while.end, %if.then40 %str.4.sink = phi ptr [ @str.5, %if.then40 ], [ @str.6, %while.end ], [ @str.5, %if.then63 ], [ @str.5, %if.end67 ], [ @str.6, %land.lhs.true49 ], [ @str.6, %for.body47 ], [ @str.6, %land.lhs.true57 ] %puts117 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) br label %if.end87 if.end87: ; preds = %for.cond44, %if.end87.sink.split call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %19 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %19, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %19, 0 br i1 %tobool.not, label %while.end88, label %while.body, !llvm.loop !13 while.end88: ; preds = %if.end87, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include <string.h> int main(void) { char s[101]; int i; scanf("%s", s); for(i = 0; i < strlen(s); i++) { s[i] = 'x'; } printf("%s\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123757/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123757/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %char0 = load i8, ptr %s, align 16 %cmp9.not = icmp eq i8 %char0, 0 br i1 %cmp9.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv store i8 120, ptr %arrayidx, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8 for.end: ; preds = %for.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int arr[26]; void clear(void) { for(int i=0;i<26;i++) arr[i]=0; return; } int main(void) { int test; scanf("%d",&test); for(int t=0;t<test;t++) { clear(); char word[200001]; scanf("%s",word); int i=0; while(word[i]!='\0') { arr[word[i]-'a']++; i++; } i=0; while(word[i]!='\0') { if(arr[word[i]-'a']>1) { arr[word[i]-'a']--; i++; } else break; } while(word[i]!='\0') { printf("%c",word[i++]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12380/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12380/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @arr = dso_local local_unnamed_addr global [26 x i32] zeroinitializer, align 16 @.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 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @clear() local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @arr, i8 0, i64 104, i1 false), !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 i32 @main() local_unnamed_addr #2 { entry: %test = alloca i32, align 4 %word = alloca [200001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %test) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %test) %0 = load i32, ptr %test, align 4, !tbaa !5 %cmp67 = icmp sgt i32 %0, 0 br i1 %cmp67, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %while.end45, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %test) #6 ret i32 0 for.body: ; preds = %entry, %while.end45 %t.068 = phi i32 [ %inc47, %while.end45 ], [ 0, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @arr, i8 0, i64 104, i1 false), !tbaa !5 call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %word) #6 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %word) %1 = load i8, ptr %word, align 16, !tbaa !9 %cmp2.not58 = icmp eq i8 %1, 0 br i1 %cmp2.not58, label %while.end45, label %while.body while.cond10.preheader: ; preds = %while.body br i1 %cmp2.not58, label %while.end45, label %while.body16 while.body: ; preds = %for.body, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %for.body ] %2 = phi i8 [ %4, %while.body ], [ %1, %for.body ] %conv = sext i8 %2 to i64 %sub = add nsw i64 %conv, -97 %arrayidx8 = getelementptr inbounds [26 x i32], ptr @arr, i64 0, i64 %sub %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %arrayidx8, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [200001 x i8], ptr %word, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp2.not = icmp eq i8 %4, 0 br i1 %cmp2.not, label %while.cond10.preheader, label %while.body, !llvm.loop !10 while.body16: ; preds = %while.cond10.preheader, %if.then %indvars.iv69 = phi i64 [ %indvars.iv.next70, %if.then ], [ 0, %while.cond10.preheader ] %5 = phi i8 [ %7, %if.then ], [ %1, %while.cond10.preheader ] %i.161 = phi i32 [ %inc31, %if.then ], [ 0, %while.cond10.preheader ] %conv13 = sext i8 %5 to i64 %sub20 = add nsw i64 %conv13, -97 %arrayidx22 = getelementptr inbounds [26 x i32], ptr @arr, i64 0, i64 %sub20 %6 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %6, 1 br i1 %cmp23, label %if.then, label %while.end32.split.loop.exit75 if.then: ; preds = %while.body16 %dec = add nsw i32 %6, -1 store i32 %dec, ptr %arrayidx22, align 4, !tbaa !5 %indvars.iv.next70 = add nuw i64 %indvars.iv69, 1 %inc31 = add nuw nsw i32 %i.161, 1 %arrayidx12 = getelementptr inbounds [200001 x i8], ptr %word, i64 0, i64 %indvars.iv.next70 %7 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %cmp14.not = icmp eq i8 %7, 0 br i1 %cmp14.not, label %while.end32, label %while.body16, !llvm.loop !12 while.end32.split.loop.exit75: ; preds = %while.body16 %8 = trunc i64 %indvars.iv69 to i32 br label %while.end32 while.end32: ; preds = %if.then, %while.end32.split.loop.exit75 %i.1.lcssa.ph = phi i32 [ %8, %while.end32.split.loop.exit75 ], [ %inc31, %if.then ] %idxprom3463.phi.trans.insert = zext i32 %i.1.lcssa.ph to i64 %arrayidx3564.phi.trans.insert = getelementptr inbounds [200001 x i8], ptr %word, i64 0, i64 %idxprom3463.phi.trans.insert %.pre = load i8, ptr %arrayidx3564.phi.trans.insert, align 1, !tbaa !9 %cmp37.not65 = icmp eq i8 %.pre, 0 br i1 %cmp37.not65, label %while.end45, label %while.body39.preheader while.body39.preheader: ; preds = %while.end32 %idxprom3463 = zext i32 %i.1.lcssa.ph to i64 br label %while.body39 while.body39: ; preds = %while.body39.preheader, %while.body39 %indvars.iv71 = phi i64 [ %idxprom3463, %while.body39.preheader ], [ %indvars.iv.next72, %while.body39 ] %9 = phi i8 [ %.pre, %while.body39.preheader ], [ %10, %while.body39 ] %conv36 = sext i8 %9 to i32 %indvars.iv.next72 = add nuw i64 %indvars.iv71, 1 %putchar57 = call i32 @putchar(i32 %conv36) %arrayidx35 = getelementptr inbounds [200001 x i8], ptr %word, i64 0, i64 %indvars.iv.next72 %10 = load i8, ptr %arrayidx35, align 1, !tbaa !9 %cmp37.not = icmp eq i8 %10, 0 br i1 %cmp37.not, label %while.end45, label %while.body39, !llvm.loop !13 while.end45: ; preds = %while.body39, %for.body, %while.cond10.preheader, %while.end32 %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %word) #6 %inc47 = add nuw nsw i32 %t.068, 1 %11 = load i32, ptr %test, align 4, !tbaa !5 %cmp = icmp slt i32 %inc47, %11 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !14 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11}
#include <stdio.h> int main(void){ int x,y; scanf("%d %d", &x, &y); int a=2*x-1, b=2*y-1, c=x+y; if(a>=b && a>=c)printf("%d\n", a); else if(b>=a && b>=c)printf("%d\n", b); else if(c>=b && c>=a)printf("%d\n", c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123843/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123843/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %mul = shl nsw i32 %0, 1 %sub = add nsw i32 %mul, -1 %1 = load i32, ptr %y, align 4, !tbaa !5 %mul1 = shl nsw i32 %1, 1 %sub2 = add nsw i32 %mul1, -1 %add = add nsw i32 %1, %0 %cmp.not = icmp sge i32 %mul, %mul1 %cmp3.not.not = icmp sgt i32 %mul, %add %or.cond = select i1 %cmp.not, i1 %cmp3.not.not, i1 false br i1 %or.cond, label %if.end17.sink.split, label %if.else if.else: ; preds = %entry %cmp5.not = icmp sge i32 %mul1, %mul %cmp7.not.not = icmp sgt i32 %mul1, %add %or.cond30 = select i1 %cmp5.not, i1 %cmp7.not.not, i1 false br i1 %or.cond30, label %if.end17.sink.split, label %if.else10 if.else10: ; preds = %if.else %cmp11.not = icmp slt i32 %add, %sub2 %cmp13.not = icmp slt i32 %add, %sub %or.cond31 = select i1 %cmp11.not, i1 true, i1 %cmp13.not br i1 %or.cond31, label %if.end17, label %if.end17.sink.split if.end17.sink.split: ; preds = %if.else10, %if.else, %entry %sub2.sink = phi i32 [ %sub, %entry ], [ %sub2, %if.else ], [ %add, %if.else10 ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2.sink) br label %if.end17 if.end17: ; preds = %if.end17.sink.split, %if.else10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int A,B,tmp; scanf("%d" "%d",&A,&B ); if (A<B) { tmp = B*2-1; }else if(A>B){ tmp = 2*A-1; }else{ tmp = A*2; } printf("%d\n",tmp); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123900/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123900/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %1, 1 %sub = add nsw i32 %mul, -1 br label %if.end7 if.else: ; preds = %entry %cmp1 = icmp sgt i32 %0, %1 %mul3 = shl nsw i32 %0, 1 %sub4 = sext i1 %cmp1 to i32 %spec.select = add nsw i32 %mul3, %sub4 br label %if.end7 if.end7: ; preds = %if.else, %if.then %tmp.0 = phi i32 [ %sub, %if.then ], [ %spec.select, %if.else ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %tmp.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int A,B,X,max; scanf("%d %d",&A,&B); max = A+A-1; if(max < A+B)max=A+B; if(max < B + B-1)max=B+B-1; printf("%d\n",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123944/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123944/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #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 %add = shl nsw i32 %0, 1 %sub = add nsw i32 %add, -1 %1 = load i32, ptr %B, align 4, !tbaa !5 %add1 = add nsw i32 %1, %0 %cmp.not = icmp sgt i32 %add, %add1 %spec.select = select i1 %cmp.not, i32 %sub, i32 %add1 %add3 = shl nsw i32 %1, 1 %sub4 = add nsw i32 %add3, -1 %max.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %sub4) %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> void rsort(int a[],int n) { int i,j,t; for (i=0;i<n-1;i=i+1){ for (j=0;j<n-i-1;j=j+1) { if (a[j]<a[j+1]) { t=a[j]; a[j]=a[j+1]; a[j+1]=t; } }} } int main() { int n,i,j,a[100000],k,b[100000],x; scanf("%d",&x); for(i=0;i<x;i++) { scanf("%d",&j); for(k=0;k<j;k++) scanf("%d",&a[k]); rsort(a,j); b[i]=a[0]+a[1]; } for(i=0;i<x;i++) printf("%d\n",b[i]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12403/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12403/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @rsort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 { entry: %sub = add i32 %n, -1 %cmp41 = icmp sgt i32 %n, 1 br i1 %cmp41, label %for.cond1.preheader.preheader, label %for.end22 for.cond1.preheader.preheader: ; preds = %entry %invariant.gep = getelementptr i32, ptr %a, i64 1 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc20 %indvars.iv44 = phi i32 [ %indvars.iv.next45, %for.inc20 ], [ %sub, %for.cond1.preheader.preheader ] %i.042 = phi i32 [ %add21, %for.inc20 ], [ 0, %for.cond1.preheader.preheader ] %0 = zext i32 %indvars.iv44 to i64 %1 = xor i32 %i.042, -1 %sub3 = add i32 %1, %n %cmp439 = icmp sgt i32 %sub3, 0 br i1 %cmp439, label %for.body5.preheader, label %for.inc20 for.body5.preheader: ; preds = %for.cond1.preheader %.pre = load i32, ptr %a, align 4, !tbaa !5 %xtraiter = and i64 %0, 1 %2 = icmp eq i32 %indvars.iv44, 1 br i1 %2, label %for.inc20.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %0, 4294967294 br label %for.body5 for.body5: ; preds = %for.inc.1, %for.body5.preheader.new %3 = phi i32 [ %.pre, %for.body5.preheader.new ], [ %7, %for.inc.1 ] %indvars.iv = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.inc.1 ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8 = icmp slt i32 %3, %4 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body5 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv store i32 %4, ptr %arrayidx, align 4, !tbaa !5 store i32 %3, ptr %arrayidx7, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body5, %if.then %5 = phi i32 [ %4, %for.body5 ], [ %3, %if.then ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx7.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.1 %6 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %cmp8.1 = icmp slt i32 %5, %6 br i1 %cmp8.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %arrayidx.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next store i32 %6, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %5, ptr %arrayidx7.1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %7 = phi i32 [ %6, %for.inc ], [ %5, %if.then.1 ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.inc20.loopexit.unr-lcssa, label %for.body5, !llvm.loop !9 for.inc20.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body5.preheader %.unr = phi i32 [ %.pre, %for.body5.preheader ], [ %7, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc20, label %for.body5.epil for.body5.epil: ; preds = %for.inc20.loopexit.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.unr %8 = load i32, ptr %gep, align 4, !tbaa !5 %cmp8.epil = icmp slt i32 %.unr, %8 br i1 %cmp8.epil, label %if.then.epil, label %for.inc20 if.then.epil: ; preds = %for.body5.epil %arrayidx.epil = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.unr store i32 %8, ptr %arrayidx.epil, align 4, !tbaa !5 store i32 %.unr, ptr %gep, align 4, !tbaa !5 br label %for.inc20 for.inc20: ; preds = %for.inc20.loopexit.unr-lcssa, %if.then.epil, %for.body5.epil, %for.cond1.preheader %add21 = add nuw nsw i32 %i.042, 1 %indvars.iv.next45 = add i32 %indvars.iv44, -1 %exitcond46.not = icmp eq i32 %add21, %sub br i1 %exitcond46.not, label %for.end22, label %for.cond1.preheader, !llvm.loop !11 for.end22: ; preds = %for.inc20, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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: %j = alloca i32, align 4 %a = alloca [100000 x i32], align 16 %b = alloca [100000 x i32], align 16 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body.lr.ph, label %for.end21 for.body.lr.ph: ; preds = %entry %arrayidx7 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 1 %invariant.gep = getelementptr i32, ptr %a, i64 1 br label %for.body for.cond13.preheader: ; preds = %rsort.exit %1 = icmp sgt i32 %16, 0 br i1 %1, label %for.body15, label %for.end21 for.body: ; preds = %for.body.lr.ph, %rsort.exit %indvars.iv37 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next38, %rsort.exit ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %2 = load i32, ptr %j, align 4, !tbaa !5 %cmp329 = icmp sgt i32 %2, 0 br i1 %cmp329, label %for.body4, label %rsort.exit for.body4: ; preds = %for.body, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %j, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body4 %sub.i = add i32 %3, -1 %cmp41.i = icmp sgt i32 %3, 1 br i1 %cmp41.i, label %for.cond1.preheader.i, label %rsort.exit for.cond1.preheader.i: ; preds = %for.end, %for.inc20.i %indvars.iv44.i = phi i32 [ %indvars.iv.next45.i, %for.inc20.i ], [ %sub.i, %for.end ] %i.042.i = phi i32 [ %add21.i, %for.inc20.i ], [ 0, %for.end ] %5 = zext i32 %indvars.iv44.i to i64 %6 = xor i32 %i.042.i, -1 %sub3.i = add i32 %3, %6 %cmp439.i = icmp sgt i32 %sub3.i, 0 br i1 %cmp439.i, label %for.body5.preheader.i, label %for.inc20.i for.body5.preheader.i: ; preds = %for.cond1.preheader.i %.pre.i = load i32, ptr %a, align 16, !tbaa !5 %xtraiter = and i64 %5, 1 %7 = icmp eq i32 %indvars.iv44.i, 1 br i1 %7, label %for.inc20.i.loopexit.unr-lcssa, label %for.body5.preheader.i.new for.body5.preheader.i.new: ; preds = %for.body5.preheader.i %unroll_iter = and i64 %5, 4294967294 br label %for.body5.i for.body5.i: ; preds = %for.inc.i.1, %for.body5.preheader.i.new %8 = phi i32 [ %.pre.i, %for.body5.preheader.i.new ], [ %12, %for.inc.i.1 ] %indvars.iv.i = phi i64 [ 0, %for.body5.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %niter = phi i64 [ 0, %for.body5.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx7.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i %9 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5 %cmp8.i = icmp slt i32 %8, %9 br i1 %cmp8.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body5.i %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i store i32 %9, ptr %arrayidx.i, align 8, !tbaa !5 store i32 %8, ptr %arrayidx7.i, align 4, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body5.i %10 = phi i32 [ %9, %for.body5.i ], [ %8, %if.then.i ] %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %arrayidx7.i.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i.1 %11 = load i32, ptr %arrayidx7.i.1, align 8, !tbaa !5 %cmp8.i.1 = icmp slt i32 %10, %11 br i1 %cmp8.i.1, label %if.then.i.1, label %for.inc.i.1 if.then.i.1: ; preds = %for.inc.i %arrayidx.i.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i store i32 %11, ptr %arrayidx.i.1, align 4, !tbaa !5 store i32 %10, ptr %arrayidx7.i.1, align 8, !tbaa !5 br label %for.inc.i.1 for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i %12 = phi i32 [ %11, %for.inc.i ], [ %10, %if.then.i.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.inc20.i.loopexit.unr-lcssa, label %for.body5.i, !llvm.loop !9 for.inc20.i.loopexit.unr-lcssa: ; preds = %for.inc.i.1, %for.body5.preheader.i %.unr = phi i32 [ %.pre.i, %for.body5.preheader.i ], [ %12, %for.inc.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body5.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc20.i, label %for.body5.i.epil for.body5.i.epil: ; preds = %for.inc20.i.loopexit.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.i.unr %13 = load i32, ptr %gep, align 4, !tbaa !5 %cmp8.i.epil = icmp slt i32 %.unr, %13 br i1 %cmp8.i.epil, label %if.then.i.epil, label %for.inc20.i if.then.i.epil: ; preds = %for.body5.i.epil %arrayidx.i.epil = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.unr store i32 %13, ptr %arrayidx.i.epil, align 4, !tbaa !5 store i32 %.unr, ptr %gep, align 4, !tbaa !5 br label %for.inc20.i for.inc20.i: ; preds = %for.inc20.i.loopexit.unr-lcssa, %if.then.i.epil, %for.body5.i.epil, %for.cond1.preheader.i %add21.i = add nuw nsw i32 %i.042.i, 1 %indvars.iv.next45.i = add i32 %indvars.iv44.i, -1 %exitcond46.not.i = icmp eq i32 %add21.i, %sub.i br i1 %exitcond46.not.i, label %rsort.exit, label %for.cond1.preheader.i, !llvm.loop !11 rsort.exit: ; preds = %for.inc20.i, %for.body, %for.end %14 = load i32, ptr %a, align 16, !tbaa !5 %15 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %15, %14 %arrayidx9 = getelementptr inbounds [100000 x i32], ptr %b, i64 0, i64 %indvars.iv37 store i32 %add, ptr %arrayidx9, align 4, !tbaa !5 %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1 %16 = load i32, ptr %x, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp = icmp slt i64 %indvars.iv.next38, %17 br i1 %cmp, label %for.body, label %for.cond13.preheader, !llvm.loop !13 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx17 = getelementptr inbounds [100000 x i32], ptr %b, i64 0, i64 %indvars.iv40 %18 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18) %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %19 = load i32, ptr %x, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp14 = icmp slt i64 %indvars.iv.next41, %20 br i1 %cmp14, label %for.body15, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.body15, %entry, %for.cond13.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> int main(){ int a, b, i, res = 0; scanf("%d %d", &a, &b); for (i=0; i<2; i++) { if (a > b) { /* code */ res += a; a--; } else { /* code */ res += b; b--; } } printf("%d\n", res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124073/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124073/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %a.promoted, -1 store i32 %dec, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %dec3 = add nsw i32 %b.promoted, -1 store i32 %dec3, ptr %b, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %dec311 = phi i32 [ %b.promoted, %if.then ], [ %dec3, %if.else ] %dec9 = phi i32 [ %dec, %if.then ], [ %a.promoted, %if.else ] %.pn = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %dec9, %dec311 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %dec3.1 = add nsw i32 %dec311, -1 store i32 %dec3.1, ptr %b, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %dec.1 = add nsw i32 %dec9, -1 store i32 %dec.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ] %res.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int A,B; scanf("%d%d",&A,&B); if(A == B) printf("%d", A+B); else printf("%d", A>B ? 2*A-1 : 2*B-1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124116/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124116/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %add = shl nsw i32 %0, 1 br label %if.end if.else: ; preds = %entry %. = call i32 @llvm.smax.i32(i32 %0, i32 %1) %cond.in = shl nsw i32 %., 1 %cond = add nsw i32 %cond.in, -1 br label %if.end if.end: ; preds = %if.else, %if.then %cond.sink = phi i32 [ %cond, %if.else ], [ %add, %if.then ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int A , B; scanf("%d %d" , &A, &B); if(A>B){ printf("%d\n" , A*2-1); }else if(A==B){ printf("%d\n" , A + B); }else{ printf("%d\n" , B*2-1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124167/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124167/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 %sub = add nsw i32 %mul, -1 br label %if.end9 if.else: ; preds = %entry %cmp2 = icmp eq i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.else5 if.then3: ; preds = %if.else %add = shl nsw i32 %0, 1 br label %if.end9 if.else5: ; preds = %if.else %mul6 = shl nsw i32 %1, 1 %sub7 = add nsw i32 %mul6, -1 br label %if.end9 if.end9: ; preds = %if.then3, %if.else5, %if.then %add.sink = phi i32 [ %add, %if.then3 ], [ %sub7, %if.else5 ], [ %sub, %if.then ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int min(int a, int b) { if(a<b) return a; else return b; } int main() { int n; scanf("%d",&n); int a[10]={0}; int c[10]={0}; int b[10]={0}; int x; for(int i=0;i<n;i++) { for(int j=0;j<6;j++) { scanf("%d",&x); if(i==0) a[x]=1; if(i==1) b[x]=1; if(i==2) c[x]=1; } } int maxi=0; int flag=0; for(maxi=1;maxi<10;maxi++) { if(!(a[maxi] || b[maxi] || c[maxi])) { flag=1; break; } } if(flag==1) { printf("%d\n",maxi-1); return 0; } flag=0; for(maxi=1;maxi<10;maxi++) { if(!((a[0]&&(b[maxi]||c[maxi])) || (b[0]&&(a[maxi]||c[maxi])) || (c[0]&&(b[maxi]||a[maxi])))) { flag=1; break; } } int minten; if(flag==1) minten=maxi*10; else minten=100; flag=0; for(maxi=1;maxi<10;maxi++) { if(a[maxi]+b[maxi]+c[maxi]<2) { flag=1; break; } } if(flag==1) { printf("%d\n", min(maxi*11-1,minten-1)); return 0; } flag=0; for(maxi=1;maxi<10;maxi++) { if(!(((a[0]&&b[0])||c[maxi]) || ((a[0]&&c[0])||b[maxi]) || ((c[0]&&b[0])||a[maxi]) )) { flag=1; break; } } int minhun; if(flag==1) minhun=maxi*100; else minhun=100; flag=0; for(maxi=1;maxi<10;maxi++) { if(a[maxi]+b[maxi]+c[maxi]<3) { flag=1; break; } } if(flag==1) { printf("%d\n", min(maxi*111-1,minhun-1)); return 0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12421/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12421/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %a = alloca [10 x i32], align 16 %c = alloca [10 x i32], align 16 %b = alloca [10 x i32], align 16 %x = 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) call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %a) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %a, i8 0, i64 40, i1 false) call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %c) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %c, i8 0, i64 40, i1 false) call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %b) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %b, i8 0, i64 40, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp247 = icmp sgt i32 %0, 0 br i1 %cmp247, label %for.cond1.preheader, label %lor.lhs.false for.cond1.preheader: ; preds = %entry, %for.cond.cleanup3 %i.0248 = phi i32 [ %inc18, %for.cond.cleanup3 ], [ 0, %entry ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) switch i32 %i.0248, label %for.body4.preheader [ i32 0, label %for.body4.us.preheader i32 1, label %for.body4.us234.preheader i32 2, label %for.body4.us241.preheader ] for.body4.us241.preheader: ; preds = %for.cond1.preheader %1 = load i32, ptr %x, align 4, !tbaa !5 %idxprom14.us = sext i32 %1 to i64 %arrayidx15.us = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %idxprom14.us store i32 1, ptr %arrayidx15.us, align 4, !tbaa !5 %call5.us243.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %2 = load i32, ptr %x, align 4, !tbaa !5 %idxprom14.us.1 = sext i32 %2 to i64 %arrayidx15.us.1 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %idxprom14.us.1 store i32 1, ptr %arrayidx15.us.1, align 4, !tbaa !5 %call5.us243.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %3 = load i32, ptr %x, align 4, !tbaa !5 %idxprom14.us.2 = sext i32 %3 to i64 %arrayidx15.us.2 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %idxprom14.us.2 store i32 1, ptr %arrayidx15.us.2, align 4, !tbaa !5 %call5.us243.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %4 = load i32, ptr %x, align 4, !tbaa !5 %idxprom14.us.3 = sext i32 %4 to i64 %arrayidx15.us.3 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %idxprom14.us.3 store i32 1, ptr %arrayidx15.us.3, align 4, !tbaa !5 %call5.us243.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %5 = load i32, ptr %x, align 4, !tbaa !5 %idxprom14.us.4 = sext i32 %5 to i64 %arrayidx15.us.4 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %idxprom14.us.4 store i32 1, ptr %arrayidx15.us.4, align 4, !tbaa !5 %call5.us243.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %6 = load i32, ptr %x, align 4, !tbaa !5 %idxprom14.us.5 = sext i32 %6 to i64 %arrayidx15.us.5 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 %idxprom14.us.5 store i32 1, ptr %arrayidx15.us.5, align 4, !tbaa !5 br label %for.cond.cleanup3 for.body4.us234.preheader: ; preds = %for.cond1.preheader %7 = load i32, ptr %x, align 4, !tbaa !5 %idxprom9.us = sext i32 %7 to i64 %arrayidx10.us = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 %idxprom9.us store i32 1, ptr %arrayidx10.us, align 4, !tbaa !5 %call5.us236.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %8 = load i32, ptr %x, align 4, !tbaa !5 %idxprom9.us.1 = sext i32 %8 to i64 %arrayidx10.us.1 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 %idxprom9.us.1 store i32 1, ptr %arrayidx10.us.1, align 4, !tbaa !5 %call5.us236.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %9 = load i32, ptr %x, align 4, !tbaa !5 %idxprom9.us.2 = sext i32 %9 to i64 %arrayidx10.us.2 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 %idxprom9.us.2 store i32 1, ptr %arrayidx10.us.2, align 4, !tbaa !5 %call5.us236.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %10 = load i32, ptr %x, align 4, !tbaa !5 %idxprom9.us.3 = sext i32 %10 to i64 %arrayidx10.us.3 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 %idxprom9.us.3 store i32 1, ptr %arrayidx10.us.3, align 4, !tbaa !5 %call5.us236.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %11 = load i32, ptr %x, align 4, !tbaa !5 %idxprom9.us.4 = sext i32 %11 to i64 %arrayidx10.us.4 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 %idxprom9.us.4 store i32 1, ptr %arrayidx10.us.4, align 4, !tbaa !5 %call5.us236.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %12 = load i32, ptr %x, align 4, !tbaa !5 %idxprom9.us.5 = sext i32 %12 to i64 %arrayidx10.us.5 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 %idxprom9.us.5 store i32 1, ptr %arrayidx10.us.5, align 4, !tbaa !5 br label %for.cond.cleanup3 for.body4.us.preheader: ; preds = %for.cond1.preheader %13 = load i32, ptr %x, align 4, !tbaa !5 %idxprom.us = sext i32 %13 to i64 %arrayidx.us = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 %idxprom.us store i32 1, ptr %arrayidx.us, align 4, !tbaa !5 %call5.us.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %14 = load i32, ptr %x, align 4, !tbaa !5 %idxprom.us.1 = sext i32 %14 to i64 %arrayidx.us.1 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 %idxprom.us.1 store i32 1, ptr %arrayidx.us.1, align 4, !tbaa !5 %call5.us.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %15 = load i32, ptr %x, align 4, !tbaa !5 %idxprom.us.2 = sext i32 %15 to i64 %arrayidx.us.2 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 %idxprom.us.2 store i32 1, ptr %arrayidx.us.2, align 4, !tbaa !5 %call5.us.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %16 = load i32, ptr %x, align 4, !tbaa !5 %idxprom.us.3 = sext i32 %16 to i64 %arrayidx.us.3 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 %idxprom.us.3 store i32 1, ptr %arrayidx.us.3, align 4, !tbaa !5 %call5.us.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %17 = load i32, ptr %x, align 4, !tbaa !5 %idxprom.us.4 = sext i32 %17 to i64 %arrayidx.us.4 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 %idxprom.us.4 store i32 1, ptr %arrayidx.us.4, align 4, !tbaa !5 %call5.us.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %18 = load i32, ptr %x, align 4, !tbaa !5 %idxprom.us.5 = sext i32 %18 to i64 %arrayidx.us.5 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 %idxprom.us.5 store i32 1, ptr %arrayidx.us.5, align 4, !tbaa !5 br label %for.cond.cleanup3 for.body4.preheader: ; preds = %for.cond1.preheader %call5.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call5.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call5.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call5.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call5.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) br label %for.cond.cleanup3 for.cond20.preheader: ; preds = %for.cond.cleanup3 %arrayidx24.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 1 %.pre = load i32, ptr %arrayidx24.phi.trans.insert, align 4, !tbaa !5 %tobool.not = icmp eq i32 %.pre, 0 br i1 %tobool.not, label %lor.lhs.false, label %for.inc34 for.cond.cleanup3: ; preds = %for.body4.us241.preheader, %for.body4.us234.preheader, %for.body4.us.preheader, %for.body4.preheader %inc18 = add nuw nsw i32 %i.0248, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc18, %19 br i1 %cmp, label %for.cond1.preheader, label %for.cond20.preheader, !llvm.loop !9 lor.lhs.false: ; preds = %entry, %for.cond20.preheader %arrayidx26 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 1 %20 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %tobool27.not = icmp eq i32 %20, 0 %arrayidx30 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 1 %21 = load i32, ptr %arrayidx30, align 4 %tobool31.not = icmp eq i32 %21, 0 %or.cond289 = select i1 %tobool27.not, i1 %tobool31.not, i1 false br i1 %or.cond289, label %cleanup175.sink.split, label %for.inc34 for.inc34: ; preds = %for.cond20.preheader, %lor.lhs.false %tobool.not285 = phi i1 [ false, %for.cond20.preheader ], [ true, %lor.lhs.false ] %22 = phi i32 [ %.pre, %for.cond20.preheader ], [ 0, %lor.lhs.false ] %arrayidx24.1 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 2 %23 = load i32, ptr %arrayidx24.1, align 8, !tbaa !5 %tobool.not.1 = icmp eq i32 %23, 0 %arrayidx26.1 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 2 %24 = load i32, ptr %arrayidx26.1, align 8 %tobool27.not.1 = icmp eq i32 %24, 0 %or.cond290 = select i1 %tobool.not.1, i1 %tobool27.not.1, i1 false %arrayidx30.1 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 2 %25 = load i32, ptr %arrayidx30.1, align 8 %tobool31.not.1 = icmp eq i32 %25, 0 %or.cond291 = select i1 %or.cond290, i1 %tobool31.not.1, i1 false br i1 %or.cond291, label %cleanup175.sink.split, label %for.inc34.1 for.inc34.1: ; preds = %for.inc34 %arrayidx24.2 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 3 %26 = load i32, ptr %arrayidx24.2, align 4, !tbaa !5 %tobool.not.2 = icmp eq i32 %26, 0 %arrayidx26.2 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 3 %27 = load i32, ptr %arrayidx26.2, align 4 %tobool27.not.2 = icmp eq i32 %27, 0 %or.cond292 = select i1 %tobool.not.2, i1 %tobool27.not.2, i1 false %arrayidx30.2 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 3 %28 = load i32, ptr %arrayidx30.2, align 4 %tobool31.not.2 = icmp eq i32 %28, 0 %or.cond293 = select i1 %or.cond292, i1 %tobool31.not.2, i1 false br i1 %or.cond293, label %cleanup175.sink.split, label %for.inc34.2 for.inc34.2: ; preds = %for.inc34.1 %arrayidx24.3 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 4 %29 = load i32, ptr %arrayidx24.3, align 16, !tbaa !5 %tobool.not.3 = icmp eq i32 %29, 0 %arrayidx26.3 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 4 %30 = load i32, ptr %arrayidx26.3, align 16 %tobool27.not.3 = icmp eq i32 %30, 0 %or.cond294 = select i1 %tobool.not.3, i1 %tobool27.not.3, i1 false %arrayidx30.3 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 4 %31 = load i32, ptr %arrayidx30.3, align 16 %tobool31.not.3 = icmp eq i32 %31, 0 %or.cond295 = select i1 %or.cond294, i1 %tobool31.not.3, i1 false br i1 %or.cond295, label %cleanup175.sink.split, label %for.inc34.3 for.inc34.3: ; preds = %for.inc34.2 %arrayidx24.4 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 5 %32 = load i32, ptr %arrayidx24.4, align 4, !tbaa !5 %tobool.not.4 = icmp eq i32 %32, 0 %arrayidx26.4 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 5 %33 = load i32, ptr %arrayidx26.4, align 4 %tobool27.not.4 = icmp eq i32 %33, 0 %or.cond296 = select i1 %tobool.not.4, i1 %tobool27.not.4, i1 false %arrayidx30.4 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 5 %34 = load i32, ptr %arrayidx30.4, align 4 %tobool31.not.4 = icmp eq i32 %34, 0 %or.cond297 = select i1 %or.cond296, i1 %tobool31.not.4, i1 false br i1 %or.cond297, label %cleanup175.sink.split, label %for.inc34.4 for.inc34.4: ; preds = %for.inc34.3 %arrayidx24.5 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 6 %35 = load i32, ptr %arrayidx24.5, align 8, !tbaa !5 %tobool.not.5 = icmp eq i32 %35, 0 %arrayidx26.5 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 6 %36 = load i32, ptr %arrayidx26.5, align 8 %tobool27.not.5 = icmp eq i32 %36, 0 %or.cond298 = select i1 %tobool.not.5, i1 %tobool27.not.5, i1 false %arrayidx30.5 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 6 %37 = load i32, ptr %arrayidx30.5, align 8 %tobool31.not.5 = icmp eq i32 %37, 0 %or.cond299 = select i1 %or.cond298, i1 %tobool31.not.5, i1 false br i1 %or.cond299, label %cleanup175.sink.split, label %for.inc34.5 for.inc34.5: ; preds = %for.inc34.4 %arrayidx24.6 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 7 %38 = load i32, ptr %arrayidx24.6, align 4, !tbaa !5 %tobool.not.6 = icmp eq i32 %38, 0 %arrayidx26.6 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 7 %39 = load i32, ptr %arrayidx26.6, align 4 %tobool27.not.6 = icmp eq i32 %39, 0 %or.cond300 = select i1 %tobool.not.6, i1 %tobool27.not.6, i1 false %arrayidx30.6 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 7 %40 = load i32, ptr %arrayidx30.6, align 4 %tobool31.not.6 = icmp eq i32 %40, 0 %or.cond301 = select i1 %or.cond300, i1 %tobool31.not.6, i1 false br i1 %or.cond301, label %cleanup175.sink.split, label %for.inc34.6 for.inc34.6: ; preds = %for.inc34.5 %arrayidx24.7 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 8 %41 = load i32, ptr %arrayidx24.7, align 16, !tbaa !5 %tobool.not.7 = icmp eq i32 %41, 0 %arrayidx26.7 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 8 %42 = load i32, ptr %arrayidx26.7, align 16 %tobool27.not.7 = icmp eq i32 %42, 0 %or.cond302 = select i1 %tobool.not.7, i1 %tobool27.not.7, i1 false %arrayidx30.7 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 8 %43 = load i32, ptr %arrayidx30.7, align 16 %tobool31.not.7 = icmp eq i32 %43, 0 %or.cond303 = select i1 %or.cond302, i1 %tobool31.not.7, i1 false br i1 %or.cond303, label %cleanup175.sink.split, label %for.inc34.7 for.inc34.7: ; preds = %for.inc34.6 %arrayidx24.8 = getelementptr inbounds [10 x i32], ptr %a, i64 0, i64 9 %44 = load i32, ptr %arrayidx24.8, align 4, !tbaa !5 %tobool.not.8 = icmp eq i32 %44, 0 %arrayidx26.8 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 9 %45 = load i32, ptr %arrayidx26.8, align 4 %tobool27.not.8 = icmp eq i32 %45, 0 %or.cond304 = select i1 %tobool.not.8, i1 %tobool27.not.8, i1 false %arrayidx30.8 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 9 %46 = load i32, ptr %arrayidx30.8, align 4 %tobool31.not.8 = icmp eq i32 %46, 0 %or.cond305 = select i1 %or.cond304, i1 %tobool31.not.8, i1 false br i1 %or.cond305, label %cleanup175.sink.split, label %for.inc34.8 for.inc34.8: ; preds = %for.inc34.7 %47 = load i32, ptr %a, align 16, !tbaa !5 %tobool45.not = icmp eq i32 %47, 0 %48 = load i32, ptr %b, align 16 %tobool55.not = icmp eq i32 %48, 0 %49 = load i32, ptr %c, align 16 %tobool66.not = icmp eq i32 %49, 0 br i1 %tobool45.not, label %lor.lhs.false53, label %land.lhs.true land.lhs.true: ; preds = %for.inc34.8 %arrayidx47 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 1 %50 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %tobool48.not = icmp eq i32 %50, 0 %arrayidx51 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 1 %51 = load i32, ptr %arrayidx51, align 4 %tobool52.not = icmp eq i32 %51, 0 %or.cond306 = select i1 %tobool48.not, i1 %tobool52.not, i1 false br i1 %or.cond306, label %lor.lhs.false53, label %land.lhs.true.1 lor.lhs.false53: ; preds = %land.lhs.true, %for.inc34.8 br i1 %tobool55.not, label %lor.lhs.false64, label %land.lhs.true56 land.lhs.true56: ; preds = %lor.lhs.false53 %arrayidx62 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 1 %52 = load i32, ptr %arrayidx62, align 4 %tobool63.not = icmp eq i32 %52, 0 %or.cond307 = select i1 %tobool.not285, i1 %tobool63.not, i1 false br i1 %or.cond307, label %lor.lhs.false64, label %for.inc77 lor.lhs.false64: ; preds = %land.lhs.true56, %lor.lhs.false53 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67 land.lhs.true67: ; preds = %lor.lhs.false64 %arrayidx69 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 1 %53 = load i32, ptr %arrayidx69, align 4, !tbaa !5 %tobool70.not = icmp eq i32 %53, 0 %brmerge.not = and i1 %tobool70.not, %tobool.not285 br i1 %brmerge.not, label %if.then81, label %for.inc77 for.inc77: ; preds = %land.lhs.true67, %land.lhs.true56 br i1 %tobool45.not, label %lor.lhs.false53.1, label %land.lhs.true.1 land.lhs.true.1: ; preds = %land.lhs.true, %for.inc77 %arrayidx47.1 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 2 %54 = load i32, ptr %arrayidx47.1, align 8, !tbaa !5 %tobool48.not.1 = icmp eq i32 %54, 0 %arrayidx51.1 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 2 %55 = load i32, ptr %arrayidx51.1, align 8 %tobool52.not.1 = icmp eq i32 %55, 0 %or.cond308 = select i1 %tobool48.not.1, i1 %tobool52.not.1, i1 false br i1 %or.cond308, label %lor.lhs.false53.1, label %land.lhs.true.2 lor.lhs.false53.1: ; preds = %land.lhs.true.1, %for.inc77 br i1 %tobool55.not, label %lor.lhs.false64.1, label %land.lhs.true56.1 land.lhs.true56.1: ; preds = %lor.lhs.false53.1 %arrayidx62.1 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 2 %56 = load i32, ptr %arrayidx62.1, align 8 %tobool63.not.1 = icmp eq i32 %56, 0 %or.cond309 = select i1 %tobool.not.1, i1 %tobool63.not.1, i1 false br i1 %or.cond309, label %lor.lhs.false64.1, label %for.inc77.1 lor.lhs.false64.1: ; preds = %land.lhs.true56.1, %lor.lhs.false53.1 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.1 land.lhs.true67.1: ; preds = %lor.lhs.false64.1 %arrayidx69.1 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 2 %57 = load i32, ptr %arrayidx69.1, align 8, !tbaa !5 %58 = or i32 %57, %23 %brmerge310.not = icmp eq i32 %58, 0 br i1 %brmerge310.not, label %if.then81, label %for.inc77.1 for.inc77.1: ; preds = %land.lhs.true67.1, %land.lhs.true56.1 br i1 %tobool45.not, label %lor.lhs.false53.2, label %land.lhs.true.2 land.lhs.true.2: ; preds = %land.lhs.true.1, %for.inc77.1 %arrayidx47.2 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 3 %59 = load i32, ptr %arrayidx47.2, align 4, !tbaa !5 %tobool48.not.2 = icmp eq i32 %59, 0 %arrayidx51.2 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 3 %60 = load i32, ptr %arrayidx51.2, align 4 %tobool52.not.2 = icmp eq i32 %60, 0 %or.cond311 = select i1 %tobool48.not.2, i1 %tobool52.not.2, i1 false br i1 %or.cond311, label %lor.lhs.false53.2, label %land.lhs.true.3 lor.lhs.false53.2: ; preds = %land.lhs.true.2, %for.inc77.1 br i1 %tobool55.not, label %lor.lhs.false64.2, label %land.lhs.true56.2 land.lhs.true56.2: ; preds = %lor.lhs.false53.2 %arrayidx62.2 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 3 %61 = load i32, ptr %arrayidx62.2, align 4 %tobool63.not.2 = icmp eq i32 %61, 0 %or.cond312 = select i1 %tobool.not.2, i1 %tobool63.not.2, i1 false br i1 %or.cond312, label %lor.lhs.false64.2, label %for.inc77.2 lor.lhs.false64.2: ; preds = %land.lhs.true56.2, %lor.lhs.false53.2 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.2 land.lhs.true67.2: ; preds = %lor.lhs.false64.2 %arrayidx69.2 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 3 %62 = load i32, ptr %arrayidx69.2, align 4, !tbaa !5 %63 = or i32 %62, %26 %brmerge313.not = icmp eq i32 %63, 0 br i1 %brmerge313.not, label %if.then81, label %for.inc77.2 for.inc77.2: ; preds = %land.lhs.true67.2, %land.lhs.true56.2 br i1 %tobool45.not, label %lor.lhs.false53.3, label %land.lhs.true.3 land.lhs.true.3: ; preds = %land.lhs.true.2, %for.inc77.2 %arrayidx47.3 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 4 %64 = load i32, ptr %arrayidx47.3, align 16, !tbaa !5 %tobool48.not.3 = icmp eq i32 %64, 0 %arrayidx51.3 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 4 %65 = load i32, ptr %arrayidx51.3, align 16 %tobool52.not.3 = icmp eq i32 %65, 0 %or.cond314 = select i1 %tobool48.not.3, i1 %tobool52.not.3, i1 false br i1 %or.cond314, label %lor.lhs.false53.3, label %land.lhs.true.4 lor.lhs.false53.3: ; preds = %land.lhs.true.3, %for.inc77.2 br i1 %tobool55.not, label %lor.lhs.false64.3, label %land.lhs.true56.3 land.lhs.true56.3: ; preds = %lor.lhs.false53.3 %arrayidx62.3 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 4 %66 = load i32, ptr %arrayidx62.3, align 16 %tobool63.not.3 = icmp eq i32 %66, 0 %or.cond315 = select i1 %tobool.not.3, i1 %tobool63.not.3, i1 false br i1 %or.cond315, label %lor.lhs.false64.3, label %for.inc77.3 lor.lhs.false64.3: ; preds = %land.lhs.true56.3, %lor.lhs.false53.3 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.3 land.lhs.true67.3: ; preds = %lor.lhs.false64.3 %arrayidx69.3 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 4 %67 = load i32, ptr %arrayidx69.3, align 16, !tbaa !5 %68 = or i32 %67, %29 %brmerge316.not = icmp eq i32 %68, 0 br i1 %brmerge316.not, label %if.then81, label %for.inc77.3 for.inc77.3: ; preds = %land.lhs.true67.3, %land.lhs.true56.3 br i1 %tobool45.not, label %lor.lhs.false53.4, label %land.lhs.true.4 land.lhs.true.4: ; preds = %land.lhs.true.3, %for.inc77.3 %arrayidx47.4 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 5 %69 = load i32, ptr %arrayidx47.4, align 4, !tbaa !5 %tobool48.not.4 = icmp eq i32 %69, 0 %arrayidx51.4 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 5 %70 = load i32, ptr %arrayidx51.4, align 4 %tobool52.not.4 = icmp eq i32 %70, 0 %or.cond317 = select i1 %tobool48.not.4, i1 %tobool52.not.4, i1 false br i1 %or.cond317, label %lor.lhs.false53.4, label %land.lhs.true.5 lor.lhs.false53.4: ; preds = %land.lhs.true.4, %for.inc77.3 br i1 %tobool55.not, label %lor.lhs.false64.4, label %land.lhs.true56.4 land.lhs.true56.4: ; preds = %lor.lhs.false53.4 %arrayidx62.4 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 5 %71 = load i32, ptr %arrayidx62.4, align 4 %tobool63.not.4 = icmp eq i32 %71, 0 %or.cond318 = select i1 %tobool.not.4, i1 %tobool63.not.4, i1 false br i1 %or.cond318, label %lor.lhs.false64.4, label %for.inc77.4 lor.lhs.false64.4: ; preds = %land.lhs.true56.4, %lor.lhs.false53.4 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.4 land.lhs.true67.4: ; preds = %lor.lhs.false64.4 %arrayidx69.4 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 5 %72 = load i32, ptr %arrayidx69.4, align 4, !tbaa !5 %73 = or i32 %72, %32 %brmerge319.not = icmp eq i32 %73, 0 br i1 %brmerge319.not, label %if.then81, label %for.inc77.4 for.inc77.4: ; preds = %land.lhs.true67.4, %land.lhs.true56.4 br i1 %tobool45.not, label %lor.lhs.false53.5, label %land.lhs.true.5 land.lhs.true.5: ; preds = %land.lhs.true.4, %for.inc77.4 %arrayidx47.5 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 6 %74 = load i32, ptr %arrayidx47.5, align 8, !tbaa !5 %tobool48.not.5 = icmp eq i32 %74, 0 %arrayidx51.5 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 6 %75 = load i32, ptr %arrayidx51.5, align 8 %tobool52.not.5 = icmp eq i32 %75, 0 %or.cond320 = select i1 %tobool48.not.5, i1 %tobool52.not.5, i1 false br i1 %or.cond320, label %lor.lhs.false53.5, label %land.lhs.true.6 lor.lhs.false53.5: ; preds = %land.lhs.true.5, %for.inc77.4 br i1 %tobool55.not, label %lor.lhs.false64.5, label %land.lhs.true56.5 land.lhs.true56.5: ; preds = %lor.lhs.false53.5 %arrayidx62.5 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 6 %76 = load i32, ptr %arrayidx62.5, align 8 %tobool63.not.5 = icmp eq i32 %76, 0 %or.cond321 = select i1 %tobool.not.5, i1 %tobool63.not.5, i1 false br i1 %or.cond321, label %lor.lhs.false64.5, label %for.inc77.5 lor.lhs.false64.5: ; preds = %land.lhs.true56.5, %lor.lhs.false53.5 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.5 land.lhs.true67.5: ; preds = %lor.lhs.false64.5 %arrayidx69.5 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 6 %77 = load i32, ptr %arrayidx69.5, align 8, !tbaa !5 %78 = or i32 %77, %35 %brmerge322.not = icmp eq i32 %78, 0 br i1 %brmerge322.not, label %if.then81, label %for.inc77.5 for.inc77.5: ; preds = %land.lhs.true67.5, %land.lhs.true56.5 br i1 %tobool45.not, label %lor.lhs.false53.6, label %land.lhs.true.6 land.lhs.true.6: ; preds = %land.lhs.true.5, %for.inc77.5 %arrayidx47.6 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 7 %79 = load i32, ptr %arrayidx47.6, align 4, !tbaa !5 %tobool48.not.6 = icmp eq i32 %79, 0 %arrayidx51.6 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 7 %80 = load i32, ptr %arrayidx51.6, align 4 %tobool52.not.6 = icmp eq i32 %80, 0 %or.cond323 = select i1 %tobool48.not.6, i1 %tobool52.not.6, i1 false br i1 %or.cond323, label %lor.lhs.false53.6, label %land.lhs.true.7 lor.lhs.false53.6: ; preds = %land.lhs.true.6, %for.inc77.5 br i1 %tobool55.not, label %lor.lhs.false64.6, label %land.lhs.true56.6 land.lhs.true56.6: ; preds = %lor.lhs.false53.6 %arrayidx62.6 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 7 %81 = load i32, ptr %arrayidx62.6, align 4 %tobool63.not.6 = icmp eq i32 %81, 0 %or.cond324 = select i1 %tobool.not.6, i1 %tobool63.not.6, i1 false br i1 %or.cond324, label %lor.lhs.false64.6, label %for.inc77.6 lor.lhs.false64.6: ; preds = %land.lhs.true56.6, %lor.lhs.false53.6 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.6 land.lhs.true67.6: ; preds = %lor.lhs.false64.6 %arrayidx69.6 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 7 %82 = load i32, ptr %arrayidx69.6, align 4, !tbaa !5 %83 = or i32 %82, %38 %brmerge325.not = icmp eq i32 %83, 0 br i1 %brmerge325.not, label %if.then81, label %for.inc77.6 for.inc77.6: ; preds = %land.lhs.true67.6, %land.lhs.true56.6 br i1 %tobool45.not, label %lor.lhs.false53.7, label %land.lhs.true.7 land.lhs.true.7: ; preds = %land.lhs.true.6, %for.inc77.6 %arrayidx47.7 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 8 %84 = load i32, ptr %arrayidx47.7, align 16, !tbaa !5 %tobool48.not.7 = icmp eq i32 %84, 0 %arrayidx51.7 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 8 %85 = load i32, ptr %arrayidx51.7, align 16 %tobool52.not.7 = icmp eq i32 %85, 0 %or.cond326 = select i1 %tobool48.not.7, i1 %tobool52.not.7, i1 false br i1 %or.cond326, label %lor.lhs.false53.7, label %land.lhs.true.8 lor.lhs.false53.7: ; preds = %land.lhs.true.7, %for.inc77.6 br i1 %tobool55.not, label %lor.lhs.false64.7, label %land.lhs.true56.7 land.lhs.true56.7: ; preds = %lor.lhs.false53.7 %arrayidx62.7 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 8 %86 = load i32, ptr %arrayidx62.7, align 16 %tobool63.not.7 = icmp eq i32 %86, 0 %or.cond327 = select i1 %tobool.not.7, i1 %tobool63.not.7, i1 false br i1 %or.cond327, label %lor.lhs.false64.7, label %for.inc77.7 lor.lhs.false64.7: ; preds = %land.lhs.true56.7, %lor.lhs.false53.7 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.7 land.lhs.true67.7: ; preds = %lor.lhs.false64.7 %arrayidx69.7 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 8 %87 = load i32, ptr %arrayidx69.7, align 16, !tbaa !5 %88 = or i32 %87, %41 %brmerge328.not = icmp eq i32 %88, 0 br i1 %brmerge328.not, label %if.then81, label %for.inc77.7 for.inc77.7: ; preds = %land.lhs.true67.7, %land.lhs.true56.7 br i1 %tobool45.not, label %lor.lhs.false53.8, label %land.lhs.true.8 land.lhs.true.8: ; preds = %land.lhs.true.7, %for.inc77.7 %arrayidx47.8 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 9 %89 = load i32, ptr %arrayidx47.8, align 4, !tbaa !5 %tobool48.not.8 = icmp eq i32 %89, 0 %arrayidx51.8 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 9 %90 = load i32, ptr %arrayidx51.8, align 4 %tobool52.not.8 = icmp eq i32 %90, 0 %or.cond329 = select i1 %tobool48.not.8, i1 %tobool52.not.8, i1 false br i1 %or.cond329, label %lor.lhs.false53.8, label %if.end82 lor.lhs.false53.8: ; preds = %land.lhs.true.8, %for.inc77.7 br i1 %tobool55.not, label %lor.lhs.false64.8, label %land.lhs.true56.8 land.lhs.true56.8: ; preds = %lor.lhs.false53.8 %arrayidx62.8 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 9 %91 = load i32, ptr %arrayidx62.8, align 4 %tobool63.not.8 = icmp eq i32 %91, 0 %or.cond330 = select i1 %tobool.not.8, i1 %tobool63.not.8, i1 false br i1 %or.cond330, label %lor.lhs.false64.8, label %if.end82 lor.lhs.false64.8: ; preds = %land.lhs.true56.8, %lor.lhs.false53.8 br i1 %tobool66.not, label %if.then81, label %land.lhs.true67.8 land.lhs.true67.8: ; preds = %lor.lhs.false64.8 %arrayidx69.8 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 9 %92 = load i32, ptr %arrayidx69.8, align 4, !tbaa !5 %93 = or i32 %92, %44 %brmerge331.not = icmp eq i32 %93, 0 br i1 %brmerge331.not, label %if.then81, label %if.end82 if.then81: ; preds = %land.lhs.true67.8, %land.lhs.true67.7, %land.lhs.true67.6, %land.lhs.true67.5, %land.lhs.true67.4, %land.lhs.true67.3, %land.lhs.true67.2, %land.lhs.true67.1, %land.lhs.true67, %lor.lhs.false64.8, %lor.lhs.false64.7, %lor.lhs.false64.6, %lor.lhs.false64.5, %lor.lhs.false64.4, %lor.lhs.false64.3, %lor.lhs.false64.2, %lor.lhs.false64.1, %lor.lhs.false64 %tobool.not288 = phi i1 [ %tobool.not285, %lor.lhs.false64 ], [ %tobool.not285, %lor.lhs.false64.1 ], [ %tobool.not285, %lor.lhs.false64.2 ], [ %tobool.not285, %lor.lhs.false64.3 ], [ %tobool.not285, %lor.lhs.false64.4 ], [ %tobool.not285, %lor.lhs.false64.5 ], [ %tobool.not285, %lor.lhs.false64.6 ], [ %tobool.not285, %lor.lhs.false64.7 ], [ %tobool.not285, %lor.lhs.false64.8 ], [ true, %land.lhs.true67 ], [ %tobool.not285, %land.lhs.true67.1 ], [ %tobool.not285, %land.lhs.true67.2 ], [ %tobool.not285, %land.lhs.true67.3 ], [ %tobool.not285, %land.lhs.true67.4 ], [ %tobool.not285, %land.lhs.true67.5 ], [ %tobool.not285, %land.lhs.true67.6 ], [ %tobool.not285, %land.lhs.true67.7 ], [ %tobool.not285, %land.lhs.true67.8 ] %maxi.1250.lcssa = phi i32 [ 9, %lor.lhs.false64 ], [ 19, %lor.lhs.false64.1 ], [ 29, %lor.lhs.false64.2 ], [ 39, %lor.lhs.false64.3 ], [ 49, %lor.lhs.false64.4 ], [ 59, %lor.lhs.false64.5 ], [ 69, %lor.lhs.false64.6 ], [ 79, %lor.lhs.false64.7 ], [ 89, %lor.lhs.false64.8 ], [ 9, %land.lhs.true67 ], [ 19, %land.lhs.true67.1 ], [ 29, %land.lhs.true67.2 ], [ 39, %land.lhs.true67.3 ], [ 49, %land.lhs.true67.4 ], [ 59, %land.lhs.true67.5 ], [ 69, %land.lhs.true67.6 ], [ 79, %land.lhs.true67.7 ], [ 89, %land.lhs.true67.8 ] br label %if.end82 if.end82: ; preds = %land.lhs.true67.8, %land.lhs.true.8, %land.lhs.true56.8, %if.then81 %tobool.not287 = phi i1 [ %tobool.not288, %if.then81 ], [ %tobool.not285, %land.lhs.true67.8 ], [ %tobool.not285, %land.lhs.true56.8 ], [ %tobool.not285, %land.lhs.true.8 ] %minten.0 = phi i32 [ %maxi.1250.lcssa, %if.then81 ], [ 99, %land.lhs.true67.8 ], [ 99, %land.lhs.true56.8 ], [ 99, %land.lhs.true.8 ] %arrayidx89 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 1 %94 = load i32, ptr %arrayidx89, align 4, !tbaa !5 %add = add nsw i32 %94, %22 %arrayidx91 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 1 %95 = load i32, ptr %arrayidx91, align 4, !tbaa !5 %add92 = add nsw i32 %add, %95 %cmp93 = icmp slt i32 %add92, 2 br i1 %cmp93, label %if.then100, label %for.inc96 for.cond107.preheader.split: ; preds = %for.inc96.8 %or.cond182 = select i1 %tobool111, i1 %tobool124, i1 false %or.cond182.fr = freeze i1 %or.cond182 br i1 %or.cond182.fr, label %if.end148, label %for.cond107.preheader.split.split for.cond107.preheader.split.split: ; preds = %for.cond107.preheader.split %or.cond183.fr = freeze i1 %or.cond183 br i1 %or.cond183.fr, label %if.end148, label %for.body109.preheader for.body109.preheader: ; preds = %for.cond107.preheader.split.split %96 = or i32 %95, %94 %or.cond332 = icmp eq i32 %96, 0 %brmerge333.not = and i1 %or.cond332, %tobool.not287 br i1 %brmerge333.not, label %if.then145, label %for.inc141 for.inc96: ; preds = %if.end82 %arrayidx89.1 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 2 %97 = load i32, ptr %arrayidx89.1, align 8, !tbaa !5 %add.1 = add nsw i32 %97, %23 %arrayidx91.1 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 2 %98 = load i32, ptr %arrayidx91.1, align 8, !tbaa !5 %add92.1 = add nsw i32 %add.1, %98 %cmp93.1 = icmp slt i32 %add92.1, 2 br i1 %cmp93.1, label %if.then100, label %for.inc96.1 for.inc96.1: ; preds = %for.inc96 %arrayidx89.2 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 3 %99 = load i32, ptr %arrayidx89.2, align 4, !tbaa !5 %add.2 = add nsw i32 %99, %26 %arrayidx91.2 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 3 %100 = load i32, ptr %arrayidx91.2, align 4, !tbaa !5 %add92.2 = add nsw i32 %add.2, %100 %cmp93.2 = icmp slt i32 %add92.2, 2 br i1 %cmp93.2, label %if.then100, label %for.inc96.2 for.inc96.2: ; preds = %for.inc96.1 %arrayidx89.3 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 4 %101 = load i32, ptr %arrayidx89.3, align 16, !tbaa !5 %add.3 = add nsw i32 %101, %29 %arrayidx91.3 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 4 %102 = load i32, ptr %arrayidx91.3, align 16, !tbaa !5 %add92.3 = add nsw i32 %add.3, %102 %cmp93.3 = icmp slt i32 %add92.3, 2 br i1 %cmp93.3, label %if.then100, label %for.inc96.3 for.inc96.3: ; preds = %for.inc96.2 %arrayidx89.4 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 5 %103 = load i32, ptr %arrayidx89.4, align 4, !tbaa !5 %add.4 = add nsw i32 %103, %32 %arrayidx91.4 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 5 %104 = load i32, ptr %arrayidx91.4, align 4, !tbaa !5 %add92.4 = add nsw i32 %add.4, %104 %cmp93.4 = icmp slt i32 %add92.4, 2 br i1 %cmp93.4, label %if.then100, label %for.inc96.4 for.inc96.4: ; preds = %for.inc96.3 %arrayidx89.5 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 6 %105 = load i32, ptr %arrayidx89.5, align 8, !tbaa !5 %add.5 = add nsw i32 %105, %35 %arrayidx91.5 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 6 %106 = load i32, ptr %arrayidx91.5, align 8, !tbaa !5 %add92.5 = add nsw i32 %add.5, %106 %cmp93.5 = icmp slt i32 %add92.5, 2 br i1 %cmp93.5, label %if.then100, label %for.inc96.5 for.inc96.5: ; preds = %for.inc96.4 %arrayidx89.6 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 7 %107 = load i32, ptr %arrayidx89.6, align 4, !tbaa !5 %add.6 = add nsw i32 %107, %38 %arrayidx91.6 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 7 %108 = load i32, ptr %arrayidx91.6, align 4, !tbaa !5 %add92.6 = add nsw i32 %add.6, %108 %cmp93.6 = icmp slt i32 %add92.6, 2 br i1 %cmp93.6, label %if.then100, label %for.inc96.6 for.inc96.6: ; preds = %for.inc96.5 %arrayidx89.7 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 8 %109 = load i32, ptr %arrayidx89.7, align 16, !tbaa !5 %add.7 = add nsw i32 %109, %41 %arrayidx91.7 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 8 %110 = load i32, ptr %arrayidx91.7, align 16, !tbaa !5 %add92.7 = add nsw i32 %add.7, %110 %cmp93.7 = icmp slt i32 %add92.7, 2 br i1 %cmp93.7, label %if.then100, label %for.inc96.7 for.inc96.7: ; preds = %for.inc96.6 %arrayidx89.8 = getelementptr inbounds [10 x i32], ptr %b, i64 0, i64 9 %111 = load i32, ptr %arrayidx89.8, align 4, !tbaa !5 %add.8 = add nsw i32 %111, %44 %arrayidx91.8 = getelementptr inbounds [10 x i32], ptr %c, i64 0, i64 9 %112 = load i32, ptr %arrayidx91.8, align 4, !tbaa !5 %add92.8 = add nsw i32 %add.8, %112 %cmp93.8 = icmp slt i32 %add92.8, 2 br i1 %cmp93.8, label %if.then100, label %for.inc96.8 for.inc96.8: ; preds = %for.inc96.7 %tobool111 = icmp ne i32 %47, 0 %tobool114 = icmp ne i32 %48, 0 %or.cond = select i1 %tobool111, i1 %tobool114, i1 false %tobool124 = icmp ne i32 %49, 0 %or.cond183 = select i1 %tobool124, i1 %tobool114, i1 false br i1 %or.cond, label %if.end148, label %for.cond107.preheader.split if.then100: ; preds = %for.inc96.7, %for.inc96.6, %for.inc96.5, %for.inc96.4, %for.inc96.3, %for.inc96.2, %for.inc96.1, %for.inc96, %if.end82 %maxi.2251.lcssa.wide = phi i32 [ 10, %if.end82 ], [ 21, %for.inc96 ], [ 32, %for.inc96.1 ], [ 43, %for.inc96.2 ], [ 54, %for.inc96.3 ], [ 65, %for.inc96.4 ], [ 76, %for.inc96.5 ], [ 87, %for.inc96.6 ], [ 98, %for.inc96.7 ] %a.b.i = call i32 @llvm.smin.i32(i32 %maxi.2251.lcssa.wide, i32 %minten.0) br label %cleanup175.sink.split for.inc141: ; preds = %for.body109.preheader %113 = or i32 %98, %97 %114 = or i32 %113, %23 %brmerge336.not = icmp eq i32 %114, 0 br i1 %brmerge336.not, label %if.then145, label %for.inc141.1 for.inc141.1: ; preds = %for.inc141 %115 = or i32 %100, %99 %116 = or i32 %115, %26 %brmerge339.not = icmp eq i32 %116, 0 br i1 %brmerge339.not, label %if.then145, label %for.inc141.2 for.inc141.2: ; preds = %for.inc141.1 %117 = or i32 %102, %101 %118 = or i32 %117, %29 %brmerge342.not = icmp eq i32 %118, 0 br i1 %brmerge342.not, label %if.then145, label %for.inc141.3 for.inc141.3: ; preds = %for.inc141.2 %119 = or i32 %104, %103 %120 = or i32 %119, %32 %brmerge345.not = icmp eq i32 %120, 0 br i1 %brmerge345.not, label %if.then145, label %for.inc141.4 for.inc141.4: ; preds = %for.inc141.3 %121 = or i32 %106, %105 %122 = or i32 %121, %35 %brmerge348.not = icmp eq i32 %122, 0 br i1 %brmerge348.not, label %if.then145, label %for.inc141.5 for.inc141.5: ; preds = %for.inc141.4 %123 = or i32 %108, %107 %124 = or i32 %123, %38 %brmerge351.not = icmp eq i32 %124, 0 br i1 %brmerge351.not, label %if.then145, label %for.inc141.6 for.inc141.6: ; preds = %for.inc141.5 %125 = or i32 %110, %109 %126 = or i32 %125, %41 %brmerge354.not = icmp eq i32 %126, 0 br i1 %brmerge354.not, label %if.then145, label %for.inc141.7 for.inc141.7: ; preds = %for.inc141.6 %127 = or i32 %112, %111 %128 = or i32 %127, %44 %brmerge357.not = icmp eq i32 %128, 0 br i1 %brmerge357.not, label %if.then145, label %if.end148 if.then145: ; preds = %for.inc141.7, %for.inc141.6, %for.inc141.5, %for.inc141.4, %for.inc141.3, %for.inc141.2, %for.inc141.1, %for.inc141, %for.body109.preheader %maxi.3252.lcssa.wide = phi i32 [ 99, %for.body109.preheader ], [ 199, %for.inc141 ], [ 299, %for.inc141.1 ], [ 399, %for.inc141.2 ], [ 499, %for.inc141.3 ], [ 599, %for.inc141.4 ], [ 699, %for.inc141.5 ], [ 799, %for.inc141.6 ], [ 899, %for.inc141.7 ] br label %if.end148 if.end148: ; preds = %for.inc141.7, %for.cond107.preheader.split.split, %for.cond107.preheader.split, %for.inc96.8, %if.then145 %minhun.0 = phi i32 [ %maxi.3252.lcssa.wide, %if.then145 ], [ 99, %for.inc96.8 ], [ 99, %for.cond107.preheader.split ], [ 99, %for.cond107.preheader.split.split ], [ 99, %for.inc141.7 ] %cmp160 = icmp ult i32 %add92, 3 br i1 %cmp160, label %if.then167, label %for.inc163 for.inc163: ; preds = %if.end148 %cmp160.1 = icmp ult i32 %add92.1, 3 br i1 %cmp160.1, label %if.then167, label %for.inc163.1 for.inc163.1: ; preds = %for.inc163 %cmp160.2 = icmp ult i32 %add92.2, 3 br i1 %cmp160.2, label %if.then167, label %for.inc163.2 for.inc163.2: ; preds = %for.inc163.1 %cmp160.3 = icmp ult i32 %add92.3, 3 br i1 %cmp160.3, label %if.then167, label %for.inc163.3 for.inc163.3: ; preds = %for.inc163.2 %cmp160.4 = icmp ult i32 %add92.4, 3 br i1 %cmp160.4, label %if.then167, label %for.inc163.4 for.inc163.4: ; preds = %for.inc163.3 %cmp160.5 = icmp ult i32 %add92.5, 3 br i1 %cmp160.5, label %if.then167, label %for.inc163.5 for.inc163.5: ; preds = %for.inc163.4 %cmp160.6 = icmp ult i32 %add92.6, 3 br i1 %cmp160.6, label %if.then167, label %for.inc163.6 for.inc163.6: ; preds = %for.inc163.5 %cmp160.7 = icmp ult i32 %add92.7, 3 br i1 %cmp160.7, label %if.then167, label %for.inc163.7 for.inc163.7: ; preds = %for.inc163.6 %cmp160.8 = icmp ult i32 %add92.8, 3 br i1 %cmp160.8, label %if.then167, label %cleanup175 if.then167: ; preds = %for.inc163.7, %for.inc163.6, %for.inc163.5, %for.inc163.4, %for.inc163.3, %for.inc163.2, %for.inc163.1, %for.inc163, %if.end148 %maxi.4267.lcssa.wide = phi i32 [ 110, %if.end148 ], [ 221, %for.inc163 ], [ 332, %for.inc163.1 ], [ 443, %for.inc163.2 ], [ 554, %for.inc163.3 ], [ 665, %for.inc163.4 ], [ 776, %for.inc163.5 ], [ 887, %for.inc163.6 ], [ 998, %for.inc163.7 ] %a.b.i226 = call i32 @llvm.smin.i32(i32 %maxi.4267.lcssa.wide, i32 %minhun.0) br label %cleanup175.sink.split cleanup175.sink.split: ; preds = %lor.lhs.false, %for.inc34, %for.inc34.1, %for.inc34.2, %for.inc34.3, %for.inc34.4, %for.inc34.5, %for.inc34.6, %for.inc34.7, %if.then167, %if.then100 %a.b.i.sink = phi i32 [ %a.b.i, %if.then100 ], [ %a.b.i226, %if.then167 ], [ 0, %lor.lhs.false ], [ 1, %for.inc34 ], [ 2, %for.inc34.1 ], [ 3, %for.inc34.2 ], [ 4, %for.inc34.3 ], [ 5, %for.inc34.4 ], [ 6, %for.inc34.5 ], [ 7, %for.inc34.6 ], [ 8, %for.inc34.7 ] %call105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.b.i.sink) br label %cleanup175 cleanup175: ; preds = %cleanup175.sink.split, %for.inc163.7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; 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 nounwind willreturn memory(argmem: write) } 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"}
#include<stdio.h> int main(void) { int a[2]; int k=0, i; scanf("%d", &a[0]); scanf("%d", &a[1]); for(i=0; i<2; i++){ if(a[0]>a[1]){ k+=a[0]; a[0]-=1; } else if(a[0]<a[1]){ k+=a[1]; a[1]-=1; }else { k+=a[0]; a[0]-=1; } } printf("%d", k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124253/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124253/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i32], align 4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx1 = getelementptr inbounds [2 x i32], ptr %a, i64 0, i64 1 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %arrayidx1.promoted = load i32, ptr %arrayidx1, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %a.promoted, %arrayidx1.promoted br i1 %cmp5, label %if.then, label %if.else if.then: ; preds = %entry %sub = add nsw i32 %a.promoted, -1 store i32 %sub, ptr %a, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %cmp10 = icmp slt i32 %a.promoted, %arrayidx1.promoted br i1 %cmp10, label %if.then11, label %if.else16 if.then11: ; preds = %if.else %sub15 = add nsw i32 %arrayidx1.promoted, -1 store i32 %sub15, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc if.else16: ; preds = %if.else %sub20 = add nsw i32 %a.promoted, -1 store i32 %sub20, ptr %a, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else16, %if.then11 %sub1530 = phi i32 [ %arrayidx1.promoted, %if.then ], [ %sub15, %if.then11 ], [ %arrayidx1.promoted, %if.else16 ] %sub2028 = phi i32 [ %sub, %if.then ], [ %a.promoted, %if.then11 ], [ %sub20, %if.else16 ] %.pn = phi i32 [ %a.promoted, %if.then ], [ %arrayidx1.promoted, %if.then11 ], [ %a.promoted, %if.else16 ] %cmp5.1 = icmp sgt i32 %sub2028, %sub1530 br i1 %cmp5.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %cmp10.1 = icmp slt i32 %sub2028, %sub1530 br i1 %cmp10.1, label %if.then11.1, label %if.else16.1 if.else16.1: ; preds = %if.else.1 %sub20.1 = add nsw i32 %sub2028, -1 store i32 %sub20.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 if.then11.1: ; preds = %if.else.1 %sub15.1 = add nsw i32 %sub1530, -1 store i32 %sub15.1, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %sub.1 = add nsw i32 %sub2028, -1 store i32 %sub.1, ptr %a, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then11.1, %if.else16.1 %.pn.1 = phi i32 [ %sub2028, %if.then.1 ], [ %sub1530, %if.then11.1 ], [ %sub2028, %if.else16.1 ] %k.1.1 = add nsw i32 %.pn.1, %.pn %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %k.1.1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void) { int A, B, ans, i; ans = 0; scanf ("%d %d", &A, &B); for (i = 0; i < 2; i++) { if (A > B) { ans = ans + A; A--; } else { ans = ans + B; B--; } } printf ("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124297/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124297/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %A.promoted = load i32, ptr %A, align 4, !tbaa !5 %B.promoted = load i32, ptr %B, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %A.promoted, %B.promoted br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %entry %dec = add nsw i32 %A.promoted, -1 store i32 %dec, ptr %A, align 4, !tbaa !5 br label %for.inc if.else: ; preds = %entry %dec3 = add nsw i32 %B.promoted, -1 store i32 %dec3, ptr %B, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.then, %if.else %dec311 = phi i32 [ %B.promoted, %if.then ], [ %dec3, %if.else ] %dec9 = phi i32 [ %dec, %if.then ], [ %A.promoted, %if.else ] %.pn = phi i32 [ %A.promoted, %if.then ], [ %B.promoted, %if.else ] %cmp1.1 = icmp sgt i32 %dec9, %dec311 br i1 %cmp1.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %dec3.1 = add nsw i32 %dec311, -1 store i32 %dec3.1, ptr %B, align 4, !tbaa !5 br label %for.inc.1 if.then.1: ; preds = %for.inc %dec.1 = add nsw i32 %dec9, -1 store i32 %dec.1, ptr %A, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.else.1 %.pn.1 = phi i32 [ %dec9, %if.then.1 ], [ %dec311, %if.else.1 ] %ans.1.1 = add nsw i32 %.pn.1, %.pn %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char number[101]; scanf("%s",number); int i,one=0,zero=0; for(i=0;i<strlen(number);i++) { if(one==0 && number[i]=='1') one=1; if(one==1) { if(number[i]=='0') zero++; if(zero==6) { printf("yes\n"); return 0; } } } printf("no\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12434/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12434/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"no\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %number = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %number) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %number) #6 %cmp42.not = icmp eq i64 %call2, 0 br i1 %cmp42.not, label %cleanup, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %zero.045 = phi i32 [ %zero.2, %for.inc ], [ 0, %entry ] %one.044 = phi i32 [ %one.140, %for.inc ], [ 0, %entry ] %cmp4 = icmp eq i32 %one.044, 0 %arrayidx = getelementptr inbounds [101 x i8], ptr %number, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 br i1 %cmp4, label %if.end, label %if.then11 if.end: ; preds = %for.body %cmp7 = icmp eq i8 %0, 49 br i1 %cmp7, label %if.then11, label %for.inc if.then11: ; preds = %for.body, %if.end %1 = phi i8 [ 49, %if.end ], [ %0, %for.body ] %cmp15 = icmp eq i8 %1, 48 %inc = zext i1 %cmp15 to i32 %spec.select37 = add nsw i32 %zero.045, %inc %cmp19 = icmp eq i32 %spec.select37, 6 br i1 %cmp19, label %cleanup, label %for.inc for.inc: ; preds = %if.end, %if.then11 %one.140 = phi i32 [ 1, %if.then11 ], [ 0, %if.end ] %zero.2 = phi i32 [ %spec.select37, %if.then11 ], [ %zero.045, %if.end ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call2 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8 cleanup: ; preds = %for.inc, %if.then11, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.3, %if.then11 ], [ @str, %for.inc ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %number) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int a,b; scanf("%d%d",&a,&b); if (a>b) printf("%d\n",2*a-1); else if (a<b) printf("%d\n",2*b-1); else printf("%d\n",a+b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124383/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124383/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = shl nsw i32 %0, 1 %sub = add nsw i32 %mul, -1 br label %if.end9 if.else: ; preds = %entry %cmp2 = icmp slt i32 %0, %1 br i1 %cmp2, label %if.then3, label %if.else7 if.then3: ; preds = %if.else %mul4 = shl nsw i32 %1, 1 %sub5 = add nsw i32 %mul4, -1 br label %if.end9 if.else7: ; preds = %if.else %add = add nsw i32 %1, %0 br label %if.end9 if.end9: ; preds = %if.then3, %if.else7, %if.then %sub5.sink = phi i32 [ %sub5, %if.then3 ], [ %add, %if.else7 ], [ %sub, %if.then ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub5.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> // printf(), scanf() #include <stdlib.h> // qsort() #include <string.h> // strcpy, strcmp() #define L_WORD 30 #define MAX_P 100 typedef struct word_tbl { char word[L_WORD + 1]; int n_page; int pages[MAX_P]; } word_tbl; int cmp_func1(const void *l_, const void *r_) { const word_tbl *l = (const word_tbl*) l_; const word_tbl *r = (const word_tbl*) r_; return strcmp(l->word, r->word); } int cmp_func2(const void *l_, const void *r_) { const int *l = (const int*) l_; const int *r = (const int*) r_; if (*l < *r) return -1; if (*l > *r) return 1; return 0; } int main(int argc, char **argv) { word_tbl word_t[MAX_P]; char word[L_WORD + 1]; int page; int i, j; int n_word = 0; while (scanf("%s %d", word, &page) != EOF) { for (i = 0; i < n_word; ++i) { if (strcmp(word, word_t[i].word) == 0) break; } if (i >= n_word) { strcpy(word_t[n_word].word, word); word_t[n_word].n_page = 1; word_t[n_word].pages[0] = page; n_word++; } else word_t[i].pages[word_t[i].n_page++] = page; } qsort(word_t, n_word, sizeof(word_tbl), cmp_func1); for (i = 0; i < n_word; ++i) { qsort(word_t[i].pages, word_t[i].n_page, sizeof(int), cmp_func2); printf("%s\n", word_t[i].word); for (j = 0; j < word_t[i].n_page; ++j) printf("%d%c", word_t[i].pages[j], (j < word_t[i].n_page - 1) ? ' ' : '\n' ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124440/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124440/source.c" target datalayout = "e-m:e-p270: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.word_tbl = type { [31 x i8], i32, [100 x i32] } @.str = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_func1(ptr nocapture noundef readonly %l_, ptr nocapture noundef readonly %r_) #0 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %l_, ptr noundef nonnull dereferenceable(1) %r_) #9 ret i32 %call } ; 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 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_func2(ptr nocapture noundef readonly %l_, ptr nocapture noundef readonly %r_) #3 { entry: %0 = load i32, ptr %l_, align 4, !tbaa !5 %1 = load i32, ptr %r_, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp sgt i32 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #4 { entry: %word_t = alloca [100 x %struct.word_tbl], align 16 %word = alloca [31 x i8], align 16 %page = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 43600, ptr nonnull %word_t) #10 call void @llvm.lifetime.start.p0(i64 31, ptr nonnull %word) #10 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %page) #10 %call99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word, ptr noundef nonnull %page) %cmp.not100 = icmp eq i32 %call99, -1 br i1 %cmp.not100, label %while.end.thread, label %for.cond.preheader while.end.thread: ; preds = %entry call void @qsort(ptr noundef nonnull %word_t, i64 noundef 0, i64 noundef 436, ptr noundef nonnull @cmp_func1) #10 br label %for.end72 for.cond.preheader: ; preds = %entry, %if.end30 %n_word.0101 = phi i32 [ %n_word.1, %if.end30 ], [ 0, %entry ] %cmp197 = icmp sgt i32 %n_word.0101, 0 br i1 %cmp197, label %for.body.preheader, label %if.then8 for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %n_word.0101 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %indvars.iv %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %word, ptr noundef nonnull dereferenceable(1) %arrayidx) #9 %cmp6 = icmp eq i32 %call5, 0 br i1 %cmp6, label %if.else, label %for.inc for.inc: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %if.then8, label %for.body, !llvm.loop !9 if.then8: ; preds = %for.inc, %for.cond.preheader %idxprom9 = sext i32 %n_word.0101 to i64 %arrayidx10 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %idxprom9 %call14 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx10, ptr noundef nonnull dereferenceable(1) %word) #10 %n_page = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %idxprom9, i32 1 store i32 1, ptr %n_page, align 4, !tbaa !11 %0 = load i32, ptr %page, align 4, !tbaa !5 %pages = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %idxprom9, i32 2 store i32 %0, ptr %pages, align 4, !tbaa !5 %inc20 = add nsw i32 %n_word.0101, 1 br label %if.end30 if.else: ; preds = %for.body %1 = load i32, ptr %page, align 4, !tbaa !5 %idxprom21 = and i64 %indvars.iv, 4294967295 %n_page26 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %idxprom21, i32 1 %2 = load i32, ptr %n_page26, align 4, !tbaa !11 %inc27 = add nsw i32 %2, 1 store i32 %inc27, ptr %n_page26, align 4, !tbaa !11 %idxprom28 = sext i32 %2 to i64 %arrayidx29 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %idxprom21, i32 2, i64 %idxprom28 store i32 %1, ptr %arrayidx29, align 4, !tbaa !5 br label %if.end30 if.end30: ; preds = %if.else, %if.then8 %n_word.1 = phi i32 [ %inc20, %if.then8 ], [ %n_word.0101, %if.else ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word, ptr noundef nonnull %page) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !13 while.end: ; preds = %if.end30 %conv = sext i32 %n_word.1 to i64 call void @qsort(ptr noundef nonnull %word_t, i64 noundef %conv, i64 noundef 436, ptr noundef nonnull @cmp_func1) #10 %cmp33104 = icmp sgt i32 %n_word.1, 0 br i1 %cmp33104, label %for.body35.preheader, label %for.end72 for.body35.preheader: ; preds = %while.end %wide.trip.count114 = zext i32 %n_word.1 to i64 br label %for.body35 for.body35: ; preds = %for.body35.preheader, %for.inc70 %indvars.iv111 = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next112, %for.inc70 ] %arrayidx37 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %indvars.iv111 %pages38 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %indvars.iv111, i32 2 %n_page42 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %indvars.iv111, i32 1 %3 = load i32, ptr %n_page42, align 4, !tbaa !11 %conv43 = sext i32 %3 to i64 call void @qsort(ptr noundef nonnull %pages38, i64 noundef %conv43, i64 noundef 4, ptr noundef nonnull @cmp_func2) #10 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx37) %4 = load i32, ptr %n_page42, align 4, !tbaa !11 %cmp53102 = icmp sgt i32 %4, 0 br i1 %cmp53102, label %for.body55, label %for.inc70 for.body55: ; preds = %for.body35, %for.body55 %indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.body55 ], [ 0, %for.body35 ] %5 = phi i32 [ %8, %for.body55 ], [ %4, %for.body35 ] %arrayidx60 = getelementptr inbounds [100 x %struct.word_tbl], ptr %word_t, i64 0, i64 %indvars.iv111, i32 2, i64 %indvars.iv108 %6 = load i32, ptr %arrayidx60, align 4, !tbaa !5 %sub = add nsw i32 %5, -1 %7 = sext i32 %sub to i64 %cmp64 = icmp slt i64 %indvars.iv108, %7 %cond = select i1 %cmp64, i32 32, i32 10 %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6, i32 noundef %cond) %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1 %8 = load i32, ptr %n_page42, align 4, !tbaa !11 %9 = sext i32 %8 to i64 %cmp53 = icmp slt i64 %indvars.iv.next109, %9 br i1 %cmp53, label %for.body55, label %for.inc70, !llvm.loop !14 for.inc70: ; preds = %for.body55, %for.body35 %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114 br i1 %exitcond115.not, label %for.end72, label %for.body35, !llvm.loop !15 for.end72: ; preds = %for.inc70, %while.end.thread, %while.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %page) #10 call void @llvm.lifetime.end.p0(i64 31, ptr nonnull %word) #10 call void @llvm.lifetime.end.p0(i64 43600, ptr nonnull %word_t) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 attributes #0 = { 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 #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 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !6, i64 32} !12 = !{!"word_tbl", !7, i64 0, !6, i64 32, !7, i64 36} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <math.h> #include <stdlib.h> int cup[100],stat[100],sum[100],wat[200]; int N,SET; int search(int cc,int left,int look,int num){ int i; if(look<N)stat[look]=1; if(left==0){ if(cc<N)stat[cc]=2; //for(i=N-1;i>=0;i--){if(stat[i]==0)break;} if(num==0)return 1; for(i=N-1;i>=0;i--){ if(stat[i]==0)break; if(stat[i]==1 && search(i,cup[i],99,num))return 1; } if(look<N)stat[look]=0; stat[cc]=1; return 0; } int ccc=(look<N) ? look:cc; for(i=ccc-1;i>=0;i--){ if(left<cup[i])continue; if(sum[i]<left)break; if(stat[i]==0 && search(cc,left-cup[i],i,num-1))return 1; if(i==cc-1 && stat[i]==0)break; } if(look<N)stat[look]=0; return 0; } int main(){ int i,j,k; while(scanf("%d",&N)*N){ SET++; for(i=0;i<=100;i++)wat[i]=0; for(i=0;i<N;i++){ scanf("%d",&k); wat[k]++; } for(i=0,j=0,k=0;i<=100,j<N;i++){ for(;wat[i]>0;wat[i]--){ k+=i; cup[j]=i; stat[j]=0; sum[j]=k; j++; } } if(search(99,0,N-1,N-1))printf("YES\n"); else printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124491/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124491/source.c" target datalayout = "e-m:e-p270: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 @stat = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @cup = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @sum = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @SET = dso_local local_unnamed_addr global i32 0, align 4 @wat = dso_local local_unnamed_addr global [200 x i32] zeroinitializer, align 16 @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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @search(i32 noundef %cc, i32 noundef %left, i32 noundef %look, i32 noundef %num) local_unnamed_addr #0 { entry: %0 = load i32, ptr @N, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %look br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %idxprom = sext i32 %look to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @stat, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %cmp1 = icmp eq i32 %left, 0 br i1 %cmp1, label %if.then2, label %if.end31 if.then2: ; preds = %if.end %cmp3 = icmp sgt i32 %0, %cc br i1 %cmp3, label %if.then4, label %if.end7 if.then4: ; preds = %if.then2 %idxprom5 = sext i32 %cc to i64 %arrayidx6 = getelementptr inbounds [100 x i32], ptr @stat, i64 0, i64 %idxprom5 store i32 2, ptr %arrayidx6, align 4, !tbaa !5 br label %if.end7 if.end7: ; preds = %if.then4, %if.then2 %cmp8 = icmp eq i32 %num, 0 br i1 %cmp8, label %cleanup75, label %for.cond.preheader for.cond.preheader: ; preds = %if.end7 %cmp11114 = icmp sgt i32 %0, 0 br i1 %cmp11114, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %for.cond.preheader %1 = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom12 = and i64 %indvars.iv.next, 4294967295 %arrayidx13 = getelementptr inbounds [100 x i32], ptr @stat, i64 0, i64 %idxprom12 %2 = load i32, ptr %arrayidx13, align 4, !tbaa !5 switch i32 %2, label %for.inc [ i32 0, label %for.end.loopexit i32 1, label %land.lhs.true ] land.lhs.true: ; preds = %for.body %indvars = trunc i64 %indvars.iv.next to i32 %arrayidx21 = getelementptr inbounds [100 x i32], ptr @cup, i64 0, i64 %idxprom12 %3 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call = tail call i32 @search(i32 noundef %indvars, i32 noundef %3, i32 noundef 99, i32 noundef %num), !range !9 %tobool.not = icmp eq i32 %call, 0 br i1 %tobool.not, label %for.inc, label %cleanup75 for.inc: ; preds = %for.body, %land.lhs.true %cmp11 = icmp ugt i64 %indvars.iv, 1 br i1 %cmp11, label %for.body, label %for.end.loopexit, !llvm.loop !10 for.end.loopexit: ; preds = %for.body, %for.inc %.pre118 = load i32, ptr @N, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %for.cond.preheader %4 = phi i32 [ %.pre118, %for.end.loopexit ], [ %0, %for.cond.preheader ] %cmp24 = icmp sgt i32 %4, %look br i1 %cmp24, label %if.then25, label %cleanup75.sink.split if.then25: ; preds = %for.end %idxprom26 = sext i32 %look to i64 %arrayidx27 = getelementptr inbounds [100 x i32], ptr @stat, i64 0, i64 %idxprom26 store i32 0, ptr %arrayidx27, align 4, !tbaa !5 br label %cleanup75.sink.split if.end31: ; preds = %if.end %cond = select i1 %cmp, i32 %look, i32 %cc %cmp35110 = icmp sgt i32 %cond, 0 br i1 %cmp35110, label %for.body36.lr.ph, label %for.end69 for.body36.lr.ph: ; preds = %if.end31 %sub54 = add nsw i32 %num, -1 %cmp35 = icmp sgt i32 %cc, 1 br label %for.body36 for.body36: ; preds = %for.body36.backedge, %for.body36.lr.ph %i.1.in111 = phi i32 [ %cond, %for.body36.lr.ph ], [ %i.1112, %for.body36.backedge ] %i.1112 = add nsw i32 %i.1.in111, -1 %idxprom37 = zext i32 %i.1112 to i64 %arrayidx38 = getelementptr inbounds [100 x i32], ptr @cup, i64 0, i64 %idxprom37 %5 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %cmp39 = icmp sgt i32 %5, %left br i1 %cmp39, label %for.inc67, label %if.end41 if.end41: ; preds = %for.body36 %arrayidx43 = getelementptr inbounds [100 x i32], ptr @sum, i64 0, i64 %idxprom37 %6 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %cmp44 = icmp slt i32 %6, %left br i1 %cmp44, label %for.end69.loopexit, label %if.end46 if.end46: ; preds = %if.end41 %arrayidx48 = getelementptr inbounds [100 x i32], ptr @stat, i64 0, i64 %idxprom37 %7 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %cmp49 = icmp eq i32 %7, 0 br i1 %cmp49, label %land.lhs.true50, label %if.end58 land.lhs.true50: ; preds = %if.end46 %sub53 = sub nsw i32 %left, %5 %call55 = tail call i32 @search(i32 noundef %cc, i32 noundef %sub53, i32 noundef %i.1112, i32 noundef %sub54), !range !9 %tobool56.not = icmp eq i32 %call55, 0 br i1 %tobool56.not, label %if.end58, label %cleanup75 if.end58: ; preds = %land.lhs.true50, %if.end46 %cmp60 = icmp eq i32 %i.1.in111, %cc br i1 %cmp60, label %land.lhs.true61, label %for.inc67 land.lhs.true61: ; preds = %if.end58 %8 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %cmp64 = icmp ne i32 %8, 0 %or.cond = and i1 %cmp64, %cmp35 br i1 %or.cond, label %for.body36.backedge, label %for.end69.loopexit for.inc67: ; preds = %if.end58, %for.body36 %cmp35.old = icmp sgt i32 %i.1.in111, 1 br i1 %cmp35.old, label %for.body36.backedge, label %for.end69.loopexit for.body36.backedge: ; preds = %for.inc67, %land.lhs.true61 br label %for.body36, !llvm.loop !12 for.end69.loopexit: ; preds = %land.lhs.true61, %if.end41, %for.inc67 %.pre = load i32, ptr @N, align 4, !tbaa !5 br label %for.end69 for.end69: ; preds = %for.end69.loopexit, %if.end31 %9 = phi i32 [ %.pre, %for.end69.loopexit ], [ %0, %if.end31 ] %cmp70 = icmp sgt i32 %9, %look br i1 %cmp70, label %cleanup75.sink.split, label %cleanup75 cleanup75.sink.split: ; preds = %for.end69, %for.end, %if.then25 %look.sink = phi i32 [ %cc, %if.then25 ], [ %cc, %for.end ], [ %look, %for.end69 ] %.sink = phi i32 [ 1, %if.then25 ], [ 1, %for.end ], [ 0, %for.end69 ] %idxprom72 = sext i32 %look.sink to i64 %arrayidx73 = getelementptr inbounds [100 x i32], ptr @stat, i64 0, i64 %idxprom72 store i32 %.sink, ptr %arrayidx73, align 4, !tbaa !5 br label %cleanup75 cleanup75: ; preds = %land.lhs.true50, %land.lhs.true, %cleanup75.sink.split, %for.end69, %if.end7 %retval.1 = phi i32 [ 1, %if.end7 ], [ 0, %for.end69 ], [ 0, %cleanup75.sink.split ], [ 1, %land.lhs.true ], [ 1, %land.lhs.true50 ] 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6 %call74 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N) %0 = load i32, ptr @N, align 4, !tbaa !5 %mul75 = mul nsw i32 %0, %call74 %tobool.not76 = icmp eq i32 %mul75, 0 br i1 %tobool.not76, label %while.end, label %while.body while.body: ; preds = %entry, %for.end36 %1 = phi i32 [ %24, %for.end36 ], [ %0, %entry ] %2 = load i32, ptr @SET, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr @SET, align 4, !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) @wat, i8 0, i64 404, i1 false), !tbaa !5 %cmp358 = icmp sgt i32 %1, 0 br i1 %cmp358, label %for.body4, label %for.end11.thread for.end11.thread: ; preds = %while.body store i32 0, ptr %k, align 4, !tbaa !5 br label %for.end36 for.body4: ; preds = %while.body, %for.body4 %i.159 = phi i32 [ %inc10, %for.body4 ], [ 0, %while.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %3 = load i32, ptr %k, align 4, !tbaa !5 %idxprom6 = sext i32 %3 to i64 %arrayidx7 = getelementptr inbounds [200 x i32], ptr @wat, i64 0, i64 %idxprom6 %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %inc8 = add nsw i32 %4, 1 store i32 %inc8, ptr %arrayidx7, align 4, !tbaa !5 %inc10 = add nuw nsw i32 %i.159, 1 %5 = load i32, ptr @N, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc10, %5 br i1 %cmp3, label %for.body4, label %for.end11, !llvm.loop !13 for.end11: ; preds = %for.body4 store i32 0, ptr %k, align 4, !tbaa !5 %cmp1470 = icmp sgt i32 %5, 0 br i1 %cmp1470, label %for.cond17.preheader, label %for.end36 for.cond17.preheader: ; preds = %for.end11, %for.inc34 %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.inc34 ], [ 0, %for.end11 ] %j.073 = phi i32 [ %j.1.lcssa, %for.inc34 ], [ 0, %for.end11 ] %add.lcssa6971 = phi i32 [ %add.lcssa68, %for.inc34 ], [ 0, %for.end11 ] %6 = trunc i64 %indvars.iv80 to i32 %arrayidx19 = getelementptr inbounds [200 x i32], ptr @wat, i64 0, i64 %indvars.iv80 %arrayidx19.promoted = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp2062 = icmp sgt i32 %arrayidx19.promoted, 0 br i1 %cmp2062, label %for.body22.preheader, label %for.inc34 for.body22.preheader: ; preds = %for.cond17.preheader %7 = sext i32 %j.073 to i64 %8 = shl nsw i64 %7, 2 %scevgep = getelementptr i8, ptr @stat, i64 %8 %9 = zext i32 %arrayidx19.promoted to i64 %10 = shl nuw nsw i64 %9, 2 call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %10, i1 false), !tbaa !5 %11 = trunc i64 %indvars.iv80 to i32 %12 = zext i32 %arrayidx19.promoted to i64 %min.iters.check = icmp ult i32 %arrayidx19.promoted, 8 br i1 %min.iters.check, label %for.body22.preheader96, label %vector.ph vector.ph: ; preds = %for.body22.preheader %n.vec = and i64 %12, 4294967288 %ind.end = add nsw i64 %n.vec, %7 %.cast = trunc i64 %n.vec to i32 %ind.end86 = sub i32 %arrayidx19.promoted, %.cast %.cast88 = trunc i64 %n.vec to i32 %13 = mul i32 %.cast88, %6 %ind.end89 = add i32 %add.lcssa6971, %13 %.splatinsert = insertelement <4 x i32> poison, i32 %add.lcssa6971, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %.splatinsert91 = insertelement <4 x i32> poison, i32 %6, i64 0 %.splat92 = shufflevector <4 x i32> %.splatinsert91, <4 x i32> poison, <4 x i32> zeroinitializer %14 = mul <4 x i32> %.splat92, <i32 0, i32 1, i32 2, i32 3> %induction = add <4 x i32> %.splat, %14 %15 = shl i32 %6, 2 %.splatinsert93 = insertelement <4 x i32> poison, i32 %15, i64 0 %.splat94 = shufflevector <4 x i32> %.splatinsert93, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %11, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, %.splat94 %offset.idx = add i64 %index, %7 %16 = add nsw <4 x i32> %vec.ind, %broadcast.splat %17 = add nsw <4 x i32> %step.add, %broadcast.splat %18 = getelementptr inbounds [100 x i32], ptr @cup, i64 0, i64 %offset.idx store <4 x i32> %broadcast.splat, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds i32, ptr %18, i64 4 store <4 x i32> %broadcast.splat, ptr %19, align 4, !tbaa !5 %20 = getelementptr inbounds [100 x i32], ptr @sum, i64 0, i64 %offset.idx store <4 x i32> %16, ptr %20, align 4, !tbaa !5 %21 = getelementptr inbounds i32, ptr %20, i64 4 store <4 x i32> %17, ptr %21, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %step.add, %.splat94 %22 = icmp eq i64 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %12 br i1 %cmp.n, label %for.cond17.for.inc34_crit_edge, label %for.body22.preheader96 for.body22.preheader96: ; preds = %for.body22.preheader, %middle.block %indvars.iv.ph = phi i64 [ %7, %for.body22.preheader ], [ %ind.end, %middle.block ] %dec6064.ph = phi i32 [ %arrayidx19.promoted, %for.body22.preheader ], [ %ind.end86, %middle.block ] %add6163.ph = phi i32 [ %add.lcssa6971, %for.body22.preheader ], [ %ind.end89, %middle.block ] br label %for.body22 for.body22: ; preds = %for.body22.preheader96, %for.body22 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body22 ], [ %indvars.iv.ph, %for.body22.preheader96 ] %dec6064 = phi i32 [ %dec, %for.body22 ], [ %dec6064.ph, %for.body22.preheader96 ] %add6163 = phi i32 [ %add, %for.body22 ], [ %add6163.ph, %for.body22.preheader96 ] %add = add nsw i32 %add6163, %11 %arrayidx24 = getelementptr inbounds [100 x i32], ptr @cup, i64 0, i64 %indvars.iv store i32 %11, ptr %arrayidx24, align 4, !tbaa !5 %arrayidx28 = getelementptr inbounds [100 x i32], ptr @sum, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx28, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %dec = add nsw i32 %dec6064, -1 %cmp20 = icmp ugt i32 %dec6064, 1 br i1 %cmp20, label %for.body22, label %for.cond17.for.inc34_crit_edge, !llvm.loop !17 for.cond17.for.inc34_crit_edge: ; preds = %for.body22, %middle.block %add.lcssa = phi i32 [ %ind.end89, %middle.block ], [ %add, %for.body22 ] %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %for.body22 ] %23 = trunc i64 %indvars.iv.next.lcssa to i32 store i32 %add.lcssa, ptr %k, align 4, !tbaa !5 store i32 0, ptr %arrayidx19, align 4, !tbaa !5 br label %for.inc34 for.inc34: ; preds = %for.cond17.for.inc34_crit_edge, %for.cond17.preheader %add.lcssa68 = phi i32 [ %add.lcssa, %for.cond17.for.inc34_crit_edge ], [ %add.lcssa6971, %for.cond17.preheader ] %j.1.lcssa = phi i32 [ %23, %for.cond17.for.inc34_crit_edge ], [ %j.073, %for.cond17.preheader ] %indvars.iv.next81 = add nuw i64 %indvars.iv80, 1 %cmp14 = icmp slt i32 %j.1.lcssa, %5 br i1 %cmp14, label %for.cond17.preheader, label %for.end36, !llvm.loop !18 for.end36: ; preds = %for.inc34, %for.end11.thread, %for.end11 %.lcssa85 = phi i32 [ %1, %for.end11.thread ], [ %5, %for.end11 ], [ %5, %for.inc34 ] %sub = add nsw i32 %.lcssa85, -1 %call38 = call i32 @search(i32 noundef 99, i32 noundef 0, i32 noundef %sub, i32 noundef %sub), !range !9 %tobool39.not = icmp eq i32 %call38, 0 %str.str.3 = select i1 %tobool39.not, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N) %24 = load i32, ptr @N, align 4, !tbaa !5 %mul = mul nsw i32 %24, %call %tobool.not = icmp eq i32 %mul, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !19 while.end: ; preds = %for.end36, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } 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 = !{i32 0, i32 2} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !11, !16, !15} !18 = distinct !{!18, !11} !19 = distinct !{!19, !11}
#include <stdio.h> #include <string.h> #include <stdlib.h> #define MAX(a,b) ((a>b)?(a):(b)) int main() { char s[3002]; char t[3002]; scanf("%s",s); scanf("%s",t); int len_s = strlen(s); int len_t = strlen(t); int **dp; dp = (int **)malloc(3002*sizeof(int*)); int index = 0; while (index < 3002) { dp[index] = (int *)malloc(3002*sizeof(int)); index++; } int i, j; index = 0; //printf("debug1001\n"); while (index < 3002) { dp[0][index] = 0; dp[index][0] = 0; index++; } //printf("debug0001\n"); i = 1; j = 1; //printf("debug0001\n"); while (i <= len_s) { j = 1; while( j <= len_t) { if(s[i-1] == t[j-1]) { dp[i][j] = dp[i-1][j-1]+1; //printf("debug0002,dp;%d, i;%d,j;%d\n",dp[i][j],i,j); } else { dp[i][j] = MAX(dp[i-1][j],dp[i][j-1]); //printf("debug0003, dp;%d,i;%d,j;%d\n",dp[i][j],i,j); } j++; } i++; } char ans[3002]; //printf("after ans def\n"); index = 0; while (index < 3002) { ans[index] = '\0'; //printf("%d\n",index); index++; } //printf("before len def\n"); int len = dp[len_s][len_t]; i = len_s; j = len_t; //printf("before ans while loop\n"); while (len > 0) { if(s[i-1] == t[j-1]) { ans[len-1] = s[i-1]; i--; j--; len--; } else if(dp[i][j] == dp[i-1][j]) { i--; } else { j--; } } //printf("just before answer debug0001\n"); printf("%s\n",ans); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124549/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124549/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [3002 x i8], align 16 %t = alloca [3002 x i8], align 16 %ans = alloca [3002 x i8], align 16 call void @llvm.lifetime.start.p0(i64 3002, ptr nonnull %s) #8 call void @llvm.lifetime.start.p0(i64 3002, ptr nonnull %t) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #9 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #9 %call8 = call noalias dereferenceable_or_null(24016) ptr @malloc(i64 noundef 24016) #10 br label %while.body while.cond11.preheader: ; preds = %while.body %conv = trunc i64 %call4 to i32 %0 = load ptr, ptr %call8, align 8, !tbaa !5 br label %while.body14 while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %while.body ] %call10 = call noalias dereferenceable_or_null(12008) ptr @malloc(i64 noundef 12008) #10 %arrayidx = getelementptr inbounds ptr, ptr %call8, i64 %indvars.iv store ptr %call10, ptr %arrayidx, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 3002 br i1 %exitcond.not, label %while.cond11.preheader, label %while.body, !llvm.loop !9 while.cond23.preheader: ; preds = %while.body14 %conv7 = trunc i64 %call6 to i32 %cmp24.not199 = icmp slt i32 %conv, 1 %cmp28.not197 = icmp slt i32 %conv7, 1 %or.cond = select i1 %cmp24.not199, i1 true, i1 %cmp28.not197 br i1 %or.cond, label %while.end79, label %while.cond27.preheader.preheader while.cond27.preheader.preheader: ; preds = %while.cond23.preheader %1 = add i64 %call6, 1 %2 = add i64 %call4, 1 %wide.trip.count221 = and i64 %2, 4294967295 %wide.trip.count = and i64 %1, 4294967295 br label %while.cond27.preheader while.body14: ; preds = %while.body14, %while.cond11.preheader %indvars.iv208 = phi i64 [ 0, %while.cond11.preheader ], [ %indvars.iv.next209.1, %while.body14 ] %arrayidx17 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv208 store i32 0, ptr %arrayidx17, align 4, !tbaa !11 %arrayidx19 = getelementptr inbounds ptr, ptr %call8, i64 %indvars.iv208 %3 = load ptr, ptr %arrayidx19, align 8, !tbaa !5 store i32 0, ptr %3, align 4, !tbaa !11 %indvars.iv.next209 = or i64 %indvars.iv208, 1 %arrayidx17.1 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next209 store i32 0, ptr %arrayidx17.1, align 4, !tbaa !11 %arrayidx19.1 = getelementptr inbounds ptr, ptr %call8, i64 %indvars.iv.next209 %4 = load ptr, ptr %arrayidx19.1, align 8, !tbaa !5 store i32 0, ptr %4, align 4, !tbaa !11 %indvars.iv.next209.1 = add nuw nsw i64 %indvars.iv208, 2 %exitcond211.not.1 = icmp eq i64 %indvars.iv.next209.1, 3002 br i1 %exitcond211.not.1, label %while.cond23.preheader, label %while.body14, !llvm.loop !13 while.cond27.preheader: ; preds = %while.cond27.preheader.preheader, %while.cond27.while.end77_crit_edge %indvars.iv217 = phi i64 [ 1, %while.cond27.preheader.preheader ], [ %indvars.iv.next218, %while.cond27.while.end77_crit_edge ] %5 = add nsw i64 %indvars.iv217, -1 %arrayidx32 = getelementptr inbounds [3002 x i8], ptr %s, i64 0, i64 %5 %arrayidx52 = getelementptr inbounds ptr, ptr %call8, i64 %5 %arrayidx56 = getelementptr inbounds ptr, ptr %call8, i64 %indvars.iv217 %6 = load ptr, ptr %arrayidx52, align 8, !tbaa !5 br label %while.body30 while.body30: ; preds = %while.cond27.preheader, %if.end %indvars.iv212 = phi i64 [ 1, %while.cond27.preheader ], [ %indvars.iv.next213, %if.end ] %7 = load i8, ptr %arrayidx32, align 1, !tbaa !14 %8 = add nsw i64 %indvars.iv212, -1 %arrayidx36 = getelementptr inbounds [3002 x i8], ptr %t, i64 0, i64 %8 %9 = load i8, ptr %arrayidx36, align 1, !tbaa !14 %cmp38 = icmp eq i8 %7, %9 br i1 %cmp38, label %if.then, label %if.else if.then: ; preds = %while.body30 %arrayidx45 = getelementptr inbounds i32, ptr %6, i64 %8 %10 = load i32, ptr %arrayidx45, align 4, !tbaa !11 %add = add nsw i32 %10, 1 %11 = load ptr, ptr %arrayidx56, align 8, !tbaa !5 br label %if.end if.else: ; preds = %while.body30 %arrayidx54 = getelementptr inbounds i32, ptr %6, i64 %indvars.iv212 %12 = load i32, ptr %arrayidx54, align 4, !tbaa !11 %13 = load ptr, ptr %arrayidx56, align 8, !tbaa !5 %arrayidx59 = getelementptr inbounds i32, ptr %13, i64 %8 %14 = load i32, ptr %arrayidx59, align 4, !tbaa !11 %. = call i32 @llvm.smax.i32(i32 %12, i32 %14) br label %if.end if.end: ; preds = %if.else, %if.then %.sink = phi ptr [ %13, %if.else ], [ %11, %if.then ] %..sink = phi i32 [ %., %if.else ], [ %add, %if.then ] %arrayidx75 = getelementptr inbounds i32, ptr %.sink, i64 %indvars.iv212 store i32 %..sink, ptr %arrayidx75, align 4, !tbaa !11 %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1 %exitcond216.not = icmp eq i64 %indvars.iv.next213, %wide.trip.count br i1 %exitcond216.not, label %while.cond27.while.end77_crit_edge, label %while.body30, !llvm.loop !15 while.cond27.while.end77_crit_edge: ; preds = %if.end %indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1 %exitcond222.not = icmp eq i64 %indvars.iv.next218, %wide.trip.count221 br i1 %exitcond222.not, label %while.end79, label %while.cond27.preheader, !llvm.loop !16 while.end79: ; preds = %while.cond27.while.end77_crit_edge, %while.cond23.preheader call void @llvm.lifetime.start.p0(i64 3002, ptr nonnull %ans) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3002) %ans, i8 0, i64 3002, i1 false), !tbaa !14 %sext = shl i64 %call4, 32 %idxprom88 = ashr exact i64 %sext, 32 %arrayidx89 = getelementptr inbounds ptr, ptr %call8, i64 %idxprom88 %15 = load ptr, ptr %arrayidx89, align 8, !tbaa !5 %sext193 = shl i64 %call6, 32 %idxprom90 = ashr exact i64 %sext193, 32 %arrayidx91 = getelementptr inbounds i32, ptr %15, i64 %idxprom90 %16 = load i32, ptr %arrayidx91, align 4, !tbaa !11 %cmp93202 = icmp sgt i32 %16, 0 br i1 %cmp93202, label %while.body95, label %while.end133 while.body95: ; preds = %while.end79, %if.end132 %len.0205 = phi i32 [ %len.1, %if.end132 ], [ %16, %while.end79 ] %j.1204 = phi i32 [ %j.2, %if.end132 ], [ %conv7, %while.end79 ] %i.1203 = phi i32 [ %i.2, %if.end132 ], [ %conv, %while.end79 ] %sub96 = add nsw i32 %i.1203, -1 %idxprom97 = sext i32 %sub96 to i64 %arrayidx98 = getelementptr inbounds [3002 x i8], ptr %s, i64 0, i64 %idxprom97 %17 = load i8, ptr %arrayidx98, align 1, !tbaa !14 %sub100 = add nsw i32 %j.1204, -1 %idxprom101 = sext i32 %sub100 to i64 %arrayidx102 = getelementptr inbounds [3002 x i8], ptr %t, i64 0, i64 %idxprom101 %18 = load i8, ptr %arrayidx102, align 1, !tbaa !14 %cmp104 = icmp eq i8 %17, %18 br i1 %cmp104, label %if.then106, label %if.else115 if.then106: ; preds = %while.body95 %sub110 = add nsw i32 %len.0205, -1 %idxprom111 = zext i32 %sub110 to i64 %arrayidx112 = getelementptr inbounds [3002 x i8], ptr %ans, i64 0, i64 %idxprom111 store i8 %17, ptr %arrayidx112, align 1, !tbaa !14 br label %if.end132 if.else115: ; preds = %while.body95 %idxprom116 = sext i32 %i.1203 to i64 %arrayidx117 = getelementptr inbounds ptr, ptr %call8, i64 %idxprom116 %19 = load ptr, ptr %arrayidx117, align 8, !tbaa !5 %idxprom118 = sext i32 %j.1204 to i64 %arrayidx119 = getelementptr inbounds i32, ptr %19, i64 %idxprom118 %20 = load i32, ptr %arrayidx119, align 4, !tbaa !11 %arrayidx122 = getelementptr inbounds ptr, ptr %call8, i64 %idxprom97 %21 = load ptr, ptr %arrayidx122, align 8, !tbaa !5 %arrayidx124 = getelementptr inbounds i32, ptr %21, i64 %idxprom118 %22 = load i32, ptr %arrayidx124, align 4, !tbaa !11 %cmp125 = icmp eq i32 %20, %22 %spec.select = select i1 %cmp125, i32 %sub96, i32 %i.1203 %spec.select194 = select i1 %cmp125, i32 %j.1204, i32 %sub100 br label %if.end132 if.end132: ; preds = %if.else115, %if.then106 %i.2 = phi i32 [ %sub96, %if.then106 ], [ %spec.select, %if.else115 ] %j.2 = phi i32 [ %sub100, %if.then106 ], [ %spec.select194, %if.else115 ] %len.1 = phi i32 [ %sub110, %if.then106 ], [ %len.0205, %if.else115 ] %cmp93 = icmp sgt i32 %len.1, 0 br i1 %cmp93, label %while.body95, label %while.end133, !llvm.loop !17 while.end133: ; preds = %if.end132, %while.end79 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans) call void @llvm.lifetime.end.p0(i64 3002, ptr nonnull %ans) #8 call void @llvm.lifetime.end.p0(i64 3002, ptr nonnull %t) #8 call void @llvm.lifetime.end.p0(i64 3002, ptr nonnull %s) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn 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 #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #8 = { nounwind } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"int", !7, i64 0} !13 = distinct !{!13, !10} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #include <string.h> #define MAX_LENGTH 5000 char input0[MAX_LENGTH], input1[MAX_LENGTH]; int dp[MAX_LENGTH][MAX_LENGTH]; int max(int foo, int bar) { if (foo > bar) { return foo; } else { return bar; } } int lcs(int i, int j) { if (i == 0 || j == 0) { return 0; } else if (dp[i][j] >= 0) { return dp[i][j]; } else if (input0[i - 1] == input1[j - 1]) { return dp[i][j] = lcs(i - 1, j - 1) + 1; } else { return dp[i][j] = max(lcs(i, j - 1), lcs(i - 1, j)); } } int main(void) { int i, j, k, len0, len1, lenAns; char ans[MAX_LENGTH]; /* 入力を行う */ fgets(input0, MAX_LENGTH, stdin); len0 = strlen(input0); fgets(input1, MAX_LENGTH, stdin); len1 = strlen(input1); /* DPテーブルの初期化を行う */ for (i = 0; i < MAX_LENGTH; i++) { ans[i] = '\0'; for (j = 0; j < MAX_LENGTH; j++) { dp[i][j] = -1; } } /* DPの計算を行う */ lenAns = lcs(len0, len1); i = len0; j = len1; k = lenAns; while (i > 0 && j > 0) { if (input0[i - 1] != input1[j - 1]) { if (dp[i - 1][j] > dp[i][j - 1]) { i--; } else { j--; } } else { ans[--k] = input0[i - 1]; i--; j--; } } /* 解答を出力します */ printf("%s\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124592/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124592/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @dp = dso_local local_unnamed_addr global [5000 x [5000 x i32]] zeroinitializer, align 16 @input0 = dso_local global [5000 x i8] zeroinitializer, align 16 @input1 = dso_local global [5000 x i8] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %foo, i32 noundef %bar) local_unnamed_addr #0 { entry: %foo.bar = tail call i32 @llvm.smax.i32(i32 %foo, i32 %bar) ret i32 %foo.bar } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @lcs(i32 noundef %i, i32 noundef %j) local_unnamed_addr #1 { entry: %cmp = icmp eq i32 %i, 0 %cmp1 = icmp eq i32 %j, 0 %or.cond = or i1 %cmp, %cmp1 br i1 %or.cond, label %common.ret, label %if.else if.else: ; preds = %entry %idxprom = sext i32 %i to i64 %idxprom2 = sext i32 %j to i64 %arrayidx3 = getelementptr inbounds [5000 x [5000 x i32]], ptr @dp, i64 0, i64 %idxprom, i64 %idxprom2 %0 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, -1 br i1 %cmp4, label %common.ret, label %if.else10 if.else10: ; preds = %if.else %sub = add nsw i32 %i, -1 %idxprom11 = sext i32 %sub to i64 %arrayidx12 = getelementptr inbounds [5000 x i8], ptr @input0, i64 0, i64 %idxprom11 %1 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %sub13 = add nsw i32 %j, -1 %idxprom14 = sext i32 %sub13 to i64 %arrayidx15 = getelementptr inbounds [5000 x i8], ptr @input1, i64 0, i64 %idxprom14 %2 = load i8, ptr %arrayidx15, align 1, !tbaa !9 %cmp17 = icmp eq i8 %1, %2 br i1 %cmp17, label %if.then19, label %if.else26 common.ret.sink.split: ; preds = %if.then19, %if.else26 %foo.bar.i.sink = phi i32 [ %foo.bar.i, %if.else26 ], [ %add, %if.then19 ] store i32 %foo.bar.i.sink, ptr %arrayidx3, align 4, !tbaa !5 br label %common.ret common.ret: ; preds = %common.ret.sink.split, %entry, %if.else %common.ret.op = phi i32 [ 0, %entry ], [ %0, %if.else ], [ %foo.bar.i.sink, %common.ret.sink.split ] ret i32 %common.ret.op if.then19: ; preds = %if.else10 %call = tail call i32 @lcs(i32 noundef %sub, i32 noundef %sub13) %add = add nsw i32 %call, 1 br label %common.ret.sink.split if.else26: ; preds = %if.else10 %call28 = tail call i32 @lcs(i32 noundef %i, i32 noundef %sub13) %call30 = tail call i32 @lcs(i32 noundef %sub, i32 noundef %j) %foo.bar.i = tail call i32 @llvm.smax.i32(i32 %call28, i32 %call30) br label %common.ret.sink.split } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %ans = alloca [5000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %ans) #9 %0 = load ptr, ptr @stdin, align 8, !tbaa !10 %call = tail call ptr @fgets(ptr noundef nonnull @input0, i32 noundef 5000, ptr noundef %0) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @input0) #10 %1 = load ptr, ptr @stdin, align 8, !tbaa !10 %call2 = tail call ptr @fgets(ptr noundef nonnull @input1, i32 noundef 5000, ptr noundef %1) %call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @input1) #10 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5000) %ans, i8 0, i64 5000, i1 false), !tbaa !9 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100000000) @dp, i8 -1, i64 100000000, i1 false), !tbaa !5 %conv = trunc i64 %call1 to i32 %conv4 = trunc i64 %call3 to i32 %call17 = tail call i32 @lcs(i32 noundef %conv, i32 noundef %conv4) %cmp1879 = icmp sgt i32 %conv, 0 %cmp2080 = icmp sgt i32 %conv4, 0 %2 = and i1 %cmp1879, %cmp2080 br i1 %2, label %while.body, label %while.end while.body: ; preds = %entry, %if.end54 %i.183 = phi i32 [ %i.2, %if.end54 ], [ %conv, %entry ] %j.182 = phi i32 [ %j.2, %if.end54 ], [ %conv4, %entry ] %k.081 = phi i32 [ %k.1, %if.end54 ], [ %call17, %entry ] %sub = add nsw i32 %i.183, -1 %idxprom22 = zext i32 %sub to i64 %arrayidx23 = getelementptr inbounds [5000 x i8], ptr @input0, i64 0, i64 %idxprom22 %3 = load i8, ptr %arrayidx23, align 1, !tbaa !9 %sub25 = add nsw i32 %j.182, -1 %idxprom26 = zext i32 %sub25 to i64 %arrayidx27 = getelementptr inbounds [5000 x i8], ptr @input1, i64 0, i64 %idxprom26 %4 = load i8, ptr %arrayidx27, align 1, !tbaa !9 %cmp29.not = icmp eq i8 %3, %4 br i1 %cmp29.not, label %if.else45, label %if.then if.then: ; preds = %while.body %idxprom34 = zext i32 %j.182 to i64 %arrayidx35 = getelementptr inbounds [5000 x [5000 x i32]], ptr @dp, i64 0, i64 %idxprom22, i64 %idxprom34 %5 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %idxprom36 = zext i32 %i.183 to i64 %arrayidx40 = getelementptr inbounds [5000 x [5000 x i32]], ptr @dp, i64 0, i64 %idxprom36, i64 %idxprom26 %6 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp sgt i32 %5, %6 %spec.select = select i1 %cmp41, i32 %j.182, i32 %sub25 %spec.select76 = select i1 %cmp41, i32 %sub, i32 %i.183 br label %if.end54 if.else45: ; preds = %while.body %dec49 = add nsw i32 %k.081, -1 %idxprom50 = sext i32 %dec49 to i64 %arrayidx51 = getelementptr inbounds [5000 x i8], ptr %ans, i64 0, i64 %idxprom50 store i8 %3, ptr %arrayidx51, align 1, !tbaa !9 br label %if.end54 if.end54: ; preds = %if.then, %if.else45 %k.1 = phi i32 [ %dec49, %if.else45 ], [ %k.081, %if.then ] %j.2 = phi i32 [ %sub25, %if.else45 ], [ %spec.select, %if.then ] %i.2 = phi i32 [ %sub, %if.else45 ], [ %spec.select76, %if.then ] %cmp18 = icmp sgt i32 %i.2, 0 %cmp20 = icmp sgt i32 %j.2, 0 %7 = select i1 %cmp18, i1 %cmp20, i1 false br i1 %7, label %while.body, label %while.end, !llvm.loop !12 while.end: ; preds = %if.end54, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans) call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %ans) #9 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nounwind } attributes #10 = { 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 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"any pointer", !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define N_MAX 100 int a[N_MAX]; int n, m; int i; int main(void){ scanf("%d%d", &n, &m); for (i = 0; i < n; i++) scanf("%d", &a[i]); for (i = 1; i <= m; i++) { int j; for (j = 0; j + 1 < n; j++) { if (a[j] % i > a[j+1] % i) { a[j+1] ^= a[j]; a[j] ^= a[j+1]; a[j+1] ^= a[j]; } } } for (i = 0; i < n; i++) printf("%d\n", a[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124642/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124642/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @n = dso_local global i32 0, align 4 @m = dso_local global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @a = dso_local global [100 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m) store i32 0, ptr @i, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp59 = icmp sgt i32 %0, 0 br i1 %cmp59, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %7, %for.body ] %2 = load i32, ptr @m, align 4, !tbaa !5 %cmp3.not64 = icmp sgt i32 %2, 0 %cmp661 = icmp sgt i32 %1, 1 %or.cond = and i1 %cmp3.not64, %cmp661 br i1 %or.cond, label %for.cond5.preheader.us.preheader, label %for.cond38.preheader for.cond5.preheader.us.preheader: ; preds = %for.cond2.preheader %3 = add nsw i32 %1, -1 %wide.trip.count = zext i32 %3 to i64 br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.end34_crit_edge.us %storemerge5765.us = phi i32 [ %inc36.us, %for.cond5.for.end34_crit_edge.us ], [ 1, %for.cond5.preheader.us.preheader ] br label %for.body7.us for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc32.us %indvars.iv71 = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next72, %for.inc32.us ] %indvars.iv = phi i64 [ 1, %for.cond5.preheader.us ], [ %indvars.iv.next, %for.inc32.us ] %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %arrayidx9.us = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 %indvars.iv71 %4 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %rem.us = srem i32 %4, %storemerge5765.us %arrayidx12.us = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %rem13.us = srem i32 %5, %storemerge5765.us %cmp14.us = icmp sgt i32 %rem.us, %rem13.us br i1 %cmp14.us, label %if.then.us, label %for.inc32.us if.then.us: ; preds = %for.body7.us store i32 %5, ptr %arrayidx9.us, align 4, !tbaa !5 store i32 %4, ptr %arrayidx12.us, align 4, !tbaa !5 br label %for.inc32.us for.inc32.us: ; preds = %if.then.us, %for.body7.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count br i1 %exitcond.not, label %for.cond5.for.end34_crit_edge.us, label %for.body7.us, !llvm.loop !9 for.cond5.for.end34_crit_edge.us: ; preds = %for.inc32.us %inc36.us = add nuw i32 %storemerge5765.us, 1 %exitcond76.not = icmp eq i32 %storemerge5765.us, %2 br i1 %exitcond76.not, label %for.cond38.preheader, label %for.cond5.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %storemerge60 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %idxprom = sext i32 %storemerge60 to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 %idxprom %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %6 = load i32, ptr @i, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @i, align 4, !tbaa !5 %7 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %7 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12 for.cond38.preheader: ; preds = %for.cond5.for.end34_crit_edge.us, %for.cond2.preheader store i32 0, ptr @i, align 4, !tbaa !5 %cmp3967 = icmp sgt i32 %1, 0 br i1 %cmp3967, label %for.body40, label %for.end46 for.body40: ; preds = %for.cond38.preheader, %for.body40 %storemerge5868 = phi i32 [ %inc45, %for.body40 ], [ 0, %for.cond38.preheader ] %idxprom41 = sext i32 %storemerge5868 to i64 %arrayidx42 = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 %idxprom41 %8 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %9 = load i32, ptr @i, align 4, !tbaa !5 %inc45 = add nsw i32 %9, 1 store i32 %inc45, ptr @i, align 4, !tbaa !5 %10 = load i32, ptr @n, align 4, !tbaa !5 %cmp39 = icmp slt i32 %inc45, %10 br i1 %cmp39, label %for.body40, label %for.end46, !llvm.loop !13 for.end46: ; preds = %for.body40, %for.cond38.preheader ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> typedef struct { int key, id; } data; typedef struct { data *obj; int size; } min_heap; void push(data x, min_heap* h) { int i = h->size; data tmp; h->obj[(h->size)++] = x; while (1) { if (i == 0) break; else if (h->obj[i].key < h->obj[(i-1)/2].key) { tmp = h->obj[(i-1)/2]; h->obj[(i-1)/2] = h->obj[i]; h->obj[i] = tmp; i = (i - 1) / 2; } else break; } } data pop(min_heap* h) { int i = 0, j; data output = h->obj[0], tmp; h->obj[0] = h->obj[--(h->size)]; while (1) { if (i * 2 + 1 >= h->size) break; else if (i * 2 + 2 >= h->size) j = i * 2 + 1; else if (h->obj[i*2+1].key < h->obj[i*2+2].key) j = i * 2 + 1; else j = i * 2 + 2; if (h->obj[j].key < h->obj[i].key) { tmp = h->obj[j]; h->obj[j] = h->obj[i]; h->obj[i] = tmp; i = j; } else break; } return output; } typedef struct { int t, h, cost; } edge; typedef struct List { struct List *next; edge *e; } list; typedef struct { int n, m; edge *e; list **inc; } graph; void input_graph(graph *G, int n, int m) { int i; list *data = (list*)malloc(sizeof(list) * m * 2); G->n = n; G->m = m; G->e = (edge*)malloc(sizeof(edge) * m); G->inc = (list**)malloc(sizeof(list*) * (n + 1)); for (i = 0; i < m; i++) { scanf("%d %d %d", &(G->e[i].t), &(G->e[i].h), &(G->e[i].cost)); data[i*2].e = &(G->e[i]); data[i*2+1].e = &(G->e[i]); data[i*2].next = G->inc[G->e[i].t]; data[i*2+1].next = G->inc[G->e[i].h]; G->inc[G->e[i].t] = &(data[i*2]); G->inc[G->e[i].h] = &(data[i*2+1]); } } void redundant_edge_dijkstra(graph *G, int s, int red[]) { static int i, *dist = NULL, *prev = NULL; if (dist == NULL) { dist = (int*)malloc(sizeof(int) * (G->n + 1)); prev = (int*)malloc(sizeof(int) * (G->n + 1)); } for (i = 1; i <= G->n; i++) { dist[i] = 1 << 30; prev[i] = 0; } dist[s] = 0; prev[s] = -s; int u, w; list *p; data d; min_heap h; h.obj = (data*)malloc(sizeof(data) * (G->m * 2 + 1)); h.size = 0; d.key = 0; d.id = s; push(d, &h); while (h.size > 0) { u = pop(&h).id; if (prev[u] > 0) continue; prev[u] *= -1; for (p = G->inc[u]; p != NULL; p = p->next) { w = (p->e->t == u)? p->e->h: p->e->t; if (dist[u] + p->e->cost < dist[w]) { dist[w] = dist[u] + p->e->cost; prev[w] = -u; d.key = dist[w]; d.id = w; push(d, &h); } } } for (i = 0; i < G->m; i++) { u = G->e[i].t; w = G->e[i].h; if (G->e[i].cost == abs(dist[u] - dist[w])) red[i] = 0; } } int main() { int N, M; graph G; scanf("%d %d", &N, &M); input_graph(&G, N, M); int i, red[1000], sum = 0; for (i = 0; i < M; i++) red[i] = 1; for (i = 1; i <= N; i++) redundant_edge_dijkstra(&G, i, red); for (i = 0; i < M; i++) sum += red[i]; printf("%d\n", sum); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124686/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124686/source.c" target datalayout = "e-m:e-p270: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.min_heap = type { ptr, i32 } %struct.data = type { i32, i32 } %struct.graph = type { i32, i32, ptr, ptr } %struct.edge = type { i32, i32, i32 } %struct.List = type { ptr, ptr } @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @redundant_edge_dijkstra.dist = internal unnamed_addr global ptr null, align 8 @redundant_edge_dijkstra.prev = internal unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @push(i64 %x.coerce, ptr nocapture noundef %h) local_unnamed_addr #0 { entry: %size = getelementptr inbounds %struct.min_heap, ptr %h, i64 0, i32 1 %0 = load i32, ptr %size, align 8, !tbaa !5 %1 = load ptr, ptr %h, align 8, !tbaa !11 %inc = add nsw i32 %0, 1 store i32 %inc, ptr %size, align 8, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds %struct.data, ptr %1, i64 %idxprom store i64 %x.coerce, ptr %arrayidx, align 4, !tbaa.struct !12 %cmp46 = icmp eq i32 %0, 0 br i1 %cmp46, label %while.end, label %if.else if.else: ; preds = %entry, %if.then10 %i.047 = phi i32 [ %div, %if.then10 ], [ %0, %entry ] %2 = load ptr, ptr %h, align 8, !tbaa !11 %idxprom3 = sext i32 %i.047 to i64 %arrayidx4 = getelementptr inbounds %struct.data, ptr %2, i64 %idxprom3 %3 = load i32, ptr %arrayidx4, align 4, !tbaa !14 %sub = add nsw i32 %i.047, -1 %div = sdiv i32 %sub, 2 %idxprom6 = sext i32 %div to i64 %arrayidx7 = getelementptr inbounds %struct.data, ptr %2, i64 %idxprom6 %4 = load i32, ptr %arrayidx7, align 4, !tbaa !14 %cmp9 = icmp slt i32 %3, %4 br i1 %cmp9, label %if.then10, label %while.end if.then10: ; preds = %if.else %5 = load i64, ptr %arrayidx7, align 4 %6 = load i64, ptr %arrayidx4, align 4 store i64 %6, ptr %arrayidx7, align 4 %7 = load ptr, ptr %h, align 8, !tbaa !11 %arrayidx26 = getelementptr inbounds %struct.data, ptr %7, i64 %idxprom3 store i64 %5, ptr %arrayidx26, align 4 %cmp = icmp ult i32 %i.047, 3 br i1 %cmp, label %while.end, label %if.else while.end: ; preds = %if.then10, %if.else, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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 i64 @pop(ptr nocapture noundef %h) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %h, align 8, !tbaa !11 %retval.sroa.0.0.copyload = load i64, ptr %0, align 4, !tbaa.struct !12 %size = getelementptr inbounds %struct.min_heap, ptr %h, i64 0, i32 1 %1 = load i32, ptr %size, align 8, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %size, align 8, !tbaa !5 %idxprom = sext i32 %dec to i64 %arrayidx4 = getelementptr inbounds %struct.data, ptr %0, i64 %idxprom %2 = load i64, ptr %arrayidx4, align 4 store i64 %2, ptr %0, align 4 %3 = load i32, ptr %size, align 8, !tbaa !5 %cmp.not83 = icmp sgt i32 %3, 1 br i1 %cmp.not83, label %if.else, label %while.end if.else: ; preds = %entry, %if.then43 %4 = phi i32 [ %12, %if.then43 ], [ %3, %entry ] %add86 = phi i32 [ %add, %if.then43 ], [ 1, %entry ] %mul85 = phi i32 [ %mul, %if.then43 ], [ 0, %entry ] %i.084 = phi i32 [ %j.0, %if.then43 ], [ 0, %entry ] %add7 = add nsw i32 %mul85, 2 %cmp9.not = icmp slt i32 %add7, %4 %.pre = load ptr, ptr %h, align 8, !tbaa !11 br i1 %cmp9.not, label %if.else13, label %if.end33 if.else13: ; preds = %if.else %idxprom17 = sext i32 %add86 to i64 %arrayidx18 = getelementptr inbounds %struct.data, ptr %.pre, i64 %idxprom17 %5 = load i32, ptr %arrayidx18, align 4, !tbaa !14 %idxprom22 = sext i32 %add7 to i64 %arrayidx23 = getelementptr inbounds %struct.data, ptr %.pre, i64 %idxprom22 %6 = load i32, ptr %arrayidx23, align 4, !tbaa !14 %cmp25 = icmp slt i32 %5, %6 %add.add7 = select i1 %cmp25, i32 %add86, i32 %add7 br label %if.end33 if.end33: ; preds = %if.else13, %if.else %j.0 = phi i32 [ %add86, %if.else ], [ %add.add7, %if.else13 ] %idxprom35 = sext i32 %j.0 to i64 %arrayidx36 = getelementptr inbounds %struct.data, ptr %.pre, i64 %idxprom35 %7 = load i32, ptr %arrayidx36, align 4, !tbaa !14 %idxprom39 = sext i32 %i.084 to i64 %arrayidx40 = getelementptr inbounds %struct.data, ptr %.pre, i64 %idxprom39 %8 = load i32, ptr %arrayidx40, align 4, !tbaa !14 %cmp42 = icmp slt i32 %7, %8 br i1 %cmp42, label %if.then43, label %while.end if.then43: ; preds = %if.end33 %9 = load i64, ptr %arrayidx36, align 4 %10 = load i64, ptr %arrayidx40, align 4 store i64 %10, ptr %arrayidx36, align 4 %11 = load ptr, ptr %h, align 8, !tbaa !11 %arrayidx55 = getelementptr inbounds %struct.data, ptr %11, i64 %idxprom39 store i64 %9, ptr %arrayidx55, align 4 %mul = shl nsw i32 %j.0, 1 %add = or i32 %mul, 1 %12 = load i32, ptr %size, align 8, !tbaa !5 %cmp.not = icmp slt i32 %add, %12 br i1 %cmp.not, label %if.else, label %while.end while.end: ; preds = %if.then43, %if.end33, %entry ret i64 %retval.sroa.0.0.copyload } ; Function Attrs: nofree nounwind uwtable define dso_local void @input_graph(ptr nocapture noundef %G, i32 noundef %n, i32 noundef %m) local_unnamed_addr #2 { entry: %conv = sext i32 %m to i64 %mul1 = shl nsw i64 %conv, 5 %call = tail call noalias ptr @malloc(i64 noundef %mul1) #7 store i32 %n, ptr %G, align 8, !tbaa !16 %m3 = getelementptr inbounds %struct.graph, ptr %G, i64 0, i32 1 store i32 %m, ptr %m3, align 4, !tbaa !18 %mul5 = mul nsw i64 %conv, 12 %call6 = tail call noalias ptr @malloc(i64 noundef %mul5) #7 %e = getelementptr inbounds %struct.graph, ptr %G, i64 0, i32 2 store ptr %call6, ptr %e, align 8, !tbaa !19 %add = add nsw i32 %n, 1 %conv7 = sext i32 %add to i64 %mul8 = shl nsw i64 %conv7, 3 %call9 = tail call noalias ptr @malloc(i64 noundef %mul8) #7 %inc = getelementptr inbounds %struct.graph, ptr %G, i64 0, i32 3 store ptr %call9, ptr %inc, align 8, !tbaa !20 %cmp119 = icmp sgt i32 %m, 0 br i1 %cmp119, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %m 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 ] %0 = load ptr, ptr %e, align 8, !tbaa !19 %arrayidx = getelementptr inbounds %struct.edge, ptr %0, i64 %indvars.iv %h = getelementptr inbounds %struct.edge, ptr %0, i64 %indvars.iv, i32 1 %cost = getelementptr inbounds %struct.edge, ptr %0, i64 %indvars.iv, i32 2 %call18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx, ptr noundef nonnull %h, ptr noundef nonnull %cost) %1 = load ptr, ptr %e, align 8, !tbaa !19 %arrayidx21 = getelementptr inbounds %struct.edge, ptr %1, i64 %indvars.iv %2 = shl nuw nsw i64 %indvars.iv, 1 %arrayidx24 = getelementptr inbounds %struct.List, ptr %call, i64 %2 %e25 = getelementptr inbounds %struct.List, ptr %call, i64 %2, i32 1 store ptr %arrayidx21, ptr %e25, align 8, !tbaa !21 %3 = or i64 %2, 1 %arrayidx32 = getelementptr inbounds %struct.List, ptr %call, i64 %3 %e33 = getelementptr inbounds %struct.List, ptr %call, i64 %3, i32 1 store ptr %arrayidx21, ptr %e33, align 8, !tbaa !21 %4 = load ptr, ptr %inc, align 8, !tbaa !20 %5 = load i32, ptr %arrayidx21, align 4, !tbaa !23 %idxprom39 = sext i32 %5 to i64 %arrayidx40 = getelementptr inbounds ptr, ptr %4, i64 %idxprom39 %6 = load ptr, ptr %arrayidx40, align 8, !tbaa !25 store ptr %6, ptr %arrayidx24, align 8, !tbaa !26 %h48 = getelementptr inbounds %struct.edge, ptr %1, i64 %indvars.iv, i32 1 %7 = load i32, ptr %h48, align 4, !tbaa !27 %idxprom49 = sext i32 %7 to i64 %arrayidx50 = getelementptr inbounds ptr, ptr %4, i64 %idxprom49 %8 = load ptr, ptr %arrayidx50, align 8, !tbaa !25 store ptr %8, ptr %arrayidx32, align 8, !tbaa !26 store ptr %arrayidx24, ptr %arrayidx40, align 8, !tbaa !25 %9 = load ptr, ptr %inc, align 8, !tbaa !20 %10 = load ptr, ptr %e, align 8, !tbaa !19 %h74 = getelementptr inbounds %struct.edge, ptr %10, i64 %indvars.iv, i32 1 %11 = load i32, ptr %h74, align 4, !tbaa !27 %idxprom75 = sext i32 %11 to i64 %arrayidx76 = getelementptr inbounds ptr, ptr %9, i64 %idxprom75 store ptr %arrayidx32, ptr %arrayidx76, align 8, !tbaa !25 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !28 for.end: ; preds = %for.body, %entry ret void } ; 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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local void @redundant_edge_dijkstra(ptr nocapture noundef readonly %G, i32 noundef %s, ptr nocapture noundef writeonly %red) local_unnamed_addr #2 { entry: %0 = load ptr, ptr @redundant_edge_dijkstra.dist, align 8, !tbaa !25 %cmp = icmp eq ptr %0, null %.pre = load i32, ptr %G, align 8, !tbaa !16 br i1 %cmp, label %if.then, label %entry.if.end_crit_edge entry.if.end_crit_edge: ; preds = %entry %.pre195.pre = load ptr, ptr @redundant_edge_dijkstra.prev, align 8, !tbaa !25 br label %if.end if.then: ; preds = %entry %add = add nsw i32 %.pre, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #7 store ptr %call, ptr @redundant_edge_dijkstra.dist, align 8, !tbaa !25 %call5 = tail call noalias ptr @malloc(i64 noundef %mul) #7 store ptr %call5, ptr @redundant_edge_dijkstra.prev, align 8, !tbaa !25 br label %if.end if.end: ; preds = %entry.if.end_crit_edge, %if.then %.pre195 = phi ptr [ %call5, %if.then ], [ %.pre195.pre, %entry.if.end_crit_edge ] %1 = phi ptr [ %call, %if.then ], [ %0, %entry.if.end_crit_edge ] %cmp7.not180 = icmp slt i32 %.pre, 1 br i1 %cmp7.not180, label %push.exit, label %for.body for.body: ; preds = %if.end, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %if.end ] %arrayidx = getelementptr inbounds i32, ptr %1, i64 %indvars.iv store i32 1073741824, ptr %arrayidx, align 4, !tbaa !13 %arrayidx10 = getelementptr inbounds i32, ptr %.pre195, i64 %indvars.iv store i32 0, ptr %arrayidx10, align 4, !tbaa !13 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %G, align 8, !tbaa !16 %3 = sext i32 %2 to i64 %cmp7.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp7.not.not, label %for.body, label %push.exit, !llvm.loop !30 push.exit: ; preds = %for.body, %if.end %idxprom11 = sext i32 %s to i64 %arrayidx12 = getelementptr inbounds i32, ptr %1, i64 %idxprom11 store i32 0, ptr %arrayidx12, align 4, !tbaa !13 %sub = sub nsw i32 0, %s %arrayidx14 = getelementptr inbounds i32, ptr %.pre195, i64 %idxprom11 store i32 %sub, ptr %arrayidx14, align 4, !tbaa !13 %m = getelementptr inbounds %struct.graph, ptr %G, i64 0, i32 1 %4 = load i32, ptr %m, align 4, !tbaa !18 %mul15 = shl nsw i32 %4, 1 %add16 = or i32 %mul15, 1 %conv17 = sext i32 %add16 to i64 %mul18 = shl nsw i64 %conv17, 3 %call19 = tail call noalias ptr @malloc(i64 noundef %mul18) #7 %d.sroa.6.0.insert.ext = zext i32 %s to i64 %d.sroa.6.0.insert.shift = shl nuw i64 %d.sroa.6.0.insert.ext, 32 store i64 %d.sroa.6.0.insert.shift, ptr %call19, align 4, !tbaa.struct !12 %inc34 = getelementptr inbounds %struct.graph, ptr %G, i64 0, i32 3 br label %while.body for.cond73.preheader: ; preds = %while.cond.backedge %5 = load i32, ptr %m, align 4, !tbaa !18 %cmp75188 = icmp sgt i32 %5, 0 br i1 %cmp75188, label %for.body77.lr.ph, label %for.end103 for.body77.lr.ph: ; preds = %for.cond73.preheader %e78 = getelementptr inbounds %struct.graph, ptr %G, i64 0, i32 2 %6 = load ptr, ptr %e78, align 8, !tbaa !19 br label %for.body77 while.body: ; preds = %push.exit, %while.cond.backedge %h.sroa.12.0187 = phi i32 [ 1, %push.exit ], [ %h.sroa.12.0.be, %while.cond.backedge ] %retval.sroa.0.0.copyload.i = load i64, ptr %call19, align 4, !tbaa.struct !12 %dec.i = add nsw i32 %h.sroa.12.0187, -1 %idxprom.i147 = zext i32 %dec.i to i64 %arrayidx4.i148 = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom.i147 %7 = load i64, ptr %arrayidx4.i148, align 4 store i64 %7, ptr %call19, align 4 %cmp.not83.i = icmp ugt i32 %dec.i, 1 br i1 %cmp.not83.i, label %if.else.i149, label %pop.exit if.else.i149: ; preds = %while.body, %if.then43.i %add86.i = phi i32 [ %add.i, %if.then43.i ], [ 1, %while.body ] %mul85.i = phi i32 [ %mul.i, %if.then43.i ], [ 0, %while.body ] %i.084.i = phi i32 [ %j.0.i, %if.then43.i ], [ 0, %while.body ] %add7.i = add nsw i32 %mul85.i, 2 %cmp9.not.i = icmp slt i32 %add7.i, %dec.i br i1 %cmp9.not.i, label %if.else13.i, label %if.end33.i if.else13.i: ; preds = %if.else.i149 %idxprom17.i = sext i32 %add86.i to i64 %arrayidx18.i = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom17.i %8 = load i32, ptr %arrayidx18.i, align 4, !tbaa !14 %idxprom22.i = sext i32 %add7.i to i64 %arrayidx23.i = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom22.i %9 = load i32, ptr %arrayidx23.i, align 4, !tbaa !14 %cmp25.i = icmp slt i32 %8, %9 %add.add7.i = select i1 %cmp25.i, i32 %add86.i, i32 %add7.i br label %if.end33.i if.end33.i: ; preds = %if.else13.i, %if.else.i149 %j.0.i = phi i32 [ %add86.i, %if.else.i149 ], [ %add.add7.i, %if.else13.i ] %idxprom35.i = sext i32 %j.0.i to i64 %arrayidx36.i = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom35.i %10 = load i32, ptr %arrayidx36.i, align 4, !tbaa !14 %idxprom39.i = sext i32 %i.084.i to i64 %arrayidx40.i = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom39.i %11 = load i32, ptr %arrayidx40.i, align 4, !tbaa !14 %cmp42.i = icmp slt i32 %10, %11 br i1 %cmp42.i, label %if.then43.i, label %pop.exit if.then43.i: ; preds = %if.end33.i %12 = load i64, ptr %arrayidx36.i, align 4 %13 = load i64, ptr %arrayidx40.i, align 4 store i64 %13, ptr %arrayidx36.i, align 4 store i64 %12, ptr %arrayidx40.i, align 4 %mul.i = shl nsw i32 %j.0.i, 1 %add.i = or i32 %mul.i, 1 %cmp.not.i = icmp slt i32 %add.i, %dec.i br i1 %cmp.not.i, label %if.else.i149, label %pop.exit pop.exit: ; preds = %if.end33.i, %if.then43.i, %while.body %coerce.sroa.1.0.extract.shift = lshr i64 %retval.sroa.0.0.copyload.i, 32 %coerce.sroa.1.0.extract.trunc = trunc i64 %coerce.sroa.1.0.extract.shift to i32 %idxprom25 = ashr i64 %retval.sroa.0.0.copyload.i, 32 %arrayidx26 = getelementptr inbounds i32, ptr %.pre195, i64 %idxprom25 %14 = load i32, ptr %arrayidx26, align 4, !tbaa !13 %cmp27 = icmp sgt i32 %14, 0 br i1 %cmp27, label %while.cond.backedge, label %if.end30 while.cond.backedge: ; preds = %for.inc71, %if.end30, %pop.exit %h.sroa.12.0.be = phi i32 [ %dec.i, %pop.exit ], [ %dec.i, %if.end30 ], [ %h.sroa.12.2, %for.inc71 ] %cmp21 = icmp sgt i32 %h.sroa.12.0.be, 0 br i1 %cmp21, label %while.body, label %for.cond73.preheader, !llvm.loop !31 if.end30: ; preds = %pop.exit %mul33 = sub nsw i32 0, %14 store i32 %mul33, ptr %arrayidx26, align 4, !tbaa !13 %15 = load ptr, ptr %inc34, align 8, !tbaa !20 %arrayidx36 = getelementptr inbounds ptr, ptr %15, i64 %idxprom25 %p.0182 = load ptr, ptr %arrayidx36, align 8, !tbaa !25 %cmp38.not183 = icmp eq ptr %p.0182, null br i1 %cmp38.not183, label %while.cond.backedge, label %for.body40.lr.ph, !llvm.loop !31 for.body40.lr.ph: ; preds = %if.end30 %arrayidx48 = getelementptr inbounds i32, ptr %1, i64 %idxprom25 %sub63 = sub nsw i32 0, %coerce.sroa.1.0.extract.trunc br label %for.body40 for.body40: ; preds = %for.body40.lr.ph, %for.inc71 %p.0185 = phi ptr [ %p.0182, %for.body40.lr.ph ], [ %p.0, %for.inc71 ] %h.sroa.12.1184 = phi i32 [ %dec.i, %for.body40.lr.ph ], [ %h.sroa.12.2, %for.inc71 ] %e = getelementptr inbounds %struct.List, ptr %p.0185, i64 0, i32 1 %16 = load ptr, ptr %e, align 8, !tbaa !21 %17 = load i32, ptr %16, align 4, !tbaa !23 %cmp41 = icmp eq i32 %17, %coerce.sroa.1.0.extract.trunc br i1 %cmp41, label %cond.true, label %cond.end cond.true: ; preds = %for.body40 %h44 = getelementptr inbounds %struct.edge, ptr %16, i64 0, i32 1 %18 = load i32, ptr %h44, align 4, !tbaa !27 br label %cond.end cond.end: ; preds = %for.body40, %cond.true %cond = phi i32 [ %18, %cond.true ], [ %17, %for.body40 ] %19 = load i32, ptr %arrayidx48, align 4, !tbaa !13 %cost = getelementptr inbounds %struct.edge, ptr %16, i64 0, i32 2 %20 = load i32, ptr %cost, align 4, !tbaa !32 %add50 = add nsw i32 %20, %19 %idxprom51 = sext i32 %cond to i64 %arrayidx52 = getelementptr inbounds i32, ptr %1, i64 %idxprom51 %21 = load i32, ptr %arrayidx52, align 4, !tbaa !13 %cmp53 = icmp slt i32 %add50, %21 br i1 %cmp53, label %if.then55, label %for.inc71 if.then55: ; preds = %cond.end store i32 %add50, ptr %arrayidx52, align 4, !tbaa !13 %arrayidx65 = getelementptr inbounds i32, ptr %.pre195, i64 %idxprom51 store i32 %sub63, ptr %arrayidx65, align 4, !tbaa !13 %d.sroa.6.0.insert.ext109 = zext i32 %cond to i64 %d.sroa.6.0.insert.shift110 = shl nuw i64 %d.sroa.6.0.insert.ext109, 32 %d.sroa.0.0.insert.ext105 = zext i32 %add50 to i64 %d.sroa.0.0.insert.insert107 = or i64 %d.sroa.6.0.insert.shift110, %d.sroa.0.0.insert.ext105 %inc.i151 = add nsw i32 %h.sroa.12.1184, 1 %idxprom.i152 = sext i32 %h.sroa.12.1184 to i64 %arrayidx.i153 = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom.i152 store i64 %d.sroa.0.0.insert.insert107, ptr %arrayidx.i153, align 4, !tbaa.struct !12 %cmp46.i154 = icmp eq i32 %h.sroa.12.1184, 0 br i1 %cmp46.i154, label %for.inc71, label %if.else.i155 if.else.i155: ; preds = %if.then55, %if.then10.i164 %i.047.i156 = phi i32 [ %div.i160, %if.then10.i164 ], [ %h.sroa.12.1184, %if.then55 ] %idxprom3.i157 = sext i32 %i.047.i156 to i64 %arrayidx4.i158 = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom3.i157 %22 = load i32, ptr %arrayidx4.i158, align 4, !tbaa !14 %sub.i159 = add nsw i32 %i.047.i156, -1 %div.i160 = sdiv i32 %sub.i159, 2 %idxprom6.i161 = sext i32 %div.i160 to i64 %arrayidx7.i162 = getelementptr inbounds %struct.data, ptr %call19, i64 %idxprom6.i161 %23 = load i32, ptr %arrayidx7.i162, align 4, !tbaa !14 %cmp9.i163 = icmp slt i32 %22, %23 br i1 %cmp9.i163, label %if.then10.i164, label %for.inc71 if.then10.i164: ; preds = %if.else.i155 %24 = load i64, ptr %arrayidx7.i162, align 4 %25 = load i64, ptr %arrayidx4.i158, align 4 store i64 %25, ptr %arrayidx7.i162, align 4 store i64 %24, ptr %arrayidx4.i158, align 4 %cmp.i166 = icmp ult i32 %i.047.i156, 3 br i1 %cmp.i166, label %for.inc71, label %if.else.i155 for.inc71: ; preds = %if.then10.i164, %if.else.i155, %if.then55, %cond.end %h.sroa.12.2 = phi i32 [ %h.sroa.12.1184, %cond.end ], [ 1, %if.then55 ], [ %inc.i151, %if.else.i155 ], [ %inc.i151, %if.then10.i164 ] %p.0 = load ptr, ptr %p.0185, align 8, !tbaa !25 %cmp38.not = icmp eq ptr %p.0, null br i1 %cmp38.not, label %while.cond.backedge, label %for.body40, !llvm.loop !33 for.body77: ; preds = %for.body77.lr.ph, %for.inc101 %26 = phi i32 [ %5, %for.body77.lr.ph ], [ %33, %for.inc101 ] %indvars.iv192 = phi i64 [ 0, %for.body77.lr.ph ], [ %indvars.iv.next193, %for.inc101 ] %arrayidx80 = getelementptr inbounds %struct.edge, ptr %6, i64 %indvars.iv192 %27 = load i32, ptr %arrayidx80, align 4, !tbaa !23 %h85 = getelementptr inbounds %struct.edge, ptr %6, i64 %indvars.iv192, i32 1 %28 = load i32, ptr %h85, align 4, !tbaa !27 %cost89 = getelementptr inbounds %struct.edge, ptr %6, i64 %indvars.iv192, i32 2 %29 = load i32, ptr %cost89, align 4, !tbaa !32 %idxprom90 = sext i32 %27 to i64 %arrayidx91 = getelementptr inbounds i32, ptr %1, i64 %idxprom90 %30 = load i32, ptr %arrayidx91, align 4, !tbaa !13 %idxprom92 = sext i32 %28 to i64 %arrayidx93 = getelementptr inbounds i32, ptr %1, i64 %idxprom92 %31 = load i32, ptr %arrayidx93, align 4, !tbaa !13 %sub94 = sub nsw i32 %30, %31 %32 = tail call i32 @llvm.abs.i32(i32 %sub94, i1 true) %cmp95 = icmp eq i32 %29, %32 br i1 %cmp95, label %if.then97, label %for.inc101 if.then97: ; preds = %for.body77 %arrayidx99 = getelementptr inbounds i32, ptr %red, i64 %indvars.iv192 store i32 0, ptr %arrayidx99, align 4, !tbaa !13 %.pre196 = load i32, ptr %m, align 4, !tbaa !18 br label %for.inc101 for.inc101: ; preds = %for.body77, %if.then97 %33 = phi i32 [ %26, %for.body77 ], [ %.pre196, %if.then97 ] %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1 %34 = sext i32 %33 to i64 %cmp75 = icmp slt i64 %indvars.iv.next193, %34 br i1 %cmp75, label %for.body77, label %for.end103, !llvm.loop !34 for.end103: ; preds = %for.inc101, %for.cond73.preheader ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #5 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %G = alloca %struct.graph, align 8 %red = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #8 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %G) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %N, align 4, !tbaa !13 %1 = load i32, ptr %M, align 4, !tbaa !13 call void @input_graph(ptr noundef nonnull %G, i32 noundef %0, i32 noundef %1) call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %red) #8 %2 = load i32, ptr %M, align 4, !tbaa !13 %cmp26 = icmp sgt i32 %2, 0 br i1 %cmp26, label %for.body.preheader, label %for.cond1.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %2 to i64 %min.iters.check = icmp ult i32 %2, 8 br i1 %min.iters.check, label %for.body.preheader54, 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 ] %3 = getelementptr inbounds [1000 x i32], ptr %red, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 16, !tbaa !13 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 16, !tbaa !13 %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 !35 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.preheader54 for.body.preheader54: ; 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, %entry %6 = load i32, ptr %N, align 4, !tbaa !13 %cmp2.not28 = icmp slt i32 %6, 1 br i1 %cmp2.not28, label %for.cond7.preheader, label %for.body3 for.body: ; preds = %for.body.preheader54, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader54 ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %red, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx, align 4, !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.cond1.preheader, label %for.body, !llvm.loop !38 for.cond7.preheader.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %M, align 4, !tbaa !13 br label %for.cond7.preheader for.cond7.preheader: ; preds = %for.cond7.preheader.loopexit, %for.cond1.preheader %7 = phi i32 [ %.pre, %for.cond7.preheader.loopexit ], [ %2, %for.cond1.preheader ] %cmp830 = icmp sgt i32 %7, 0 br i1 %cmp830, label %for.body9.preheader, label %for.end14 for.body9.preheader: ; preds = %for.cond7.preheader %wide.trip.count37 = zext i32 %7 to i64 %min.iters.check41 = icmp ult i32 %7, 8 br i1 %min.iters.check41, label %for.body9.preheader52, label %vector.ph42 vector.ph42: ; preds = %for.body9.preheader %n.vec44 = and i64 %wide.trip.count37, 4294967288 br label %vector.body47 vector.body47: ; preds = %vector.body47, %vector.ph42 %index48 = phi i64 [ 0, %vector.ph42 ], [ %index.next51, %vector.body47 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph42 ], [ %10, %vector.body47 ] %vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph42 ], [ %11, %vector.body47 ] %8 = getelementptr inbounds [1000 x i32], ptr %red, i64 0, i64 %index48 %wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !13 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load50 = load <4 x i32>, ptr %9, align 16, !tbaa !13 %10 = add <4 x i32> %wide.load, %vec.phi %11 = add <4 x i32> %wide.load50, %vec.phi49 %index.next51 = add nuw i64 %index48, 8 %12 = icmp eq i64 %index.next51, %n.vec44 br i1 %12, label %middle.block39, label %vector.body47, !llvm.loop !39 middle.block39: ; preds = %vector.body47 %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n46 = icmp eq i64 %n.vec44, %wide.trip.count37 br i1 %cmp.n46, label %for.end14, label %for.body9.preheader52 for.body9.preheader52: ; preds = %for.body9.preheader, %middle.block39 %indvars.iv34.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec44, %middle.block39 ] %sum.032.ph = phi i32 [ 0, %for.body9.preheader ], [ %13, %middle.block39 ] br label %for.body9 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.129 = phi i32 [ %inc5, %for.body3 ], [ 1, %for.cond1.preheader ] call void @redundant_edge_dijkstra(ptr noundef nonnull %G, i32 noundef %i.129, ptr noundef nonnull %red) %inc5 = add nuw nsw i32 %i.129, 1 %14 = load i32, ptr %N, align 4, !tbaa !13 %cmp2.not.not = icmp slt i32 %i.129, %14 br i1 %cmp2.not.not, label %for.body3, label %for.cond7.preheader.loopexit, !llvm.loop !40 for.body9: ; preds = %for.body9.preheader52, %for.body9 %indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.body9 ], [ %indvars.iv34.ph, %for.body9.preheader52 ] %sum.032 = phi i32 [ %add, %for.body9 ], [ %sum.032.ph, %for.body9.preheader52 ] %arrayidx11 = getelementptr inbounds [1000 x i32], ptr %red, i64 0, i64 %indvars.iv34 %15 = load i32, ptr %arrayidx11, align 4, !tbaa !13 %add = add nsw i32 %15, %sum.032 %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1 %exitcond38.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count37 br i1 %exitcond38.not, label %for.end14, label %for.body9, !llvm.loop !41 for.end14: ; preds = %for.body9, %middle.block39, %for.cond7.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ %13, %middle.block39 ], [ %add, %for.body9 ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) %16 = load ptr, ptr @stdout, align 8, !tbaa !25 %call16 = call i32 @fflush(ptr noundef %16) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %red) #8 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %G) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { 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 #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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind allocsize(0) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !10, i64 8} !6 = !{!"", !7, i64 0, !10, i64 8} !7 = !{!"any pointer", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"int", !8, i64 0} !11 = !{!6, !7, i64 0} !12 = !{i64 0, i64 4, !13, i64 4, i64 4, !13} !13 = !{!10, !10, i64 0} !14 = !{!15, !10, i64 0} !15 = !{!"", !10, i64 0, !10, i64 4} !16 = !{!17, !10, i64 0} !17 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16} !18 = !{!17, !10, i64 4} !19 = !{!17, !7, i64 8} !20 = !{!17, !7, i64 16} !21 = !{!22, !7, i64 8} !22 = !{!"List", !7, i64 0, !7, i64 8} !23 = !{!24, !10, i64 0} !24 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8} !25 = !{!7, !7, i64 0} !26 = !{!22, !7, i64 0} !27 = !{!24, !10, i64 4} !28 = distinct !{!28, !29} !29 = !{!"llvm.loop.mustprogress"} !30 = distinct !{!30, !29} !31 = distinct !{!31, !29} !32 = !{!24, !10, i64 8} !33 = distinct !{!33, !29} !34 = distinct !{!34, !29} !35 = distinct !{!35, !29, !36, !37} !36 = !{!"llvm.loop.isvectorized", i32 1} !37 = !{!"llvm.loop.unroll.runtime.disable"} !38 = distinct !{!38, !29, !37, !36} !39 = distinct !{!39, !29, !36, !37} !40 = distinct !{!40, !29} !41 = distinct !{!41, !29, !37, !36}
#include <stdio.h> int a[1005]; int b[1005]; int c[1005]; int d[105][105]; int main() { int N, M; scanf("%d %d",&N,&M); int i,j,k; for (i = 0; i < M; i++) { scanf("%d %d %d",&a[i],&b[i],&c[i]); a[i]--; b[i]--; } for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { if (i == j) { d[i][j] = 0; } else { d[i][j] = 99999999; } } } for (i = 0; i < M; i++) { d[a[i]][b[i]] = c[i]; d[b[i]][a[i]] = c[i]; } for (k = 0; k < N; k++) { for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { if (d[i][j] > d[i][k] + d[k][j]) { d[i][j] = d[i][k] + d[k][j]; } } } } int ans = 0; for (i = 0; i < M; i++) { if (d[a[i]][b[i]] < c[i]) { ans++; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124729/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124729/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @a = dso_local global [1005 x i32] zeroinitializer, align 16 @b = dso_local global [1005 x i32] zeroinitializer, align 16 @c = dso_local global [1005 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [105 x [105 x i32]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 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 %M, align 4, !tbaa !5 %cmp172 = icmp sgt i32 %0, 0 br i1 %cmp172, label %for.body, label %for.cond11.preheader for.cond11.preheader: ; preds = %for.body, %entry %.lcssa171 = phi i32 [ %0, %entry ], [ %12, %for.body ] %1 = load i32, ptr %N, align 4, !tbaa !5 %cmp12176 = icmp sgt i32 %1, 0 br i1 %cmp12176, label %for.cond14.preheader.us.preheader, label %for.cond32.preheader for.cond14.preheader.us.preheader: ; preds = %for.cond11.preheader %wide.trip.count198 = zext i32 %1 to i64 %min.iters.check = icmp ult i32 %1, 8 %n.vec = and i64 %wide.trip.count198, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count198 br label %for.cond14.preheader.us for.cond14.preheader.us: ; preds = %for.cond14.preheader.us.preheader, %for.cond14.for.inc29_crit_edge.us %indvars.iv195 = phi i64 [ 0, %for.cond14.preheader.us.preheader ], [ %indvars.iv.next196, %for.cond14.for.inc29_crit_edge.us ] br i1 %min.iters.check, label %for.body16.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond14.preheader.us %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv195, i64 0 %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> 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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4> %2 = icmp eq <4 x i64> %broadcast.splat, %vec.ind %3 = icmp eq <4 x i64> %broadcast.splat, %step.add %4 = select <4 x i1> %2, <4 x i32> zeroinitializer, <4 x i32> <i32 99999999, i32 99999999, i32 99999999, i32 99999999> %5 = select <4 x i1> %3, <4 x i32> zeroinitializer, <4 x i32> <i32 99999999, i32 99999999, i32 99999999, i32 99999999> %6 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv195, i64 %index store <4 x i32> %4, ptr %6, align 4 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %5, ptr %7, align 4 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond14.for.inc29_crit_edge.us, label %for.body16.us.preheader for.body16.us.preheader: ; preds = %for.cond14.preheader.us, %middle.block %indvars.iv192.ph = phi i64 [ 0, %for.cond14.preheader.us ], [ %n.vec, %middle.block ] br label %for.body16.us for.body16.us: ; preds = %for.body16.us.preheader, %for.body16.us %indvars.iv192 = phi i64 [ %indvars.iv.next193, %for.body16.us ], [ %indvars.iv192.ph, %for.body16.us.preheader ] %cmp17.us = icmp eq i64 %indvars.iv195, %indvars.iv192 %spec.select225 = select i1 %cmp17.us, i32 0, i32 99999999 %9 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv195, i64 %indvars.iv192 store i32 %spec.select225, ptr %9, align 4 %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1 %exitcond.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count198 br i1 %exitcond.not, label %for.cond14.for.inc29_crit_edge.us, label %for.body16.us, !llvm.loop !13 for.cond14.for.inc29_crit_edge.us: ; preds = %for.body16.us, %middle.block %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1 %exitcond199.not = icmp eq i64 %indvars.iv.next196, %wide.trip.count198 br i1 %exitcond199.not, label %for.cond32.preheader, label %for.cond14.preheader.us, !llvm.loop !14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4) %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %dec = add nsw i32 %10, -1 store i32 %dec, ptr %arrayidx, align 4, !tbaa !5 %11 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %dec10 = add nsw i32 %11, -1 store i32 %dec10, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %12 = load i32, ptr %M, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp = icmp slt i64 %indvars.iv.next, %13 br i1 %cmp, label %for.body, label %for.cond11.preheader, !llvm.loop !15 for.cond32.preheader: ; preds = %for.cond14.for.inc29_crit_edge.us, %for.cond11.preheader %cmp33179 = icmp sgt i32 %.lcssa171, 0 br i1 %cmp33179, label %for.body34.preheader, label %for.cond58.preheader for.body34.preheader: ; preds = %for.cond32.preheader %wide.trip.count203 = zext i32 %.lcssa171 to i64 %xtraiter = and i64 %wide.trip.count203, 1 %14 = icmp eq i32 %.lcssa171, 1 br i1 %14, label %for.cond58.preheader.loopexit.unr-lcssa, label %for.body34.preheader.new for.body34.preheader.new: ; preds = %for.body34.preheader %unroll_iter = and i64 %wide.trip.count203, 4294967294 br label %for.body34 for.cond58.preheader.loopexit.unr-lcssa: ; preds = %for.body34, %for.body34.preheader %indvars.iv200.unr = phi i64 [ 0, %for.body34.preheader ], [ %indvars.iv.next201.1, %for.body34 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond58.preheader, label %for.body34.epil for.body34.epil: ; preds = %for.cond58.preheader.loopexit.unr-lcssa %arrayidx36.epil = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv200.unr %15 = load i32, ptr %arrayidx36.epil, align 4, !tbaa !5 %arrayidx38.epil = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv200.unr %16 = load i32, ptr %arrayidx38.epil, align 4, !tbaa !5 %idxprom39.epil = sext i32 %16 to i64 %arrayidx42.epil = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv200.unr %17 = load i32, ptr %arrayidx42.epil, align 4, !tbaa !5 %idxprom43.epil = sext i32 %17 to i64 %arrayidx44.epil = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom39.epil, i64 %idxprom43.epil store i32 %15, ptr %arrayidx44.epil, align 4, !tbaa !5 %arrayidx54.epil = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom43.epil, i64 %idxprom39.epil store i32 %15, ptr %arrayidx54.epil, align 4, !tbaa !5 br label %for.cond58.preheader for.cond58.preheader: ; preds = %for.body34.epil, %for.cond58.preheader.loopexit.unr-lcssa, %for.cond32.preheader br i1 %cmp12176, label %for.cond61.preheader.us.preheader, label %for.cond104.preheader for.cond61.preheader.us.preheader: ; preds = %for.cond58.preheader %wide.trip.count218 = zext i32 %1 to i64 %18 = shl nuw nsw i64 %wide.trip.count218, 2 %19 = getelementptr i8, ptr @d, i64 %18 %min.iters.check237 = icmp ult i32 %1, 12 %20 = getelementptr i8, ptr @d, i64 %18 %n.vec240 = and i64 %wide.trip.count218, 4294967288 %cmp.n242 = icmp eq i64 %n.vec240, %wide.trip.count218 %xtraiter267 = and i64 %wide.trip.count218, 1 %lcmp.mod268.not = icmp eq i64 %xtraiter267, 0 %21 = sub nsw i64 0, %wide.trip.count218 br label %for.cond61.preheader.us for.cond61.preheader.us: ; preds = %for.cond61.preheader.us.preheader, %for.cond61.for.inc101_crit_edge.split.us.us %indvars.iv215 = phi i64 [ 0, %for.cond61.preheader.us.preheader ], [ %indvars.iv.next216, %for.cond61.for.inc101_crit_edge.split.us.us ] %22 = shl nuw nsw i64 %indvars.iv215, 2 %23 = mul nuw nsw i64 %indvars.iv215, 420 %scevgep230 = getelementptr i8, ptr @d, i64 %23 %scevgep231 = getelementptr i8, ptr %19, i64 %23 %gep = getelementptr i8, ptr getelementptr (i8, ptr @d, i64 4), i64 %22 %24 = getelementptr i8, ptr @d, i64 %22 %bound0 = icmp ugt ptr %gep, @d %bound1 = icmp ult ptr %24, %20 %found.conflict = and i1 %bound0, %bound1 br label %for.cond64.preheader.us.us for.cond64.preheader.us.us: ; preds = %for.cond64.for.inc98_crit_edge.us.us, %for.cond61.preheader.us %indvars.iv210 = phi i64 [ %indvars.iv.next211, %for.cond64.for.inc98_crit_edge.us.us ], [ 0, %for.cond61.preheader.us ] %arrayidx74.us.us = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %indvars.iv215 br i1 %min.iters.check237, label %for.body66.us.us.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond64.preheader.us.us %25 = mul nuw nsw i64 %indvars.iv210, 420 %scevgep227 = getelementptr i8, ptr %20, i64 %25 %scevgep = getelementptr i8, ptr @d, i64 %25 %bound0232 = icmp ult ptr %scevgep, %scevgep231 %bound1233 = icmp ult ptr %scevgep230, %scevgep227 %found.conflict234 = and i1 %bound0232, %bound1233 %conflict.rdx = or i1 %found.conflict, %found.conflict234 br i1 %conflict.rdx, label %for.body66.us.us.preheader, label %vector.ph238 vector.ph238: ; preds = %vector.memcheck %26 = load i32, ptr %arrayidx74.us.us, align 4, !tbaa !5, !alias.scope !16 %broadcast.splatinsert250 = insertelement <4 x i32> poison, i32 %26, i64 0 %broadcast.splat251 = shufflevector <4 x i32> %broadcast.splatinsert250, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body243 vector.body243: ; preds = %pred.store.continue265, %vector.ph238 %index244 = phi i64 [ 0, %vector.ph238 ], [ %index.next266, %pred.store.continue265 ] %27 = or i64 %index244, 4 %28 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %index244 %wide.load = load <4 x i32>, ptr %28, align 4, !tbaa !5, !alias.scope !19, !noalias !21 %29 = getelementptr inbounds i32, ptr %28, i64 4 %wide.load245 = load <4 x i32>, ptr %29, align 4, !tbaa !5, !alias.scope !19, !noalias !21 %30 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv215, i64 %index244 %wide.load246 = load <4 x i32>, ptr %30, align 4, !tbaa !5, !alias.scope !23 %31 = getelementptr inbounds i32, ptr %30, i64 4 %wide.load247 = load <4 x i32>, ptr %31, align 4, !tbaa !5, !alias.scope !23 %32 = add nsw <4 x i32> %wide.load246, %broadcast.splat251 %33 = add nsw <4 x i32> %wide.load247, %broadcast.splat251 %34 = icmp sgt <4 x i32> %wide.load, %32 %35 = icmp sgt <4 x i32> %wide.load245, %33 %36 = extractelement <4 x i1> %34, i64 0 br i1 %36, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body243 %37 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %index244 %38 = extractelement <4 x i32> %32, i64 0 store i32 %38, ptr %37, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body243 %39 = extractelement <4 x i1> %34, i64 1 br i1 %39, label %pred.store.if252, label %pred.store.continue253 pred.store.if252: ; preds = %pred.store.continue %40 = or i64 %index244, 1 %41 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %40 %42 = extractelement <4 x i32> %32, i64 1 store i32 %42, ptr %41, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue253 pred.store.continue253: ; preds = %pred.store.if252, %pred.store.continue %43 = extractelement <4 x i1> %34, i64 2 br i1 %43, label %pred.store.if254, label %pred.store.continue255 pred.store.if254: ; preds = %pred.store.continue253 %44 = or i64 %index244, 2 %45 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %44 %46 = extractelement <4 x i32> %32, i64 2 store i32 %46, ptr %45, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue255 pred.store.continue255: ; preds = %pred.store.if254, %pred.store.continue253 %47 = extractelement <4 x i1> %34, i64 3 br i1 %47, label %pred.store.if256, label %pred.store.continue257 pred.store.if256: ; preds = %pred.store.continue255 %48 = or i64 %index244, 3 %49 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %48 %50 = extractelement <4 x i32> %32, i64 3 store i32 %50, ptr %49, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue257 pred.store.continue257: ; preds = %pred.store.if256, %pred.store.continue255 %51 = extractelement <4 x i1> %35, i64 0 br i1 %51, label %pred.store.if258, label %pred.store.continue259 pred.store.if258: ; preds = %pred.store.continue257 %52 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %27 %53 = extractelement <4 x i32> %33, i64 0 store i32 %53, ptr %52, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue259 pred.store.continue259: ; preds = %pred.store.if258, %pred.store.continue257 %54 = extractelement <4 x i1> %35, i64 1 br i1 %54, label %pred.store.if260, label %pred.store.continue261 pred.store.if260: ; preds = %pred.store.continue259 %55 = or i64 %index244, 5 %56 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %55 %57 = extractelement <4 x i32> %33, i64 1 store i32 %57, ptr %56, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue261 pred.store.continue261: ; preds = %pred.store.if260, %pred.store.continue259 %58 = extractelement <4 x i1> %35, i64 2 br i1 %58, label %pred.store.if262, label %pred.store.continue263 pred.store.if262: ; preds = %pred.store.continue261 %59 = or i64 %index244, 6 %60 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %59 %61 = extractelement <4 x i32> %33, i64 2 store i32 %61, ptr %60, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue263 pred.store.continue263: ; preds = %pred.store.if262, %pred.store.continue261 %62 = extractelement <4 x i1> %35, i64 3 br i1 %62, label %pred.store.if264, label %pred.store.continue265 pred.store.if264: ; preds = %pred.store.continue263 %63 = or i64 %index244, 7 %64 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %63 %65 = extractelement <4 x i32> %33, i64 3 store i32 %65, ptr %64, align 4, !tbaa !5, !alias.scope !19, !noalias !21 br label %pred.store.continue265 pred.store.continue265: ; preds = %pred.store.if264, %pred.store.continue263 %index.next266 = add nuw i64 %index244, 8 %66 = icmp eq i64 %index.next266, %n.vec240 br i1 %66, label %middle.block235, label %vector.body243, !llvm.loop !24 middle.block235: ; preds = %pred.store.continue265 br i1 %cmp.n242, label %for.cond64.for.inc98_crit_edge.us.us, label %for.body66.us.us.preheader for.body66.us.us.preheader: ; preds = %vector.memcheck, %for.cond64.preheader.us.us, %middle.block235 %indvars.iv205.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond64.preheader.us.us ], [ %n.vec240, %middle.block235 ] br i1 %lcmp.mod268.not, label %for.body66.us.us.prol.loopexit, label %for.body66.us.us.prol for.body66.us.us.prol: ; preds = %for.body66.us.us.preheader %arrayidx70.us.us.prol = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %indvars.iv205.ph %67 = load i32, ptr %arrayidx70.us.us.prol, align 4, !tbaa !5 %68 = load i32, ptr %arrayidx74.us.us, align 4, !tbaa !5 %arrayidx78.us.us.prol = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv215, i64 %indvars.iv205.ph %69 = load i32, ptr %arrayidx78.us.us.prol, align 4, !tbaa !5 %add.us.us.prol = add nsw i32 %69, %68 %cmp79.us.us.prol = icmp sgt i32 %67, %add.us.us.prol br i1 %cmp79.us.us.prol, label %if.then80.us.us.prol, label %for.inc95.us.us.prol if.then80.us.us.prol: ; preds = %for.body66.us.us.prol store i32 %add.us.us.prol, ptr %arrayidx70.us.us.prol, align 4, !tbaa !5 br label %for.inc95.us.us.prol for.inc95.us.us.prol: ; preds = %if.then80.us.us.prol, %for.body66.us.us.prol %indvars.iv.next206.prol = or i64 %indvars.iv205.ph, 1 br label %for.body66.us.us.prol.loopexit for.body66.us.us.prol.loopexit: ; preds = %for.inc95.us.us.prol, %for.body66.us.us.preheader %indvars.iv205.unr = phi i64 [ %indvars.iv205.ph, %for.body66.us.us.preheader ], [ %indvars.iv.next206.prol, %for.inc95.us.us.prol ] %70 = xor i64 %indvars.iv205.ph, %21 %71 = icmp eq i64 %70, -1 br i1 %71, label %for.cond64.for.inc98_crit_edge.us.us, label %for.body66.us.us for.body66.us.us: ; preds = %for.body66.us.us.prol.loopexit, %for.inc95.us.us.1 %indvars.iv205 = phi i64 [ %indvars.iv.next206.1, %for.inc95.us.us.1 ], [ %indvars.iv205.unr, %for.body66.us.us.prol.loopexit ] %arrayidx70.us.us = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %indvars.iv205 %72 = load i32, ptr %arrayidx70.us.us, align 4, !tbaa !5 %73 = load i32, ptr %arrayidx74.us.us, align 4, !tbaa !5 %arrayidx78.us.us = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv215, i64 %indvars.iv205 %74 = load i32, ptr %arrayidx78.us.us, align 4, !tbaa !5 %add.us.us = add nsw i32 %74, %73 %cmp79.us.us = icmp sgt i32 %72, %add.us.us br i1 %cmp79.us.us, label %if.then80.us.us, label %for.inc95.us.us if.then80.us.us: ; preds = %for.body66.us.us store i32 %add.us.us, ptr %arrayidx70.us.us, align 4, !tbaa !5 br label %for.inc95.us.us for.inc95.us.us: ; preds = %if.then80.us.us, %for.body66.us.us %indvars.iv.next206 = add nuw nsw i64 %indvars.iv205, 1 %arrayidx70.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv210, i64 %indvars.iv.next206 %75 = load i32, ptr %arrayidx70.us.us.1, align 4, !tbaa !5 %76 = load i32, ptr %arrayidx74.us.us, align 4, !tbaa !5 %arrayidx78.us.us.1 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %indvars.iv215, i64 %indvars.iv.next206 %77 = load i32, ptr %arrayidx78.us.us.1, align 4, !tbaa !5 %add.us.us.1 = add nsw i32 %77, %76 %cmp79.us.us.1 = icmp sgt i32 %75, %add.us.us.1 br i1 %cmp79.us.us.1, label %if.then80.us.us.1, label %for.inc95.us.us.1 if.then80.us.us.1: ; preds = %for.inc95.us.us store i32 %add.us.us.1, ptr %arrayidx70.us.us.1, align 4, !tbaa !5 br label %for.inc95.us.us.1 for.inc95.us.us.1: ; preds = %if.then80.us.us.1, %for.inc95.us.us %indvars.iv.next206.1 = add nuw nsw i64 %indvars.iv205, 2 %exitcond209.not.1 = icmp eq i64 %indvars.iv.next206.1, %wide.trip.count218 br i1 %exitcond209.not.1, label %for.cond64.for.inc98_crit_edge.us.us, label %for.body66.us.us, !llvm.loop !25 for.cond64.for.inc98_crit_edge.us.us: ; preds = %for.body66.us.us.prol.loopexit, %for.inc95.us.us.1, %middle.block235 %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1 %exitcond214.not = icmp eq i64 %indvars.iv.next211, %wide.trip.count218 br i1 %exitcond214.not, label %for.cond61.for.inc101_crit_edge.split.us.us, label %for.cond64.preheader.us.us, !llvm.loop !26 for.cond61.for.inc101_crit_edge.split.us.us: ; preds = %for.cond64.for.inc98_crit_edge.us.us %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1 %exitcond219.not = icmp eq i64 %indvars.iv.next216, %wide.trip.count218 br i1 %exitcond219.not, label %for.cond104.preheader, label %for.cond61.preheader.us, !llvm.loop !27 for.body34: ; preds = %for.body34, %for.body34.preheader.new %indvars.iv200 = phi i64 [ 0, %for.body34.preheader.new ], [ %indvars.iv.next201.1, %for.body34 ] %niter = phi i64 [ 0, %for.body34.preheader.new ], [ %niter.next.1, %for.body34 ] %arrayidx36 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv200 %78 = load i32, ptr %arrayidx36, align 8, !tbaa !5 %arrayidx38 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv200 %79 = load i32, ptr %arrayidx38, align 8, !tbaa !5 %idxprom39 = sext i32 %79 to i64 %arrayidx42 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv200 %80 = load i32, ptr %arrayidx42, align 8, !tbaa !5 %idxprom43 = sext i32 %80 to i64 %arrayidx44 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom39, i64 %idxprom43 store i32 %78, ptr %arrayidx44, align 4, !tbaa !5 %arrayidx54 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom43, i64 %idxprom39 store i32 %78, ptr %arrayidx54, align 4, !tbaa !5 %indvars.iv.next201 = or i64 %indvars.iv200, 1 %arrayidx36.1 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv.next201 %81 = load i32, ptr %arrayidx36.1, align 4, !tbaa !5 %arrayidx38.1 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv.next201 %82 = load i32, ptr %arrayidx38.1, align 4, !tbaa !5 %idxprom39.1 = sext i32 %82 to i64 %arrayidx42.1 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv.next201 %83 = load i32, ptr %arrayidx42.1, align 4, !tbaa !5 %idxprom43.1 = sext i32 %83 to i64 %arrayidx44.1 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom39.1, i64 %idxprom43.1 store i32 %81, ptr %arrayidx44.1, align 4, !tbaa !5 %arrayidx54.1 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom43.1, i64 %idxprom39.1 store i32 %81, ptr %arrayidx54.1, align 4, !tbaa !5 %indvars.iv.next201.1 = add nuw nsw i64 %indvars.iv200, 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.cond58.preheader.loopexit.unr-lcssa, label %for.body34, !llvm.loop !28 for.cond104.preheader: ; preds = %for.cond61.for.inc101_crit_edge.split.us.us, %for.cond58.preheader br i1 %cmp33179, label %for.body106.preheader, label %for.end123 for.body106.preheader: ; preds = %for.cond104.preheader %wide.trip.count223 = zext i32 %.lcssa171 to i64 %xtraiter269 = and i64 %wide.trip.count223, 1 %84 = icmp eq i32 %.lcssa171, 1 br i1 %84, label %for.end123.loopexit.unr-lcssa, label %for.body106.preheader.new for.body106.preheader.new: ; preds = %for.body106.preheader %unroll_iter272 = and i64 %wide.trip.count223, 4294967294 br label %for.body106 for.body106: ; preds = %for.body106, %for.body106.preheader.new %indvars.iv220 = phi i64 [ 0, %for.body106.preheader.new ], [ %indvars.iv.next221.1, %for.body106 ] %ans.0189 = phi i32 [ 0, %for.body106.preheader.new ], [ %spec.select.1, %for.body106 ] %niter273 = phi i64 [ 0, %for.body106.preheader.new ], [ %niter273.next.1, %for.body106 ] %arrayidx108 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv220 %85 = load i32, ptr %arrayidx108, align 8, !tbaa !5 %idxprom109 = sext i32 %85 to i64 %arrayidx112 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv220 %86 = load i32, ptr %arrayidx112, align 8, !tbaa !5 %idxprom113 = sext i32 %86 to i64 %arrayidx114 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom109, i64 %idxprom113 %87 = load i32, ptr %arrayidx114, align 4, !tbaa !5 %arrayidx116 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv220 %88 = load i32, ptr %arrayidx116, align 8, !tbaa !5 %cmp117 = icmp slt i32 %87, %88 %inc119 = zext i1 %cmp117 to i32 %spec.select = add nuw nsw i32 %ans.0189, %inc119 %indvars.iv.next221 = or i64 %indvars.iv220, 1 %arrayidx108.1 = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv.next221 %89 = load i32, ptr %arrayidx108.1, align 4, !tbaa !5 %idxprom109.1 = sext i32 %89 to i64 %arrayidx112.1 = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv.next221 %90 = load i32, ptr %arrayidx112.1, align 4, !tbaa !5 %idxprom113.1 = sext i32 %90 to i64 %arrayidx114.1 = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom109.1, i64 %idxprom113.1 %91 = load i32, ptr %arrayidx114.1, align 4, !tbaa !5 %arrayidx116.1 = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv.next221 %92 = load i32, ptr %arrayidx116.1, align 4, !tbaa !5 %cmp117.1 = icmp slt i32 %91, %92 %inc119.1 = zext i1 %cmp117.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %inc119.1 %indvars.iv.next221.1 = add nuw nsw i64 %indvars.iv220, 2 %niter273.next.1 = add i64 %niter273, 2 %niter273.ncmp.1 = icmp eq i64 %niter273.next.1, %unroll_iter272 br i1 %niter273.ncmp.1, label %for.end123.loopexit.unr-lcssa, label %for.body106, !llvm.loop !29 for.end123.loopexit.unr-lcssa: ; preds = %for.body106, %for.body106.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body106.preheader ], [ %spec.select.1, %for.body106 ] %indvars.iv220.unr = phi i64 [ 0, %for.body106.preheader ], [ %indvars.iv.next221.1, %for.body106 ] %ans.0189.unr = phi i32 [ 0, %for.body106.preheader ], [ %spec.select.1, %for.body106 ] %lcmp.mod270.not = icmp eq i64 %xtraiter269, 0 br i1 %lcmp.mod270.not, label %for.end123, label %for.body106.epil for.body106.epil: ; preds = %for.end123.loopexit.unr-lcssa %arrayidx108.epil = getelementptr inbounds [1005 x i32], ptr @a, i64 0, i64 %indvars.iv220.unr %93 = load i32, ptr %arrayidx108.epil, align 4, !tbaa !5 %idxprom109.epil = sext i32 %93 to i64 %arrayidx112.epil = getelementptr inbounds [1005 x i32], ptr @b, i64 0, i64 %indvars.iv220.unr %94 = load i32, ptr %arrayidx112.epil, align 4, !tbaa !5 %idxprom113.epil = sext i32 %94 to i64 %arrayidx114.epil = getelementptr inbounds [105 x [105 x i32]], ptr @d, i64 0, i64 %idxprom109.epil, i64 %idxprom113.epil %95 = load i32, ptr %arrayidx114.epil, align 4, !tbaa !5 %arrayidx116.epil = getelementptr inbounds [1005 x i32], ptr @c, i64 0, i64 %indvars.iv220.unr %96 = load i32, ptr %arrayidx116.epil, align 4, !tbaa !5 %cmp117.epil = icmp slt i32 %95, %96 %inc119.epil = zext i1 %cmp117.epil to i32 %spec.select.epil = add nuw nsw i32 %ans.0189.unr, %inc119.epil br label %for.end123 for.end123: ; preds = %for.body106.epil, %for.end123.loopexit.unr-lcssa, %for.cond104.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond104.preheader ], [ %spec.select.lcssa.ph, %for.end123.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body106.epil ] %call124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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 = !{!17} !17 = distinct !{!17, !18} !18 = distinct !{!18, !"LVerDomain"} !19 = !{!20} !20 = distinct !{!20, !18} !21 = !{!17, !22} !22 = distinct !{!22, !18} !23 = !{!22} !24 = distinct !{!24, !10, !11, !12} !25 = distinct !{!25, !10, !11} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10}
#include <stdlib.h> #include <string.h> #include <math.h> #include <stdio.h> int main() { long long p,n,base=1,ans; scanf("%lld%lld",&n,&p); if(n==1){ printf("%lld",p); return 0; } while(pow(base,n)<=p){ if(p%(long long)(pow(base,n))==0){ ans=base; } base++; } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124772/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124772/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 1 %1 = load i64, ptr %p, align 8, !tbaa !5 br i1 %cmp, label %if.then, label %while.cond.preheader while.cond.preheader: ; preds = %entry %cmp525 = icmp sgt i64 %1, 0 call void @llvm.assume(i1 %cmp525) br label %while.body if.then: ; preds = %entry %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1) br label %cleanup while.body: ; preds = %while.cond.preheader, %while.body %2 = phi i64 [ %5, %while.body ], [ %1, %while.cond.preheader ] %conv28 = phi double [ %conv, %while.body ], [ 1.000000e+00, %while.cond.preheader ] %ans.027 = phi i64 [ %spec.select, %while.body ], [ undef, %while.cond.preheader ] %base.026 = phi i64 [ %inc, %while.body ], [ 1, %while.cond.preheader ] %3 = load i64, ptr %n, align 8, !tbaa !5 %conv8 = sitofp i64 %3 to double %call9 = call double @pow(double noundef %conv28, double noundef %conv8) #5 %conv10 = fptosi double %call9 to i64 %rem = srem i64 %2, %conv10 %cmp11 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp11, i64 %base.026, i64 %ans.027 %inc = add nuw nsw i64 %base.026, 1 %conv = sitofp i64 %inc to double %4 = load i64, ptr %n, align 8, !tbaa !5 %conv2 = sitofp i64 %4 to double %call3 = call double @pow(double noundef %conv, double noundef %conv2) #5 %5 = load i64, ptr %p, align 8, !tbaa !5 %conv4 = sitofp i64 %5 to double %cmp5 = fcmp ugt double %call3, %conv4 br i1 %cmp5, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select) br label %cleanup cleanup: ; preds = %while.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %p) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(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: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int f(int fa,int fb,int fc,int fd){ if(fc>=5&&fd>=2)return (fa*fc+fb*fd)*0.8; return fa*fc+fb*fd; } int main(void){ int i,j,k,N,x,y,b,p,ans,ANS; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); ANS=f(x,y,b,p); for(j=b;j<=b+5;j++){ for(k=p;k<=p+2;k++){ ans=f(x,y,j,k); if(ans<ANS)ANS=ans; } } printf("%d\n",ANS); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124822/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @f(i32 noundef %fa, i32 noundef %fb, i32 noundef %fc, i32 noundef %fd) local_unnamed_addr #0 { entry: %cmp = icmp sgt i32 %fc, 4 %cmp1 = icmp sgt i32 %fd, 1 %or.cond = and i1 %cmp, %cmp1 %mul = mul nsw i32 %fc, %fa %mul2 = mul nsw i32 %fd, %fb %add = add nsw i32 %mul2, %mul %conv = sitofp i32 %add to double %mul3 = fmul double %conv, 8.000000e-01 %conv4 = fptosi double %mul3 to i32 %retval.0 = select i1 %or.cond, i32 %conv4, i32 %add ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %b = 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 %y) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #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 %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.body, label %for.end18 for.body: ; preds = %entry, %for.end14 %i.041 = phi i32 [ %inc17, %for.end14 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %b, ptr noundef nonnull %p) %1 = load i32, ptr %x, align 4, !tbaa !5 %2 = load i32, ptr %y, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %.fr = freeze i32 %3 %4 = load i32, ptr %p, align 4, !tbaa !5 %cmp.i = icmp sgt i32 %.fr, 4 %cmp1.i = icmp sgt i32 %4, 1 %mul.i = mul nsw i32 %.fr, %1 %mul2.i = mul nsw i32 %4, %2 %add.i = add nsw i32 %mul2.i, %mul.i %add = add i32 %.fr, 5 %add7 = add i32 %4, 2 br i1 %cmp.i, label %for.body9.preheader, label %for.body9.us.preheader for.body9.us.preheader: ; preds = %for.body %exitcond.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond.not.not, label %for.body9.us.1, label %for.inc12, !llvm.loop !9 for.body9.preheader: ; preds = %for.body %or.cond.i = and i1 %cmp.i, %cmp1.i %conv.i = sitofp i32 %add.i to double %mul3.i = fmul double %conv.i, 8.000000e-01 %conv4.i = fptosi double %mul3.i to i32 %retval.0.i = select i1 %or.cond.i, i32 %conv4.i, i32 %add.i %spec.select42 = select i1 %cmp1.i, i32 %conv4.i, i32 %add.i %spec.select = call i32 @llvm.smin.i32(i32 %spec.select42, i32 %retval.0.i) %exitcond45.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond45.not.not, label %for.body9.1, label %for.inc12, !llvm.loop !9 for.body9.us.1: ; preds = %for.body9.us.preheader %inc.us = add nsw i32 %4, 1 %mul2.i30.us.1 = mul nsw i32 %inc.us, %2 %add.i31.us.1 = add nsw i32 %mul2.i30.us.1, %mul.i %spec.select.us.1 = call i32 @llvm.smin.i32(i32 %add.i31.us.1, i32 %add.i) %mul2.i30.us.2 = mul nsw i32 %add7, %2 %add.i31.us.2 = add nsw i32 %mul2.i30.us.2, %mul.i %spec.select.us.2 = call i32 @llvm.smin.i32(i32 %add.i31.us.2, i32 %spec.select.us.1) br label %for.inc12 for.body9.1: ; preds = %for.body9.preheader %inc = add nsw i32 %4, 1 %cmp1.i27.1 = icmp sgt i32 %4, 0 %mul2.i30.1 = mul nsw i32 %inc, %2 %add.i31.1 = add nsw i32 %mul2.i30.1, %mul.i %conv.i32.1 = sitofp i32 %add.i31.1 to double %mul3.i33.1 = fmul double %conv.i32.1, 8.000000e-01 %conv4.i34.1 = fptosi double %mul3.i33.1 to i32 %spec.select42.1 = select i1 %cmp1.i27.1, i32 %conv4.i34.1, i32 %add.i31.1 %spec.select.1 = call i32 @llvm.smin.i32(i32 %spec.select42.1, i32 %spec.select) %cmp1.i27.2 = icmp ult i32 %4, 2147483646 %mul2.i30.2 = mul nsw i32 %add7, %2 %add.i31.2 = add nsw i32 %mul2.i30.2, %mul.i %conv.i32.2 = sitofp i32 %add.i31.2 to double %mul3.i33.2 = fmul double %conv.i32.2, 8.000000e-01 %conv4.i34.2 = fptosi double %mul3.i33.2 to i32 %spec.select42.2 = select i1 %cmp1.i27.2, i32 %conv4.i34.2, i32 %add.i31.2 %spec.select.2 = call i32 @llvm.smin.i32(i32 %spec.select42.2, i32 %spec.select.1) br label %for.inc12 for.inc12: ; preds = %for.body9.us.preheader, %for.body9.us.1, %for.body9.preheader, %for.body9.1 %.us-phi = phi i32 [ %spec.select, %for.body9.preheader ], [ %spec.select.2, %for.body9.1 ], [ %add.i, %for.body9.us.preheader ], [ %spec.select.us.2, %for.body9.us.1 ] %inc13 = add i32 %.fr, 1 %cmp4.not = icmp sgt i32 %inc13, %add br i1 %cmp4.not, label %for.end14, label %for.cond6.preheader.1, !llvm.loop !11 for.cond6.preheader.1: ; preds = %for.inc12 %cmp.i26.1 = icmp sgt i32 %inc13, 4 %mul.i29.1 = mul nsw i32 %inc13, %1 %add.i31.153 = add nsw i32 %mul2.i, %mul.i29.1 br i1 %cmp.i26.1, label %for.body9.preheader.1, label %for.body9.us.preheader.1 for.body9.us.preheader.1: ; preds = %for.cond6.preheader.1 %spec.select.us.148 = call i32 @llvm.smin.i32(i32 %add.i31.153, i32 %.us-phi) %exitcond.1.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond.1.not.not, label %for.body9.us.1.1, label %for.inc12.1, !llvm.loop !9 for.body9.us.1.1: ; preds = %for.body9.us.preheader.1 %inc.us.149 = add nsw i32 %4, 1 %mul2.i30.us.1.1 = mul nsw i32 %inc.us.149, %2 %add.i31.us.1.1 = add nsw i32 %mul2.i30.us.1.1, %mul.i29.1 %spec.select.us.1.1 = call i32 @llvm.smin.i32(i32 %add.i31.us.1.1, i32 %spec.select.us.148) %mul2.i30.us.2.1 = mul nsw i32 %add7, %2 %add.i31.us.2.1 = add nsw i32 %mul2.i30.us.2.1, %mul.i29.1 %spec.select.us.2.1 = call i32 @llvm.smin.i32(i32 %add.i31.us.2.1, i32 %spec.select.us.1.1) br label %for.inc12.1 for.body9.preheader.1: ; preds = %for.cond6.preheader.1 %conv.i32.154 = sitofp i32 %add.i31.153 to double %mul3.i33.155 = fmul double %conv.i32.154, 8.000000e-01 %conv4.i34.156 = fptosi double %mul3.i33.155 to i32 %spec.select42.157 = select i1 %cmp1.i, i32 %conv4.i34.156, i32 %add.i31.153 %spec.select.158 = call i32 @llvm.smin.i32(i32 %spec.select42.157, i32 %.us-phi) %exitcond45.1.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond45.1.not.not, label %for.body9.1.1, label %for.inc12.1, !llvm.loop !9 for.body9.1.1: ; preds = %for.body9.preheader.1 %inc.159 = add nsw i32 %4, 1 %cmp1.i27.1.1 = icmp sgt i32 %4, 0 %mul2.i30.1.1 = mul nsw i32 %inc.159, %2 %add.i31.1.1 = add nsw i32 %mul2.i30.1.1, %mul.i29.1 %conv.i32.1.1 = sitofp i32 %add.i31.1.1 to double %mul3.i33.1.1 = fmul double %conv.i32.1.1, 8.000000e-01 %conv4.i34.1.1 = fptosi double %mul3.i33.1.1 to i32 %spec.select42.1.1 = select i1 %cmp1.i27.1.1, i32 %conv4.i34.1.1, i32 %add.i31.1.1 %spec.select.1.1 = call i32 @llvm.smin.i32(i32 %spec.select42.1.1, i32 %spec.select.158) %cmp1.i27.2.1 = icmp ult i32 %4, 2147483646 %mul2.i30.2.1 = mul nsw i32 %add7, %2 %add.i31.2.1 = add nsw i32 %mul2.i30.2.1, %mul.i29.1 %conv.i32.2.1 = sitofp i32 %add.i31.2.1 to double %mul3.i33.2.1 = fmul double %conv.i32.2.1, 8.000000e-01 %conv4.i34.2.1 = fptosi double %mul3.i33.2.1 to i32 %spec.select42.2.1 = select i1 %cmp1.i27.2.1, i32 %conv4.i34.2.1, i32 %add.i31.2.1 %spec.select.2.1 = call i32 @llvm.smin.i32(i32 %spec.select42.2.1, i32 %spec.select.1.1) br label %for.inc12.1 for.inc12.1: ; preds = %for.body9.preheader.1, %for.body9.1.1, %for.body9.us.preheader.1, %for.body9.us.1.1 %.us-phi.1 = phi i32 [ %spec.select.us.148, %for.body9.us.preheader.1 ], [ %spec.select.us.2.1, %for.body9.us.1.1 ], [ %spec.select.158, %for.body9.preheader.1 ], [ %spec.select.2.1, %for.body9.1.1 ] %inc13.1 = add i32 %.fr, 2 %cmp.i26.2 = icmp sgt i32 %inc13.1, 4 %mul.i29.2 = mul nsw i32 %inc13.1, %1 %add.i31.266 = add nsw i32 %mul2.i, %mul.i29.2 br i1 %cmp.i26.2, label %for.body9.preheader.2, label %for.body9.us.preheader.2 for.body9.us.preheader.2: ; preds = %for.inc12.1 %spec.select.us.263 = call i32 @llvm.smin.i32(i32 %add.i31.266, i32 %.us-phi.1) %exitcond.2.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond.2.not.not, label %for.body9.us.1.2, label %for.inc12.2, !llvm.loop !9 for.body9.us.1.2: ; preds = %for.body9.us.preheader.2 %inc.us.2 = add nsw i32 %4, 1 %mul2.i30.us.1.2 = mul nsw i32 %inc.us.2, %2 %add.i31.us.1.2 = add nsw i32 %mul2.i30.us.1.2, %mul.i29.2 %spec.select.us.1.2 = call i32 @llvm.smin.i32(i32 %add.i31.us.1.2, i32 %spec.select.us.263) %mul2.i30.us.2.2 = mul nsw i32 %add7, %2 %add.i31.us.2.2 = add nsw i32 %mul2.i30.us.2.2, %mul.i29.2 %spec.select.us.2.2 = call i32 @llvm.smin.i32(i32 %add.i31.us.2.2, i32 %spec.select.us.1.2) br label %for.inc12.2 for.body9.preheader.2: ; preds = %for.inc12.1 %conv.i32.267 = sitofp i32 %add.i31.266 to double %mul3.i33.268 = fmul double %conv.i32.267, 8.000000e-01 %conv4.i34.269 = fptosi double %mul3.i33.268 to i32 %spec.select42.270 = select i1 %cmp1.i, i32 %conv4.i34.269, i32 %add.i31.266 %spec.select.271 = call i32 @llvm.smin.i32(i32 %spec.select42.270, i32 %.us-phi.1) %exitcond45.2.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond45.2.not.not, label %for.body9.1.2, label %for.inc12.2, !llvm.loop !9 for.body9.1.2: ; preds = %for.body9.preheader.2 %inc.2 = add nsw i32 %4, 1 %cmp1.i27.1.2 = icmp sgt i32 %4, 0 %mul2.i30.1.2 = mul nsw i32 %inc.2, %2 %add.i31.1.2 = add nsw i32 %mul2.i30.1.2, %mul.i29.2 %conv.i32.1.2 = sitofp i32 %add.i31.1.2 to double %mul3.i33.1.2 = fmul double %conv.i32.1.2, 8.000000e-01 %conv4.i34.1.2 = fptosi double %mul3.i33.1.2 to i32 %spec.select42.1.2 = select i1 %cmp1.i27.1.2, i32 %conv4.i34.1.2, i32 %add.i31.1.2 %spec.select.1.2 = call i32 @llvm.smin.i32(i32 %spec.select42.1.2, i32 %spec.select.271) %cmp1.i27.2.2 = icmp ult i32 %4, 2147483646 %mul2.i30.2.2 = mul nsw i32 %add7, %2 %add.i31.2.2 = add nsw i32 %mul2.i30.2.2, %mul.i29.2 %conv.i32.2.2 = sitofp i32 %add.i31.2.2 to double %mul3.i33.2.2 = fmul double %conv.i32.2.2, 8.000000e-01 %conv4.i34.2.2 = fptosi double %mul3.i33.2.2 to i32 %spec.select42.2.2 = select i1 %cmp1.i27.2.2, i32 %conv4.i34.2.2, i32 %add.i31.2.2 %spec.select.2.2 = call i32 @llvm.smin.i32(i32 %spec.select42.2.2, i32 %spec.select.1.2) br label %for.inc12.2 for.inc12.2: ; preds = %for.body9.preheader.2, %for.body9.1.2, %for.body9.us.preheader.2, %for.body9.us.1.2 %.us-phi.2 = phi i32 [ %spec.select.us.263, %for.body9.us.preheader.2 ], [ %spec.select.us.2.2, %for.body9.us.1.2 ], [ %spec.select.271, %for.body9.preheader.2 ], [ %spec.select.2.2, %for.body9.1.2 ] %inc13.2 = add i32 %.fr, 3 %cmp.i26.3 = icmp sgt i32 %inc13.2, 4 %mul.i29.3 = mul nsw i32 %inc13.2, %1 %add.i31.3 = add nsw i32 %mul2.i, %mul.i29.3 br i1 %cmp.i26.3, label %for.body9.preheader.3, label %for.body9.us.preheader.3 for.body9.us.preheader.3: ; preds = %for.inc12.2 %spec.select.us.3 = call i32 @llvm.smin.i32(i32 %add.i31.3, i32 %.us-phi.2) %exitcond.3.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond.3.not.not, label %for.body9.us.1.3, label %for.inc12.3, !llvm.loop !9 for.body9.us.1.3: ; preds = %for.body9.us.preheader.3 %inc.us.3 = add nsw i32 %4, 1 %mul2.i30.us.1.3 = mul nsw i32 %inc.us.3, %2 %add.i31.us.1.3 = add nsw i32 %mul2.i30.us.1.3, %mul.i29.3 %spec.select.us.1.3 = call i32 @llvm.smin.i32(i32 %add.i31.us.1.3, i32 %spec.select.us.3) %mul2.i30.us.2.3 = mul nsw i32 %add7, %2 %add.i31.us.2.3 = add nsw i32 %mul2.i30.us.2.3, %mul.i29.3 %spec.select.us.2.3 = call i32 @llvm.smin.i32(i32 %add.i31.us.2.3, i32 %spec.select.us.1.3) br label %for.inc12.3 for.body9.preheader.3: ; preds = %for.inc12.2 %conv.i32.3 = sitofp i32 %add.i31.3 to double %mul3.i33.3 = fmul double %conv.i32.3, 8.000000e-01 %conv4.i34.3 = fptosi double %mul3.i33.3 to i32 %spec.select42.3 = select i1 %cmp1.i, i32 %conv4.i34.3, i32 %add.i31.3 %spec.select.3 = call i32 @llvm.smin.i32(i32 %spec.select42.3, i32 %.us-phi.2) %exitcond45.3.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond45.3.not.not, label %for.body9.1.3, label %for.inc12.3, !llvm.loop !9 for.body9.1.3: ; preds = %for.body9.preheader.3 %inc.3 = add nsw i32 %4, 1 %cmp1.i27.1.3 = icmp sgt i32 %4, 0 %mul2.i30.1.3 = mul nsw i32 %inc.3, %2 %add.i31.1.3 = add nsw i32 %mul2.i30.1.3, %mul.i29.3 %conv.i32.1.3 = sitofp i32 %add.i31.1.3 to double %mul3.i33.1.3 = fmul double %conv.i32.1.3, 8.000000e-01 %conv4.i34.1.3 = fptosi double %mul3.i33.1.3 to i32 %spec.select42.1.3 = select i1 %cmp1.i27.1.3, i32 %conv4.i34.1.3, i32 %add.i31.1.3 %spec.select.1.3 = call i32 @llvm.smin.i32(i32 %spec.select42.1.3, i32 %spec.select.3) %cmp1.i27.2.3 = icmp ult i32 %4, 2147483646 %mul2.i30.2.3 = mul nsw i32 %add7, %2 %add.i31.2.3 = add nsw i32 %mul2.i30.2.3, %mul.i29.3 %conv.i32.2.3 = sitofp i32 %add.i31.2.3 to double %mul3.i33.2.3 = fmul double %conv.i32.2.3, 8.000000e-01 %conv4.i34.2.3 = fptosi double %mul3.i33.2.3 to i32 %spec.select42.2.3 = select i1 %cmp1.i27.2.3, i32 %conv4.i34.2.3, i32 %add.i31.2.3 %spec.select.2.3 = call i32 @llvm.smin.i32(i32 %spec.select42.2.3, i32 %spec.select.1.3) br label %for.inc12.3 for.inc12.3: ; preds = %for.body9.preheader.3, %for.body9.1.3, %for.body9.us.preheader.3, %for.body9.us.1.3 %.us-phi.3 = phi i32 [ %spec.select.us.3, %for.body9.us.preheader.3 ], [ %spec.select.us.2.3, %for.body9.us.1.3 ], [ %spec.select.3, %for.body9.preheader.3 ], [ %spec.select.2.3, %for.body9.1.3 ] %inc13.3 = add i32 %.fr, 4 %cmp.i26.4 = icmp sgt i32 %inc13.3, 4 %mul.i29.4 = mul nsw i32 %inc13.3, %1 %add.i31.4 = add nsw i32 %mul2.i, %mul.i29.4 br i1 %cmp.i26.4, label %for.body9.preheader.4, label %for.body9.us.preheader.4 for.body9.us.preheader.4: ; preds = %for.inc12.3 %spec.select.us.4 = call i32 @llvm.smin.i32(i32 %add.i31.4, i32 %.us-phi.3) %exitcond.4.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond.4.not.not, label %for.body9.us.1.4, label %for.inc12.4, !llvm.loop !9 for.body9.us.1.4: ; preds = %for.body9.us.preheader.4 %inc.us.4 = add nsw i32 %4, 1 %mul2.i30.us.1.4 = mul nsw i32 %inc.us.4, %2 %add.i31.us.1.4 = add nsw i32 %mul2.i30.us.1.4, %mul.i29.4 %spec.select.us.1.4 = call i32 @llvm.smin.i32(i32 %add.i31.us.1.4, i32 %spec.select.us.4) %mul2.i30.us.2.4 = mul nsw i32 %add7, %2 %add.i31.us.2.4 = add nsw i32 %mul2.i30.us.2.4, %mul.i29.4 %spec.select.us.2.4 = call i32 @llvm.smin.i32(i32 %add.i31.us.2.4, i32 %spec.select.us.1.4) br label %for.inc12.4 for.body9.preheader.4: ; preds = %for.inc12.3 %conv.i32.4 = sitofp i32 %add.i31.4 to double %mul3.i33.4 = fmul double %conv.i32.4, 8.000000e-01 %conv4.i34.4 = fptosi double %mul3.i33.4 to i32 %spec.select42.4 = select i1 %cmp1.i, i32 %conv4.i34.4, i32 %add.i31.4 %spec.select.4 = call i32 @llvm.smin.i32(i32 %spec.select42.4, i32 %.us-phi.3) %exitcond45.4.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond45.4.not.not, label %for.body9.1.4, label %for.inc12.4, !llvm.loop !9 for.body9.1.4: ; preds = %for.body9.preheader.4 %inc.4 = add nsw i32 %4, 1 %cmp1.i27.1.4 = icmp sgt i32 %4, 0 %mul2.i30.1.4 = mul nsw i32 %inc.4, %2 %add.i31.1.4 = add nsw i32 %mul2.i30.1.4, %mul.i29.4 %conv.i32.1.4 = sitofp i32 %add.i31.1.4 to double %mul3.i33.1.4 = fmul double %conv.i32.1.4, 8.000000e-01 %conv4.i34.1.4 = fptosi double %mul3.i33.1.4 to i32 %spec.select42.1.4 = select i1 %cmp1.i27.1.4, i32 %conv4.i34.1.4, i32 %add.i31.1.4 %spec.select.1.4 = call i32 @llvm.smin.i32(i32 %spec.select42.1.4, i32 %spec.select.4) %cmp1.i27.2.4 = icmp ult i32 %4, 2147483646 %mul2.i30.2.4 = mul nsw i32 %add7, %2 %add.i31.2.4 = add nsw i32 %mul2.i30.2.4, %mul.i29.4 %conv.i32.2.4 = sitofp i32 %add.i31.2.4 to double %mul3.i33.2.4 = fmul double %conv.i32.2.4, 8.000000e-01 %conv4.i34.2.4 = fptosi double %mul3.i33.2.4 to i32 %spec.select42.2.4 = select i1 %cmp1.i27.2.4, i32 %conv4.i34.2.4, i32 %add.i31.2.4 %spec.select.2.4 = call i32 @llvm.smin.i32(i32 %spec.select42.2.4, i32 %spec.select.1.4) br label %for.inc12.4 for.inc12.4: ; preds = %for.body9.preheader.4, %for.body9.1.4, %for.body9.us.preheader.4, %for.body9.us.1.4 %.us-phi.4 = phi i32 [ %spec.select.us.4, %for.body9.us.preheader.4 ], [ %spec.select.us.2.4, %for.body9.us.1.4 ], [ %spec.select.4, %for.body9.preheader.4 ], [ %spec.select.2.4, %for.body9.1.4 ] %cmp.i26.5 = icmp ult i32 %.fr, 2147483643 %mul.i29.5 = mul nsw i32 %add, %1 %add.i31.5 = add nsw i32 %mul2.i, %mul.i29.5 br i1 %cmp.i26.5, label %for.body9.preheader.5, label %for.body9.us.preheader.5 for.body9.us.preheader.5: ; preds = %for.inc12.4 %spec.select.us.5 = call i32 @llvm.smin.i32(i32 %add.i31.5, i32 %.us-phi.4) %exitcond.5.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond.5.not.not, label %for.body9.us.1.5, label %for.end14, !llvm.loop !9 for.body9.us.1.5: ; preds = %for.body9.us.preheader.5 %inc.us.5 = add nsw i32 %4, 1 %mul2.i30.us.1.5 = mul nsw i32 %inc.us.5, %2 %add.i31.us.1.5 = add nsw i32 %mul2.i30.us.1.5, %mul.i29.5 %spec.select.us.1.5 = call i32 @llvm.smin.i32(i32 %add.i31.us.1.5, i32 %spec.select.us.5) %mul2.i30.us.2.5 = mul nsw i32 %add7, %2 %add.i31.us.2.5 = add nsw i32 %mul2.i30.us.2.5, %mul.i29.5 %spec.select.us.2.5 = call i32 @llvm.smin.i32(i32 %add.i31.us.2.5, i32 %spec.select.us.1.5) br label %for.end14 for.body9.preheader.5: ; preds = %for.inc12.4 %conv.i32.5 = sitofp i32 %add.i31.5 to double %mul3.i33.5 = fmul double %conv.i32.5, 8.000000e-01 %conv4.i34.5 = fptosi double %mul3.i33.5 to i32 %spec.select42.5 = select i1 %cmp1.i, i32 %conv4.i34.5, i32 %add.i31.5 %spec.select.5 = call i32 @llvm.smin.i32(i32 %spec.select42.5, i32 %.us-phi.4) %exitcond45.5.not.not = icmp slt i32 %4, 2147483646 br i1 %exitcond45.5.not.not, label %for.body9.1.5, label %for.end14, !llvm.loop !9 for.body9.1.5: ; preds = %for.body9.preheader.5 %inc.5 = add nsw i32 %4, 1 %cmp1.i27.1.5 = icmp sgt i32 %4, 0 %mul2.i30.1.5 = mul nsw i32 %inc.5, %2 %add.i31.1.5 = add nsw i32 %mul2.i30.1.5, %mul.i29.5 %conv.i32.1.5 = sitofp i32 %add.i31.1.5 to double %mul3.i33.1.5 = fmul double %conv.i32.1.5, 8.000000e-01 %conv4.i34.1.5 = fptosi double %mul3.i33.1.5 to i32 %spec.select42.1.5 = select i1 %cmp1.i27.1.5, i32 %conv4.i34.1.5, i32 %add.i31.1.5 %spec.select.1.5 = call i32 @llvm.smin.i32(i32 %spec.select42.1.5, i32 %spec.select.5) %cmp1.i27.2.5 = icmp ult i32 %4, 2147483646 %mul2.i30.2.5 = mul nsw i32 %add7, %2 %add.i31.2.5 = add nsw i32 %mul2.i30.2.5, %mul.i29.5 %conv.i32.2.5 = sitofp i32 %add.i31.2.5 to double %mul3.i33.2.5 = fmul double %conv.i32.2.5, 8.000000e-01 %conv4.i34.2.5 = fptosi double %mul3.i33.2.5 to i32 %spec.select42.2.5 = select i1 %cmp1.i27.2.5, i32 %conv4.i34.2.5, i32 %add.i31.2.5 %spec.select.2.5 = call i32 @llvm.smin.i32(i32 %spec.select42.2.5, i32 %spec.select.1.5) br label %for.end14 for.end14: ; preds = %for.body9.us.1.5, %for.body9.us.preheader.5, %for.body9.1.5, %for.body9.preheader.5, %for.inc12 %.us-phi.lcssa = phi i32 [ %.us-phi, %for.inc12 ], [ %spec.select.us.5, %for.body9.us.preheader.5 ], [ %spec.select.us.2.5, %for.body9.us.1.5 ], [ %spec.select.5, %for.body9.preheader.5 ], [ %spec.select.2.5, %for.body9.1.5 ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi.lcssa) %inc17 = add nuw nsw i32 %i.041, 1 %5 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc17, %5 br i1 %cmp, label %for.body, label %for.end18, !llvm.loop !12 for.end18: ; preds = %for.end14, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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}
#include<stdio.h> int main(void) { int n,x,y,b,p,a,i,max,j,k; scanf("%d",&n); for(i=0;i<n;i++){ max=12001; scanf("%d %d %d %d",&x,&y,&b,&p); for(j=b;j<=6;j++){ for(k=p;k<=6;k++){ a=x*j+y*k; if(j>=5&&k>=2){ a=a*0.8; } if(a<max){ max=a; } } } printf("%d\n",max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124866/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %b = alloca i32, align 4 %p = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp53 = icmp sgt i32 %0, 0 br i1 %cmp53, label %for.body, label %for.end23 for.body: ; preds = %entry, %for.end19 %i.054 = phi i32 [ %inc22, %for.end19 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %b, ptr noundef nonnull %p) %1 = load i32, ptr %b, align 4, !tbaa !5 %.fr = freeze i32 %1 %cmp337 = icmp slt i32 %.fr, 7 br i1 %cmp337, label %for.body4.lr.ph, label %for.end19 for.body4.lr.ph: ; preds = %for.body %2 = load i32, ptr %p, align 4, !tbaa !5 %cmp634 = icmp slt i32 %2, 7 %3 = load i32, ptr %x, align 4 %4 = load i32, ptr %y, align 4 br i1 %cmp634, label %for.body4.us.preheader, label %for.end19 for.body4.us.preheader: ; preds = %for.body4.lr.ph %5 = sub i32 7, %2 %min.iters.check = icmp ult i32 %5, 8 %n.vec70 = and i32 %5, -8 %ind.end71 = add i32 %2, %n.vec70 %.splatinsert76 = insertelement <4 x i32> poison, i32 %2, i64 0 %.splat77 = shufflevector <4 x i32> %.splatinsert76, <4 x i32> poison, <4 x i32> zeroinitializer %induction78 = add <4 x i32> %.splat77, <i32 0, i32 1, i32 2, i32 3> %broadcast.splatinsert87 = insertelement <4 x i32> poison, i32 %4, i64 0 %broadcast.splat88 = shufflevector <4 x i32> %broadcast.splatinsert87, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n73 = icmp eq i32 %5, %n.vec70 %n.vec = and i32 %5, -8 %ind.end = add i32 %2, %n.vec %.splatinsert = insertelement <4 x i32> poison, i32 %2, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %4, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %5, %n.vec br label %for.body4.us for.body4.us: ; preds = %for.body4.us.preheader, %for.cond5.for.inc17_crit_edge.us %j.039.us = phi i32 [ %inc18.us, %for.cond5.for.inc17_crit_edge.us ], [ %.fr, %for.body4.us.preheader ] %max.038.us = phi i32 [ %.us-phi.us, %for.cond5.for.inc17_crit_edge.us ], [ 12001, %for.body4.us.preheader ] %mul.us = mul nsw i32 %3, %j.039.us %cmp9.us = icmp sgt i32 %j.039.us, 4 br i1 %cmp9.us, label %for.body7.us41.preheader, label %for.body7.us.us.preheader for.body7.us.us.preheader: ; preds = %for.body4.us br i1 %min.iters.check, label %for.body7.us.us.preheader95, label %vector.ph68 vector.ph68: ; preds = %for.body7.us.us.preheader %minmax.ident.splatinsert85 = insertelement <4 x i32> poison, i32 %max.038.us, i64 0 %minmax.ident.splat86 = shufflevector <4 x i32> %minmax.ident.splatinsert85, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert89 = insertelement <4 x i32> poison, i32 %mul.us, i64 0 %broadcast.splat90 = shufflevector <4 x i32> %broadcast.splatinsert89, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body74 vector.body74: ; preds = %vector.body74, %vector.ph68 %index75 = phi i32 [ 0, %vector.ph68 ], [ %index.next91, %vector.body74 ] %vec.ind79 = phi <4 x i32> [ %induction78, %vector.ph68 ], [ %vec.ind.next82, %vector.body74 ] %vec.phi83 = phi <4 x i32> [ %minmax.ident.splat86, %vector.ph68 ], [ %10, %vector.body74 ] %vec.phi84 = phi <4 x i32> [ %minmax.ident.splat86, %vector.ph68 ], [ %11, %vector.body74 ] %step.add80 = add <4 x i32> %vec.ind79, <i32 4, i32 4, i32 4, i32 4> %6 = mul nsw <4 x i32> %broadcast.splat88, %vec.ind79 %7 = mul nsw <4 x i32> %broadcast.splat88, %step.add80 %8 = add nsw <4 x i32> %6, %broadcast.splat90 %9 = add nsw <4 x i32> %7, %broadcast.splat90 %10 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %8, <4 x i32> %vec.phi83) %11 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %9, <4 x i32> %vec.phi84) %index.next91 = add nuw i32 %index75, 8 %vec.ind.next82 = add <4 x i32> %vec.ind79, <i32 8, i32 8, i32 8, i32 8> %12 = icmp eq i32 %index.next91, %n.vec70 br i1 %12, label %middle.block65, label %vector.body74, !llvm.loop !9 middle.block65: ; preds = %vector.body74 %rdx.minmax92 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %10, <4 x i32> %11) %13 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax92) br i1 %cmp.n73, label %for.cond5.for.inc17_crit_edge.us, label %for.body7.us.us.preheader95 for.body7.us.us.preheader95: ; preds = %for.body7.us.us.preheader, %middle.block65 %k.036.us.us.ph = phi i32 [ %2, %for.body7.us.us.preheader ], [ %ind.end71, %middle.block65 ] %max.135.us.us.ph = phi i32 [ %max.038.us, %for.body7.us.us.preheader ], [ %13, %middle.block65 ] br label %for.body7.us.us for.body7.us41.preheader: ; preds = %for.body4.us br i1 %min.iters.check, label %for.body7.us41.preheader94, label %vector.ph vector.ph: ; preds = %for.body7.us41.preheader %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %max.038.us, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert63 = insertelement <4 x i32> poison, i32 %mul.us, i64 0 %broadcast.splat64 = shufflevector <4 x i32> %broadcast.splatinsert63, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %28, %vector.body ] %vec.phi62 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %29, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %14 = mul nsw <4 x i32> %broadcast.splat, %vec.ind %15 = mul nsw <4 x i32> %broadcast.splat, %step.add %16 = add nsw <4 x i32> %14, %broadcast.splat64 %17 = add nsw <4 x i32> %15, %broadcast.splat64 %18 = icmp sgt <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1> %19 = icmp sgt <4 x i32> %step.add, <i32 1, i32 1, i32 1, i32 1> %20 = sitofp <4 x i32> %16 to <4 x double> %21 = sitofp <4 x i32> %17 to <4 x double> %22 = fmul <4 x double> %20, <double 8.000000e-01, double 8.000000e-01, double 8.000000e-01, double 8.000000e-01> %23 = fmul <4 x double> %21, <double 8.000000e-01, double 8.000000e-01, double 8.000000e-01, double 8.000000e-01> %24 = fptosi <4 x double> %22 to <4 x i32> %25 = fptosi <4 x double> %23 to <4 x i32> %26 = select <4 x i1> %18, <4 x i32> %24, <4 x i32> %16 %27 = select <4 x i1> %19, <4 x i32> %25, <4 x i32> %17 %28 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %26, <4 x i32> %vec.phi) %29 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %27, <4 x i32> %vec.phi62) %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %30 = icmp eq i32 %index.next, %n.vec br i1 %30, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %28, <4 x i32> %29) %31 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) br i1 %cmp.n, label %for.cond5.for.inc17_crit_edge.us, label %for.body7.us41.preheader94 for.body7.us41.preheader94: ; preds = %for.body7.us41.preheader, %middle.block %k.036.us42.ph = phi i32 [ %2, %for.body7.us41.preheader ], [ %ind.end, %middle.block ] %max.135.us43.ph = phi i32 [ %max.038.us, %for.body7.us41.preheader ], [ %31, %middle.block ] br label %for.body7.us41 for.body7.us41: ; preds = %for.body7.us41.preheader94, %for.body7.us41 %k.036.us42 = phi i32 [ %inc.us49, %for.body7.us41 ], [ %k.036.us42.ph, %for.body7.us41.preheader94 ] %max.135.us43 = phi i32 [ %max.2.us48, %for.body7.us41 ], [ %max.135.us43.ph, %for.body7.us41.preheader94 ] %mul8.us44 = mul nsw i32 %4, %k.036.us42 %add.us45 = add nsw i32 %mul8.us44, %mul.us %cmp10.us = icmp sgt i32 %k.036.us42, 1 %conv.us = sitofp i32 %add.us45 to double %mul11.us = fmul double %conv.us, 8.000000e-01 %conv12.us = fptosi double %mul11.us to i32 %spec.select = select i1 %cmp10.us, i32 %conv12.us, i32 %add.us45 %max.2.us48 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %max.135.us43) %inc.us49 = add i32 %k.036.us42, 1 %exitcond57.not = icmp eq i32 %inc.us49, 7 br i1 %exitcond57.not, label %for.cond5.for.inc17_crit_edge.us, label %for.body7.us41, !llvm.loop !14 for.cond5.for.inc17_crit_edge.us: ; preds = %for.body7.us.us, %for.body7.us41, %middle.block65, %middle.block %.us-phi.us = phi i32 [ %31, %middle.block ], [ %13, %middle.block65 ], [ %max.2.us48, %for.body7.us41 ], [ %max.2.us.us, %for.body7.us.us ] %inc18.us = add nsw i32 %j.039.us, 1 %exitcond58.not = icmp eq i32 %inc18.us, 7 br i1 %exitcond58.not, label %for.end19, label %for.body4.us, !llvm.loop !15 for.body7.us.us: ; preds = %for.body7.us.us.preheader95, %for.body7.us.us %k.036.us.us = phi i32 [ %inc.us.us, %for.body7.us.us ], [ %k.036.us.us.ph, %for.body7.us.us.preheader95 ] %max.135.us.us = phi i32 [ %max.2.us.us, %for.body7.us.us ], [ %max.135.us.us.ph, %for.body7.us.us.preheader95 ] %mul8.us.us = mul nsw i32 %4, %k.036.us.us %add.us.us = add nsw i32 %mul8.us.us, %mul.us %max.2.us.us = call i32 @llvm.smin.i32(i32 %add.us.us, i32 %max.135.us.us) %inc.us.us = add i32 %k.036.us.us, 1 %exitcond.not = icmp eq i32 %inc.us.us, 7 br i1 %exitcond.not, label %for.cond5.for.inc17_crit_edge.us, label %for.body7.us.us, !llvm.loop !16 for.end19: ; preds = %for.cond5.for.inc17_crit_edge.us, %for.body4.lr.ph, %for.body %max.0.lcssa = phi i32 [ 12001, %for.body ], [ 12001, %for.body4.lr.ph ], [ %.us-phi.us, %for.cond5.for.inc17_crit_edge.us ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) %inc22 = add nuw nsw i32 %i.054, 1 %32 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc22, %32 br i1 %cmp, label %for.body, label %for.end23, !llvm.loop !17 for.end23: ; preds = %for.end19, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.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, !11, !12} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10}
#include<stdio.h> int main(void){ int n; scanf("%d", &n); if(64<n && n<91) puts("1"); else if(96<n && n<123) puts("2"); else puts("0"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124916/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124916/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"1\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %1 = add i32 %0, -65 %or.cond = icmp ult i32 %1, 26 %2 = add i32 %0, -97 %or.cond11 = icmp ult i32 %2, 26 %.str.2..str.3 = select i1 %or.cond11, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %or.cond, ptr @.str.1, ptr %.str.2..str.3 %call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @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)"}
#include <stdio.h> int main() { int x; scanf("%d", &x); if (x >= 30) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_124967/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_124967/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int X; scanf("%d",&X); if(X >=30) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125009/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125009/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { int i,n,res,c[102],flag,co; while(scanf("%d",&n)!=EOF){ res=flag=co=c[0]=c[n+1]=0; for(i=1;i<=n;i++){ scanf("%d,",&c[i]); if(c[i]==1) co++; } for(i=1;i<=n;i++){ if(c[i]==1){ res++; flag++; }else if((c[i-1]+c[i+1]>1)&&res>0&&flag!=co){ res++; } } printf("%d\n",res); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12506/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12506/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d,\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %c = alloca [102 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %c) #3 %call62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not63 = icmp eq i32 %call62, -1 br i1 %cmp.not63, label %while.end, label %while.body while.body: ; preds = %entry, %for.end35 %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %idxprom = sext i32 %add to i64 %arrayidx = getelementptr inbounds [102 x i32], ptr %c, i64 0, i64 %idxprom store i32 0, ptr %arrayidx, align 4, !tbaa !5 store i32 0, ptr %c, align 16, !tbaa !5 %cmp2.not53 = icmp slt i32 %0, 1 br i1 %cmp2.not53, label %for.end35, label %for.body for.cond10.preheader: ; preds = %for.body %cmp11.not57 = icmp slt i32 %3, 1 br i1 %cmp11.not57, label %for.end35, label %for.body12.preheader for.body12.preheader: ; preds = %for.cond10.preheader %1 = add nuw i32 %3, 1 %wide.trip.count = zext i32 %1 to i64 br label %for.body12 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.body ] %co.055 = phi i32 [ %spec.select, %for.body ], [ 0, %while.body ] %arrayidx4 = getelementptr inbounds [102 x i32], ptr %c, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx4) %2 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp8 = icmp eq i32 %2, 1 %inc = zext i1 %cmp8 to i32 %spec.select = add nuw nsw i32 %co.055, %inc %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.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp2.not.not, label %for.body, label %for.cond10.preheader, !llvm.loop !9 for.body12: ; preds = %for.body12.preheader, %for.inc33 %indvars.iv66 = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next67.pre-phi, %for.inc33 ] %flag.060 = phi i32 [ 0, %for.body12.preheader ], [ %flag.1, %for.inc33 ] %res.059 = phi i32 [ 0, %for.body12.preheader ], [ %res.1, %for.inc33 ] %arrayidx14 = getelementptr inbounds [102 x i32], ptr %c, i64 0, i64 %indvars.iv66 %5 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %cmp15 = icmp eq i32 %5, 1 br i1 %cmp15, label %if.then16, label %if.else if.then16: ; preds = %for.body12 %inc18 = add nsw i32 %flag.060, 1 %.pre = add nuw nsw i64 %indvars.iv66, 1 br label %for.inc33 if.else: ; preds = %for.body12 %6 = add nsw i64 %indvars.iv66, -1 %arrayidx20 = getelementptr inbounds [102 x i32], ptr %c, i64 0, i64 %6 %7 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %8 = add nuw nsw i64 %indvars.iv66, 1 %idxprom22 = and i64 %8, 4294967295 %arrayidx23 = getelementptr inbounds [102 x i32], ptr %c, i64 0, i64 %idxprom22 %9 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %add24 = add nsw i32 %9, %7 %cmp25 = icmp sgt i32 %add24, 1 %cmp26 = icmp ne i32 %res.059, 0 %or.cond.not52.not = select i1 %cmp25, i1 %cmp26, i1 false %cmp28.not = icmp ne i32 %flag.060, %spec.select %or.cond50 = select i1 %or.cond.not52.not, i1 %cmp28.not, i1 false %inc30 = zext i1 %or.cond50 to i32 br label %for.inc33 for.inc33: ; preds = %if.else, %if.then16 %indvars.iv.next67.pre-phi = phi i64 [ %8, %if.else ], [ %.pre, %if.then16 ] %inc30.pn = phi i32 [ %inc30, %if.else ], [ 1, %if.then16 ] %flag.1 = phi i32 [ %flag.060, %if.else ], [ %inc18, %if.then16 ] %res.1 = add nuw nsw i32 %res.059, %inc30.pn %exitcond.not = icmp eq i64 %indvars.iv.next67.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.end35, label %for.body12, !llvm.loop !11 for.end35: ; preds = %for.inc33, %while.body, %for.cond10.preheader %res.0.lcssa = phi i32 [ 0, %for.cond10.preheader ], [ 0, %while.body ], [ %res.1, %for.inc33 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %for.end35, %entry call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int X; scanf("%d",&X); if(X>=30) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125102/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125102/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int x; scanf("%d",&x); if (x>=30) { printf("Yes"); } else { printf("No"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125153/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125153/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int X; scanf("%d",&X); if (X>=30) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125203/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125203/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { //code int x; scanf("%d",&x); if(x>=30) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125247/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125247/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int X; scanf("%d",&X); if(X>=30) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125290/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125290/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> void main(void){ int X; scanf("%d",&X); if(X>=30) puts("Yes"); else puts("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125340/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125340/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main(){ int x; scanf("%d",&x); if(x>=30)printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125384/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125384/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 29 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#define _CRT_SECURE_NO_WARNINGS //#define _USE_MATH_DEFINES #include<stdio.h> //#include<stdlib.h> //#include<math.h> //#include<string.h> //#include<time.h> //#define pi acos(-1.0) #define P(type,x) fprintf(stdout,"%"#type"\n",x) typedef struct { int index, cnt; }TRIP; void sort(TRIP[], int); int main() { int i, n, m,j,a; TRIP d[100] = {}; char *sep; while (fscanf(stdin, "%d%d", &n, &m), n, m) { while (n--) { for (i = 0; i < m; i++) { d[i].index = i + 1; fscanf(stdin, "%d", &a); d[i].cnt += a; } } sort(d, m); for (i = 0,sep=""; i < m; i++,sep=" ") fprintf(stdout, "%s%d",sep, d[i].index); puts(""); for (i = 0; i < m; i++) d[i].cnt = 0; } return 0; } void sort(TRIP d[], int m){ TRIP tmp; int i, j; for (i = 0; i < m; i++) for (j = 0; j<m-1; j++) if (d[j].cnt < d[j + 1].cnt) tmp = d[j], d[j] = d[j + 1], d[j + 1] = tmp; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125434/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125434/source.c" target datalayout = "e-m:e-p270: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.TRIP = type { i32, i32 } @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 @.str.2 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.3 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c" \00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca i32, align 4 %d = alloca [100 x %struct.TRIP], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %d) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %d, i8 0, i64 800, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call49 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) #7 %1 = load i32, ptr %m, align 4, !tbaa !9 %tobool.not50 = icmp eq i32 %1, 0 br i1 %tobool.not50, label %while.end28, label %while.cond1.preheader while.cond.loopexit.loopexit.unr-lcssa: ; preds = %for.body21, %for.body21.preheader %indvars.iv56.unr = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next57.7, %for.body21 ] %lcmp.mod67.not = icmp eq i64 %xtraiter66, 0 br i1 %lcmp.mod67.not, label %while.cond.loopexit, label %for.body21.epil for.body21.epil: ; preds = %while.cond.loopexit.loopexit.unr-lcssa, %for.body21.epil %indvars.iv56.epil = phi i64 [ %indvars.iv.next57.epil, %for.body21.epil ], [ %indvars.iv56.unr, %while.cond.loopexit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body21.epil ], [ 0, %while.cond.loopexit.loopexit.unr-lcssa ] %cnt24.epil = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv56.epil, i32 1 store i32 0, ptr %cnt24.epil, align 4, !tbaa !11 %indvars.iv.next57.epil = add nuw nsw i64 %indvars.iv56.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter66 br i1 %epil.iter.cmp.not, label %while.cond.loopexit, label %for.body21.epil, !llvm.loop !13 while.cond.loopexit: ; preds = %while.cond.loopexit.loopexit.unr-lcssa, %for.body21.epil, %for.end17 %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) #7 %3 = load i32, ptr %m, align 4, !tbaa !9 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end28, label %while.cond1.preheader, !llvm.loop !15 while.cond1.preheader: ; preds = %entry, %while.cond.loopexit %4 = phi i32 [ %3, %while.cond.loopexit ], [ %1, %entry ] %5 = load i32, ptr %n, align 4, !tbaa !9 %dec41 = add nsw i32 %5, -1 store i32 %dec41, ptr %n, align 4, !tbaa !9 %tobool2.not42 = icmp eq i32 %5, 0 br i1 %tobool2.not42, label %while.end, label %for.cond.preheader.lr.ph for.cond.preheader.lr.ph: ; preds = %while.cond1.preheader %6 = icmp sgt i32 %4, 0 br i1 %6, label %for.cond.preheader, label %sort.exit.thread sort.exit.thread: ; preds = %for.cond.preheader.lr.ph store i32 -1, ptr %n, align 4, !tbaa !9 br label %for.end17 while.cond1.loopexit.loopexit: ; preds = %for.body %.pre = load i32, ptr %n, align 4, !tbaa !9 br label %while.cond1.loopexit while.cond1.loopexit: ; preds = %while.cond1.loopexit.loopexit, %for.cond.preheader %7 = phi i32 [ %.pre, %while.cond1.loopexit.loopexit ], [ %9, %for.cond.preheader ] %8 = phi i32 [ %15, %while.cond1.loopexit.loopexit ], [ %10, %for.cond.preheader ] %dec = add nsw i32 %7, -1 store i32 %dec, ptr %n, align 4, !tbaa !9 %tobool2.not = icmp eq i32 %7, 0 br i1 %tobool2.not, label %while.end, label %for.cond.preheader, !llvm.loop !17 for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %while.cond1.loopexit %9 = phi i32 [ %dec, %while.cond1.loopexit ], [ %dec41, %for.cond.preheader.lr.ph ] %10 = phi i32 [ %8, %while.cond1.loopexit ], [ %4, %for.cond.preheader.lr.ph ] %cmp39 = icmp sgt i32 %10, 0 br i1 %cmp39, label %for.body, label %while.cond1.loopexit for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv %11 = trunc i64 %indvars.iv.next to i32 store i32 %11, ptr %arrayidx, align 8, !tbaa !19 %12 = load ptr, ptr @stdin, align 8, !tbaa !5 %call4 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %12, ptr noundef nonnull @.str.1, ptr noundef nonnull %a) #7 %13 = load i32, ptr %a, align 4, !tbaa !9 %cnt = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv, i32 1 %14 = load i32, ptr %cnt, align 4, !tbaa !11 %add7 = add nsw i32 %14, %13 store i32 %add7, ptr %cnt, align 4, !tbaa !11 %15 = load i32, ptr %m, align 4, !tbaa !9 %16 = sext i32 %15 to i64 %cmp = icmp slt i64 %indvars.iv.next, %16 br i1 %cmp, label %for.body, label %while.cond1.loopexit.loopexit, !llvm.loop !20 while.end: ; preds = %while.cond1.loopexit, %while.cond1.preheader %17 = phi i32 [ %4, %while.cond1.preheader ], [ %8, %while.cond1.loopexit ] %or.cond = icmp slt i32 %17, 2 br i1 %or.cond, label %sort.exit, label %for.cond1.preheader.us.preheader.i for.cond1.preheader.us.preheader.i: ; preds = %while.end %sub.i = add i32 %17, -1 %wide.trip.count.i = zext i32 %sub.i to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %18 = icmp eq i32 %sub.i, 1 %unroll_iter = and i64 %wide.trip.count.i, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond1.preheader.us.i for.cond1.preheader.us.i: ; preds = %for.cond1.for.inc18_crit_edge.us.i, %for.cond1.preheader.us.preheader.i %i.038.us.i = phi i32 [ %inc19.us.i, %for.cond1.for.inc18_crit_edge.us.i ], [ 0, %for.cond1.preheader.us.preheader.i ] br i1 %18, label %for.cond1.for.inc18_crit_edge.us.i.unr-lcssa, label %for.body3.us.i for.body3.us.i: ; preds = %for.cond1.preheader.us.i, %for.inc.us.i.1 %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.us.i.1 ], [ 0, %for.cond1.preheader.us.i ] %niter = phi i64 [ %niter.next.1, %for.inc.us.i.1 ], [ 0, %for.cond1.preheader.us.i ] %cnt.us.i = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.i, i32 1 %19 = load i32, ptr %cnt.us.i, align 4, !tbaa !11 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %cnt6.us.i = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.i, i32 1 %20 = load i32, ptr %cnt6.us.i, align 4, !tbaa !11 %cmp7.us.i = icmp slt i32 %19, %20 br i1 %cmp7.us.i, label %if.then.us.i, label %for.inc.us.i if.then.us.i: ; preds = %for.body3.us.i %arrayidx.us.i = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.i %21 = load <2 x i64>, ptr %arrayidx.us.i, align 16 %22 = shufflevector <2 x i64> %21, <2 x i64> poison, <2 x i32> <i32 1, i32 0> store <2 x i64> %22, ptr %arrayidx.us.i, align 16 br label %for.inc.us.i for.inc.us.i: ; preds = %if.then.us.i, %for.body3.us.i %cnt.us.i.1 = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.i, i32 1 %23 = load i32, ptr %cnt.us.i.1, align 4, !tbaa !11 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %cnt6.us.i.1 = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.i.1, i32 1 %24 = load i32, ptr %cnt6.us.i.1, align 4, !tbaa !11 %cmp7.us.i.1 = icmp slt i32 %23, %24 br i1 %cmp7.us.i.1, label %if.then.us.i.1, label %for.inc.us.i.1 if.then.us.i.1: ; preds = %for.inc.us.i %arrayidx.us.i.1 = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.i %25 = load <2 x i64>, ptr %arrayidx.us.i.1, align 8 %26 = shufflevector <2 x i64> %25, <2 x i64> poison, <2 x i32> <i32 1, i32 0> store <2 x i64> %26, ptr %arrayidx.us.i.1, align 8 br label %for.inc.us.i.1 for.inc.us.i.1: ; preds = %if.then.us.i.1, %for.inc.us.i %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.cond1.for.inc18_crit_edge.us.i.unr-lcssa, label %for.body3.us.i, !llvm.loop !21 for.cond1.for.inc18_crit_edge.us.i.unr-lcssa: ; preds = %for.inc.us.i.1, %for.cond1.preheader.us.i %indvars.iv.i.unr = phi i64 [ 0, %for.cond1.preheader.us.i ], [ %indvars.iv.next.i.1, %for.inc.us.i.1 ] br i1 %lcmp.mod.not, label %for.cond1.for.inc18_crit_edge.us.i, label %for.body3.us.i.epil for.body3.us.i.epil: ; preds = %for.cond1.for.inc18_crit_edge.us.i.unr-lcssa %cnt.us.i.epil = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.i.unr, i32 1 %27 = load i32, ptr %cnt.us.i.epil, align 4, !tbaa !11 %indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.unr, 1 %cnt6.us.i.epil = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.i.epil, i32 1 %28 = load i32, ptr %cnt6.us.i.epil, align 4, !tbaa !11 %cmp7.us.i.epil = icmp slt i32 %27, %28 br i1 %cmp7.us.i.epil, label %if.then.us.i.epil, label %for.cond1.for.inc18_crit_edge.us.i if.then.us.i.epil: ; preds = %for.body3.us.i.epil %arrayidx.us.i.epil = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.i.unr %29 = load <2 x i64>, ptr %arrayidx.us.i.epil, align 8 %30 = shufflevector <2 x i64> %29, <2 x i64> poison, <2 x i32> <i32 1, i32 0> store <2 x i64> %30, ptr %arrayidx.us.i.epil, align 8 br label %for.cond1.for.inc18_crit_edge.us.i for.cond1.for.inc18_crit_edge.us.i: ; preds = %for.body3.us.i.epil, %if.then.us.i.epil, %for.cond1.for.inc18_crit_edge.us.i.unr-lcssa %inc19.us.i = add nuw nsw i32 %i.038.us.i, 1 %exitcond41.not.i = icmp eq i32 %inc19.us.i, %17 br i1 %exitcond41.not.i, label %sort.exit, label %for.cond1.preheader.us.i, !llvm.loop !22 sort.exit: ; preds = %for.cond1.for.inc18_crit_edge.us.i, %while.end %cmp944 = icmp sgt i32 %17, 0 br i1 %cmp944, label %for.body10.preheader, label %for.end17 for.body10.preheader: ; preds = %sort.exit %31 = load ptr, ptr @stdout, align 8, !tbaa !5 %32 = load i32, ptr %d, align 16, !tbaa !19 %call14.peel = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef %32) %33 = load i32, ptr %m, align 4, !tbaa !9 %cmp9.peel = icmp sgt i32 %33, 1 br i1 %cmp9.peel, label %for.body10, label %for.end17 for.body10: ; preds = %for.body10.preheader, %for.body10 %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body10 ], [ 1, %for.body10.preheader ] %34 = load ptr, ptr @stdout, align 8, !tbaa !5 %arrayidx12 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv52 %35 = load i32, ptr %arrayidx12, align 8, !tbaa !19 %call14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef %35) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %36 = load i32, ptr %m, align 4, !tbaa !9 %37 = sext i32 %36 to i64 %cmp9 = icmp slt i64 %indvars.iv.next53, %37 br i1 %cmp9, label %for.body10, label %for.end17, !llvm.loop !23 for.end17: ; preds = %for.body10, %for.body10.preheader, %sort.exit.thread, %sort.exit %putchar = call i32 @putchar(i32 10) %38 = load i32, ptr %m, align 4, !tbaa !9 %cmp2047 = icmp sgt i32 %38, 0 br i1 %cmp2047, label %for.body21.preheader, label %while.cond.loopexit for.body21.preheader: ; preds = %for.end17 %wide.trip.count = zext i32 %38 to i64 %xtraiter66 = and i64 %wide.trip.count, 7 %39 = icmp ult i32 %38, 8 br i1 %39, label %while.cond.loopexit.loopexit.unr-lcssa, label %for.body21.preheader.new for.body21.preheader.new: ; preds = %for.body21.preheader %unroll_iter68 = and i64 %wide.trip.count, 4294967288 br label %for.body21 for.body21: ; preds = %for.body21, %for.body21.preheader.new %indvars.iv56 = phi i64 [ 0, %for.body21.preheader.new ], [ %indvars.iv.next57.7, %for.body21 ] %niter69 = phi i64 [ 0, %for.body21.preheader.new ], [ %niter69.next.7, %for.body21 ] %cnt24 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv56, i32 1 store i32 0, ptr %cnt24, align 4, !tbaa !11 %indvars.iv.next57 = or i64 %indvars.iv56, 1 %cnt24.1 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57, i32 1 store i32 0, ptr %cnt24.1, align 4, !tbaa !11 %indvars.iv.next57.1 = or i64 %indvars.iv56, 2 %cnt24.2 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57.1, i32 1 store i32 0, ptr %cnt24.2, align 4, !tbaa !11 %indvars.iv.next57.2 = or i64 %indvars.iv56, 3 %cnt24.3 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57.2, i32 1 store i32 0, ptr %cnt24.3, align 4, !tbaa !11 %indvars.iv.next57.3 = or i64 %indvars.iv56, 4 %cnt24.4 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57.3, i32 1 store i32 0, ptr %cnt24.4, align 4, !tbaa !11 %indvars.iv.next57.4 = or i64 %indvars.iv56, 5 %cnt24.5 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57.4, i32 1 store i32 0, ptr %cnt24.5, align 4, !tbaa !11 %indvars.iv.next57.5 = or i64 %indvars.iv56, 6 %cnt24.6 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57.5, i32 1 store i32 0, ptr %cnt24.6, align 4, !tbaa !11 %indvars.iv.next57.6 = or i64 %indvars.iv56, 7 %cnt24.7 = getelementptr inbounds [100 x %struct.TRIP], ptr %d, i64 0, i64 %indvars.iv.next57.6, i32 1 store i32 0, ptr %cnt24.7, align 4, !tbaa !11 %indvars.iv.next57.7 = add nuw nsw i64 %indvars.iv56, 8 %niter69.next.7 = add i64 %niter69, 8 %niter69.ncmp.7 = icmp eq i64 %niter69.next.7, %unroll_iter68 br i1 %niter69.ncmp.7, label %while.cond.loopexit.loopexit.unr-lcssa, label %for.body21, !llvm.loop !25 while.end28: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %d) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort(ptr nocapture noundef %d, i32 noundef %m) local_unnamed_addr #4 { entry: %or.cond = icmp slt i32 %m, 2 br i1 %or.cond, label %for.end20, label %for.cond1.preheader.us.preheader for.cond1.preheader.us.preheader: ; preds = %entry %sub = add i32 %m, -1 %wide.trip.count = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %sub, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc18_crit_edge.us %i.038.us = phi i32 [ %inc19.us, %for.cond1.for.inc18_crit_edge.us ], [ 0, %for.cond1.preheader.us.preheader ] br i1 %0, label %for.cond1.for.inc18_crit_edge.us.unr-lcssa, label %for.body3.us for.body3.us: ; preds = %for.cond1.preheader.us, %for.inc.us.1 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.us.1 ], [ 0, %for.cond1.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc.us.1 ], [ 0, %for.cond1.preheader.us ] %cnt.us = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv, i32 1 %1 = load i32, ptr %cnt.us, align 4, !tbaa !11 %indvars.iv.next = or i64 %indvars.iv, 1 %cnt6.us = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next, i32 1 %2 = load i32, ptr %cnt6.us, align 4, !tbaa !11 %cmp7.us = icmp slt i32 %1, %2 br i1 %cmp7.us, label %if.then.us, label %for.inc.us if.then.us: ; preds = %for.body3.us %arrayidx.us = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv %3 = load <2 x i64>, ptr %arrayidx.us, align 4 %4 = shufflevector <2 x i64> %3, <2 x i64> poison, <2 x i32> <i32 1, i32 0> store <2 x i64> %4, ptr %arrayidx.us, align 4 br label %for.inc.us for.inc.us: ; preds = %if.then.us, %for.body3.us %cnt.us.1 = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next, i32 1 %5 = load i32, ptr %cnt.us.1, align 4, !tbaa !11 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %cnt6.us.1 = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.1, i32 1 %6 = load i32, ptr %cnt6.us.1, align 4, !tbaa !11 %cmp7.us.1 = icmp slt i32 %5, %6 br i1 %cmp7.us.1, label %if.then.us.1, label %for.inc.us.1 if.then.us.1: ; preds = %for.inc.us %arrayidx.us.1 = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next %7 = load <2 x i64>, ptr %arrayidx.us.1, align 4 %8 = shufflevector <2 x i64> %7, <2 x i64> poison, <2 x i32> <i32 1, i32 0> store <2 x i64> %8, ptr %arrayidx.us.1, align 4 br label %for.inc.us.1 for.inc.us.1: ; preds = %if.then.us.1, %for.inc.us %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.cond1.for.inc18_crit_edge.us.unr-lcssa, label %for.body3.us, !llvm.loop !21 for.cond1.for.inc18_crit_edge.us.unr-lcssa: ; preds = %for.inc.us.1, %for.cond1.preheader.us %indvars.iv.unr = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next.1, %for.inc.us.1 ] br i1 %lcmp.mod.not, label %for.cond1.for.inc18_crit_edge.us, label %for.body3.us.epil for.body3.us.epil: ; preds = %for.cond1.for.inc18_crit_edge.us.unr-lcssa %cnt.us.epil = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.unr, i32 1 %9 = load i32, ptr %cnt.us.epil, align 4, !tbaa !11 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1 %cnt6.us.epil = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.next.epil, i32 1 %10 = load i32, ptr %cnt6.us.epil, align 4, !tbaa !11 %cmp7.us.epil = icmp slt i32 %9, %10 br i1 %cmp7.us.epil, label %if.then.us.epil, label %for.cond1.for.inc18_crit_edge.us if.then.us.epil: ; preds = %for.body3.us.epil %arrayidx.us.epil = getelementptr inbounds %struct.TRIP, ptr %d, i64 %indvars.iv.unr %11 = load <2 x i64>, ptr %arrayidx.us.epil, align 4 %12 = shufflevector <2 x i64> %11, <2 x i64> poison, <2 x i32> <i32 1, i32 0> store <2 x i64> %12, ptr %arrayidx.us.epil, align 4 br label %for.cond1.for.inc18_crit_edge.us for.cond1.for.inc18_crit_edge.us: ; preds = %for.body3.us.epil, %if.then.us.epil, %for.cond1.for.inc18_crit_edge.us.unr-lcssa %inc19.us = add nuw nsw i32 %i.038.us, 1 %exitcond41.not = icmp eq i32 %inc19.us, %m br i1 %exitcond41.not, label %for.end20, label %for.cond1.preheader.us, !llvm.loop !22 for.end20: ; preds = %for.cond1.for.inc18_crit_edge.us, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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, !10, i64 4} !12 = !{!"", !10, i64 0, !10, i64 4} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = distinct !{!17, !16, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = !{!12, !10, i64 0} !20 = distinct !{!20, !16} !21 = distinct !{!21, !16} !22 = distinct !{!22, !16} !23 = distinct !{!23, !16, !24} !24 = !{!"llvm.loop.peeled.count", i32 1} !25 = distinct !{!25, !16}
#include <stdio.h> int main(){ int t; scanf("%d",&t); while(t--){ int n,m,i,j,k; scanf("%d%d",&n,&m); printf("W"); for(i=1;i<m;i++) printf("B"); printf("\n"); for(i=1;i<n;i++){ for(j=0;j<m;j++) printf("B"); printf("\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1255/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1255/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec33 = add nsw i32 %0, -1 store i32 %dec33, ptr %t, align 4, !tbaa !5 %tobool.not34 = icmp eq i32 %0, 0 br i1 %tobool.not34, label %while.end, label %while.body while.body: ; preds = %entry, %for.end18 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m) %putchar = call i32 @putchar(i32 87) %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 1 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %while.body, %for.body %i.028 = phi i32 [ %inc, %for.body ], [ 1, %while.body ] %putchar26 = call i32 @putchar(i32 66) %inc = add nuw nsw i32 %i.028, 1 %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %putchar23 = call i32 @putchar(i32 10) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp631 = icmp sgt i32 %3, 1 br i1 %cmp631, label %for.cond8.preheader, label %for.end18 for.cond8.preheader: ; preds = %for.end, %for.end14 %i.132 = phi i32 [ %inc17, %for.end14 ], [ 1, %for.end ] %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp929 = icmp sgt i32 %4, 0 br i1 %cmp929, label %for.body10, label %for.end14 for.body10: ; preds = %for.cond8.preheader, %for.body10 %j.030 = phi i32 [ %inc13, %for.body10 ], [ 0, %for.cond8.preheader ] %putchar25 = call i32 @putchar(i32 66) %inc13 = add nuw nsw i32 %j.030, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %cmp9 = icmp slt i32 %inc13, %5 br i1 %cmp9, label %for.body10, label %for.end14, !llvm.loop !11 for.end14: ; preds = %for.body10, %for.cond8.preheader %putchar24 = call i32 @putchar(i32 10) %inc17 = add nuw nsw i32 %i.132, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc17, %6 br i1 %cmp6, label %for.cond8.preheader, label %for.end18, !llvm.loop !12 for.end18: ; preds = %for.end14, %for.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 %7 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %7, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %7, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %for.end18, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int n,i,counter=0,k; scanf("%d %d",&n,&k); int drinks[1001]={1}; int odd=0,even=0; for(i=0;i<n;i++) { int input; scanf("%d",&input); drinks[input]++; } for(i=0;i<1001;i++) { even+=drinks[i]/2; odd+=drinks[i]%2; } int maximum=(n/2)+(n%2)-even; int result=even*2+maximum; printf("%d",result); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12555/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12555/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %drinks = alloca [1001 x i32], align 16 %input = 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 %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %drinks) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %drinks, i8 0, i64 4004, i1 false) store i32 1, ptr %drinks, align 16 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %0, 0 br i1 %cmp26, label %for.body, label %vector.ph vector.ph: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %16, %for.body ] br label %vector.body vector.body: ; preds = %vector.body.1, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next.1, %vector.body.1 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body.1 ] %vec.phi34 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body.1 ] %1 = getelementptr inbounds [1001 x i32], ptr %drinks, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 %wide.load35 = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = sdiv <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2> %4 = sdiv <4 x i32> %wide.load35, <i32 2, i32 2, i32 2, i32 2> %5 = add <4 x i32> %3, %vec.phi %6 = add <4 x i32> %4, %vec.phi34 %index.next = or i64 %index, 8 %7 = icmp eq i64 %index.next, 1000 br i1 %7, label %for.body5, label %vector.body.1, !llvm.loop !9 vector.body.1: ; preds = %vector.body %8 = getelementptr inbounds [1001 x i32], ptr %drinks, i64 0, i64 %index.next %wide.load.1 = load <4 x i32>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load35.1 = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = sdiv <4 x i32> %wide.load.1, <i32 2, i32 2, i32 2, i32 2> %11 = sdiv <4 x i32> %wide.load35.1, <i32 2, i32 2, i32 2, i32 2> %12 = add <4 x i32> %10, %5 %13 = add <4 x i32> %11, %6 %index.next.1 = add nuw nsw i64 %index, 16 br label %vector.body for.body: ; preds = %entry, %for.body %i.027 = phi i32 [ %inc2, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %input) %14 = load i32, ptr %input, align 4, !tbaa !5 %idxprom = sext i32 %14 to i64 %arrayidx = getelementptr inbounds [1001 x i32], ptr %drinks, i64 0, i64 %idxprom %15 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %15, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input) #5 %inc2 = add nuw nsw i32 %i.027, 1 %16 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc2, %16 br i1 %cmp, label %for.body, label %vector.ph, !llvm.loop !13 for.body5: ; preds = %vector.body %bin.rdx = add <4 x i32> %6, %5 %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %arrayidx7 = getelementptr inbounds [1001 x i32], ptr %drinks, i64 0, i64 1000 %18 = load i32, ptr %arrayidx7, align 16, !tbaa !5 %div = sdiv i32 %18, 2 %add = add nsw i32 %div, %17 %div14 = sdiv i32 %.lcssa, 2 %rem15 = srem i32 %.lcssa, 2 %add16 = add nsw i32 %div14, %rem15 %sub = sub i32 %add16, %add %mul = shl nsw i32 %add, 1 %add17 = add nsw i32 %sub, %mul %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add17) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %drinks) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10}
#include <stdio.h> long long dp[2][100001]; int arr[2][100001]; int main(void){ int n, i; scanf("%d", &n); for(i=1; i<=n; ++i){ scanf("%d", &arr[0][i]); } for(i=1; i<=n; ++i){ scanf("%d", &arr[1][i]); } dp[0][1]=(long long)arr[0][1]; dp[1][1]=(long long)arr[1][1]; for(i=2; i<=n; ++i){ dp[0][i]=((dp[1][i-1]>dp[1][i-2])?dp[1][i-1]:dp[1][i-2])+(long long)arr[0][i]; dp[1][i]=((dp[0][i-1]>dp[0][i-2])?dp[0][i-1]:dp[0][i-2])+(long long)arr[1][i]; } printf("%lld", ((dp[0][n]>dp[1][n])?dp[0][n]:dp[1][n])); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12560/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12560/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @arr = dso_local global [2 x [100001 x i32]] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [2 x [100001 x i64]] zeroinitializer, align 16 @.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: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not102 = icmp slt i32 %0, 1 br i1 %cmp.not102, label %for.end10.thread, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3.not104 = icmp slt i32 %1, 1 br i1 %cmp3.not104, label %for.end10.thread, label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100001 x i32], ptr @arr, 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.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.body4 ], [ 1, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [2 x [100001 x i32]], ptr @arr, i64 0, i64 1, i64 %indvars.iv110 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp3.not.not = icmp slt i64 %indvars.iv110, %4 br i1 %cmp3.not.not, label %for.body4, label %for.end10, !llvm.loop !11 for.end10.thread: ; preds = %for.cond2.preheader, %entry %.lcssa.ph = phi i32 [ %1, %for.cond2.preheader ], [ %0, %entry ] %5 = load i32, ptr getelementptr inbounds ([2 x [100001 x i32]], ptr @arr, i64 0, i64 0, i64 1), align 4, !tbaa !5 %conv120 = sext i32 %5 to i64 store i64 %conv120, ptr getelementptr inbounds ([2 x [100001 x i64]], ptr @dp, i64 0, i64 0, i64 1), align 8, !tbaa !12 %6 = load i32, ptr getelementptr inbounds ([2 x [100001 x i32]], ptr @arr, i64 0, i64 1, i64 1), align 8, !tbaa !5 %conv11121 = sext i32 %6 to i64 store i64 %conv11121, ptr getelementptr inbounds ([2 x [100001 x i64]], ptr @dp, i64 0, i64 1, i64 1), align 16, !tbaa !12 br label %for.end60 for.end10: ; preds = %for.body4 %7 = load i32, ptr getelementptr inbounds ([2 x [100001 x i32]], ptr @arr, i64 0, i64 0, i64 1), align 4, !tbaa !5 %conv = sext i32 %7 to i64 store i64 %conv, ptr getelementptr inbounds ([2 x [100001 x i64]], ptr @dp, i64 0, i64 0, i64 1), align 8, !tbaa !12 %8 = load i32, ptr getelementptr inbounds ([2 x [100001 x i32]], ptr @arr, i64 0, i64 1, i64 1), align 8, !tbaa !5 %conv11 = sext i32 %8 to i64 store i64 %conv11, ptr getelementptr inbounds ([2 x [100001 x i64]], ptr @dp, i64 0, i64 1, i64 1), align 16, !tbaa !12 %cmp13.not106 = icmp slt i32 %3, 2 br i1 %cmp13.not106, label %for.end60, label %for.body15.preheader for.body15.preheader: ; preds = %for.end10 %9 = add nuw i32 %3, 1 %wide.trip.count = zext i32 %9 to i64 br label %for.body15 for.body15: ; preds = %for.body15.preheader, %for.body15 %10 = phi i64 [ %conv, %for.body15.preheader ], [ %add, %for.body15 ] %11 = phi i64 [ %conv11, %for.body15.preheader ], [ %add55, %for.body15 ] %indvars.iv113 = phi i64 [ 2, %for.body15.preheader ], [ %indvars.iv.next114, %for.body15 ] %12 = add nsw i64 %indvars.iv113, -2 %arrayidx20 = getelementptr inbounds [2 x [100001 x i64]], ptr @dp, i64 0, i64 1, i64 %12 %13 = load i64, ptr %arrayidx20, align 8, !tbaa !12 %. = call i64 @llvm.smax.i64(i64 %11, i64 %13) %arrayidx30 = getelementptr inbounds [100001 x i32], ptr @arr, i64 0, i64 %indvars.iv113 %14 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %conv31 = sext i32 %14 to i64 %add = add nsw i64 %., %conv31 %arrayidx33 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %indvars.iv113 store i64 %add, ptr %arrayidx33, align 8, !tbaa !12 %arrayidx39 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %12 %15 = load i64, ptr %arrayidx39, align 8, !tbaa !12 %cond51 = call i64 @llvm.smax.i64(i64 %10, i64 %15) %arrayidx53 = getelementptr inbounds [2 x [100001 x i32]], ptr @arr, i64 0, i64 1, i64 %indvars.iv113 %16 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %conv54 = sext i32 %16 to i64 %add55 = add nsw i64 %cond51, %conv54 %arrayidx57 = getelementptr inbounds [2 x [100001 x i64]], ptr @dp, i64 0, i64 1, i64 %indvars.iv113 store i64 %add55, ptr %arrayidx57, align 8, !tbaa !12 %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %exitcond.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count br i1 %exitcond.not, label %for.end60, label %for.body15, !llvm.loop !14 for.end60: ; preds = %for.body15, %for.end10.thread, %for.end10 %.lcssa123 = phi i32 [ %.lcssa.ph, %for.end10.thread ], [ %3, %for.end10 ], [ %3, %for.body15 ] %idxprom61 = sext i32 %.lcssa123 to i64 %arrayidx62 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %idxprom61 %17 = load i64, ptr %arrayidx62, align 8, !tbaa !12 %arrayidx64 = getelementptr inbounds [2 x [100001 x i64]], ptr @dp, i64 0, i64 1, i64 %idxprom61 %18 = load i64, ptr %arrayidx64, align 8, !tbaa !12 %.101 = call i64 @llvm.smax.i64(i64 %17, i64 %18) %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.101) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!13, !13, i64 0} !13 = !{!"long long", !7, i64 0} !14 = distinct !{!14, !10}
#include <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_HUMAN_MAX 200005 // 最大人数 // 内部変数 static FILE *szpFpI; // 入力 static int si1Human[D_HUMAN_MAX]; // 人 static int siHCnt; // 人数 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpA; static int siTNo; #endif // 1行出力 int fOutLine( char *pcpLine // <I> 1行 ) { char lc1Buf[1024]; #ifdef D_TEST lc1Buf[0] = '\0'; fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, pcpLine)) { siRes = -1; } #else printf("%s", pcpLine); #endif return 0; } // 比較関数 - int降順 int fCmpFncId( const void *pzpVal1 // <I> 値1 , const void *pzpVal2 // <I> 値2 ) { int *lipVal1 = (int *)pzpVal1; int *lipVal2 = (int *)pzpVal2; // int降順 if (*lipVal1 > *lipVal2) { return -1; } else if (*lipVal1 < *lipVal2) { return 1; } return 0; } // 実行メイン int fMain( ) { int i; char lc1Buf[1024]; // 人数 - 取得 fgets(lc1Buf, sizeof(lc1Buf), szpFpI); sscanf(lc1Buf, "%d", &siHCnt); // 人 - 取得 si1Human[0] = 0; for (i = 0; i < siHCnt; i++) { fscanf(szpFpI, "%d", &si1Human[i]); } fgets(lc1Buf, sizeof(lc1Buf), szpFpI); qsort(si1Human, siHCnt, sizeof(int), fCmpFncId); // 合計 - 取得 long long llSum = 0; for (i = 1; i < siHCnt; i++) { llSum += si1Human[i / 2]; } // 出力 sprintf(lc1Buf, "%lld\n", llSum); fOutLine(lc1Buf); return 0; } // 1回実行 int fOne( ) { int liRet; char lc1Buf[1024]; // 入力 - セット #ifdef D_TEST sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo); szpFpI = fopen(lc1Buf, "r"); sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo); szpFpA = fopen(lc1Buf, "r"); siRes = 0; #else szpFpI = stdin; #endif // 実行メイン liRet = fMain(); // 残データ有無 #ifdef D_TEST lc1Buf[0] = '\0'; fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, "")) { siRes = -1; } #endif // テストファイルクローズ #ifdef D_TEST fclose(szpFpI); fclose(szpFpA); #endif // テスト結果 #ifdef D_TEST if (siRes == 0) { printf("OK %d\n", siTNo); } else { printf("NG %d\n", siTNo); } #endif return 0; } // プログラム開始 int main() { #ifdef D_TEST int i; for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) { siTNo = i; fOne(); } #else fOne(); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125658/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125658/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @szpFpI = internal unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @siHCnt = internal global i32 0, align 4 @si1Human = internal global [200005 x i32] zeroinitializer, align 16 @.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 @fOutLine(ptr noundef %pcpLine) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %pcpLine) ret i32 0 } ; Function Attrs: mustprogress nocallback nofree 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @fCmpFncId(ptr nocapture noundef readonly %pzpVal1, ptr nocapture noundef readonly %pzpVal2) #3 { entry: %0 = load i32, ptr %pzpVal1, align 4, !tbaa !5 %1 = load i32, ptr %pzpVal2, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp slt i32 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @fMain() local_unnamed_addr #4 { entry: %lc1Buf = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #7 %0 = load ptr, ptr @szpFpI, align 8, !tbaa !9 %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.1, ptr noundef nonnull @siHCnt) #7 store i32 0, ptr @si1Human, align 16, !tbaa !5 %1 = load i32, ptr @siHCnt, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %2 = load ptr, ptr @szpFpI, align 8, !tbaa !9 %arrayidx = getelementptr inbounds [200005 x i32], ptr @si1Human, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) #7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @siHCnt, 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 !11 for.end: ; preds = %for.body, %entry %5 = load ptr, ptr @szpFpI, align 8, !tbaa !9 %call5 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %5) %6 = load i32, ptr @siHCnt, align 4, !tbaa !5 %conv = sext i32 %6 to i64 call void @qsort(ptr noundef nonnull @si1Human, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @fCmpFncId) #7 %7 = load i32, ptr @siHCnt, align 4, !tbaa !5 %cmp729 = icmp sgt i32 %7, 1 br i1 %cmp729, label %for.body9.preheader, label %for.end15 for.body9.preheader: ; preds = %for.end %8 = add i32 %7, -1 %9 = add i32 %7, -2 %xtraiter = and i32 %8, 3 %10 = icmp ult i32 %9, 3 br i1 %10, label %for.end15.loopexit.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = and i32 %8, -4 br label %for.body9 for.body9: ; preds = %for.body9, %for.body9.preheader.new %llSum.031 = phi i64 [ 0, %for.body9.preheader.new ], [ %add.3, %for.body9 ] %i.130 = phi i32 [ 1, %for.body9.preheader.new ], [ %inc14.3, %for.body9 ] %niter = phi i32 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ] %div26 = lshr i32 %i.130, 1 %idxprom10 = zext i32 %div26 to i64 %arrayidx11 = getelementptr inbounds [200005 x i32], ptr @si1Human, i64 0, i64 %idxprom10 %11 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %conv12 = sext i32 %11 to i64 %add = add nsw i64 %llSum.031, %conv12 %inc14 = add nuw nsw i32 %i.130, 1 %div26.1 = lshr i32 %inc14, 1 %idxprom10.1 = zext i32 %div26.1 to i64 %arrayidx11.1 = getelementptr inbounds [200005 x i32], ptr @si1Human, i64 0, i64 %idxprom10.1 %12 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5 %conv12.1 = sext i32 %12 to i64 %add.1 = add nsw i64 %add, %conv12.1 %div26.2 = lshr i32 %inc14, 1 %idxprom10.2 = zext i32 %div26.2 to i64 %arrayidx11.2 = getelementptr inbounds [200005 x i32], ptr @si1Human, i64 0, i64 %idxprom10.2 %13 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5 %conv12.2 = sext i32 %13 to i64 %add.2 = add nsw i64 %add.1, %conv12.2 %inc14.2 = add nuw nsw i32 %i.130, 3 %div26.3 = lshr i32 %inc14.2, 1 %idxprom10.3 = zext i32 %div26.3 to i64 %arrayidx11.3 = getelementptr inbounds [200005 x i32], ptr @si1Human, i64 0, i64 %idxprom10.3 %14 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5 %conv12.3 = sext i32 %14 to i64 %add.3 = add nsw i64 %add.2, %conv12.3 %inc14.3 = add nuw nsw i32 %i.130, 4 %niter.next.3 = add nuw i32 %niter, 4 %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end15.loopexit.unr-lcssa, label %for.body9, !llvm.loop !13 for.end15.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader %add.lcssa.ph = phi i64 [ undef, %for.body9.preheader ], [ %add.3, %for.body9 ] %llSum.031.unr = phi i64 [ 0, %for.body9.preheader ], [ %add.3, %for.body9 ] %i.130.unr = phi i32 [ 1, %for.body9.preheader ], [ %inc14.3, %for.body9 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end15, label %for.body9.epil for.body9.epil: ; preds = %for.end15.loopexit.unr-lcssa, %for.body9.epil %llSum.031.epil = phi i64 [ %add.epil, %for.body9.epil ], [ %llSum.031.unr, %for.end15.loopexit.unr-lcssa ] %i.130.epil = phi i32 [ %inc14.epil, %for.body9.epil ], [ %i.130.unr, %for.end15.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end15.loopexit.unr-lcssa ] %div26.epil = lshr i32 %i.130.epil, 1 %idxprom10.epil = zext i32 %div26.epil to i64 %arrayidx11.epil = getelementptr inbounds [200005 x i32], ptr @si1Human, i64 0, i64 %idxprom10.epil %15 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5 %conv12.epil = sext i32 %15 to i64 %add.epil = add nsw i64 %llSum.031.epil, %conv12.epil %inc14.epil = add nuw nsw i32 %i.130.epil, 1 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end15, label %for.body9.epil, !llvm.loop !14 for.end15: ; preds = %for.end15.loopexit.unr-lcssa, %for.body9.epil, %for.end %llSum.0.lcssa = phi i64 [ 0, %for.end ], [ %add.lcssa.ph, %for.end15.loopexit.unr-lcssa ], [ %add.epil, %for.body9.epil ] %call17 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %llSum.0.lcssa) #7 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #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 #5 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nounwind uwtable define dso_local i32 @fOne() local_unnamed_addr #4 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !9 store ptr %0, ptr @szpFpI, align 8, !tbaa !9 %call = tail call i32 @fMain() ret i32 0 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !9 store ptr %0, ptr @szpFpI, align 8, !tbaa !9 %call.i = tail call i32 @fMain() ret i32 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #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 = !{!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, !15} !15 = !{!"llvm.loop.unroll.disable"}
#include<stdio.h> int main(){ int i; char s[1002]; fgets(s,1002,stdin); for(i=0;s[i];i++){ if(s[i ]=='a'&& s[i+1]=='p'&& s[i+2]=='p'&& s[i+3]=='l'&& s[i+4]=='e'){ printf("peach"); i+=4; } else if(s[i ]=='p'&& s[i+1]=='e'&& s[i+2]=='a'&& s[i+3]=='c'&& s[i+4]=='h'){ printf("apple"); i+=4; } else printf("%c",s[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125722/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125722/source.c" target datalayout = "e-m:e-p270: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"peach\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"apple\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1002 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1002, ptr nonnull %s) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 1002, ptr noundef %0) br label %for.cond for.cond: ; preds = %for.inc, %entry %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %idxprom = sext i32 %i.0 to i64 %arrayidx = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 switch i8 %1, label %if.else68 [ i8 0, label %for.end i8 97, label %land.lhs.true i8 112, label %land.lhs.true37 ] land.lhs.true: ; preds = %for.cond %add = add nsw i32 %i.0, 1 %idxprom4 = sext i32 %add to i64 %arrayidx5 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom4 %2 = load i8, ptr %arrayidx5, align 1, !tbaa !9 %cmp7 = icmp eq i8 %2, 112 br i1 %cmp7, label %land.lhs.true9, label %if.else68 land.lhs.true9: ; preds = %land.lhs.true %add10 = add nsw i32 %i.0, 2 %idxprom11 = sext i32 %add10 to i64 %arrayidx12 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom11 %3 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %cmp14 = icmp eq i8 %3, 112 br i1 %cmp14, label %land.lhs.true16, label %if.else68 land.lhs.true16: ; preds = %land.lhs.true9 %add17 = add nsw i32 %i.0, 3 %idxprom18 = sext i32 %add17 to i64 %arrayidx19 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom18 %4 = load i8, ptr %arrayidx19, align 1, !tbaa !9 %cmp21 = icmp eq i8 %4, 108 br i1 %cmp21, label %land.lhs.true23, label %if.else68 land.lhs.true23: ; preds = %land.lhs.true16 %add24 = add nsw i32 %i.0, 4 %idxprom25 = sext i32 %add24 to i64 %arrayidx26 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom25 %5 = load i8, ptr %arrayidx26, align 1, !tbaa !9 %cmp28 = icmp eq i8 %5, 101 br i1 %cmp28, label %if.then, label %if.else68 if.then: ; preds = %land.lhs.true23 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str) br label %for.inc land.lhs.true37: ; preds = %for.cond %add38 = add nsw i32 %i.0, 1 %idxprom39 = sext i32 %add38 to i64 %arrayidx40 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom39 %6 = load i8, ptr %arrayidx40, align 1, !tbaa !9 %cmp42 = icmp eq i8 %6, 101 br i1 %cmp42, label %land.lhs.true44, label %if.else68 land.lhs.true44: ; preds = %land.lhs.true37 %add45 = add nsw i32 %i.0, 2 %idxprom46 = sext i32 %add45 to i64 %arrayidx47 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom46 %7 = load i8, ptr %arrayidx47, align 1, !tbaa !9 %cmp49 = icmp eq i8 %7, 97 br i1 %cmp49, label %land.lhs.true51, label %if.else68 land.lhs.true51: ; preds = %land.lhs.true44 %add52 = add nsw i32 %i.0, 3 %idxprom53 = sext i32 %add52 to i64 %arrayidx54 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom53 %8 = load i8, ptr %arrayidx54, align 1, !tbaa !9 %cmp56 = icmp eq i8 %8, 99 br i1 %cmp56, label %land.lhs.true58, label %if.else68 land.lhs.true58: ; preds = %land.lhs.true51 %add59 = add nsw i32 %i.0, 4 %idxprom60 = sext i32 %add59 to i64 %arrayidx61 = getelementptr inbounds [1002 x i8], ptr %s, i64 0, i64 %idxprom60 %9 = load i8, ptr %arrayidx61, align 1, !tbaa !9 %cmp63 = icmp eq i8 %9, 104 br i1 %cmp63, label %if.then65, label %if.else68 if.then65: ; preds = %land.lhs.true58 %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %for.inc if.else68: ; preds = %for.cond, %land.lhs.true, %land.lhs.true9, %land.lhs.true16, %land.lhs.true23, %land.lhs.true58, %land.lhs.true51, %land.lhs.true44, %land.lhs.true37 %conv71 = sext i8 %1 to i32 %putchar = call i32 @putchar(i32 %conv71) br label %for.inc for.inc: ; preds = %if.then, %if.else68, %if.then65 %i.1 = phi i32 [ %add24, %if.then ], [ %add59, %if.then65 ], [ %i.0, %if.else68 ] %inc = add nsw i32 %i.1, 1 br label %for.cond, !llvm.loop !10 for.end: ; preds = %for.cond call void @llvm.lifetime.end.p0(i64 1002, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; 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} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ char s[11]; int i; scanf("%s\n",s); int len,x=0; for(len=0;s[len]!='\0';len++); if(len%2==1){ printf("No\n"); return 0; } for(i=0;i<len/2;i++){ if(s[i*2]!='h')x++; if(s[i*2+1]!='i')x++; } if(x==0)printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125852/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125852/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\0A\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %for.cond for.cond: ; preds = %for.cond, %entry %indvars.iv58 = phi i32 [ %indvars.iv.next59, %for.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next59 = add nuw i32 %indvars.iv58, 1 br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !8 for.end: ; preds = %for.cond %1 = trunc i64 %indvars.iv to i32 %rem = and i32 %1, 1 %cmp2.not = icmp eq i32 %rem, 0 br i1 %cmp2.not, label %for.cond5.preheader, label %cleanup for.cond5.preheader: ; preds = %for.end %cmp649.not = icmp ult i32 %1, 2 br i1 %cmp649.not, label %cleanup, label %for.body8.preheader for.body8.preheader: ; preds = %for.cond5.preheader %2 = lshr i32 %indvars.iv58, 1 %umax = call i32 @llvm.umax.i32(i32 %2, i32 1) %wide.trip.count = zext i32 %umax to i64 %min.iters.check = icmp ult i32 %indvars.iv58, 16 br i1 %min.iters.check, label %for.body8.preheader67, label %vector.ph vector.ph: ; preds = %for.body8.preheader %n.vec = and i64 %wide.trip.count, 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 ], [ %18, %vector.body ] %vec.phi62 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ] %3 = shl nuw nsw i64 %index, 1 %4 = shl i64 %index, 1 %5 = or i64 %4, 8 %6 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %3 %7 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %5 %wide.vec = load <8 x i8>, ptr %6, align 1, !tbaa !5 %wide.vec63 = load <8 x i8>, ptr %7, align 1, !tbaa !5 %strided.vec = shufflevector <8 x i8> %wide.vec, <8 x i8> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec64 = shufflevector <8 x i8> %wide.vec63, <8 x i8> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec65 = shufflevector <8 x i8> %wide.vec, <8 x i8> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> %strided.vec66 = shufflevector <8 x i8> %wide.vec63, <8 x i8> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> %8 = icmp ne <4 x i8> %strided.vec, <i8 104, i8 104, i8 104, i8 104> %9 = icmp ne <4 x i8> %strided.vec64, <i8 104, i8 104, i8 104, i8 104> %10 = zext <4 x i1> %8 to <4 x i32> %11 = zext <4 x i1> %9 to <4 x i32> %12 = add <4 x i32> %vec.phi, %10 %13 = add <4 x i32> %vec.phi62, %11 %14 = icmp ne <4 x i8> %strided.vec65, <i8 105, i8 105, i8 105, i8 105> %15 = icmp ne <4 x i8> %strided.vec66, <i8 105, i8 105, i8 105, i8 105> %16 = zext <4 x i1> %14 to <4 x i32> %17 = zext <4 x i1> %15 to <4 x i32> %18 = add <4 x i32> %12, %16 %19 = add <4 x i32> %13, %17 %index.next = add nuw i64 %index, 8 %20 = icmp eq i64 %index.next, %n.vec br i1 %20, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %19, %18 %21 = 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.end28, label %for.body8.preheader67 for.body8.preheader67: ; preds = %for.body8.preheader, %middle.block %indvars.iv53.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ] %x.051.ph = phi i32 [ 0, %for.body8.preheader ], [ %21, %middle.block ] br label %for.body8 for.body8: ; preds = %for.body8.preheader67, %for.body8 %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body8 ], [ %indvars.iv53.ph, %for.body8.preheader67 ] %x.051 = phi i32 [ %x.2, %for.body8 ], [ %x.051.ph, %for.body8.preheader67 ] %22 = shl nuw nsw i64 %indvars.iv53, 1 %arrayidx10 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %22 %23 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.not = icmp ne i8 %23, 104 %inc15 = zext i1 %cmp12.not to i32 %spec.select = add nsw i32 %x.051, %inc15 %24 = or i64 %22, 1 %arrayidx19 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %24 %25 = load i8, ptr %arrayidx19, align 1, !tbaa !5 %cmp21.not = icmp ne i8 %25, 105 %inc24 = zext i1 %cmp21.not to i32 %x.2 = add nsw i32 %spec.select, %inc24 %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count br i1 %exitcond.not, label %for.end28, label %for.body8, !llvm.loop !13 for.end28: ; preds = %for.body8, %middle.block %x.2.lcssa = phi i32 [ %21, %middle.block ], [ %x.2, %for.body8 ] %26 = icmp eq i32 %x.2.lcssa, 0 %spec.select61 = select i1 %26, ptr @str.3, ptr @str.4 br label %cleanup cleanup: ; preds = %for.end28, %for.cond5.preheader, %for.end %str.3.sink = phi ptr [ @str.4, %for.end ], [ @str.3, %for.cond5.preheader ], [ %spec.select61, %for.end28 ] %puts47 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.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 = { 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9, !11, !12} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !9, !12, !11}
#include<stdio.h> #define max 100000 int main() { long long int n,k,i,s; scanf("%lld%lld",&n,&k); for(i=1;i<=n;i++) { s=i*(i+1)/2; if(i+s-k==n) { printf("%lld",s-k); break; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12591/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12591/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %k, align 8 %smax = call i64 @llvm.smax.i64(i64 %0, i64 0) %2 = add nuw i64 %smax, 1 br label %for.cond for.cond: ; preds = %for.body, %entry %i.0 = phi i64 [ 1, %entry ], [ %add, %for.body ] %exitcond = icmp eq i64 %i.0, %2 br i1 %exitcond, label %for.end, label %for.body for.body: ; preds = %for.cond %add = add nuw i64 %i.0, 1 %mul = mul nsw i64 %add, %i.0 %div10 = lshr i64 %mul, 1 %add1 = add nuw nsw i64 %div10, %i.0 %sub = sub i64 %add1, %1 %cmp2 = icmp eq i64 %sub, %0 br i1 %cmp2, label %if.then, label %for.cond, !llvm.loop !9 if.then: ; preds = %for.body %sub3 = sub nsw i64 %div10, %1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub3) br label %for.end for.end: ; preds = %for.cond, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.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} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int n, y; scanf("%d%d", &n, &y); int res_a = -1, res_b = -1, res_c = -1; int k = 0; for(int i = 0; i <= n; ++i){ for(int j = 0; j + i <= n; ++j){ k = n - i - j; if((10000 * i + 5000 * j + 1000 * k) == y){ res_a = i; res_b = j; res_c = k; break; } } } printf("%d %d %d\n", res_a, res_b, res_c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_125953/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_125953/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %y) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not34 = icmp slt i32 %0, 0 br i1 %cmp.not34, label %for.cond.cleanup, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %y, align 4, !tbaa !5 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %cleanup %i.038 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc12, %cleanup ] %res_c.037 = phi i32 [ -1, %for.cond1.preheader.lr.ph ], [ %res_c.1, %cleanup ] %res_b.036 = phi i32 [ -1, %for.cond1.preheader.lr.ph ], [ %res_b.1, %cleanup ] %res_a.035 = phi i32 [ -1, %for.cond1.preheader.lr.ph ], [ %res_a.1, %cleanup ] %mul = mul nuw nsw i32 %i.038, 10000 br label %for.body4 for.cond.cleanup: ; preds = %cleanup, %entry %res_a.0.lcssa = phi i32 [ -1, %entry ], [ %res_a.1, %cleanup ] %res_b.0.lcssa = phi i32 [ -1, %entry ], [ %res_b.1, %cleanup ] %res_c.0.lcssa = phi i32 [ -1, %entry ], [ %res_c.1, %cleanup ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res_a.0.lcssa, i32 noundef %res_b.0.lcssa, i32 noundef %res_c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body4: ; preds = %for.cond1.preheader, %for.inc %add33 = phi i32 [ %i.038, %for.cond1.preheader ], [ %add, %for.inc ] %j.032 = phi i32 [ 0, %for.cond1.preheader ], [ %inc, %for.inc ] %sub5 = sub i32 %0, %add33 %mul6 = mul nuw nsw i32 %j.032, 5000 %add7 = add nuw nsw i32 %mul6, %mul %mul8 = mul nsw i32 %sub5, 1000 %add9 = add nsw i32 %add7, %mul8 %cmp10 = icmp eq i32 %add9, %1 br i1 %cmp10, label %cleanup, label %for.inc for.inc: ; preds = %for.body4 %inc = add nuw nsw i32 %j.032, 1 %add = add nuw nsw i32 %inc, %i.038 %cmp2.not = icmp sgt i32 %add, %0 br i1 %cmp2.not, label %cleanup, label %for.body4, !llvm.loop !9 cleanup: ; preds = %for.body4, %for.inc %res_a.1 = phi i32 [ %res_a.035, %for.inc ], [ %i.038, %for.body4 ] %res_b.1 = phi i32 [ %res_b.036, %for.inc ], [ %j.032, %for.body4 ] %res_c.1 = phi i32 [ %res_c.037, %for.inc ], [ %sub5, %for.body4 ] %inc12 = add nuw i32 %i.038, 1 %exitcond.not = icmp eq i32 %i.038, %0 br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int num = 0; int sum = 0; int sub_man = 0; int sub_gosen = 0; scanf("%d",&num); scanf("%d",&sum); // printf("man:%d gosen:%d\n",sub_man,sub_gosen); for(int num_man=num; num_man>=0; num_man--){ for(int num_gosen=0; num_gosen<=num; num_gosen++){ if(sum > num_man*10000+num*5000 || num_man*10000>sum){ // printf("break\n"); break; } for(int num_sen=0; num_sen<=num; num_sen++){ if(sum > num_man*10000+num_gosen*5000+num*1000){ // printf("break\n"); break; } // printf("sum:%d 1万:%d 5千:%d 1千:%d\n",10000*num_man+5000*num_gosen+1000*num_sen,num_man,num_gosen,num_sen); if(10000*num_man+5000*num_gosen+1000*num_sen == sum && num_man+num_gosen+num_sen == num){ printf("%d %d %d\n",num_man,num_gosen,num_sen); return 0; } } } } printf("-1 -1 -1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126002/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126002/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @str = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %sum = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 store i32 0, ptr %num, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sum) #4 store i32 0, ptr %sum, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sum) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp78 = icmp slt i32 %0, 0 br i1 %cmp78, label %for.end42, label %for.cond2.preheader.lr.ph for.cond2.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %sum, align 4 %mul6 = mul nsw i32 %0, 5000 %mul17 = mul nsw i32 %0, 1000 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.inc39.critedge %num_man.079 = phi i32 [ %0, %for.cond2.preheader.lr.ph ], [ %dec, %for.inc39.critedge ] %mul = mul nsw i32 %num_man.079, 10000 %add = add nsw i32 %mul, %mul6 %cmp7 = icmp sgt i32 %1, %add %cmp9 = icmp sgt i32 %mul, %1 %or.cond = or i1 %cmp7, %cmp9 br i1 %or.cond, label %for.inc39.critedge, label %for.body5 for.body5: ; preds = %for.cond2.preheader, %for.inc34 %num_gosen.077 = phi i32 [ %inc35, %for.inc34 ], [ 0, %for.cond2.preheader ] %mul15 = mul nuw nsw i32 %num_gosen.077, 5000 %add16 = add nsw i32 %mul15, %mul %add18 = add nsw i32 %add16, %mul17 %cmp19 = icmp sgt i32 %1, %add18 %add28 = add nsw i32 %num_gosen.077, %num_man.079 br i1 %cmp19, label %for.inc34, label %for.body13 for.body13: ; preds = %for.body5, %for.inc %num_sen.075 = phi i32 [ %inc, %for.inc ], [ 0, %for.body5 ] %mul25 = mul nuw nsw i32 %num_sen.075, 1000 %add26 = add nsw i32 %mul25, %add16 %cmp27 = icmp eq i32 %add26, %1 %add29 = add nsw i32 %add28, %num_sen.075 %cmp30 = icmp eq i32 %add29, %0 %or.cond80 = select i1 %cmp27, i1 %cmp30, i1 false br i1 %or.cond80, label %if.then31, label %for.inc if.then31: ; preds = %for.body13 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num_man.079, i32 noundef %num_gosen.077, i32 noundef %num_sen.075) br label %cleanup44 for.inc: ; preds = %for.body13 %inc = add nuw i32 %num_sen.075, 1 %exitcond.not = icmp eq i32 %num_sen.075, %0 br i1 %exitcond.not, label %for.inc34, label %for.body13, !llvm.loop !9 for.inc34: ; preds = %for.inc, %for.body5 %inc35 = add nuw i32 %num_gosen.077, 1 %exitcond84.not = icmp eq i32 %num_gosen.077, %0 br i1 %exitcond84.not, label %for.inc39.critedge, label %for.body5, !llvm.loop !11 for.inc39.critedge: ; preds = %for.inc34, %for.cond2.preheader %dec = add nsw i32 %num_man.079, -1 %cmp = icmp slt i32 %num_man.079, 1 br i1 %cmp, label %for.end42, label %for.cond2.preheader, !llvm.loop !12 for.end42: ; preds = %for.inc39.critedge, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup44 cleanup44: ; preds = %if.then31, %for.end42 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sum) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int N, Y; int i, j; if (scanf("%d%d", &N, &Y) != 2) return 1; for (i = 0; i <= N; i++) { for (j = 0; j <= N - i; j++) { int k = N - i - j; if (10000 * i + 5000 * j + 1000 * k == Y) { printf("%d %d %d\n", i, j, k); return 0; } } } puts("-1 -1 -1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126046/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126046/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %Y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %cmp.not = icmp eq i32 %call, 2 br i1 %cmp.not, label %for.cond.preheader, label %cleanup18 for.cond.preheader: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp1.not36 = icmp slt i32 %0, 0 br i1 %cmp1.not36, label %for.end16, label %for.cond2.preheader.lr.ph for.cond2.preheader.lr.ph: ; preds = %for.cond.preheader %1 = load i32, ptr %Y, align 4 %2 = add nuw i32 %0, 1 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.inc14 %indvars.iv = phi i32 [ %2, %for.cond2.preheader.lr.ph ], [ %indvars.iv.next, %for.inc14 ] %i.037 = phi i32 [ 0, %for.cond2.preheader.lr.ph ], [ %inc15, %for.inc14 ] %sub = sub nsw i32 %0, %i.037 %cmp3.not34 = icmp slt i32 %sub, 0 br i1 %cmp3.not34, label %for.inc14, label %for.body4.lr.ph for.body4.lr.ph: ; preds = %for.cond2.preheader %mul = mul nsw i32 %i.037, 10000 br label %for.body4 for.body4: ; preds = %for.body4.lr.ph, %for.inc %j.035 = phi i32 [ 0, %for.body4.lr.ph ], [ %inc, %for.inc ] %sub6 = sub nsw i32 %sub, %j.035 %mul7 = mul nuw nsw i32 %j.035, 5000 %add = add nuw nsw i32 %mul7, %mul %mul8 = mul nsw i32 %sub6, 1000 %add9 = add nsw i32 %add, %mul8 %cmp10.not = icmp eq i32 %add9, %1 br i1 %cmp10.not, label %if.then11, label %for.inc if.then11: ; preds = %for.body4 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.037, i32 noundef %j.035, i32 noundef %sub6) br label %cleanup18 for.inc: ; preds = %for.body4 %inc = add nuw i32 %j.035, 1 %exitcond.not = icmp eq i32 %inc, %indvars.iv br i1 %exitcond.not, label %for.inc14, label %for.body4, !llvm.loop !9 for.inc14: ; preds = %for.inc, %for.cond2.preheader %inc15 = add nuw i32 %i.037, 1 %indvars.iv.next = add i32 %indvars.iv, -1 %exitcond41.not = icmp eq i32 %i.037, %0 br i1 %exitcond41.not, label %for.end16, label %for.cond2.preheader, !llvm.loop !11 for.end16: ; preds = %for.inc14, %for.cond.preheader %call17 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %cleanup18 cleanup18: ; preds = %if.then11, %entry, %for.end16 %retval.3 = phi i32 [ 0, %if.then11 ], [ 0, %for.end16 ], [ 1, %entry ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 %retval.3 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; 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 #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int H,M; scanf("%d:%d",&H,&M); if(H>=12) H = H-12; double hA,mA; hA = 6*H*5 + ((double)M/60)*6*5; mA = M*6; printf("%4.1lf %4.1lf\n",hA,mA); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12609/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12609/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [15 x i8] c"%4.1lf %4.1lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #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 %H, ptr noundef nonnull %M) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 11 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %sub = add nsw i32 %0, -12 store i32 %sub, ptr %H, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ %sub, %if.then ], [ %0, %entry ] %mul1 = mul i32 %1, 30 %conv = sitofp i32 %mul1 to double %2 = load i32, ptr %M, align 4, !tbaa !5 %conv2 = sitofp i32 %2 to double %div = fdiv double %conv2, 6.000000e+01 %mul3 = fmul double %div, 6.000000e+00 %3 = call double @llvm.fmuladd.f64(double %mul3, double 5.000000e+00, double %conv) %mul5 = mul nsw i32 %2, 6 %conv6 = sitofp i32 %mul5 to double %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %3, double noundef %conv6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int examin_money(int N, int SUM) { for (int i = 0; i <= N; i++) { if (10000 * i > SUM) { break; } for (int j = 0; j <= N - i; j++) { if (10000 * i + 5000 * j > SUM) { break; } int total = 10000 * i + 5000 * j + 1000 * (N - i - j); if (total == SUM) { printf("%d %d %d\n", i, j, N - i - j); return 0; } } } printf("%d %d %d\n", -1, -1, -1); return 0; } int main(void) { int n, sum; scanf("%d %d", &n, &sum); examin_money(n, sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126132/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126132/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @examin_money(i32 noundef %N, i32 noundef %SUM) local_unnamed_addr #0 { entry: %cmp.not62 = icmp slt i32 %N, 0 br i1 %cmp.not62, label %for.end29, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add nuw i32 %N, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc25 %indvars.iv = phi i32 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc25 ] %i.063 = phi i32 [ 0, %for.body.preheader ], [ %inc26, %for.inc25 ] %mul = mul nuw nsw i32 %i.063, 10000 %cmp1 = icmp sgt i32 %mul, %SUM br i1 %cmp1, label %for.end29, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body %sub = sub nsw i32 %N, %i.063 %cmp3.not60 = icmp slt i32 %sub, 0 br i1 %cmp3.not60, label %for.inc25, label %for.body5 for.body5: ; preds = %for.cond2.preheader, %for.inc %j.061 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond2.preheader ] %mul7 = mul nuw nsw i32 %j.061, 5000 %add = add nuw nsw i32 %mul7, %mul %cmp8 = icmp sgt i32 %add, %SUM br i1 %cmp8, label %for.inc25, label %if.end10 if.end10: ; preds = %for.body5 %sub15 = sub nsw i32 %sub, %j.061 %mul16 = mul nsw i32 %sub15, 1000 %add17 = add nsw i32 %add, %mul16 %cmp18.not = icmp eq i32 %add17, %SUM br i1 %cmp18.not, label %cleanup27, label %for.inc for.inc: ; preds = %if.end10 %inc = add nuw i32 %j.061, 1 %exitcond.not = icmp eq i32 %inc, %indvars.iv br i1 %exitcond.not, label %for.inc25, label %for.body5, !llvm.loop !5 for.inc25: ; preds = %for.body5, %for.inc, %for.cond2.preheader %inc26 = add nuw i32 %i.063, 1 %indvars.iv.next = add i32 %indvars.iv, -1 %exitcond66.not = icmp eq i32 %i.063, %N br i1 %exitcond66.not, label %for.end29, label %for.body, !llvm.loop !7 cleanup27: ; preds = %if.end10 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.063, i32 noundef %j.061, i32 noundef %sub15) br label %return for.end29: ; preds = %for.body, %for.inc25, %entry %call30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef -1, i32 noundef -1, i32 noundef -1) br label %return return: ; preds = %cleanup27, %for.end29 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree 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: %n = alloca i32, align 4 %sum = 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 %sum) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %sum) %0 = load i32, ptr %n, align 4, !tbaa !8 %1 = load i32, ptr %sum, align 4, !tbaa !8 %cmp.not62.i = icmp slt i32 %0, 0 br i1 %cmp.not62.i, label %for.end29.i, label %for.body.preheader.i for.body.preheader.i: ; preds = %entry %2 = add nuw i32 %0, 1 br label %for.body.i for.body.i: ; preds = %for.inc25.i, %for.body.preheader.i %indvars.iv.i = phi i32 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc25.i ] %i.063.i = phi i32 [ 0, %for.body.preheader.i ], [ %inc26.i, %for.inc25.i ] %mul.i = mul nuw nsw i32 %i.063.i, 10000 %cmp1.i = icmp sgt i32 %mul.i, %1 br i1 %cmp1.i, label %for.end29.i, label %for.cond2.preheader.i for.cond2.preheader.i: ; preds = %for.body.i %sub.i = sub nsw i32 %0, %i.063.i %cmp3.not60.i = icmp slt i32 %sub.i, 0 br i1 %cmp3.not60.i, label %for.inc25.i, label %for.body5.i for.body5.i: ; preds = %for.cond2.preheader.i, %for.inc.i %j.061.i = phi i32 [ %inc.i, %for.inc.i ], [ 0, %for.cond2.preheader.i ] %mul7.i = mul nuw nsw i32 %j.061.i, 5000 %add.i = add nuw nsw i32 %mul7.i, %mul.i %cmp8.i = icmp sgt i32 %add.i, %1 br i1 %cmp8.i, label %for.inc25.i, label %if.end10.i if.end10.i: ; preds = %for.body5.i %sub15.i = sub nsw i32 %sub.i, %j.061.i %mul16.i = mul nsw i32 %sub15.i, 1000 %add17.i = add nsw i32 %add.i, %mul16.i %cmp18.not.i = icmp eq i32 %add17.i, %1 br i1 %cmp18.not.i, label %cleanup27.i, label %for.inc.i for.inc.i: ; preds = %if.end10.i %inc.i = add nuw i32 %j.061.i, 1 %exitcond.not.i = icmp eq i32 %inc.i, %indvars.iv.i br i1 %exitcond.not.i, label %for.inc25.i, label %for.body5.i, !llvm.loop !5 for.inc25.i: ; preds = %for.inc.i, %for.body5.i, %for.cond2.preheader.i %inc26.i = add nuw i32 %i.063.i, 1 %indvars.iv.next.i = add i32 %indvars.iv.i, -1 %exitcond66.not.i = icmp eq i32 %i.063.i, %0 br i1 %exitcond66.not.i, label %for.end29.i, label %for.body.i, !llvm.loop !7 cleanup27.i: ; preds = %if.end10.i %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.063.i, i32 noundef %j.061.i, i32 noundef %sub15.i) br label %examin_money.exit for.end29.i: ; preds = %for.inc25.i, %for.body.i, %entry %call30.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef -1, i32 noundef -1, i32 noundef -1) br label %examin_money.exit examin_money.exit: ; preds = %cleanup27.i, %for.end29.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sum) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"int", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> /* 10^6のオーダーは大丈夫 */ int main(void){ int N,Y; scanf("%d %d",&N,&Y); int x,y,z; int i,j,flag=0; for(i=0;i<=N;i++){ x = i; for(j=0;j<=N-i;j++){ y = j; z = N-i-j; int m = 10000*x + 5000*y + 1000*z; if(m==Y){flag = 1;break;} } if(flag==1)break; } if(flag==1) printf("%d %d %d",x,y,z); else printf("-1 -1 -1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126176/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126176/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"-1 -1 -1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %Y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not.not52 = icmp slt i32 %0, 0 br i1 %cmp.not.not52, label %if.else, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %Y, align 4 %2 = add nuw i32 %0, 1 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc13 %indvars.iv59 = phi i32 [ %2, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next60, %for.inc13 ] %indvars.iv = phi i32 [ %0, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next, %for.inc13 ] %i.055 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc14, %for.inc13 ] %sub = sub nsw i32 %0, %i.055 %cmp2.not.not44 = icmp slt i32 %sub, 0 br i1 %cmp2.not.not44, label %for.inc13, label %for.body3.lr.ph for.body3.lr.ph: ; preds = %for.cond1.preheader %mul = mul nsw i32 %i.055, 10000 %mul769 = mul nsw i32 %sub, 1000 %add870 = add nsw i32 %mul, %mul769 %cmp971 = icmp eq i32 %add870, %1 br i1 %cmp971, label %for.end, label %for.inc for.body3: ; preds = %for.inc %sub5 = sub nsw i32 %sub, %inc %mul6 = mul nuw nsw i32 %inc, 5000 %add = add nuw nsw i32 %mul6, %mul %mul7 = mul nsw i32 %sub5, 1000 %add8 = add nsw i32 %add, %mul7 %cmp9 = icmp eq i32 %add8, %1 br i1 %cmp9, label %for.end.loopexit, label %for.inc, !llvm.loop !9 for.inc: ; preds = %for.body3.lr.ph, %for.body3 %j.04572 = phi i32 [ %inc, %for.body3 ], [ 0, %for.body3.lr.ph ] %inc = add nuw i32 %j.04572, 1 %exitcond = icmp eq i32 %inc, %indvars.iv59 br i1 %exitcond, label %for.end.loopexit, label %for.body3, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc, %for.body3 %y.2.ph = phi i32 [ %inc, %for.body3 ], [ %indvars.iv, %for.inc ] %z.2.ph = phi i32 [ %sub5, %for.body3 ], [ 0, %for.inc ] %cmp2.not.not.le = icmp sge i32 %j.04572, %sub br label %for.end for.end: ; preds = %for.end.loopexit, %for.body3.lr.ph %cmp2.not.not.lcssa = phi i1 [ false, %for.body3.lr.ph ], [ %cmp2.not.not.le, %for.end.loopexit ] %y.2 = phi i32 [ 0, %for.body3.lr.ph ], [ %y.2.ph, %for.end.loopexit ] %z.2 = phi i32 [ %sub, %for.body3.lr.ph ], [ %z.2.ph, %for.end.loopexit ] br i1 %cmp2.not.not.lcssa, label %for.inc13, label %if.then17 for.inc13: ; preds = %for.cond1.preheader, %for.end %inc14 = add nuw i32 %i.055, 1 %indvars.iv.next = add i32 %indvars.iv, -1 %indvars.iv.next60 = add i32 %indvars.iv59, -1 %exitcond61.not = icmp eq i32 %i.055, %0 br i1 %exitcond61.not, label %if.else, label %for.cond1.preheader, !llvm.loop !11 if.then17: ; preds = %for.end %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.055, i32 noundef %y.2, i32 noundef %z.2) br label %if.end20 if.else: ; preds = %for.inc13, %entry %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end20 if.end20: ; preds = %if.else, %if.then17 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { int N,Y,x,y,z,r; scanf("%d %d",&N,&Y); r = 0; for(x=0;x<=N;x++){ for(y=0;y<=N-x;y++){ z = N - x - y; if((z >= 0)&&(10000*x + 5000*y + 1000*z == Y)){ r = 1; break; } } if(r == 1){ printf("%d %d %d\n",x,y,z); break; } } if(r!=1) printf("%d %d %d\n",-1,-1,-1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126219/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126219/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %Y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %Y) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not.not40 = icmp slt i32 %0, 0 br i1 %cmp.not.not40, label %if.then19, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %Y, align 4 %2 = add nuw i32 %0, 1 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc15 %indvars.iv = phi i32 [ %2, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next, %for.inc15 ] %x.041 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc16, %for.inc15 ] %sub = sub nsw i32 %0, %x.041 %cmp2.not.not38 = icmp slt i32 %sub, 0 br i1 %cmp2.not.not38, label %for.inc15, label %for.body3.lr.ph for.body3.lr.ph: ; preds = %for.cond1.preheader %mul = mul nsw i32 %x.041, 10000 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %y.039 = phi i32 [ 0, %for.body3.lr.ph ], [ %inc, %for.inc ] %sub5 = sub nsw i32 %sub, %y.039 %cmp6 = icmp sgt i32 %sub5, -1 br i1 %cmp6, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body3 %mul7 = mul nsw i32 %y.039, 5000 %add = add nuw nsw i32 %mul7, %mul %mul8 = mul nsw i32 %sub5, 1000 %add9 = add nsw i32 %add, %mul8 %cmp10 = icmp eq i32 %add9, %1 br i1 %cmp10, label %if.then12, label %for.inc for.inc: ; preds = %for.body3, %land.lhs.true %inc = add nuw i32 %y.039, 1 %exitcond.not = icmp eq i32 %inc, %indvars.iv br i1 %exitcond.not, label %for.inc15, label %for.body3, !llvm.loop !9 if.then12: ; preds = %land.lhs.true %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.041, i32 noundef %y.039, i32 noundef %sub5) br label %if.end21 for.inc15: ; preds = %for.inc, %for.cond1.preheader %inc16 = add nuw i32 %x.041, 1 %indvars.iv.next = add i32 %indvars.iv, -1 %exitcond45.not = icmp eq i32 %x.041, %0 br i1 %exitcond45.not, label %if.then19, label %for.cond1.preheader, !llvm.loop !11 if.then19: ; preds = %for.inc15, %entry %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef -1, i32 noundef -1, i32 noundef -1) br label %if.end21 if.end21: ; preds = %if.then12, %if.then19 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> int main() { int n,m,i,k,j; scanf("%d %d",&n,&m); for(i=2;i<=(m/2);i++) { if((m%i)==0) { printf("NO\n"); return 0; } } for(j=n+1;j<m;j++) { for(i=2;i<=(j/2);i++) { if((j%i)==0) { break; } } if(i==j/2+1) break; } if(j==m) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12627/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12627/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp.not48 = icmp slt i32 %0, 4 br i1 %cmp.not48, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %div5960 = lshr i32 %0, 1 br label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.049, 1 %exitcond.not = icmp eq i32 %i.049, %div5960 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond %i.049 = phi i32 [ %inc, %for.cond ], [ 2, %for.body.preheader ] %rem = srem i32 %0, %i.049 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %cleanup, label %for.cond for.end: ; preds = %for.cond, %entry %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = add nsw i32 %1, 1 %smax58 = call i32 @llvm.smax.i32(i32 %0, i32 %2) br label %for.cond3 for.cond3: ; preds = %for.end16, %for.end %j.0.in = phi i32 [ %1, %for.end ], [ %j.0, %for.end16 ] %j.0 = add nsw i32 %j.0.in, 1 %cmp4 = icmp slt i32 %j.0, %0 br i1 %cmp4, label %for.cond6.preheader, label %for.end24 for.cond6.preheader: ; preds = %for.cond3 %div7 = sdiv i32 %j.0, 2 %cmp8.not50 = icmp slt i32 %j.0.in, 3 br i1 %cmp8.not50, label %for.end16, label %for.body9.preheader for.body9.preheader: ; preds = %for.cond6.preheader %smax56 = call i32 @llvm.smax.i32(i32 %div7, i32 2) %3 = add nuw nsw i32 %smax56, 1 br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.inc14 %i.151 = phi i32 [ %inc15, %for.inc14 ], [ 2, %for.body9.preheader ] %rem10 = srem i32 %j.0, %i.151 %cmp11 = icmp eq i32 %rem10, 0 br i1 %cmp11, label %for.end16, label %for.inc14 for.inc14: ; preds = %for.body9 %inc15 = add nuw nsw i32 %i.151, 1 %exitcond57.not = icmp eq i32 %i.151, %smax56 br i1 %exitcond57.not, label %for.end16, label %for.body9, !llvm.loop !11 for.end16: ; preds = %for.inc14, %for.body9, %for.cond6.preheader %i.1.lcssa = phi i32 [ 2, %for.cond6.preheader ], [ %i.151, %for.body9 ], [ %3, %for.inc14 ] %add18 = add nsw i32 %div7, 1 %cmp19 = icmp eq i32 %i.1.lcssa, %add18 br i1 %cmp19, label %for.end24, label %for.cond3, !llvm.loop !12 for.end24: ; preds = %for.end16, %for.cond3 %j.0.lcssa = phi i32 [ %j.0, %for.end16 ], [ %smax58, %for.cond3 ] %cmp25 = icmp eq i32 %j.0.lcssa, %0 %str.3.str = select i1 %cmp25, ptr @str.3, ptr @str.4 br label %cleanup cleanup: ; preds = %for.body, %for.end24 %str.3.sink = phi ptr [ %str.3.str, %for.end24 ], [ @str.4, %for.body ] %puts45 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int n,s,a[1001],b[1001]; scanf("%d%d",&n,&s); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) scanf("%d",&b[i]); if(a[1]==0){ printf("NO\n"); return 0; } if(a[s]==1) { printf("YES\n"); return 0; } if(b[s]==0){ printf("NO\n"); return 0;} for(int i=s+1;i<=n;i++) { if(a[i]&b[i]==1){ printf("YES\n"); return 0; } } printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12632/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca i32, align 4 %a = alloca [1001 x i32], align 16 %b = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not61 = icmp slt i32 %0, 1 br i1 %cmp.not61, label %for.cond.cleanup5, label %for.body for.cond3.preheader: ; preds = %for.body %cmp4.not63 = icmp slt i32 %1, 1 br i1 %cmp4.not63, label %for.cond.cleanup5, label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %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, %2 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.body6, %entry, %for.cond3.preheader %.lcssa = phi i32 [ %1, %for.cond3.preheader ], [ %0, %entry ], [ %4, %for.body6 ] %arrayidx13 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 1 %3 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp eq i32 %3, 0 br i1 %cmp14, label %cleanup45, label %if.end for.body6: ; preds = %for.cond3.preheader, %for.body6 %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body6 ], [ 1, %for.cond3.preheader ] %arrayidx8 = getelementptr inbounds [1001 x i32], ptr %b, i64 0, i64 %indvars.iv67 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8) %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp4.not.not = icmp slt i64 %indvars.iv67, %5 br i1 %cmp4.not.not, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11 if.end: ; preds = %for.cond.cleanup5 %6 = load i32, ptr %s, align 4, !tbaa !5 %idxprom16 = sext i32 %6 to i64 %arrayidx17 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %idxprom16 %7 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp18 = icmp eq i32 %7, 1 br i1 %cmp18, label %cleanup45, label %if.end21 if.end21: ; preds = %if.end %arrayidx23 = getelementptr inbounds [1001 x i32], ptr %b, i64 0, i64 %idxprom16 %8 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %cmp24 = icmp eq i32 %8, 0 br i1 %cmp24, label %cleanup45, label %for.cond29.preheader for.cond29.preheader: ; preds = %if.end21 %smax = call i32 @llvm.smax.i32(i32 %.lcssa, i32 %6) %wide.trip.count = sext i32 %smax to i64 br label %for.cond29 for.cond29: ; preds = %for.cond29.preheader, %for.body32 %indvars.iv70 = phi i64 [ %idxprom16, %for.cond29.preheader ], [ %indvars.iv.next71, %for.body32 ] %exitcond.not = icmp eq i64 %indvars.iv70, %wide.trip.count br i1 %exitcond.not, label %cleanup45, label %for.body32 for.body32: ; preds = %for.cond29 %indvars.iv.next71 = add nsw i64 %indvars.iv70, 1 %arrayidx34 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv.next71 %9 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %arrayidx36 = getelementptr inbounds [1001 x i32], ptr %b, i64 0, i64 %indvars.iv.next71 %10 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %cmp37 = icmp ne i32 %10, 1 %11 = and i32 %9, 1 %tobool.not56 = icmp eq i32 %11, 0 %tobool.not = select i1 %cmp37, i1 true, i1 %tobool.not56 br i1 %tobool.not, label %for.cond29, label %cleanup45, !llvm.loop !12 cleanup45: ; preds = %for.cond29, %for.body32, %if.end21, %if.end, %for.cond.cleanup5 %str.sink = phi ptr [ @str.7, %for.cond.cleanup5 ], [ @str.6, %if.end ], [ @str.7, %if.end21 ], [ @str.6, %for.body32 ], [ @str.7, %for.cond29 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #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 memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> int c[15], a[15][15]; int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } int main() { int k; scanf("%d", &k); int ans = 0; for (int i = 1; i <= k; i++) for (int j = 1; j <= k; j++) for (int l = 1; l <= k; l++) ans += gcd(gcd(i, j), l); printf("%d\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126392/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126392/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @c = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16 @a = dso_local local_unnamed_addr global [15 x [15 x i32]] zeroinitializer, align 16 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i32 %b, 0 br i1 %cmp4, label %return, label %if.else if.else: ; preds = %entry, %if.else %b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.else return: ; preds = %if.else, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not38 = icmp slt i32 %0, 1 br i1 %cmp.not38, label %for.cond.cleanup, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.cond.cleanup3_crit_edge.split %i.040 = phi i32 [ %inc15, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 1, %entry ] %ans.039 = phi i32 [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ], [ 0, %entry ] br label %for.cond5.preheader for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.split, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond1.for.cond.cleanup3_crit_edge.split ] %call17 = 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 %k) #4 ret i32 0 for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond5.for.cond.cleanup7_crit_edge %j.036 = phi i32 [ 1, %for.cond1.preheader ], [ %inc12, %for.cond5.for.cond.cleanup7_crit_edge ] %ans.135 = phi i32 [ %ans.039, %for.cond1.preheader ], [ %add, %for.cond5.for.cond.cleanup7_crit_edge ] br label %if.else.i.preheader for.cond1.for.cond.cleanup3_crit_edge.split: ; preds = %for.cond5.for.cond.cleanup7_crit_edge %inc15 = add nuw i32 %i.040, 1 %exitcond43.not = icmp eq i32 %i.040, %0 br i1 %exitcond43.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9 if.else.i.preheader: ; preds = %for.cond5.preheader, %gcd.exit30 %l.033 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %gcd.exit30 ] %ans.232 = phi i32 [ %ans.135, %for.cond5.preheader ], [ %add, %gcd.exit30 ] br label %if.else.i for.cond5.for.cond.cleanup7_crit_edge: ; preds = %gcd.exit30 %inc12 = add nuw i32 %j.036, 1 %exitcond42.not = icmp eq i32 %j.036, %0 br i1 %exitcond42.not, label %for.cond1.for.cond.cleanup3_crit_edge.split, label %for.cond5.preheader, !llvm.loop !11 if.else.i: ; preds = %if.else.i.preheader, %if.else.i %b.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %j.036, %if.else.i.preheader ] %a.tr5.i = phi i32 [ %b.tr6.i, %if.else.i ], [ %i.040, %if.else.i.preheader ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %if.else.i25, label %if.else.i if.else.i25: ; preds = %if.else.i, %if.else.i25 %b.tr6.i26 = phi i32 [ %rem.i28, %if.else.i25 ], [ %l.033, %if.else.i ] %a.tr5.i27 = phi i32 [ %b.tr6.i26, %if.else.i25 ], [ %b.tr6.i, %if.else.i ] %rem.i28 = srem i32 %a.tr5.i27, %b.tr6.i26 %cmp.i29 = icmp eq i32 %rem.i28, 0 br i1 %cmp.i29, label %gcd.exit30, label %if.else.i25 gcd.exit30: ; preds = %if.else.i25 %add = add nsw i32 %b.tr6.i26, %ans.232 %inc = add nuw i32 %l.033, 1 %exitcond.not = icmp eq i32 %l.033, %0 br i1 %exitcond.not, label %for.cond5.for.cond.cleanup7_crit_edge, label %if.else.i.preheader, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main(void){ int K,a,b,c,MIN,A =0; if((scanf("%d",&K)) == 1);; for(a=1;a<=K;a++){ for(b=1;b<=K;b++){ for(c=1;c<=K;c++){ MIN = a; if(MIN>b){ MIN= b; } if(MIN>c){ MIN = c; } for(;MIN >0;MIN--){ if(a%MIN == 0 && b%MIN == 0 && c%MIN == 0 ){ A = A + MIN; break; } } } } } printf("%d",A); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126435/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126435/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %K, align 4, !tbaa !5 %cmp1.not62 = icmp slt i32 %0, 1 br i1 %cmp1.not62, label %for.end32, label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.cond2.for.inc30_crit_edge.split %A.064 = phi i32 [ %A.3, %for.cond2.for.inc30_crit_edge.split ], [ 0, %entry ] %a.063 = phi i32 [ %inc31, %for.cond2.for.inc30_crit_edge.split ], [ 1, %entry ] br label %for.cond5.preheader for.cond5.preheader: ; preds = %for.cond2.preheader, %for.cond5.for.inc27_crit_edge %A.160 = phi i32 [ %A.064, %for.cond2.preheader ], [ %A.3, %for.cond5.for.inc27_crit_edge ] %b.059 = phi i32 [ 1, %for.cond2.preheader ], [ %inc28, %for.cond5.for.inc27_crit_edge ] %spec.select = call i32 @llvm.umin.i32(i32 %a.063, i32 %b.059) br label %for.body7 for.body7: ; preds = %for.cond5.preheader, %for.inc25 %A.257 = phi i32 [ %A.160, %for.cond5.preheader ], [ %A.3, %for.inc25 ] %c.056 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %for.inc25 ] %MIN.1 = call i32 @llvm.umin.i32(i32 %spec.select, i32 %c.056) br label %for.body16 for.body16: ; preds = %for.body7, %for.inc %MIN.254 = phi i32 [ %MIN.1, %for.body7 ], [ %dec, %for.inc ] %rem = srem i32 %a.063, %MIN.254 %cmp17 = icmp eq i32 %rem, 0 br i1 %cmp17, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body16 %rem18 = srem i32 %b.059, %MIN.254 %cmp19 = icmp eq i32 %rem18, 0 br i1 %cmp19, label %land.lhs.true20, label %for.inc land.lhs.true20: ; preds = %land.lhs.true %rem21 = srem i32 %c.056, %MIN.254 %cmp22 = icmp eq i32 %rem21, 0 br i1 %cmp22, label %if.then23, label %for.inc if.then23: ; preds = %land.lhs.true20 %add = add nsw i32 %MIN.254, %A.257 br label %for.inc25 for.inc: ; preds = %for.body16, %land.lhs.true, %land.lhs.true20 %dec = add nsw i32 %MIN.254, -1 %cmp15 = icmp sgt i32 %MIN.254, 1 br i1 %cmp15, label %for.body16, label %for.inc25, !llvm.loop !9 for.inc25: ; preds = %for.inc, %if.then23 %A.3 = phi i32 [ %add, %if.then23 ], [ %A.257, %for.inc ] %inc = add nuw i32 %c.056, 1 %exitcond.not = icmp eq i32 %c.056, %0 br i1 %exitcond.not, label %for.cond5.for.inc27_crit_edge, label %for.body7, !llvm.loop !11 for.cond5.for.inc27_crit_edge: ; preds = %for.inc25 %inc28 = add nuw i32 %b.059, 1 %exitcond67.not = icmp eq i32 %b.059, %0 br i1 %exitcond67.not, label %for.cond2.for.inc30_crit_edge.split, label %for.cond5.preheader, !llvm.loop !12 for.cond2.for.inc30_crit_edge.split: ; preds = %for.cond5.for.inc27_crit_edge %inc31 = add nuw i32 %a.063, 1 %exitcond68.not = icmp eq i32 %a.063, %0 br i1 %exitcond68.not, label %for.end32, label %for.cond2.preheader, !llvm.loop !13 for.end32: ; preds = %for.cond2.for.inc30_crit_edge.split, %entry %A.0.lcssa = phi i32 [ 0, %entry ], [ %A.3, %for.cond2.for.inc30_crit_edge.split ] %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %A.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int gcd(int a, int b); int main(void) { int K; scanf("%d", &K); int i,j,k, sum=0; for (i = 1; i <= K; i++) { for (j = 1; j <= K; j++) { for (k = 1; k <= K; k++) { sum+=gcd(gcd(i, j), k); } } } printf("%d", sum); return 0; } int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126479/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126479/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %K, align 4, !tbaa !5 %cmp.not36 = icmp slt i32 %0, 1 br i1 %cmp.not36, label %for.end14, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc12_crit_edge.split %sum.038 = phi i32 [ %add, %for.cond1.for.inc12_crit_edge.split ], [ 0, %entry ] %i.037 = phi i32 [ %inc13, %for.cond1.for.inc12_crit_edge.split ], [ 1, %entry ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc9_crit_edge %sum.134 = phi i32 [ %sum.038, %for.cond1.preheader ], [ %add, %for.cond4.for.inc9_crit_edge ] %j.033 = phi i32 [ 1, %for.cond1.preheader ], [ %inc10, %for.cond4.for.inc9_crit_edge ] br label %if.end.i.preheader if.end.i.preheader: ; preds = %for.cond4.preheader, %gcd.exit28 %sum.231 = phi i32 [ %sum.134, %for.cond4.preheader ], [ %add, %gcd.exit28 ] %k.030 = phi i32 [ 1, %for.cond4.preheader ], [ %inc, %gcd.exit28 ] br label %if.end.i if.end.i: ; preds = %if.end.i.preheader, %if.end.i %b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %j.033, %if.end.i.preheader ] %a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %i.037, %if.end.i.preheader ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %if.end.i23, label %if.end.i if.end.i23: ; preds = %if.end.i, %if.end.i23 %b.tr6.i24 = phi i32 [ %rem.i26, %if.end.i23 ], [ %k.030, %if.end.i ] %a.tr5.i25 = phi i32 [ %b.tr6.i24, %if.end.i23 ], [ %b.tr6.i, %if.end.i ] %rem.i26 = srem i32 %a.tr5.i25, %b.tr6.i24 %cmp.i27 = icmp eq i32 %rem.i26, 0 br i1 %cmp.i27, label %gcd.exit28, label %if.end.i23 gcd.exit28: ; preds = %if.end.i23 %add = add nsw i32 %b.tr6.i24, %sum.231 %inc = add nuw i32 %k.030, 1 %exitcond.not = icmp eq i32 %k.030, %0 br i1 %exitcond.not, label %for.cond4.for.inc9_crit_edge, label %if.end.i.preheader, !llvm.loop !9 for.cond4.for.inc9_crit_edge: ; preds = %gcd.exit28 %inc10 = add nuw i32 %j.033, 1 %exitcond40.not = icmp eq i32 %j.033, %0 br i1 %exitcond40.not, label %for.cond1.for.inc12_crit_edge.split, label %for.cond4.preheader, !llvm.loop !11 for.cond1.for.inc12_crit_edge.split: ; preds = %for.cond4.for.inc9_crit_edge %inc13 = add nuw i32 %i.037, 1 %exitcond41.not = icmp eq i32 %i.037, %0 br i1 %exitcond41.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !12 for.end14: ; preds = %for.cond1.for.inc12_crit_edge.split, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond1.for.inc12_crit_edge.split ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %cmp4 = icmp eq i32 %b, 0 br i1 %cmp4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> long gcd(long a, long b){ if(a % b == 0) return b; else return gcd(b, a % b); } int main(void) { int K; int a, b, c; scanf("%d", &K); long ans = 0; for(a = 1; a <= K; a++){ for(b = 1; b <= K; b++){ for(c = 1; c <= K; c++){ ans += gcd(gcd(a, b), c); } } } printf("%ld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126521/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126521/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %a.tr = phi i64 [ %a, %entry ], [ %b.tr, %tailrecurse ] %b.tr = phi i64 [ %b, %entry ], [ %rem, %tailrecurse ] %rem = srem i64 %a.tr, %b.tr %cmp = icmp eq i64 %rem, 0 br i1 %cmp, label %return, label %tailrecurse return: ; preds = %tailrecurse ret i64 %b.tr } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %K, align 4, !tbaa !5 %cmp.not38 = icmp slt i32 %0, 1 br i1 %cmp.not38, label %for.end16, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = add nuw i32 %0, 1 %wide.trip.count51 = zext i32 %1 to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.for.inc14_crit_edge.split %indvars.iv48 = phi i64 [ 1, %for.cond1.preheader.preheader ], [ %indvars.iv.next49, %for.cond1.for.inc14_crit_edge.split ] %ans.040 = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %add, %for.cond1.for.inc14_crit_edge.split ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc11_crit_edge %indvars.iv43 = phi i64 [ 1, %for.cond1.preheader ], [ %indvars.iv.next44, %for.cond4.for.inc11_crit_edge ] %ans.136 = phi i64 [ %ans.040, %for.cond1.preheader ], [ %add, %for.cond4.for.inc11_crit_edge ] br label %for.body6 for.body6: ; preds = %for.cond4.preheader, %gcd.exit30 %indvars.iv = phi i64 [ 1, %for.cond4.preheader ], [ %indvars.iv.next, %gcd.exit30 ] %ans.233 = phi i64 [ %ans.136, %for.cond4.preheader ], [ %add, %gcd.exit30 ] br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i, %for.body6 %a.tr.i = phi i64 [ %indvars.iv48, %for.body6 ], [ %b.tr.i, %tailrecurse.i ] %b.tr.i = phi i64 [ %indvars.iv43, %for.body6 ], [ %rem.i, %tailrecurse.i ] %rem.i = srem i64 %a.tr.i, %b.tr.i %cmp.i = icmp eq i64 %rem.i, 0 br i1 %cmp.i, label %tailrecurse.i25, label %tailrecurse.i tailrecurse.i25: ; preds = %tailrecurse.i, %tailrecurse.i25 %a.tr.i26 = phi i64 [ %b.tr.i27, %tailrecurse.i25 ], [ %b.tr.i, %tailrecurse.i ] %b.tr.i27 = phi i64 [ %rem.i28, %tailrecurse.i25 ], [ %indvars.iv, %tailrecurse.i ] %rem.i28 = srem i64 %a.tr.i26, %b.tr.i27 %cmp.i29 = icmp eq i64 %rem.i28, 0 br i1 %cmp.i29, label %gcd.exit30, label %tailrecurse.i25 gcd.exit30: ; preds = %tailrecurse.i25 %add = add nsw i64 %b.tr.i27, %ans.233 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count51 br i1 %exitcond.not, label %for.cond4.for.inc11_crit_edge, label %for.body6, !llvm.loop !9 for.cond4.for.inc11_crit_edge: ; preds = %gcd.exit30 %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %exitcond47.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count51 br i1 %exitcond47.not, label %for.cond1.for.inc14_crit_edge.split, label %for.cond4.preheader, !llvm.loop !11 for.cond1.for.inc14_crit_edge.split: ; preds = %for.cond4.for.inc11_crit_edge %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1 %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51 br i1 %exitcond52.not, label %for.end16, label %for.cond1.preheader, !llvm.loop !12 for.end16: ; preds = %for.cond1.for.inc14_crit_edge.split, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond1.for.inc14_crit_edge.split ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int n, s, i; scanf("%d%d", &n, &s); int a[n], b[n]; for(i=0; i<n; i++) { scanf("%d", &a[i]); } for(i=0; i<n; i++) { scanf("%d", &b[i]); } if(a[0]==0 || ((a[s-1]==0 && b[s-1]==0))) { printf("NO"); return 0; } if(a[0]==1 && a[s-1]==1) { printf("YES"); return 0; } if(a[0]==1 && a[s-1]==0 && b[s-1]==1) { for(i=s;i<n;i++) { if(a[i]==1 && b[i]==1) { printf("YES"); return 0; } } } printf("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12658/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12658/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %n = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %0 = load i32, ptr %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 %cmp81 = icmp sgt i32 %3, 0 br i1 %cmp81, label %for.body, label %for.end11 for.cond3.preheader: ; preds = %for.body %cmp483 = icmp sgt i32 %5, 0 br i1 %cmp483, label %for.body5, label %for.end11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv90 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp4 = icmp slt i64 %indvars.iv.next91, %8 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.body5, %entry, %for.cond3.preheader %.lcssa = phi i32 [ %5, %for.cond3.preheader ], [ %3, %entry ], [ %7, %for.body5 ] %9 = load i32, ptr %vla, align 16, !tbaa !5 %cmp13 = icmp eq i32 %9, 0 br i1 %cmp13, label %cleanup, label %lor.lhs.false lor.lhs.false: ; preds = %for.end11 %10 = load i32, ptr %s, align 4, !tbaa !5 %sub = add nsw i32 %10, -1 %idxprom14 = sext i32 %sub to i64 %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %idxprom14 %11 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp eq i32 %11, 0 br i1 %cmp16, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %lor.lhs.false %arrayidx19 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom14 %12 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp20 = icmp eq i32 %12, 0 br i1 %cmp20, label %cleanup, label %if.end.thread if.end: ; preds = %lor.lhs.false %cmp23 = icmp eq i32 %9, 1 %cmp28 = icmp eq i32 %11, 1 %or.cond = and i1 %cmp23, %cmp28 br i1 %or.cond, label %cleanup, label %if.end61 if.end.thread: ; preds = %land.lhs.true %cmp2375 = icmp eq i32 %9, 1 br i1 %cmp2375, label %land.lhs.true39, label %if.end61 land.lhs.true39: ; preds = %if.end.thread %cmp43 = icmp eq i32 %12, 1 %cmp4685 = icmp slt i32 %10, %.lcssa %or.cond87 = and i1 %cmp43, %cmp4685 br i1 %or.cond87, label %for.body47.preheader, label %if.end61 for.body47.preheader: ; preds = %land.lhs.true39 %13 = sext i32 %10 to i64 br label %for.body47 for.body47: ; preds = %for.body47.preheader, %for.inc58 %indvars.iv93 = phi i64 [ %13, %for.body47.preheader ], [ %indvars.iv.next94, %for.inc58 ] %arrayidx49 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv93 %14 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %cmp50 = icmp eq i32 %14, 1 br i1 %cmp50, label %land.lhs.true51, label %for.inc58 land.lhs.true51: ; preds = %for.body47 %arrayidx53 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv93 %15 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %cmp54 = icmp eq i32 %15, 1 br i1 %cmp54, label %cleanup, label %for.inc58 for.inc58: ; preds = %for.body47, %land.lhs.true51 %indvars.iv.next94 = add nsw i64 %indvars.iv93, 1 %lftr.wideiv = trunc i64 %indvars.iv.next94 to i32 %exitcond.not = icmp eq i32 %.lcssa, %lftr.wideiv br i1 %exitcond.not, label %if.end61, label %for.body47, !llvm.loop !12 if.end61: ; preds = %for.inc58, %if.end, %if.end.thread, %land.lhs.true39 br label %cleanup cleanup: ; preds = %land.lhs.true51, %if.end, %for.end11, %land.lhs.true, %if.end61 %.str.2.sink = phi ptr [ @.str.2, %if.end61 ], [ @.str.2, %land.lhs.true ], [ @.str.2, %for.end11 ], [ @.str.3, %if.end ], [ @.str.3, %land.lhs.true51 ] %call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { long long int n,m,i,j,ck=0; scanf("%lld%lld",&n,&m); long long int a[n],b[n]; for(i=0;i<n;i++) { scanf("%lld",&a[i]); } for(i=0;i<n;i++) { scanf("%lld",&b[i]); } if (a[0]==0) { printf("NO\n"); } else if((a[0]==1 && a[m-1]==1)) { printf("YES\n"); } else { for(i=1;i<n;i++) { if(a[i]==1&&b[i]==1 && b[m-1]==1&&m-1<i) { printf("YES\n"); ck=1; return 0; } } if(ck==0) { printf("NO\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12663/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12663/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5 %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 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %vla1 = alloca i64, i64 %2, align 16 %cmp65 = icmp sgt i64 %2, 0 br i1 %cmp65, label %for.body, label %for.end10 for.cond3.preheader: ; preds = %for.body %cmp467 = icmp sgt i64 %3, 0 br i1 %cmp467, label %for.body5, label %for.end10 for.body: ; preds = %entry, %for.body %i.066 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.066 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.066, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.cond3.preheader, %for.body5 %i.168 = phi i64 [ %inc9, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx6 = getelementptr inbounds i64, ptr %vla1, i64 %i.168 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %inc9 = add nuw nsw i64 %i.168, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp4 = icmp slt i64 %inc9, %4 br i1 %cmp4, label %for.body5, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.body5, %entry, %for.cond3.preheader %.lcssa = phi i64 [ %3, %for.cond3.preheader ], [ %2, %entry ], [ %4, %for.body5 ] %5 = load i64, ptr %vla, align 16, !tbaa !5 switch i64 %5, label %if.else20 [ i64 0, label %cleanup i64 1, label %land.lhs.true ] land.lhs.true: ; preds = %for.end10 %6 = load i64, ptr %m, align 8, !tbaa !5 %7 = getelementptr i64, ptr %vla, i64 %6 %arrayidx16 = getelementptr i64, ptr %7, i64 -1 %8 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %cmp17 = icmp eq i64 %8, 1 br i1 %cmp17, label %cleanup, label %if.else20 if.else20: ; preds = %for.end10, %land.lhs.true %cmp2269 = icmp sgt i64 %.lcssa, 1 br i1 %cmp2269, label %for.body23.lr.ph, label %cleanup for.body23.lr.ph: ; preds = %if.else20 %invariant.gep = getelementptr i64, ptr %vla1, i64 -1 %9 = load i64, ptr %m, align 8 %gep = getelementptr i64, ptr %invariant.gep, i64 %9 br label %for.body23 for.body23: ; preds = %for.body23.lr.ph, %for.inc38 %i.270 = phi i64 [ 1, %for.body23.lr.ph ], [ %inc39, %for.inc38 ] %arrayidx24 = getelementptr inbounds i64, ptr %vla, i64 %i.270 %10 = load i64, ptr %arrayidx24, align 8, !tbaa !5 %cmp25 = icmp eq i64 %10, 1 br i1 %cmp25, label %land.lhs.true26, label %for.inc38 land.lhs.true26: ; preds = %for.body23 %arrayidx27 = getelementptr inbounds i64, ptr %vla1, i64 %i.270 %11 = load i64, ptr %arrayidx27, align 8, !tbaa !5 %cmp28 = icmp eq i64 %11, 1 br i1 %cmp28, label %land.lhs.true29, label %for.inc38 land.lhs.true29: ; preds = %land.lhs.true26 %12 = load i64, ptr %gep, align 8, !tbaa !5 %cmp32 = icmp ne i64 %12, 1 %cmp35.not = icmp sgt i64 %9, %i.270 %or.cond = or i1 %cmp35.not, %cmp32 br i1 %or.cond, label %for.inc38, label %cleanup for.inc38: ; preds = %for.body23, %land.lhs.true26, %land.lhs.true29 %inc39 = add nuw nsw i64 %i.270, 1 %exitcond.not = icmp eq i64 %inc39, %.lcssa br i1 %exitcond.not, label %cleanup, label %for.body23, !llvm.loop !12 cleanup: ; preds = %for.inc38, %land.lhs.true29, %if.else20, %land.lhs.true, %for.end10 %str.6.sink = phi ptr [ @str.6, %for.end10 ], [ @str.5, %land.lhs.true ], [ @str.6, %if.else20 ], [ @str.5, %land.lhs.true29 ], [ @str.6, %for.inc38 ] %puts64 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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}
#include<stdio.h> int gcd(int a,int b); int main(void){ int a,b,c,k,i,ans,ab; scanf("%d",&k); ans = 0; for(a=1;a<=k;a++){ for(b=1;b<=k;b++){ for(c=1;c<=k;c++){ ab = gcd(a,b); ans += gcd(ab,c); } } } printf("%d\n",ans); return 0; } int gcd(int a,int b){ if(b==0){ return a; } int i; i = gcd(b,a%b); return i; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126673/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not36 = icmp slt i32 %0, 1 br i1 %cmp.not36, label %for.end14, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.inc12_crit_edge.split %a.038 = phi i32 [ %inc13, %for.cond1.for.inc12_crit_edge.split ], [ 1, %entry ] %ans.037 = phi i32 [ %add, %for.cond1.for.inc12_crit_edge.split ], [ 0, %entry ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.inc9_crit_edge %ans.134 = phi i32 [ %ans.037, %for.cond1.preheader ], [ %add, %for.cond4.for.inc9_crit_edge ] %b.033 = phi i32 [ 1, %for.cond1.preheader ], [ %inc10, %for.cond4.for.inc9_crit_edge ] br label %if.end.i.preheader if.end.i.preheader: ; preds = %for.cond4.preheader, %gcd.exit28 %ans.231 = phi i32 [ %ans.134, %for.cond4.preheader ], [ %add, %gcd.exit28 ] %c.030 = phi i32 [ 1, %for.cond4.preheader ], [ %inc, %gcd.exit28 ] br label %if.end.i if.end.i: ; preds = %if.end.i.preheader, %if.end.i %b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %b.033, %if.end.i.preheader ] %a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %a.038, %if.end.i.preheader ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %if.end.i23, label %if.end.i if.end.i23: ; preds = %if.end.i, %if.end.i23 %b.tr6.i24 = phi i32 [ %rem.i26, %if.end.i23 ], [ %c.030, %if.end.i ] %a.tr5.i25 = phi i32 [ %b.tr6.i24, %if.end.i23 ], [ %b.tr6.i, %if.end.i ] %rem.i26 = srem i32 %a.tr5.i25, %b.tr6.i24 %cmp.i27 = icmp eq i32 %rem.i26, 0 br i1 %cmp.i27, label %gcd.exit28, label %if.end.i23 gcd.exit28: ; preds = %if.end.i23 %add = add nsw i32 %b.tr6.i24, %ans.231 %inc = add nuw i32 %c.030, 1 %exitcond.not = icmp eq i32 %c.030, %0 br i1 %exitcond.not, label %for.cond4.for.inc9_crit_edge, label %if.end.i.preheader, !llvm.loop !9 for.cond4.for.inc9_crit_edge: ; preds = %gcd.exit28 %inc10 = add nuw i32 %b.033, 1 %exitcond40.not = icmp eq i32 %b.033, %0 br i1 %exitcond40.not, label %for.cond1.for.inc12_crit_edge.split, label %for.cond4.preheader, !llvm.loop !11 for.cond1.for.inc12_crit_edge.split: ; preds = %for.cond4.for.inc9_crit_edge %inc13 = add nuw i32 %a.038, 1 %exitcond41.not = icmp eq i32 %a.038, %0 br i1 %exitcond41.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !12 for.end14: ; preds = %for.cond1.for.inc12_crit_edge.split, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.cond1.for.inc12_crit_edge.split ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %cmp4 = icmp eq i32 %b, 0 br i1 %cmp4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int gcd(int x, int y){ if(y==0) return x; return gcd(y, x%y); } int main(){ int unused __attribute__((unused)); int K, a, b, c, tmp; long long sum = 0; unused = scanf("%d", &K); for(a=1; a<=K; a++){ for(b=1; b<=K; b++){ for(c=1; c<=K; c++){ tmp = gcd(a, b); sum += gcd(tmp, c); } c--; } b--; } printf("%lld", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126716/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126716/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %cmp4 = icmp eq i32 %y, 0 br i1 %cmp4, label %return, label %if.end if.end: ; preds = %entry, %if.end %y.tr6 = phi i32 [ %rem, %if.end ], [ %y, %entry ] %x.tr5 = phi i32 [ %y.tr6, %if.end ], [ %x, %entry ] %rem = srem i32 %x.tr5, %y.tr6 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end, %entry %x.tr.lcssa = phi i32 [ %x, %entry ], [ %y.tr6, %if.end ] ret i32 %x.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %K, align 4, !tbaa !5 %cmp.not39 = icmp slt i32 %0, 1 br i1 %cmp.not39, label %for.end15, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.cond1.for.end11_crit_edge.split %sum.041 = phi i64 [ %add, %for.cond1.for.end11_crit_edge.split ], [ 0, %entry ] %a.040 = phi i32 [ %inc14, %for.cond1.for.end11_crit_edge.split ], [ 1, %entry ] br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.cond4.for.end_crit_edge %sum.137 = phi i64 [ %sum.041, %for.cond1.preheader ], [ %add, %for.cond4.for.end_crit_edge ] %b.036 = phi i32 [ 1, %for.cond1.preheader ], [ %inc10, %for.cond4.for.end_crit_edge ] br label %if.end.i.preheader if.end.i.preheader: ; preds = %for.cond4.preheader, %gcd.exit31 %sum.234 = phi i64 [ %sum.137, %for.cond4.preheader ], [ %add, %gcd.exit31 ] %c.033 = phi i32 [ 1, %for.cond4.preheader ], [ %inc, %gcd.exit31 ] br label %if.end.i if.end.i: ; preds = %if.end.i.preheader, %if.end.i %y.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %b.036, %if.end.i.preheader ] %x.tr5.i = phi i32 [ %y.tr6.i, %if.end.i ], [ %a.040, %if.end.i.preheader ] %rem.i = srem i32 %x.tr5.i, %y.tr6.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %if.end.i26, label %if.end.i if.end.i26: ; preds = %if.end.i, %if.end.i26 %y.tr6.i27 = phi i32 [ %rem.i29, %if.end.i26 ], [ %c.033, %if.end.i ] %x.tr5.i28 = phi i32 [ %y.tr6.i27, %if.end.i26 ], [ %y.tr6.i, %if.end.i ] %rem.i29 = srem i32 %x.tr5.i28, %y.tr6.i27 %cmp.i30 = icmp eq i32 %rem.i29, 0 br i1 %cmp.i30, label %gcd.exit31, label %if.end.i26 gcd.exit31: ; preds = %if.end.i26 %conv = sext i32 %y.tr6.i27 to i64 %add = add nsw i64 %sum.234, %conv %inc = add nuw i32 %c.033, 1 %exitcond.not = icmp eq i32 %c.033, %0 br i1 %exitcond.not, label %for.cond4.for.end_crit_edge, label %if.end.i.preheader, !llvm.loop !9 for.cond4.for.end_crit_edge: ; preds = %gcd.exit31 %inc10 = add nuw i32 %b.036, 1 %exitcond43.not = icmp eq i32 %b.036, %0 br i1 %exitcond43.not, label %for.cond1.for.end11_crit_edge.split, label %for.cond4.preheader, !llvm.loop !11 for.cond1.for.end11_crit_edge.split: ; preds = %for.cond4.for.end_crit_edge %inc14 = add nuw i32 %a.040, 1 %exitcond44.not = icmp eq i32 %a.040, %0 br i1 %exitcond44.not, label %for.end15, label %for.cond1.preheader, !llvm.loop !12 for.end15: ; preds = %for.cond1.for.end11_crit_edge.split, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond1.for.end11_crit_edge.split ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int r,c; char a[20][20]; int main(void) { int i,j,res=0; int tmp; char b; scanf("%d %d", &c,&r); scanf("%c", &b); for (i=0; i < c; ++i) { for (j=0; j < r; ++j) scanf("%c", &a[i][j]); scanf("%c", &b); } for (i=0; i < c; ++i) { tmp = 0; for (j=0; j < r; ++j) { if (a[i][j] == 'S') tmp = 1; } if (!tmp) { for (j=0; j < r; ++j) { if (a[i][j] == '.') { res++; a[i][j] = 'A'; } } } } for (j=0; j < r; ++j) { tmp = 0; for (i=0; i < c; ++i) { if (a[i][j] == 'S') tmp = 1; } if (!tmp) { for (i=0; i < c; ++i) { if (a[i][j] == '.') { res++; a[i][j] = 'A'; } } } } printf("%d\n", res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12676/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12676/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @c = dso_local global i32 0, align 4 @r = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @a = dso_local global [20 x [20 x i8]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @c, ptr noundef nonnull @r) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) %0 = load i32, ptr @c, align 4, !tbaa !5 %cmp136 = icmp sgt i32 %0, 0 br i1 %cmp136, label %for.cond2.preheader, label %for.cond12.preheader.thread for.cond12.preheader.thread: ; preds = %entry %.pre240 = load i32, ptr @r, align 4, !tbaa !5 %.fr241 = freeze i32 %.pre240 br label %for.cond53.preheader for.cond2.preheader: ; preds = %entry, %for.end %indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.end ], [ 0, %entry ] %1 = load i32, ptr @r, align 4, !tbaa !5 %cmp3134 = icmp sgt i32 %1, 0 br i1 %cmp3134, label %for.body4, label %for.end for.cond12.preheader: ; preds = %for.end %cmp13147 = icmp sgt i32 %46, 0 %.pre = load i32, ptr @r, align 4, !tbaa !5 %.fr = freeze i32 %.pre br i1 %cmp13147, label %for.cond15.preheader.lr.ph, label %for.cond53.preheader for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader %cmp16138 = icmp sgt i32 %.fr, 0 br i1 %cmp16138, label %for.cond15.preheader.us.us.preheader, label %for.end99 for.cond15.preheader.us.us.preheader: ; preds = %for.cond15.preheader.lr.ph %wide.trip.count221 = zext i32 %46 to i64 %wide.trip.count211 = zext i32 %.fr to i64 %min.iters.check269 = icmp ult i32 %.fr, 8 %n.vec272 = and i64 %wide.trip.count211, 4294967288 %cmp.n274 = icmp eq i64 %n.vec272, %wide.trip.count211 %min.iters.check = icmp ult i32 %.fr, 8 %n.vec = and i64 %wide.trip.count211, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count211 br label %for.cond15.preheader.us.us for.cond15.preheader.us.us: ; preds = %for.cond15.preheader.us.us.preheader, %for.inc50.us.us %indvars.iv218 = phi i64 [ 0, %for.cond15.preheader.us.us.preheader ], [ %indvars.iv.next219, %for.inc50.us.us ] %res.0150.us.us = phi i32 [ 0, %for.cond15.preheader.us.us.preheader ], [ %res.3.us.us, %for.inc50.us.us ] br i1 %min.iters.check269, label %for.body17.us.us.preheader, label %vector.body275 vector.body275: ; preds = %for.cond15.preheader.us.us, %vector.body275 %index276 = phi i64 [ %index.next281, %vector.body275 ], [ 0, %for.cond15.preheader.us.us ] %vec.phi277 = phi <4 x i32> [ %6, %vector.body275 ], [ zeroinitializer, %for.cond15.preheader.us.us ] %vec.phi278 = phi <4 x i32> [ %7, %vector.body275 ], [ zeroinitializer, %for.cond15.preheader.us.us ] %2 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %index276 %wide.load279 = load <4 x i8>, ptr %2, align 4, !tbaa !9 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load280 = load <4 x i8>, ptr %3, align 4, !tbaa !9 %4 = icmp eq <4 x i8> %wide.load279, <i8 83, i8 83, i8 83, i8 83> %5 = icmp eq <4 x i8> %wide.load280, <i8 83, i8 83, i8 83, i8 83> %6 = select <4 x i1> %4, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %vec.phi277 %7 = select <4 x i1> %5, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %vec.phi278 %index.next281 = add nuw i64 %index276, 8 %8 = icmp eq i64 %index.next281, %n.vec272 br i1 %8, label %middle.block267, label %vector.body275, !llvm.loop !10 middle.block267: ; preds = %vector.body275 %rdx.select.cmp.not = icmp ne <4 x i32> %6, zeroinitializer %rdx.select.cmp282303 = icmp ne <4 x i32> %7, zeroinitializer %rdx.select.cmp282 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp282303 %9 = bitcast <4 x i1> %rdx.select.cmp282 to i4 %.not = icmp ne i4 %9, 0 %rdx.select283 = zext i1 %.not to i32 br i1 %cmp.n274, label %for.cond15.for.end26_crit_edge.us.us, label %for.body17.us.us.preheader for.body17.us.us.preheader: ; preds = %for.cond15.preheader.us.us, %middle.block267 %indvars.iv208.ph = phi i64 [ 0, %for.cond15.preheader.us.us ], [ %n.vec272, %middle.block267 ] %tmp.0140.us.us.ph = phi i32 [ 0, %for.cond15.preheader.us.us ], [ %rdx.select283, %middle.block267 ] br label %for.body17.us.us for.inc50.us.us: ; preds = %for.inc46.us.us, %middle.block, %for.cond15.for.end26_crit_edge.us.us %res.3.us.us = phi i32 [ %res.0150.us.us, %for.cond15.for.end26_crit_edge.us.us ], [ %43, %middle.block ], [ %res.2.us.us, %for.inc46.us.us ] %indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1 %exitcond222.not = icmp eq i64 %indvars.iv.next219, %wide.trip.count221 br i1 %exitcond222.not, label %for.cond53.preheader, label %for.cond15.preheader.us.us, !llvm.loop !14 for.body31.us.us: ; preds = %for.body31.us.us.preheader308, %for.inc46.us.us %indvars.iv213 = phi i64 [ %indvars.iv.next214, %for.inc46.us.us ], [ %indvars.iv213.ph, %for.body31.us.us.preheader308 ] %res.1145.us.us = phi i32 [ %res.2.us.us, %for.inc46.us.us ], [ %res.1145.us.us.ph, %for.body31.us.us.preheader308 ] %arrayidx35.us.us = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %indvars.iv213 %10 = load i8, ptr %arrayidx35.us.us, align 1, !tbaa !9 %cmp37.us.us = icmp eq i8 %10, 46 br i1 %cmp37.us.us, label %if.then39.us.us, label %for.inc46.us.us if.then39.us.us: ; preds = %for.body31.us.us %inc40.us.us = add nsw i32 %res.1145.us.us, 1 store i8 65, ptr %arrayidx35.us.us, align 1, !tbaa !9 br label %for.inc46.us.us for.inc46.us.us: ; preds = %if.then39.us.us, %for.body31.us.us %res.2.us.us = phi i32 [ %inc40.us.us, %if.then39.us.us ], [ %res.1145.us.us, %for.body31.us.us ] %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1 %exitcond217.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count211 br i1 %exitcond217.not, label %for.inc50.us.us, label %for.body31.us.us, !llvm.loop !15 for.body17.us.us: ; preds = %for.body17.us.us.preheader, %for.body17.us.us %indvars.iv208 = phi i64 [ %indvars.iv.next209, %for.body17.us.us ], [ %indvars.iv208.ph, %for.body17.us.us.preheader ] %tmp.0140.us.us = phi i32 [ %spec.select.us.us, %for.body17.us.us ], [ %tmp.0140.us.us.ph, %for.body17.us.us.preheader ] %arrayidx21.us.us = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %indvars.iv208 %11 = load i8, ptr %arrayidx21.us.us, align 1, !tbaa !9 %cmp22.us.us = icmp eq i8 %11, 83 %spec.select.us.us = select i1 %cmp22.us.us, i32 1, i32 %tmp.0140.us.us %indvars.iv.next209 = add nuw nsw i64 %indvars.iv208, 1 %exitcond212.not = icmp eq i64 %indvars.iv.next209, %wide.trip.count211 br i1 %exitcond212.not, label %for.cond15.for.end26_crit_edge.us.us, label %for.body17.us.us, !llvm.loop !16 for.cond15.for.end26_crit_edge.us.us: ; preds = %for.body17.us.us, %middle.block267 %spec.select.us.us.lcssa = phi i32 [ %rdx.select283, %middle.block267 ], [ %spec.select.us.us, %for.body17.us.us ] %tobool.not.us.us = icmp eq i32 %spec.select.us.us.lcssa, 0 br i1 %tobool.not.us.us, label %for.body31.us.us.preheader, label %for.inc50.us.us for.body31.us.us.preheader: ; preds = %for.cond15.for.end26_crit_edge.us.us br i1 %min.iters.check, label %for.body31.us.us.preheader308, label %vector.ph vector.ph: ; preds = %for.body31.us.us.preheader %12 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %res.0150.us.us, i64 0 br label %vector.body vector.body: ; preds = %pred.store.continue265, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue265 ] %vec.phi = phi <4 x i32> [ %12, %vector.ph ], [ %predphi, %pred.store.continue265 ] %vec.phi250 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi266, %pred.store.continue265 ] %13 = or i64 %index, 4 %14 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %index %wide.load = load <4 x i8>, ptr %14, align 4, !tbaa !9 %15 = getelementptr inbounds i8, ptr %14, i64 4 %wide.load251 = load <4 x i8>, ptr %15, align 4, !tbaa !9 %16 = icmp eq <4 x i8> %wide.load, <i8 46, i8 46, i8 46, i8 46> %17 = icmp eq <4 x i8> %wide.load251, <i8 46, i8 46, i8 46, i8 46> %18 = extractelement <4 x i1> %16, i64 0 br i1 %18, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %19 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %index store i8 65, ptr %19, align 4, !tbaa !9 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %20 = extractelement <4 x i1> %16, i64 1 br i1 %20, label %pred.store.if252, label %pred.store.continue253 pred.store.if252: ; preds = %pred.store.continue %21 = or i64 %index, 1 %22 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %21 store i8 65, ptr %22, align 1, !tbaa !9 br label %pred.store.continue253 pred.store.continue253: ; preds = %pred.store.if252, %pred.store.continue %23 = extractelement <4 x i1> %16, i64 2 br i1 %23, label %pred.store.if254, label %pred.store.continue255 pred.store.if254: ; preds = %pred.store.continue253 %24 = or i64 %index, 2 %25 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %24 store i8 65, ptr %25, align 2, !tbaa !9 br label %pred.store.continue255 pred.store.continue255: ; preds = %pred.store.if254, %pred.store.continue253 %26 = extractelement <4 x i1> %16, i64 3 br i1 %26, label %pred.store.if256, label %pred.store.continue257 pred.store.if256: ; preds = %pred.store.continue255 %27 = or i64 %index, 3 %28 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %27 store i8 65, ptr %28, align 1, !tbaa !9 br label %pred.store.continue257 pred.store.continue257: ; preds = %pred.store.if256, %pred.store.continue255 %29 = extractelement <4 x i1> %17, i64 0 br i1 %29, label %pred.store.if258, label %pred.store.continue259 pred.store.if258: ; preds = %pred.store.continue257 %30 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %13 store i8 65, ptr %30, align 4, !tbaa !9 br label %pred.store.continue259 pred.store.continue259: ; preds = %pred.store.if258, %pred.store.continue257 %31 = extractelement <4 x i1> %17, i64 1 br i1 %31, label %pred.store.if260, label %pred.store.continue261 pred.store.if260: ; preds = %pred.store.continue259 %32 = or i64 %index, 5 %33 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %32 store i8 65, ptr %33, align 1, !tbaa !9 br label %pred.store.continue261 pred.store.continue261: ; preds = %pred.store.if260, %pred.store.continue259 %34 = extractelement <4 x i1> %17, i64 2 br i1 %34, label %pred.store.if262, label %pred.store.continue263 pred.store.if262: ; preds = %pred.store.continue261 %35 = or i64 %index, 6 %36 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %35 store i8 65, ptr %36, align 2, !tbaa !9 br label %pred.store.continue263 pred.store.continue263: ; preds = %pred.store.if262, %pred.store.continue261 %37 = extractelement <4 x i1> %17, i64 3 br i1 %37, label %pred.store.if264, label %pred.store.continue265 pred.store.if264: ; preds = %pred.store.continue263 %38 = or i64 %index, 7 %39 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv218, i64 %38 store i8 65, ptr %39, align 1, !tbaa !9 br label %pred.store.continue265 pred.store.continue265: ; preds = %pred.store.if264, %pred.store.continue263 %40 = zext <4 x i1> %16 to <4 x i32> %predphi = add <4 x i32> %vec.phi, %40 %41 = zext <4 x i1> %17 to <4 x i32> %predphi266 = add <4 x i32> %vec.phi250, %41 %index.next = add nuw i64 %index, 8 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %pred.store.continue265 %bin.rdx = add <4 x i32> %predphi266, %predphi %43 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.inc50.us.us, label %for.body31.us.us.preheader308 for.body31.us.us.preheader308: ; preds = %for.body31.us.us.preheader, %middle.block %indvars.iv213.ph = phi i64 [ 0, %for.body31.us.us.preheader ], [ %n.vec, %middle.block ] %res.1145.us.us.ph = phi i32 [ %res.0150.us.us, %for.body31.us.us.preheader ], [ %43, %middle.block ] br label %for.body31.us.us for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv194, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %44 = load i32, ptr @r, align 4, !tbaa !5 %45 = sext i32 %44 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %45 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !18 for.end: ; preds = %for.body4, %for.cond2.preheader %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b) %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1 %46 = load i32, ptr @c, align 4, !tbaa !5 %47 = sext i32 %46 to i64 %cmp = icmp slt i64 %indvars.iv.next195, %47 br i1 %cmp, label %for.cond2.preheader, label %for.cond12.preheader, !llvm.loop !19 for.cond53.preheader: ; preds = %for.inc50.us.us, %for.cond12.preheader.thread, %for.cond12.preheader %.fr244 = phi i32 [ %.fr, %for.cond12.preheader ], [ %.fr241, %for.cond12.preheader.thread ], [ %.fr, %for.inc50.us.us ] %cmp13147243 = phi i1 [ false, %for.cond12.preheader ], [ false, %for.cond12.preheader.thread ], [ %cmp13147, %for.inc50.us.us ] %.lcssa133242 = phi i32 [ %46, %for.cond12.preheader ], [ %0, %for.cond12.preheader.thread ], [ %46, %for.inc50.us.us ] %res.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond12.preheader.thread ], [ %res.3.us.us, %for.inc50.us.us ] %cmp54185 = icmp sgt i32 %.fr244, 0 br i1 %cmp54185, label %for.cond57.preheader.lr.ph, label %for.end99 for.cond57.preheader.lr.ph: ; preds = %for.cond53.preheader %cmp76181 = icmp slt i32 %.lcssa133242, 1 %wide.trip.count236 = zext i32 %.fr244 to i64 %wide.trip.count226 = zext i32 %.lcssa133242 to i64 %min.iters.check287 = icmp ult i32 %.lcssa133242, 8 %n.vec290 = and i64 %wide.trip.count226, 4294967288 %cmp.n292 = icmp eq i64 %n.vec290, %wide.trip.count226 %xtraiter = and i64 %wide.trip.count226, 1 %48 = icmp eq i32 %.lcssa133242, 1 %unroll_iter = and i64 %wide.trip.count226, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond57.preheader for.cond57.preheader: ; preds = %for.cond57.preheader.lr.ph, %for.inc97 %indvars.iv233 = phi i64 [ 0, %for.cond57.preheader.lr.ph ], [ %indvars.iv.next234, %for.inc97 ] %res.4188 = phi i32 [ %res.0.lcssa, %for.cond57.preheader.lr.ph ], [ %res.7, %for.inc97 ] br i1 %cmp13147243, label %for.body60.preheader, label %for.end72 for.body60.preheader: ; preds = %for.cond57.preheader br i1 %min.iters.check287, label %for.body60.preheader306, label %vector.body293 vector.body293: ; preds = %for.body60.preheader, %vector.body293 %index294 = phi i64 [ %index.next297, %vector.body293 ], [ 0, %for.body60.preheader ] %vec.phi295 = phi <4 x i32> [ %82, %vector.body293 ], [ zeroinitializer, %for.body60.preheader ] %vec.phi296 = phi <4 x i32> [ %83, %vector.body293 ], [ zeroinitializer, %for.body60.preheader ] %49 = or i64 %index294, 1 %50 = or i64 %index294, 2 %51 = or i64 %index294, 3 %52 = or i64 %index294, 4 %53 = or i64 %index294, 5 %54 = or i64 %index294, 6 %55 = or i64 %index294, 7 %56 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %index294, i64 %indvars.iv233 %57 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %49, i64 %indvars.iv233 %58 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %50, i64 %indvars.iv233 %59 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %51, i64 %indvars.iv233 %60 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %52, i64 %indvars.iv233 %61 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %53, i64 %indvars.iv233 %62 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %54, i64 %indvars.iv233 %63 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %55, i64 %indvars.iv233 %64 = load i8, ptr %56, align 1, !tbaa !9 %65 = load i8, ptr %57, align 1, !tbaa !9 %66 = load i8, ptr %58, align 1, !tbaa !9 %67 = load i8, ptr %59, align 1, !tbaa !9 %68 = insertelement <4 x i8> poison, i8 %64, i64 0 %69 = insertelement <4 x i8> %68, i8 %65, i64 1 %70 = insertelement <4 x i8> %69, i8 %66, i64 2 %71 = insertelement <4 x i8> %70, i8 %67, i64 3 %72 = load i8, ptr %60, align 1, !tbaa !9 %73 = load i8, ptr %61, align 1, !tbaa !9 %74 = load i8, ptr %62, align 1, !tbaa !9 %75 = load i8, ptr %63, align 1, !tbaa !9 %76 = insertelement <4 x i8> poison, i8 %72, i64 0 %77 = insertelement <4 x i8> %76, i8 %73, i64 1 %78 = insertelement <4 x i8> %77, i8 %74, i64 2 %79 = insertelement <4 x i8> %78, i8 %75, i64 3 %80 = icmp eq <4 x i8> %71, <i8 83, i8 83, i8 83, i8 83> %81 = icmp eq <4 x i8> %79, <i8 83, i8 83, i8 83, i8 83> %82 = select <4 x i1> %80, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %vec.phi295 %83 = select <4 x i1> %81, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %vec.phi296 %index.next297 = add nuw i64 %index294, 8 %84 = icmp eq i64 %index.next297, %n.vec290 br i1 %84, label %middle.block285, label %vector.body293, !llvm.loop !20 middle.block285: ; preds = %vector.body293 %rdx.select.cmp298.not = icmp ne <4 x i32> %82, zeroinitializer %rdx.select.cmp300304 = icmp ne <4 x i32> %83, zeroinitializer %rdx.select.cmp300 = select <4 x i1> %rdx.select.cmp298.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp300304 %85 = bitcast <4 x i1> %rdx.select.cmp300 to i4 %.not305 = icmp ne i4 %85, 0 %rdx.select301 = zext i1 %.not305 to i32 br i1 %cmp.n292, label %for.end72, label %for.body60.preheader306 for.body60.preheader306: ; preds = %for.body60.preheader, %middle.block285 %indvars.iv223.ph = phi i64 [ 0, %for.body60.preheader ], [ %n.vec290, %middle.block285 ] %tmp.2179.ph = phi i32 [ 0, %for.body60.preheader ], [ %rdx.select301, %middle.block285 ] br label %for.body60 for.body60: ; preds = %for.body60.preheader306, %for.body60 %indvars.iv223 = phi i64 [ %indvars.iv.next224, %for.body60 ], [ %indvars.iv223.ph, %for.body60.preheader306 ] %tmp.2179 = phi i32 [ %spec.select132, %for.body60 ], [ %tmp.2179.ph, %for.body60.preheader306 ] %arrayidx64 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv223, i64 %indvars.iv233 %86 = load i8, ptr %arrayidx64, align 1, !tbaa !9 %cmp66 = icmp eq i8 %86, 83 %spec.select132 = select i1 %cmp66, i32 1, i32 %tmp.2179 %indvars.iv.next224 = add nuw nsw i64 %indvars.iv223, 1 %exitcond227.not = icmp eq i64 %indvars.iv.next224, %wide.trip.count226 br i1 %exitcond227.not, label %for.end72, label %for.body60, !llvm.loop !21 for.end72: ; preds = %for.body60, %middle.block285, %for.cond57.preheader %tmp.2.lcssa = phi i32 [ 0, %for.cond57.preheader ], [ %rdx.select301, %middle.block285 ], [ %spec.select132, %for.body60 ] %tobool73.not = icmp ne i32 %tmp.2.lcssa, 0 %brmerge = or i1 %tobool73.not, %cmp76181 br i1 %brmerge, label %for.inc97, label %for.body78.preheader for.body78.preheader: ; preds = %for.end72 br i1 %48, label %for.inc97.loopexit.unr-lcssa, label %for.body78 for.body78: ; preds = %for.body78.preheader, %for.inc93.1 %indvars.iv228 = phi i64 [ %indvars.iv.next229.1, %for.inc93.1 ], [ 0, %for.body78.preheader ] %res.5183 = phi i32 [ %res.6.1, %for.inc93.1 ], [ %res.4188, %for.body78.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc93.1 ], [ 0, %for.body78.preheader ] %arrayidx82 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv228, i64 %indvars.iv233 %87 = load i8, ptr %arrayidx82, align 1, !tbaa !9 %cmp84 = icmp eq i8 %87, 46 br i1 %cmp84, label %if.then86, label %for.inc93 if.then86: ; preds = %for.body78 %inc87 = add nsw i32 %res.5183, 1 store i8 65, ptr %arrayidx82, align 1, !tbaa !9 br label %for.inc93 for.inc93: ; preds = %for.body78, %if.then86 %res.6 = phi i32 [ %inc87, %if.then86 ], [ %res.5183, %for.body78 ] %indvars.iv.next229 = or i64 %indvars.iv228, 1 %arrayidx82.1 = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv.next229, i64 %indvars.iv233 %88 = load i8, ptr %arrayidx82.1, align 1, !tbaa !9 %cmp84.1 = icmp eq i8 %88, 46 br i1 %cmp84.1, label %if.then86.1, label %for.inc93.1 if.then86.1: ; preds = %for.inc93 %inc87.1 = add nsw i32 %res.6, 1 store i8 65, ptr %arrayidx82.1, align 1, !tbaa !9 br label %for.inc93.1 for.inc93.1: ; preds = %if.then86.1, %for.inc93 %res.6.1 = phi i32 [ %inc87.1, %if.then86.1 ], [ %res.6, %for.inc93 ] %indvars.iv.next229.1 = add nuw nsw i64 %indvars.iv228, 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.inc97.loopexit.unr-lcssa, label %for.body78, !llvm.loop !22 for.inc97.loopexit.unr-lcssa: ; preds = %for.inc93.1, %for.body78.preheader %res.6.lcssa.ph = phi i32 [ undef, %for.body78.preheader ], [ %res.6.1, %for.inc93.1 ] %indvars.iv228.unr = phi i64 [ 0, %for.body78.preheader ], [ %indvars.iv.next229.1, %for.inc93.1 ] %res.5183.unr = phi i32 [ %res.4188, %for.body78.preheader ], [ %res.6.1, %for.inc93.1 ] br i1 %lcmp.mod.not, label %for.inc97, label %for.body78.epil for.body78.epil: ; preds = %for.inc97.loopexit.unr-lcssa %arrayidx82.epil = getelementptr inbounds [20 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv228.unr, i64 %indvars.iv233 %89 = load i8, ptr %arrayidx82.epil, align 1, !tbaa !9 %cmp84.epil = icmp eq i8 %89, 46 br i1 %cmp84.epil, label %if.then86.epil, label %for.inc97 if.then86.epil: ; preds = %for.body78.epil %inc87.epil = add nsw i32 %res.5183.unr, 1 store i8 65, ptr %arrayidx82.epil, align 1, !tbaa !9 br label %for.inc97 for.inc97: ; preds = %for.inc97.loopexit.unr-lcssa, %if.then86.epil, %for.body78.epil, %for.end72 %res.7 = phi i32 [ %res.4188, %for.end72 ], [ %res.6.lcssa.ph, %for.inc97.loopexit.unr-lcssa ], [ %inc87.epil, %if.then86.epil ], [ %res.5183.unr, %for.body78.epil ] %indvars.iv.next234 = add nuw nsw i64 %indvars.iv233, 1 %exitcond237.not = icmp eq i64 %indvars.iv.next234, %wide.trip.count236 br i1 %exitcond237.not, label %for.end99, label %for.cond57.preheader, !llvm.loop !23 for.end99: ; preds = %for.inc97, %for.cond15.preheader.lr.ph, %for.cond53.preheader %res.4.lcssa = phi i32 [ %res.0.lcssa, %for.cond53.preheader ], [ 0, %for.cond15.preheader.lr.ph ], [ %res.7, %for.inc97 ] %call100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.4.lcssa) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11, !13, !12} !16 = distinct !{!16, !11, !13, !12} !17 = distinct !{!17, !11, !12, !13} !18 = distinct !{!18, !11} !19 = distinct !{!19, !11} !20 = distinct !{!20, !11, !12, !13} !21 = distinct !{!21, !11, !13, !12} !22 = distinct !{!22, !11} !23 = distinct !{!23, !11}
#include<stdio.h> #include<stdlib.h> long long int llabs(long long int n) { if (n < 0) n *= -1; return n; } int asc(const void* a, const void* b) { if (*(long long int*)a > * (long long int*)b)return 1; if (*(long long int*)a < *(long long int*)b)return -1; return 0; } int main() { long long int n; scanf("%lld", &n); long long int i; long long int a[200005]; for (i = 0; i < n; i++) scanf("%lld", &a[i]); for (i = 0; i < n; i++) a[i] -= i + 1; qsort(a, n, sizeof(long long int), asc); long long int b = a[(n - 1) / 2]; long long int ans = 0; for (i = 0; i < n; i++) ans += llabs(a[i] - b); printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126875/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126875/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llabs(i64 noundef %n) local_unnamed_addr #0 { entry: %spec.select = tail call i64 @llvm.abs.i64(i64 %n, i1 true) ret i64 %spec.select } ; 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) #1 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp slt i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %a = alloca [200005 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 1600040, ptr nonnull %a) #8 %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp31 = icmp sgt i64 %0, 0 br i1 %cmp31, label %for.body, label %for.end8 for.cond2.preheader: ; preds = %for.body %cmp333 = icmp sgt i64 %7, 0 br i1 %cmp333, label %for.body4.preheader, label %for.end8 for.body4.preheader: ; preds = %for.cond2.preheader %min.iters.check = icmp ult i64 %7, 4 br i1 %min.iters.check, label %for.body4.preheader62, label %vector.ph vector.ph: ; preds = %for.body4.preheader %n.vec = and i64 %7, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %.neg = xor <2 x i64> %vec.ind, <i64 -1, i64 -1> %1 = add <2 x i64> %vec.ind, <i64 3, i64 3> %2 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %index %wide.load = load <2 x i64>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i64, ptr %2, i64 2 %wide.load45 = load <2 x i64>, ptr %3, align 16, !tbaa !5 %4 = add <2 x i64> %wide.load, %.neg %5 = sub nsw <2 x i64> %wide.load45, %1 store <2 x i64> %4, ptr %2, align 16, !tbaa !5 store <2 x i64> %5, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %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 %7, %n.vec br i1 %cmp.n, label %for.end8, label %for.body4.preheader62 for.body4.preheader62: ; preds = %for.body4.preheader, %middle.block %i.134.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ] br label %for.body4 for.body: ; preds = %entry, %for.body %i.032 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %i.032 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.032, 1 %7 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %7 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.body4: ; preds = %for.body4.preheader62, %for.body4 %i.134 = phi i64 [ %add, %for.body4 ], [ %i.134.ph, %for.body4.preheader62 ] %add = add nuw nsw i64 %i.134, 1 %arrayidx5 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %i.134 %8 = load i64, ptr %arrayidx5, align 8, !tbaa !5 %sub = sub nsw i64 %8, %add store i64 %sub, ptr %arrayidx5, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %add, %7 br i1 %exitcond.not, label %for.end8, label %for.body4, !llvm.loop !14 for.end8: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader %.lcssa43 = phi i64 [ %7, %for.cond2.preheader ], [ %0, %entry ], [ %7, %middle.block ], [ %7, %for.body4 ] call void @qsort(ptr noundef nonnull %a, i64 noundef %.lcssa43, i64 noundef 8, ptr noundef nonnull @asc) #8 %9 = load i64, ptr %n, align 8, !tbaa !5 %sub9 = add nsw i64 %9, -1 %div = sdiv i64 %sub9, 2 %arrayidx10 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %div %10 = load i64, ptr %arrayidx10, align 8, !tbaa !5 %cmp1235 = icmp sgt i64 %9, 0 br i1 %cmp1235, label %for.body13.preheader, label %for.end19 for.body13.preheader: ; preds = %for.end8 %min.iters.check48 = icmp ult i64 %9, 4 br i1 %min.iters.check48, label %for.body13.preheader60, label %vector.ph49 vector.ph49: ; preds = %for.body13.preheader %n.vec51 = and i64 %9, -4 %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %10, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body54 vector.body54: ; preds = %vector.body54, %vector.ph49 %index55 = phi i64 [ 0, %vector.ph49 ], [ %index.next59, %vector.body54 ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph49 ], [ %17, %vector.body54 ] %vec.phi56 = phi <2 x i64> [ zeroinitializer, %vector.ph49 ], [ %18, %vector.body54 ] %11 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %index55 %wide.load57 = load <2 x i64>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i64, ptr %11, i64 2 %wide.load58 = load <2 x i64>, ptr %12, align 16, !tbaa !5 %13 = sub nsw <2 x i64> %wide.load57, %broadcast.splat %14 = sub nsw <2 x i64> %wide.load58, %broadcast.splat %15 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %13, i1 true) %16 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %14, i1 true) %17 = add <2 x i64> %15, %vec.phi %18 = add <2 x i64> %16, %vec.phi56 %index.next59 = add nuw i64 %index55, 4 %19 = icmp eq i64 %index.next59, %n.vec51 br i1 %19, label %middle.block46, label %vector.body54, !llvm.loop !15 middle.block46: ; preds = %vector.body54 %bin.rdx = add <2 x i64> %18, %17 %20 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n53 = icmp eq i64 %9, %n.vec51 br i1 %cmp.n53, label %for.end19, label %for.body13.preheader60 for.body13.preheader60: ; preds = %for.body13.preheader, %middle.block46 %ans.037.ph = phi i64 [ 0, %for.body13.preheader ], [ %20, %middle.block46 ] %i.236.ph = phi i64 [ 0, %for.body13.preheader ], [ %n.vec51, %middle.block46 ] br label %for.body13 for.body13: ; preds = %for.body13.preheader60, %for.body13 %ans.037 = phi i64 [ %add16, %for.body13 ], [ %ans.037.ph, %for.body13.preheader60 ] %i.236 = phi i64 [ %inc18, %for.body13 ], [ %i.236.ph, %for.body13.preheader60 ] %arrayidx14 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %i.236 %21 = load i64, ptr %arrayidx14, align 8, !tbaa !5 %sub15 = sub nsw i64 %21, %10 %22 = call i64 @llvm.abs.i64(i64 %sub15, i1 true) %add16 = add nuw nsw i64 %22, %ans.037 %inc18 = add nuw nsw i64 %i.236, 1 %exitcond40.not = icmp eq i64 %inc18, %9 br i1 %exitcond40.not, label %for.end19, label %for.body13, !llvm.loop !16 for.end19: ; preds = %for.body13, %middle.block46, %for.end8 %ans.0.lcssa = phi i64 [ 0, %for.end8 ], [ %20, %middle.block46 ], [ %add16, %for.body13 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1600040, ptr nonnull %a) #8 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.abs.v2i64(<2 x i64>, i1 immarg) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10, !11, !12} !16 = distinct !{!16, !10, !12, !11}
#include <stdio.h> int main(void) { int n, p, v, per, i, max = 0, num; int a[1000001] = {0}; scanf("%d%d", &n, &p); while(p){ scanf("%d%d", &per, &v); a[per] += v; if(v>0){ if(a[per] > max || a[per] == max && per < num){ max = a[per]; num = per; } }else if(per == num){ if(a[per] < max){ num = 0; max = 0; for(i = 1; i <= n; i++){ if(a[i] > max){ max = a[i]; num = i; } } } } printf("%d %d\n", num, a[num]); p--; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126925/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126925/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %p = alloca i32, align 4 %v = alloca i32, align 4 %per = alloca i32, align 4 %a = alloca [1000001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %per) #5 call void @llvm.lifetime.start.p0(i64 4000004, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000004) %a, i8 0, i64 4000004, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p) %.pr = load i32, ptr %p, align 4, !tbaa !5 %tobool.not51 = icmp eq i32 %.pr, 0 br i1 %tobool.not51, label %while.end, label %while.body while.body: ; preds = %entry, %if.end28 %num.053 = phi i32 [ %num.3, %if.end28 ], [ undef, %entry ] %max.052 = phi i32 [ %max.3, %if.end28 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %per, ptr noundef nonnull %v) %0 = load i32, ptr %v, align 4, !tbaa !5 %1 = load i32, ptr %per, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %2, %0 store i32 %add, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %cmp4 = icmp sgt i32 %add, %max.052 br i1 %cmp4, label %if.then9, label %lor.lhs.false lor.lhs.false: ; preds = %if.then %cmp7 = icmp eq i32 %add, %max.052 %cmp8 = icmp slt i32 %1, %num.053 %or.cond = and i1 %cmp8, %cmp7 br i1 %or.cond, label %if.then9, label %if.end28 if.then9: ; preds = %lor.lhs.false, %if.then br label %if.end28 if.else: ; preds = %while.body %cmp12 = icmp eq i32 %1, %num.053 %cmp16 = icmp slt i32 %add, %max.052 %or.cond45 = select i1 %cmp12, i1 %cmp16, i1 false br i1 %or.cond45, label %for.cond.preheader, label %if.end28 for.cond.preheader: ; preds = %if.else %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp18.not46 = icmp slt i32 %3, 1 br i1 %cmp18.not46, label %if.end28, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %4 = add nuw i32 %3, 1 %wide.trip.count = zext i32 %4 to i64 %5 = add nsw i64 %wide.trip.count, -1 %6 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %5, 3 %7 = icmp ult i64 %6, 3 br i1 %7, label %if.end28.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %5, -4 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %num.149 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select44.3, %for.body ] %max.148 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx20 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv %8 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %8, %max.148 %spec.select = call i32 @llvm.smax.i32(i32 %8, i32 %max.148) %9 = trunc i64 %indvars.iv to i32 %spec.select44 = select i1 %cmp21, i32 %9, i32 %num.149 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx20.1 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv.next %10 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %cmp21.1 = icmp sgt i32 %10, %spec.select %spec.select.1 = call i32 @llvm.smax.i32(i32 %10, i32 %spec.select) %11 = trunc i64 %indvars.iv.next to i32 %spec.select44.1 = select i1 %cmp21.1, i32 %11, i32 %spec.select44 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx20.2 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv.next.1 %12 = load i32, ptr %arrayidx20.2, align 4, !tbaa !5 %cmp21.2 = icmp sgt i32 %12, %spec.select.1 %spec.select.2 = call i32 @llvm.smax.i32(i32 %12, i32 %spec.select.1) %13 = trunc i64 %indvars.iv.next.1 to i32 %spec.select44.2 = select i1 %cmp21.2, i32 %13, i32 %spec.select44.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx20.3 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv.next.2 %14 = load i32, ptr %arrayidx20.3, align 4, !tbaa !5 %cmp21.3 = icmp sgt i32 %14, %spec.select.2 %spec.select.3 = call i32 @llvm.smax.i32(i32 %14, i32 %spec.select.2) %15 = trunc i64 %indvars.iv.next.2 to i32 %spec.select44.3 = select i1 %cmp21.3, i32 %15, i32 %spec.select44.2 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %if.end28.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 if.end28.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.3, %for.body ] %spec.select44.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select44.3, %for.body ] %indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %num.149.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select44.3, %for.body ] %max.148.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %if.end28, label %for.body.epil for.body.epil: ; preds = %if.end28.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %if.end28.loopexit.unr-lcssa ] %num.149.epil = phi i32 [ %spec.select44.epil, %for.body.epil ], [ %num.149.unr, %if.end28.loopexit.unr-lcssa ] %max.148.epil = phi i32 [ %spec.select.epil, %for.body.epil ], [ %max.148.unr, %if.end28.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %if.end28.loopexit.unr-lcssa ] %arrayidx20.epil = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %indvars.iv.epil %16 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5 %cmp21.epil = icmp sgt i32 %16, %max.148.epil %spec.select.epil = call i32 @llvm.smax.i32(i32 %16, i32 %max.148.epil) %17 = trunc i64 %indvars.iv.epil to i32 %spec.select44.epil = select i1 %cmp21.epil, i32 %17, i32 %num.149.epil %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %if.end28, label %for.body.epil, !llvm.loop !11 if.end28: ; preds = %if.end28.loopexit.unr-lcssa, %for.body.epil, %for.cond.preheader, %if.else, %lor.lhs.false, %if.then9 %max.3 = phi i32 [ %add, %if.then9 ], [ %max.052, %lor.lhs.false ], [ %max.052, %if.else ], [ 0, %for.cond.preheader ], [ %spec.select.lcssa.ph, %if.end28.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ] %num.3 = phi i32 [ %1, %if.then9 ], [ %num.053, %lor.lhs.false ], [ %num.053, %if.else ], [ 0, %for.cond.preheader ], [ %spec.select44.lcssa.ph, %if.end28.loopexit.unr-lcssa ], [ %spec.select44.epil, %for.body.epil ] %idxprom29 = sext i32 %num.3 to i64 %arrayidx30 = getelementptr inbounds [1000001 x i32], ptr %a, i64 0, i64 %idxprom29 %18 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.3, i32 noundef %18) %19 = load i32, ptr %p, align 4, !tbaa !5 %dec = add nsw i32 %19, -1 store i32 %dec, ptr %p, align 4, !tbaa !5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end28, %entry call void @llvm.lifetime.end.p0(i64 4000004, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %per) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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: 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.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 = { 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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10}
#pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <string.h> #define _USE_MATH_DEFINES #include <math.h> #include <float.h> #pragma region 定義 typedef long long ll; typedef unsigned long long ull; #define _itoa(A,N) sprintf(A, "%d", N); int i_dsort(const void* a, const void* b); int i_asort(const void* a, const void* b); int _gcd(int a, int b); int _swp(int* a, int* b); int _cknum(char* a, int n); int _atoi(char* s, int len); int s_asort(const void* a, const void* b); int s_dsort(const void* a, const void* b); //昇順 int s_asort(const void* a, const void* b) { return(strcmp((char*)a, (char*)b)); } int s_dsort(const void* a, const void* b) { return(strcmp((char*)b, (char*)a)); } int i_dsort(const void* a, const void* b) { return(*(int*)b - *(int*)a); } int i_asort(const void* a, const void* b) { return(*(int*)a - *(int*)b); } int i_gcd(int a, int b); int i_gcd(int a, int b) { if (!b)return a; return i_gcd(b, a % b); } int i_lcm(int a, int b); int i_lcm(int a, int b) { return (a * b) / i_gcd(a, b); } int ll_gcd(ll a, ll b); int ll_gcd(ll a, ll b) { if (!b)return a; return ll_gcd(b, a % b); } int ll_lcm(ll a, ll b); int ll_lcm(ll a, ll b) { return (a * b) / ll_gcd(a, b); } // puts("Yes\n") puts("No\n") // scanf("%d.%d") 浮動小数点入力を整数2つで得る //#define pai 3.1415926535 //#define _USE_MATH_DEFINES でM_PIが使える #define deg_rad(X) (X*(M_PI/180)) int _swp(int* a, int* b) { int tmp; tmp = *b; *b = *a; *a = tmp; return 0; } #define _abs(x) ((x)>0?(x):-(x)) #define _min(x,y) ((x)<(y)?(x):(y)) #define _max(x,y) ((x)<(y)?(y):(x)) int _cknum(char* a, int n) { int i; char t = '0'; for (i = 0; i < n; i++) { if (a[i] < '0' || a[i]>'9') return 1; } return 0; } int _atoi(char* s, int len) { char tmp[20]; memcpy(tmp, s, len); tmp[len] = 0x00; return (atoi(tmp)); } //素因数分解 pf素数が入る pc 素数の数 //ll _pfact(ll a); //static ll pf[100000000]; //static ll pc; // //ll _pfact(ll a) { // long i, r; // if (a % 2 == 0) { // pf[pc] = 2; pc++; // return(_pfact(a / 2)); // } // r = sqrt(a); // for (i = 3; i <= r; i += 2) { // if (a % i == 0) { // pf[pc] = i; pc++; // return(_pfact(a / i)); // } // } // if (a != 1) { // pf[pc] = a; pc++; // } // return 0; // //} //同じものの最初の文字をNULLにして降順 int _sort(const void* a, const void* b); int _sort(const void* a, const void* b) { char rc; rc = strcmp((char*)b, (char*)a); if (rc == 0) { *(char*)a = 0x00; return(1); } return(rc); } // 立っている ビットの数 int bitcount(unsigned int uc); int bitcount(unsigned int uc) { int bit; for (bit = 0; 0 != uc; uc = (unsigned int)(uc >> 1)) if (0 != (uc & 1))++bit; return bit; }//bitco #define _rnd(a,b) ((a+b-1)/b) // A/Bの余りを繰り上げる #define _abs(x) ((x)<0 ? -(x) : (x)) #define _MAX 100000 #pragma endregion // ABC113 B - int main(void) { int i,l; char c[100001]; scanf("%s", c); l = strlen(c); for (i = 0; i < l; i+=2) printf("%c", c[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_126969/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_126969/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #14 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #14 ret i32 %call } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @i_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @i_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @i_gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4 = icmp eq i32 %b, 0 br i1 %tobool.not4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @i_lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4.i = icmp eq i32 %b, 0 br i1 %tobool.not4.i, label %i_gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %b, %entry ] %a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %a, %entry ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i32 %rem.i, 0 br i1 %tobool.not.i, label %i_gcd.exit, label %if.end.i i_gcd.exit: ; preds = %if.end.i, %entry %a.tr.lcssa.i = phi i32 [ %a, %entry ], [ %b.tr6.i, %if.end.i ] %mul = mul nsw i32 %b, %a %div = sdiv i32 %mul, %a.tr.lcssa.i ret i32 %div } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @ll_gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %if.then, label %if.end if.then: ; preds = %if.end, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %if.end ] %conv = trunc i64 %a.tr.lcssa to i32 ret i32 %conv if.end: ; preds = %entry, %if.end %b.tr6 = phi i64 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %if.then, label %if.end } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @ll_lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %ll_gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %b.tr6.i = phi i64 [ %rem.i, %if.end.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %if.end.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %ll_gcd.exit, label %if.end.i ll_gcd.exit: ; preds = %if.end.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %if.end.i ] %mul = mul nsw i64 %b, %a %sext = shl i64 %a.tr.lcssa.i, 32 %conv = ashr exact i64 %sext, 32 %div = sdiv i64 %mul, %conv %conv1 = trunc i64 %div to i32 ret i32 %conv1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @_swp(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %b, align 4, !tbaa !5 store i32 %0, ptr %a, align 4, !tbaa !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) #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #5 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @_cknum(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #6 { entry: %cmp13 = icmp sgt i32 %n, 0 br i1 %cmp13, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds i8, ptr %a, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !11 %1 = add i8 %0, -58 %or.cond = icmp ult i8 %1, -10 br i1 %or.cond, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn uwtable define dso_local i32 @_atoi(ptr nocapture noundef readonly %s, i32 noundef %len) local_unnamed_addr #7 { entry: %tmp = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %tmp) #15 %conv = sext i32 %len to i64 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %tmp, ptr align 1 %s, i64 %conv, i1 false) %arrayidx = getelementptr inbounds [20 x i8], ptr %tmp, i64 0, i64 %conv store i8 0, ptr %arrayidx, align 1, !tbaa !11 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmp, ptr noundef null, i32 noundef 10) #15 %conv.i = trunc i64 %call.i to i32 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) #15 ret i32 %conv.i } ; 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) #8 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @_sort(ptr nocapture noundef %a, ptr nocapture noundef readonly %b) local_unnamed_addr #9 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #14 %sext = shl i32 %call, 24 %cmp = icmp eq i32 %sext, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i8 0, ptr %a, align 1, !tbaa !11 br label %cleanup if.end: ; preds = %entry %conv1 = ashr exact i32 %sext, 24 br label %cleanup cleanup: ; preds = %if.end, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ %conv1, %if.end ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i32 noundef %uc) local_unnamed_addr #3 { entry: %cmp.not5 = icmp eq i32 %uc, 0 br i1 %cmp.not5, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %bit.07 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %uc.addr.06 = phi i32 [ %shr, %for.body ], [ %uc, %entry ] %and = and i32 %uc.addr.06, 1 %spec.select = add i32 %bit.07, %and %shr = lshr i32 %uc.addr.06, 1 %cmp.not = icmp ult i32 %uc.addr.06, 2 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.body, %entry %bit.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] ret i32 %bit.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #10 { entry: %c = alloca [100001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %c) #15 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %c) #14 %conv = trunc i64 %call2 to i32 %cmp8 = icmp sgt i32 %conv, 0 br i1 %cmp8, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x i8], ptr %c, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 2, !tbaa !11 %conv4 = sext i8 %0 to i32 %putchar = call i32 @putchar(i32 %conv4) %indvars.iv.next = add nuw i64 %indvars.iv, 2 %1 = trunc i64 %indvars.iv.next to i32 %cmp = icmp slt i32 %1, %conv br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %c) #15 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #12 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #13 attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #6 = { 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 #7 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #9 = { mustprogress nofree 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 #10 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nofree nounwind "no-trapping-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 "no-trapping-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 nounwind } attributes #14 = { nounwind willreturn memory(read) } attributes #15 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX(a,b) (a > b) ? a : b #define MIN(a,b) (a < b) ? a : b const int inf = 1000000000; // 10^9 int main(){ char s[100000];scanf("%s",s); for(int i = 0;i < strlen(s);i+=2)printf("%c",s[i]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127010/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127010/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @inf = dso_local local_unnamed_addr constant i32 1000000000, align 4 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %char0 = load i8, ptr %s, align 16 %cmp9.not = icmp eq i8 %char0, 0 br i1 %cmp9.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 2, !tbaa !5 %conv4 = sext i8 %0 to i32 %putchar = call i32 @putchar(i32 %conv4) %indvars.iv.next = add nuw i64 %indvars.iv, 2 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void){ char s[100001]; scanf("%s",s); int slen = strlen(s); int i; for(i=0;i<slen;i++){ if(i%2==0)printf("%c",s[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127054/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127054/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp11 = icmp sgt i32 %conv, 0 br i1 %cmp11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %rem14 = and i64 %indvars.iv, 1 %cmp4 = icmp eq i64 %rem14, 0 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body %arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv6 = sext i8 %0 to i32 %putchar = call i32 @putchar(i32 %conv6) br label %for.inc for.inc: ; preds = %for.body, %if.then %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 !8 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> char a[100000],c; int main() { int i,j,t; j=0; while(scanf("%s",a)!=EOF) { for(i=0;(c=a[i])!='\0';i++,i++) { a[j]=a[i]; j++; } a[j]='\0'; printf("%s",a); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127119/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [100000 x i8] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global i8 0, align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a) %cmp.not22 = icmp eq i32 %call21, -1 br i1 %cmp.not22, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %j.023 = phi i32 [ %j.1.lcssa, %for.end ], [ 0, %entry ] %0 = load i8, ptr @a, align 16, !tbaa !5 %cmp1.not17 = icmp eq i8 %0, 0 br i1 %cmp1.not17, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %1 = sext i32 %j.023 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv25 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next26, %for.body ] %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %2 = phi i8 [ %0, %for.body.preheader ], [ %3, %for.body ] %arrayidx6 = getelementptr inbounds [100000 x i8], ptr @a, i64 0, i64 %indvars.iv25 store i8 %2, ptr %arrayidx6, align 1, !tbaa !5 %indvars.iv.next26 = add i64 %indvars.iv25, 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2 %arrayidx = getelementptr inbounds [100000 x i8], ptr @a, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx, align 2, !tbaa !5 %cmp1.not = icmp eq i8 %3, 0 br i1 %cmp1.not, label %for.end.loopexit, label %for.body, !llvm.loop !8 for.end.loopexit: ; preds = %for.body %4 = trunc i64 %indvars.iv.next26 to i32 br label %for.end for.end: ; preds = %for.end.loopexit, %for.cond.preheader %j.1.lcssa = phi i32 [ %j.023, %for.cond.preheader ], [ %4, %for.end.loopexit ] store i8 0, ptr @c, align 1, !tbaa !5 %idxprom9 = sext i32 %j.1.lcssa to i64 %arrayidx10 = getelementptr inbounds [100000 x i8], ptr @a, i64 0, i64 %idxprom9 store i8 0, ptr %arrayidx10, align 1, !tbaa !5 %call11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @a) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !10 while.end: ; preds = %for.end, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include<stdio.h> #define MAX 100000 int main() { char str[MAX]; int i; scanf("%s", str); for(i=0; str[i]!='\0'; i++) { if(i%2==0)printf("%c", str[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127177/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127177/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %str) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %0 = load i8, ptr %str, align 16, !tbaa !5 %cmp.not14 = icmp eq i8 %0, 0 br i1 %cmp.not14, label %for.end, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %conv16.in = phi i8 [ %1, %for.inc ], [ %0, %entry ] %rem17 = and i64 %indvars.iv, 1 %cmp2 = icmp eq i64 %rem17, 0 br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.body %conv16 = sext i8 %conv16.in to i32 %putchar12 = call i32 @putchar(i32 %conv16) br label %for.inc for.inc: ; preds = %for.body, %if.then %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100000 x i8], ptr %str, i64 0, i64 %indvars.iv.next %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %1, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.inc, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 100000, 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 i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef struct sort_num { int64_t A; int64_t B; int64_t C; } t_sort_num; int my_sort( const void * a , const void * b ) { return (((t_sort_num*)b)->C - ((t_sort_num*)a)->C); } int main(void){ int N; t_sort_num X[100000]; scanf("%d", &N); for(int i = 0; i < N; i++) { scanf("%lu %lu", &X[i].A, &X[i].B); X[i].C = X[i].A + X[i].B; } // sort qsort((void*)X, N, sizeof(t_sort_num), my_sort); int64_t taka = 0; int64_t aoki = 0; for(int i = 0; i < N; i++) { if(i % 2) { aoki += X[i].B; } else { taka += X[i].A; } } printf("%ld\n", taka - aoki); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127227/source.c" target datalayout = "e-m:e-p270: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.sort_num = type { i64, i64, i64 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%lu %lu\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @my_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %C = getelementptr inbounds %struct.sort_num, ptr %b, i64 0, i32 2 %0 = load i64, ptr %C, align 8, !tbaa !5 %C1 = getelementptr inbounds %struct.sort_num, ptr %a, i64 0, i32 2 %1 = load i64, ptr %C1, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %X = alloca [100000 x %struct.sort_num], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 2400000, ptr nonnull %X) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !10 %cmp42 = icmp sgt i32 %0, 0 br i1 %cmp42, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %6, %for.body ] call void @qsort(ptr noundef nonnull %X, i64 noundef %conv.pre-phi, i64 noundef 24, ptr noundef nonnull @my_sort) #5 %1 = load i32, ptr %N, align 4, !tbaa !10 %cmp1444 = icmp sgt i32 %1, 0 br i1 %cmp1444, label %for.body17.preheader, label %for.cond.cleanup16 for.body17.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 1 %2 = icmp eq i32 %1, 1 br i1 %2, label %for.cond.cleanup16.loopexit.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body17 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv %B = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %B) %3 = load i64, ptr %arrayidx, align 8, !tbaa !12 %4 = load i64, ptr %B, align 8, !tbaa !13 %add = add nsw i64 %4, %3 %C = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv, i32 2 store i64 %add, ptr %C, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !10 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !14 for.cond.cleanup16.loopexit.unr-lcssa: ; preds = %for.body17, %for.body17.preheader %taka.1.lcssa.ph = phi i64 [ undef, %for.body17.preheader ], [ %add25, %for.body17 ] %aoki.1.lcssa.ph = phi i64 [ undef, %for.body17.preheader ], [ %add21.1, %for.body17 ] %indvars.iv52.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next53.1, %for.body17 ] %aoki.046.unr = phi i64 [ 0, %for.body17.preheader ], [ %add21.1, %for.body17 ] %taka.045.unr = phi i64 [ 0, %for.body17.preheader ], [ %add25, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup16.loopexit, label %for.body17.epil for.body17.epil: ; preds = %for.cond.cleanup16.loopexit.unr-lcssa %rem55.epil = and i64 %indvars.iv52.unr, 1 %tobool.not.epil = icmp eq i64 %rem55.epil, 0 br i1 %tobool.not.epil, label %if.else.epil, label %if.then.epil if.then.epil: ; preds = %for.body17.epil %B20.epil = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv52.unr, i32 1 %7 = load i64, ptr %B20.epil, align 8, !tbaa !13 %add21.epil = add nsw i64 %7, %aoki.046.unr br label %for.cond.cleanup16.loopexit if.else.epil: ; preds = %for.body17.epil %arrayidx23.epil = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv52.unr %8 = load i64, ptr %arrayidx23.epil, align 8, !tbaa !12 %add25.epil = add nsw i64 %8, %taka.045.unr br label %for.cond.cleanup16.loopexit for.cond.cleanup16.loopexit: ; preds = %if.then.epil, %if.else.epil, %for.cond.cleanup16.loopexit.unr-lcssa %taka.1.lcssa = phi i64 [ %taka.1.lcssa.ph, %for.cond.cleanup16.loopexit.unr-lcssa ], [ %taka.045.unr, %if.then.epil ], [ %add25.epil, %if.else.epil ] %aoki.1.lcssa = phi i64 [ %aoki.1.lcssa.ph, %for.cond.cleanup16.loopexit.unr-lcssa ], [ %add21.epil, %if.then.epil ], [ %aoki.046.unr, %if.else.epil ] %9 = sub nsw i64 %taka.1.lcssa, %aoki.1.lcssa br label %for.cond.cleanup16 for.cond.cleanup16: ; preds = %for.cond.cleanup16.loopexit, %for.cond.cleanup %sub = phi i64 [ 0, %for.cond.cleanup ], [ %9, %for.cond.cleanup16.loopexit ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub) call void @llvm.lifetime.end.p0(i64 2400000, ptr nonnull %X) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 for.body17: ; preds = %for.body17, %for.body17.preheader.new %indvars.iv52 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next53.1, %for.body17 ] %aoki.046 = phi i64 [ 0, %for.body17.preheader.new ], [ %add21.1, %for.body17 ] %taka.045 = phi i64 [ 0, %for.body17.preheader.new ], [ %add25, %for.body17 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.body17 ] %arrayidx23 = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv52 %10 = load i64, ptr %arrayidx23, align 16, !tbaa !12 %add25 = add nsw i64 %10, %taka.045 %indvars.iv.next53 = or i64 %indvars.iv52, 1 %B20.1 = getelementptr inbounds [100000 x %struct.sort_num], ptr %X, i64 0, i64 %indvars.iv.next53, i32 1 %11 = load i64, ptr %B20.1, align 16, !tbaa !13 %add21.1 = add nsw i64 %11, %aoki.046 %indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup16.loopexit.unr-lcssa, label %for.body17, !llvm.loop !16 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 16} !6 = !{!"sort_num", !7, i64 0, !7, i64 8, !7, i64 16} !7 = !{!"long", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !8, i64 0} !12 = !{!6, !7, i64 0} !13 = !{!6, !7, i64 8} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = distinct !{!16, !15}
#include <stdio.h> int answer(char ch[]) { int sum = 0; int i; for(i=0;;i++){ if(ch[i] == 0){ break; } sum += ((int)ch[i]-48); } return sum; } int main() { char ch[1001]; while(1){ scanf("%s",ch); if(answer(ch) == 0){ break; } printf("%d\n",answer(ch)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127270/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127270/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @answer(ptr nocapture noundef readonly %ch) local_unnamed_addr #0 { entry: %0 = load i8, ptr %ch, align 1, !tbaa !5 %cmp9 = icmp eq i8 %0, 0 br i1 %cmp9, label %for.end, label %if.end if.end: ; preds = %entry, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %1 = phi i8 [ %2, %if.end ], [ %0, %entry ] %sum.010 = phi i32 [ %add, %if.end ], [ 0, %entry ] %conv = sext i8 %1 to i32 %sub = add i32 %sum.010, -48 %add = add i32 %sub, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds i8, ptr %ch, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %2, 0 br i1 %cmp, label %for.end, label %if.end for.end: ; preds = %if.end, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %if.end ] 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: %ch = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %ch) #4 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %0 = load i8, ptr %ch, align 16, !tbaa !5 %cmp9.i21 = icmp eq i8 %0, 0 br i1 %cmp9.i21, label %while.end, label %if.end.i.preheader if.end.i.preheader: ; preds = %entry, %answer.exit17.loopexit %1 = phi i8 [ %6, %answer.exit17.loopexit ], [ %0, %entry ] br label %if.end.i if.end.i: ; preds = %if.end.i.preheader, %if.end.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 0, %if.end.i.preheader ] %2 = phi i8 [ %3, %if.end.i ], [ %1, %if.end.i.preheader ] %sum.010.i = phi i32 [ %add.i, %if.end.i ], [ 0, %if.end.i.preheader ] %conv.i = sext i8 %2 to i32 %sub.i = add i32 %sum.010.i, -48 %add.i = add i32 %sub.i, %conv.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds i8, ptr %ch, i64 %indvars.iv.next.i %3 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %cmp.i = icmp eq i8 %3, 0 br i1 %cmp.i, label %answer.exit, label %if.end.i answer.exit: ; preds = %if.end.i %cmp = icmp eq i32 %add.i, 0 br i1 %cmp, label %while.end, label %if.end.i7 if.end.i7: ; preds = %answer.exit, %if.end.i7 %indvars.iv.i8 = phi i64 [ %indvars.iv.next.i13, %if.end.i7 ], [ 0, %answer.exit ] %4 = phi i8 [ %5, %if.end.i7 ], [ %1, %answer.exit ] %sum.010.i9 = phi i32 [ %add.i12, %if.end.i7 ], [ 0, %answer.exit ] %conv.i10 = sext i8 %4 to i32 %sub.i11 = add i32 %sum.010.i9, -48 %add.i12 = add i32 %sub.i11, %conv.i10 %indvars.iv.next.i13 = add nuw nsw i64 %indvars.iv.i8, 1 %arrayidx.i14 = getelementptr inbounds i8, ptr %ch, i64 %indvars.iv.next.i13 %5 = load i8, ptr %arrayidx.i14, align 1, !tbaa !5 %cmp.i15 = icmp eq i8 %5, 0 br i1 %cmp.i15, label %answer.exit17.loopexit, label %if.end.i7 answer.exit17.loopexit: ; preds = %if.end.i7 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.i12) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %6 = load i8, ptr %ch, align 16, !tbaa !5 %cmp9.i = icmp eq i8 %6, 0 br i1 %cmp9.i, label %while.end, label %if.end.i.preheader while.end: ; preds = %answer.exit, %answer.exit17.loopexit, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %ch) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main () { int i,j; char n[100000] = {0}; int x[1001] = {0}; i = 0; j = 0; while(1) { scanf("%c",&n[i]); if(n[i] == '0' && n[i-1] == '\n'|| n[0] == '0') {break;} if(n[i] >= '1' && '9' >= n[i] && n[i] != '\n') { x[j] += n[i]-48; } if(n[i] == '\n') { j = j + 1; } i= i+1; } for(i=0; i < j;i++) { printf("%d",x[i]); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127320/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127320/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [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 [100000 x i8], align 16 %x = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %n) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100000) %n, i8 0, i64 100000, i1 false) call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %x) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %x, i8 0, i64 4004, i1 false) br label %while.cond while.cond: ; preds = %if.end37, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %if.end37 ], [ 0, %entry ] %j.0 = phi i32 [ %spec.select, %if.end37 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %n, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 48 br i1 %cmp, label %land.lhs.true, label %lor.lhs.false land.lhs.true: ; preds = %while.cond %1 = add nsw i64 %indvars.iv, -1 %arrayidx5 = getelementptr inbounds [100000 x i8], ptr %n, i64 0, i64 %1 %2 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7 = icmp eq i8 %2, 10 %3 = load i8, ptr %n, align 16 %cmp11 = icmp eq i8 %3, 48 %or.cond = select i1 %cmp7, i1 true, i1 %cmp11 br i1 %or.cond, label %while.end, label %if.end37 lor.lhs.false: ; preds = %while.cond %.old = load i8, ptr %n, align 16, !tbaa !5 %cmp11.old = icmp eq i8 %.old, 48 br i1 %cmp11.old, label %while.end, label %if.end if.end: ; preds = %lor.lhs.false %4 = add i8 %0, -49 %or.cond66 = icmp ult i8 %4, 9 br i1 %or.cond66, label %if.then30, label %if.end37 if.then30: ; preds = %if.end %conv15 = zext i8 %0 to i32 %sub34 = add nsw i32 %conv15, -48 %idxprom35 = zext i32 %j.0 to i64 %arrayidx36 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %idxprom35 %5 = load i32, ptr %arrayidx36, align 4, !tbaa !8 %add = add nsw i32 %sub34, %5 store i32 %add, ptr %arrayidx36, align 4, !tbaa !8 br label %if.end37 if.end37: ; preds = %land.lhs.true, %if.then30, %if.end %cmp41 = icmp eq i8 %0, 10 %add44 = zext i1 %cmp41 to i32 %spec.select = add nuw nsw i32 %j.0, %add44 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %while.cond while.end: ; preds = %land.lhs.true, %lor.lhs.false %cmp4771.not = icmp eq i32 %j.0, 0 br i1 %cmp4771.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %while.end %wide.trip.count = zext i32 %j.0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv75 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next76, %for.body ] %arrayidx50 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv75 %6 = load i32, ptr %arrayidx50, align 4, !tbaa !8 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %putchar = call i32 @putchar(i32 10) %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body, %while.end call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 100000, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { while(1){ int i=0; int sum=0; char num[1001]={}; scanf("%s",num); if(num[0]-'0'==0){break;} while(num[i]) { sum+=num[i]-'0'; i++; } printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127364/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127364/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %num) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %num, i8 0, i64 1001, i1 false) %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i8, ptr %num, align 16, !tbaa !5 %cmp22 = icmp eq i8 %0, 48 br i1 %cmp22, label %while.end12, label %while.cond2.preheader while.cond2.preheader: ; preds = %entry, %cleanup %1 = phi i8 [ %4, %cleanup ], [ %0, %entry ] %tobool.not18 = icmp eq i8 %1, 0 br i1 %tobool.not18, label %cleanup, label %while.body4 while.body4: ; preds = %while.cond2.preheader, %while.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body4 ], [ 0, %while.cond2.preheader ] %2 = phi i8 [ %3, %while.body4 ], [ %1, %while.cond2.preheader ] %sum.020 = phi i32 [ %add, %while.body4 ], [ 0, %while.cond2.preheader ] %conv7 = sext i8 %2 to i32 %sub8 = add i32 %sum.020, -48 %add = add i32 %sub8, %conv7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx3 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %tobool.not = icmp eq i8 %3, 0 br i1 %tobool.not, label %cleanup, label %while.body4, !llvm.loop !8 cleanup: ; preds = %while.body4, %while.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %add, %while.body4 ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %num) #4 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %num) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %num, i8 0, i64 1001, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %4 = load i8, ptr %num, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end12, label %while.cond2.preheader while.end12: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void) { int sum=0; int l, i; char s[1001]; while(1){ scanf("%s", s); if(s[0] == '0') break; l = strlen(s); for(i=0; i<l; i++){ sum += s[i] - '0'; } printf("%d\n", sum); sum = 0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127414/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127414/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %if.end if.end: ; preds = %entry, %for.end %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv4 = trunc i64 %call3 to i32 %cmp513 = icmp sgt i32 %conv4, 0 br i1 %cmp513, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %if.end %wide.trip.count = and i64 %call3, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader21, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call3, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi19 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %1 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load20 = load <4 x i8>, ptr %2, align 4, !tbaa !5 %3 = sext <4 x i8> %wide.load to <4 x i32> %4 = sext <4 x i8> %wide.load20 to <4 x i32> %5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add <4 x i32> %vec.phi19, <i32 -48, i32 -48, i32 -48, i32 -48> %7 = add <4 x i32> %5, %3 %8 = add <4 x i32> %6, %4 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end, label %for.body.preheader21 for.body.preheader21: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.114.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader21, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader21 ] %sum.114 = phi i32 [ %add, %for.body ], [ %sum.114.ph, %for.body.preheader21 ] %arrayidx7 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %indvars.iv %11 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %11 to i32 %sub = add i32 %sum.114, -48 %add = add i32 %sub, %conv8 %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 !12 for.end: ; preds = %for.body, %middle.block, %if.end %sum.1.lcssa = phi i32 [ 0, %if.end ], [ %10, %middle.block ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %12 = load i8, ptr %s, align 16, !tbaa !5 %cmp = icmp eq i8 %12, 48 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(void){ char num_str[1002]; int num; long sum = 0; int i; char tmp; while (1){ fgets(num_str,sizeof(num_str),stdin); if(num_str[0] == '0') break; for(i=0;i<strlen(num_str)-1;i++){ tmp = num_str[i]; num=atoi(&tmp); sum=sum+num; } printf("%ld\n",sum); sum=0; memset(num_str,1002,0); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num_str = alloca [1002 x i8], align 16 %tmp = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1002, ptr nonnull %num_str) #5 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %tmp) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call21 = call ptr @fgets(ptr noundef nonnull %num_str, i32 noundef 1002, ptr noundef %0) %1 = load i8, ptr %num_str, align 16, !tbaa !9 %cmp22 = icmp eq i8 %1, 48 br i1 %cmp22, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %call415 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num_str) #6 %cmp517.not = icmp eq i64 %call415, 1 br i1 %cmp517.not, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %sum.118 = phi i64 [ %add, %for.body ], [ 0, %for.cond.preheader ] %arrayidx7 = getelementptr inbounds [1002 x i8], ptr %num_str, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx7, align 1, !tbaa !9 store i8 %2, ptr %tmp, align 1, !tbaa !9 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmp, ptr noundef null, i32 noundef 10) #5 %sext = shl i64 %call.i, 32 %conv9 = ashr exact i64 %sext, 32 %add = add nsw i64 %conv9, %sum.118 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num_str) #6 %sub = add i64 %call4, -1 %cmp5 = icmp ugt i64 %sub, %indvars.iv.next br i1 %cmp5, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %for.cond.preheader %sum.1.lcssa = phi i64 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.1.lcssa) %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %num_str, i32 noundef 1002, ptr noundef %3) %4 = load i8, ptr %num_str, align 16, !tbaa !9 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %tmp) #5 call void @llvm.lifetime.end.p0(i64 1002, ptr nonnull %num_str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i,sum; char num[1000]; while(1){ scanf("%s",num); sum=0; i=0; while(num[i] != '\0'){ sum+=num[i]-'0'; i++; } if(sum==0) break; printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127515/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127515/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %num) #3 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i8, ptr %num, align 16, !tbaa !5 %cmp.not1521 = icmp eq i8 %0, 0 br i1 %cmp.not1521, label %while.end10, label %while.body3 while.body3: ; preds = %entry, %while.body3.backedge %indvars.iv = phi i64 [ %indvars.iv.be, %while.body3.backedge ], [ 0, %entry ] %1 = phi i8 [ %.be, %while.body3.backedge ], [ %0, %entry ] %sum.017 = phi i32 [ %sum.017.be, %while.body3.backedge ], [ 0, %entry ] %conv = sext i8 %1 to i32 %sub = add i32 %sum.017, -48 %add = add i32 %sub, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1000 x i8], ptr %num, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %2, 0 br i1 %cmp.not, label %while.end, label %while.body3.backedge while.body3.backedge: ; preds = %while.body3, %if.end %indvars.iv.be = phi i64 [ %indvars.iv.next, %while.body3 ], [ 0, %if.end ] %.be = phi i8 [ %2, %while.body3 ], [ %3, %if.end ] %sum.017.be = phi i32 [ %add, %while.body3 ], [ 0, %if.end ] br label %while.body3, !llvm.loop !8 while.end: ; preds = %while.body3 %cmp7 = icmp eq i32 %add, 0 br i1 %cmp7, label %while.end10, label %if.end if.end: ; preds = %while.end %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %3 = load i8, ptr %num, align 16, !tbaa !5 %cmp.not15 = icmp eq i8 %3, 0 br i1 %cmp.not15, label %while.end10, label %while.body3.backedge while.end10: ; preds = %while.end, %if.end, %entry call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %num) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(void) { int i,a,gokei; char b,suti[1000]; while(1){ gokei = 0; scanf("%s",suti); if(suti[0] == '0'){ break; } a = strlen(suti); for(i=0 ; i<a ; i++){ b= suti[i]; gokei += atoi(&b); } printf("%d\n",gokei); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127559/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127559/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i8, align 1 %suti = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %suti) #5 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %suti) %0 = load i8, ptr %suti, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %if.end if.end: ; preds = %entry, %for.end %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %suti) #6 %conv4 = trunc i64 %call3 to i32 %cmp513 = icmp sgt i32 %conv4, 0 br i1 %cmp513, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %if.end %wide.trip.count = and i64 %call3, 4294967295 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 ] %gokei.015 = phi i32 [ 0, %for.body.preheader ], [ %add, %for.body ] %arrayidx7 = getelementptr inbounds [1000 x i8], ptr %suti, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx7, align 1, !tbaa !5 store i8 %1, ptr %b, align 1, !tbaa !5 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %b, ptr noundef null, i32 noundef 10) #5 %conv.i = trunc i64 %call.i to i32 %add = add nsw i32 %gokei.015, %conv.i %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 !8 for.end: ; preds = %for.body, %if.end %gokei.0.lcssa = phi i32 [ 0, %if.end ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %gokei.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %suti) %2 = load i8, ptr %suti, align 16, !tbaa !5 %cmp = icmp eq i8 %2, 48 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %suti) #5 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #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: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main (void) { int sum[1000]; int i; int j; int k=0; char array[1000]; char n[10]={'0','1','2','3','4','5','6','7','8','9'}; for(i=0;i<1000;i++){ sum[i]=0; } while(1){ for(i=0;i<1000;i++){ array[i]='0'; } scanf("%s",array); if(array[0]=='0'){ break; } for(i=0;i<1000;i++){ for(j=0;j<10;j++){ if(n[j]==array[i]){ sum[k]+=j; } } } k++; } for(i=0;i<=k;i++){ if(sum[i]==0){ break; } printf("%d\n",sum[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127616/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127616/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sum = alloca [1000 x i32], align 16 %array = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %sum) #4 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %array) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %sum, i8 0, i64 4000, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %array, i8 48, i64 1000, i1 false), !tbaa !9 %call99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %array) %0 = load i8, ptr %array, align 16, !tbaa !9 %cmp10100 = icmp eq i8 %0, 48 br i1 %cmp10100, label %for.cond39.preheader, label %for.cond12.preheader for.cond12.preheader: ; preds = %entry, %for.end37 %indvars.iv81102 = phi i64 [ %indvars.iv.next82, %for.end37 ], [ 0, %entry ] %indvars.iv87101 = phi i32 [ %indvars.iv.next88, %for.end37 ], [ 1, %entry ] %arrayidx30 = getelementptr inbounds [1000 x i32], ptr %sum, i64 0, i64 %indvars.iv81102 br label %for.cond16.preheader while.cond.for.cond39.preheader_crit_edge: ; preds = %for.end37 %1 = zext i32 %indvars.iv.next88 to i64 br label %for.cond39.preheader for.cond39.preheader: ; preds = %while.cond.for.cond39.preheader_crit_edge, %entry %indvars.iv87.lcssa = phi i64 [ %1, %while.cond.for.cond39.preheader_crit_edge ], [ 1, %entry ] br label %for.body42 for.cond16.preheader: ; preds = %for.inc32.9.1, %for.cond12.preheader %indvars.iv = phi i64 [ 0, %for.cond12.preheader ], [ %indvars.iv.next.1, %for.inc32.9.1 ] %arrayidx24 = getelementptr inbounds [1000 x i8], ptr %array, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx24, align 2, !tbaa !9 %switch.tableidx = add i8 %2, -49 %3 = icmp ult i8 %switch.tableidx, 9 br i1 %3, label %switch.lookup, label %for.inc32.9 switch.lookup: ; preds = %for.cond16.preheader %switch.idx.cast = zext i8 %switch.tableidx to i32 %switch.offset = add nuw nsw i32 %switch.idx.cast, 1 %4 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %add.2 = add nsw i32 %4, %switch.offset store i32 %add.2, ptr %arrayidx30, align 4, !tbaa !5 br label %for.inc32.9 for.inc32.9: ; preds = %for.cond16.preheader, %switch.lookup %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx24.1 = getelementptr inbounds [1000 x i8], ptr %array, i64 0, i64 %indvars.iv.next %5 = load i8, ptr %arrayidx24.1, align 1, !tbaa !9 %switch.tableidx.1 = add i8 %5, -49 %6 = icmp ult i8 %switch.tableidx.1, 9 br i1 %6, label %switch.lookup.1, label %for.inc32.9.1 switch.lookup.1: ; preds = %for.inc32.9 %switch.idx.cast.1 = zext i8 %switch.tableidx.1 to i32 %switch.offset.1 = add nuw nsw i32 %switch.idx.cast.1, 1 %7 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %add.2.1 = add nsw i32 %7, %switch.offset.1 store i32 %add.2.1, ptr %arrayidx30, align 4, !tbaa !5 br label %for.inc32.9.1 for.inc32.9.1: ; preds = %switch.lookup.1, %for.inc32.9 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 1000 br i1 %exitcond.not.1, label %for.end37, label %for.cond16.preheader, !llvm.loop !10 for.end37: ; preds = %for.inc32.9.1 %indvars.iv.next82 = add nuw i64 %indvars.iv81102, 1 %indvars.iv.next88 = add nuw i32 %indvars.iv87101, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1000) %array, i8 48, i64 1000, i1 false), !tbaa !9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %array) %8 = load i8, ptr %array, align 16, !tbaa !9 %cmp10 = icmp eq i8 %8, 48 br i1 %cmp10, label %while.cond.for.cond39.preheader_crit_edge, label %for.cond12.preheader for.body42: ; preds = %for.cond39.preheader, %if.end48 %indvars.iv84 = phi i64 [ 0, %for.cond39.preheader ], [ %indvars.iv.next85, %if.end48 ] %arrayidx44 = getelementptr inbounds [1000 x i32], ptr %sum, i64 0, i64 %indvars.iv84 %9 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %cmp45 = icmp eq i32 %9, 0 br i1 %cmp45, label %for.end54, label %if.end48 if.end48: ; preds = %for.body42 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond89.not = icmp eq i64 %indvars.iv.next85, %indvars.iv87.lcssa br i1 %exitcond89.not, label %for.end54, label %for.body42, !llvm.loop !12 for.end54: ; preds = %for.body42, %if.end48 call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %array) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %sum) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> int main( void ) { char str[1001] = { 0 }; int i = 0; int sum = 0; while( 1 ){ scanf("%c", &str[i]); if(str[i] == '\n'){ if(i == 1 && str[0] == '0'){ break; } else{ printf("%d\n", sum); sum = 0; i = 0; } } else{ sum += str[i] - 0x30; i++; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127689/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127689/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %str, i8 0, i64 1001, i1 false) br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %i.0 = phi i32 [ 0, %entry ], [ %i.0.be, %while.cond.backedge ] %sum.0 = phi i32 [ 0, %entry ], [ %sum.0.be, %while.cond.backedge ] %idxprom = sext i32 %i.0 to i64 %arrayidx = getelementptr inbounds [1001 x i8], ptr %str, i64 0, i64 %idxprom %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 10 br i1 %cmp, label %if.then, label %if.else12 if.then: ; preds = %while.cond %cmp4 = icmp eq i32 %i.0, 1 %1 = load i8, ptr %str, align 16 %cmp8 = icmp eq i8 %1, 48 %or.cond = select i1 %cmp4, i1 %cmp8, i1 false br i1 %or.cond, label %while.end, label %if.else if.else: ; preds = %if.then %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0) br label %while.cond.backedge if.else12: ; preds = %while.cond %conv = sext i8 %0 to i32 %sub = add i32 %sum.0, -48 %add = add i32 %sub, %conv %inc = add nsw i32 %i.0, 1 br label %while.cond.backedge while.cond.backedge: ; preds = %if.else12, %if.else %i.0.be = phi i32 [ 0, %if.else ], [ %inc, %if.else12 ] %sum.0.be = phi i32 [ 0, %if.else ], [ %add, %if.else12 ] br label %while.cond while.end: ; preds = %if.then call void @llvm.lifetime.end.p0(i64 1001, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ char number[1001]; int i, sum; while(1){ scanf("%s", number); if(number[0]=='0')break; sum=0; for(i=0;number[i]!='\0';i++){ sum+=number[i]-'0'; } printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127731/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127731/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %number = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %number) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %0 = load i8, ptr %number, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp4.not13 = icmp eq i8 %1, 0 br i1 %cmp4.not13, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ] %sum.015 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv3 = sext i8 %2 to i32 %sub = add i32 %sum.015, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [1001 x i8], ptr %number, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %3, 0 br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %4 = load i8, ptr %number, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %number) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ char number[1001]; while(1){ scanf("%s", number); if(number[0] == '0'){break;} int i = 0; int sum = 0; while(number[i]){ sum += number[i] - '0'; i ++ ; } printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127775/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127775/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %number = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %number) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %0 = load i8, ptr %number, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end9, label %while.cond2.preheader while.cond2.preheader: ; preds = %entry, %while.end %1 = phi i8 [ %4, %while.end ], [ %0, %entry ] %tobool.not13 = icmp eq i8 %1, 0 br i1 %tobool.not13, label %while.end, label %while.body4 while.body4: ; preds = %while.cond2.preheader, %while.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body4 ], [ 0, %while.cond2.preheader ] %2 = phi i8 [ %3, %while.body4 ], [ %1, %while.cond2.preheader ] %sum.015 = phi i32 [ %add, %while.body4 ], [ 0, %while.cond2.preheader ] %conv7 = sext i8 %2 to i32 %sub = add i32 %sum.015, -48 %add = add i32 %sub, %conv7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx3 = getelementptr inbounds [1001 x i8], ptr %number, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %tobool.not = icmp eq i8 %3, 0 br i1 %tobool.not, label %while.end, label %while.body4, !llvm.loop !8 while.end: ; preds = %while.body4, %while.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %add, %while.body4 ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %4 = load i8, ptr %number, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end9, label %while.cond2.preheader while.end9: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %number) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main() { int i, j; int sum[10000] = {}; char st[1000]; for( i = 0 ; ; i++ ) { sum[i] = 0; scanf("%s", st); if( st[0] == '0' ) break; for( j = 0 ; j < strlen(st) ; j++ ) { sum[i] = sum[i] + st[j] - '0'; } } for( j = 0 ; j < i ; j++ ) printf("%d\n", sum[j]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127825/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127825/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sum = alloca [10000 x i32], align 16 %st = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %sum) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %sum, i8 0, i64 40000, i1 false) call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %st) #6 store i32 0, ptr %sum, align 16, !tbaa !5 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %st) %0 = load i8, ptr %st, align 16, !tbaa !9 %cmp43 = icmp eq i8 %0, 48 br i1 %cmp43, label %for.end28, label %for.cond3.preheader for.cond3.preheader: ; preds = %entry, %for.inc16 %indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.inc16 ], [ 0, %entry ] %arrayidx45 = phi ptr [ %arrayidx, %for.inc16 ], [ %sum, %entry ] %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %st) #7 %cmp738.not = icmp eq i64 %call6, 0 br i1 %cmp738.not, label %for.inc16, label %for.body.preheader for.body.preheader: ; preds = %for.cond3.preheader %min.iters.check = icmp ult i64 %call6, 8 br i1 %min.iters.check, label %for.body.preheader60, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %call6, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi58 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %1 = getelementptr inbounds [1000 x i8], ptr %st, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !9 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load59 = load <4 x i8>, ptr %2, align 4, !tbaa !9 %3 = sext <4 x i8> %wide.load to <4 x i32> %4 = sext <4 x i8> %wide.load59 to <4 x i32> %5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add <4 x i32> %vec.phi58, <i32 -48, i32 -48, i32 -48, i32 -48> %7 = add <4 x i32> %5, %3 %8 = add <4 x i32> %6, %4 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %call6, %n.vec br i1 %cmp.n, label %for.cond3.for.inc16_crit_edge, label %for.body.preheader60 for.body.preheader60: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sub41.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ] br label %for.body for.cond19.preheader: ; preds = %for.inc16 %11 = and i64 %indvars.iv.next50, 4294967295 %cmp2046.not = icmp eq i64 %11, 0 br i1 %cmp2046.not, label %for.end28, label %for.body22.preheader for.body22.preheader: ; preds = %for.cond19.preheader %wide.trip.count = and i64 %indvars.iv.next50, 4294967295 br label %for.body22 for.body: ; preds = %for.body.preheader60, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader60 ] %sub41 = phi i32 [ %sub, %for.body ], [ %sub41.ph, %for.body.preheader60 ] %arrayidx12 = getelementptr inbounds [1000 x i8], ptr %st, i64 0, i64 %indvars.iv %12 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %conv13 = sext i8 %12 to i32 %add = add i32 %sub41, -48 %sub = add i32 %add, %conv13 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call6 br i1 %exitcond.not, label %for.cond3.for.inc16_crit_edge, label %for.body, !llvm.loop !14 for.cond3.for.inc16_crit_edge: ; preds = %for.body, %middle.block %sub.lcssa = phi i32 [ %10, %middle.block ], [ %sub, %for.body ] store i32 %sub.lcssa, ptr %arrayidx45, align 4, !tbaa !5 br label %for.inc16 for.inc16: ; preds = %for.cond3.for.inc16_crit_edge, %for.cond3.preheader %indvars.iv.next50 = add nuw i64 %indvars.iv49, 1 %arrayidx = getelementptr inbounds [10000 x i32], ptr %sum, i64 0, i64 %indvars.iv.next50 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %st) %13 = load i8, ptr %st, align 16, !tbaa !9 %cmp = icmp eq i8 %13, 48 br i1 %cmp, label %for.cond19.preheader, label %for.cond3.preheader for.body22: ; preds = %for.body22.preheader, %for.body22 %indvars.iv52 = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next53, %for.body22 ] %arrayidx24 = getelementptr inbounds [10000 x i32], ptr %sum, i64 0, i64 %indvars.iv52 %14 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %exitcond55.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count br i1 %exitcond55.not, label %for.end28, label %for.body22, !llvm.loop !15 for.end28: ; preds = %for.body22, %entry, %for.cond19.preheader call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %st) #6 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %sum) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12} !15 = distinct !{!15, !11}
#include<stdio.h> #include<string.h> int main(){ int a,s,i,j,n,sum; char x[1001]; while(1){ sum=0; scanf("%s",x); if(strcmp(x,"0")==0){ break; } for(i=0;x[i]!='\0';i++){ n=x[i]-'0'; sum+=n; } printf("%d\n",sum); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127883/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127883/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %x) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %lhsv17 = load i16, ptr %x, align 16 %.not18 = icmp eq i16 %lhsv17, 48 br i1 %.not18, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %.in = phi i16 [ %lhsv, %for.end ], [ %lhsv17, %entry ] %0 = trunc i16 %.in to i8 %cmp3.not13 = icmp eq i8 %0, 0 br i1 %cmp3.not13, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %1 = phi i8 [ %2, %for.body ], [ %0, %for.cond.preheader ] %sum.015 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv = sext i8 %1 to i32 %sub = add i32 %sum.015, -48 %add = add i32 %sub, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp3.not = icmp eq i8 %2, 0 br i1 %cmp3.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %lhsv = load i16, ptr %x, align 16 %.not = icmp eq i16 %lhsv, 48 br i1 %.not, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(){ char str[1005]; int sum = 0; scanf("%s",str); while(str[0]!='0'){ for(int i=0;i<strlen(str);i++){ sum += str[i]-48; } printf("%d\n",sum); sum=0; scanf("%s",str); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127926/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127926/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [1005 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %0 = load i8, ptr %str, align 16, !tbaa !5 %cmp.not19 = icmp eq i8 %0, 48 br i1 %cmp.not19, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %cmp515.not = icmp eq i64 %call4, 0 br i1 %cmp515.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %min.iters.check = icmp ult i64 %call4, 8 br i1 %min.iters.check, label %for.body.preheader23, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %call4, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi21 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %1 = getelementptr inbounds [1005 x i8], ptr %str, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load22 = load <4 x i8>, ptr %2, align 4, !tbaa !5 %3 = sext <4 x i8> %wide.load to <4 x i32> %4 = sext <4 x i8> %wide.load22 to <4 x i32> %5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add <4 x i32> %vec.phi21, <i32 -48, i32 -48, i32 -48, i32 -48> %7 = add <4 x i32> %5, %3 %8 = add <4 x i32> %6, %4 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %call4, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader23 for.body.preheader23: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.116.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %for.cond.preheader %sum.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %10, %middle.block ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.1.lcssa) %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %11 = load i8, ptr %str, align 16, !tbaa !5 %cmp.not = icmp eq i8 %11, 48 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 for.body: ; preds = %for.body.preheader23, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader23 ] %sum.116 = phi i32 [ %add, %for.body ], [ %sum.116.ph, %for.body.preheader23 ] %arrayidx7 = getelementptr inbounds [1005 x i8], ptr %str, i64 0, i64 %indvars.iv %12 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %12 to i32 %sub = add i32 %sum.116, -48 %add = add i32 %sub, %conv8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call4 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 1005, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9} !13 = distinct !{!13, !9, !11, !10}
#include<stdio.h> int main(){ char y[1001],z,x; int a,b,c,e,f; c=0; while(1){ scanf("%s",y); if(y[0]=='0')break; for(a=0;y[a]!='\0';a++){ b=y[a]-'0'; c=b+c; } printf("%d\n",c); c=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128011/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %y = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %y) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y) %0 = load i8, ptr %y, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp4.not13 = icmp eq i8 %1, 0 br i1 %cmp4.not13, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ] %c.114 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv3 = sext i8 %2 to i32 %sub = add i32 %c.114, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [1001 x i8], ptr %y, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %3, 0 br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %c.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y) %4 = load i8, ptr %y, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %y) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char c; int sum = 0; while ((c=getc(stdin))!= EOF) { if('0' <= c && c <='9') { sum += (c-'0'); if(sum == 0) { break; } } else { printf("%d\n", sum); sum = 0; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128055/source.c" target datalayout = "e-m:e-p270: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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call19 = tail call i32 @getc(ptr noundef %0) %sext20 = shl i32 %call19, 24 %cmp.not22 = icmp eq i32 %sext20, -16777216 br i1 %cmp.not22, label %while.end, label %while.body while.body: ; preds = %entry, %if.end14 %sext24 = phi i32 [ %sext, %if.end14 ], [ %sext20, %entry ] %sum.023 = phi i32 [ %sum.1, %if.end14 ], [ 0, %entry ] %1 = add i32 %sext24, -788529153 %or.cond = icmp ult i32 %1, 184549375 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %while.body %conv125 = lshr exact i32 %sext24, 24 %sub = add i32 %sum.023, -48 %add = add i32 %sub, %conv125 %cmp10 = icmp eq i32 %add, 0 br i1 %cmp10, label %while.end, label %if.end14 if.else: ; preds = %while.body %call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.023) br label %if.end14 if.end14: ; preds = %if.then, %if.else %sum.1 = phi i32 [ %add, %if.then ], [ 0, %if.else ] %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call i32 @getc(ptr noundef %2) %sext = shl i32 %call, 24 %cmp.not = icmp eq i32 %sext, -16777216 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end14, %if.then, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
// SumOfNumbers.c // 与えられた数の各桁の和を計算するプログラムを作成して下さい。 // 【入力】 // 複数のデータセットが入力として与えられます。 // 各データセットは1つの整数 x を含む1行で与えられます。 // x は 1000 桁以下の整数です。 // x が 0 のとき入力の終わりとします。このデータセットに対する出力を行ってはいけません。 // 【出力】 // 各データセットに対して、x の各桁の和を1行に出力して下さい。 // 【例】 // 入力: // 123 // 55 // 1000 // 0 // 出力: // 6 // 10 // 1 #include<stdio.h> #include<string.h> int main( void) { char X[1001]; while( 1) { scanf( "%s", X); if ( strcmp( X, "0") == 0) break; int len = (int)strlen( X); int sum = 0; for ( int i = 0; i < len; i++) { sum += (int)( X[i] - '0'); } printf( "%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128099/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128099/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %X) #5 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %lhsv17 = load i16, ptr %X, align 16 %.not18 = icmp eq i16 %lhsv17, 48 br i1 %.not18, label %while.end, label %if.end if.end: ; preds = %entry, %for.cond.cleanup %call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %X) #6 %conv = trunc i64 %call4 to i32 %cmp513 = icmp sgt i32 %conv, 0 br i1 %cmp513, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %if.end %wide.trip.count = and i64 %call4, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader22, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call4, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi20 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %0 = getelementptr inbounds [1001 x i8], ptr %X, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load21 = load <4 x i8>, ptr %1, align 4, !tbaa !5 %2 = sext <4 x i8> %wide.load to <4 x i32> %3 = sext <4 x i8> %wide.load21 to <4 x i32> %4 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %5 = add <4 x i32> %vec.phi20, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add <4 x i32> %4, %2 %7 = add <4 x i32> %5, %3 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader22 for.body.preheader22: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.014.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %if.end %sum.0.lcssa = phi i32 [ 0, %if.end ], [ %9, %middle.block ], [ %add, %for.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %lhsv = load i16, ptr %X, align 16 %.not = icmp eq i16 %lhsv, 48 br i1 %.not, label %while.end, label %if.end for.body: ; preds = %for.body.preheader22, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader22 ] %sum.014 = phi i32 [ %add, %for.body ], [ %sum.014.ph, %for.body.preheader22 ] %arrayidx = getelementptr inbounds [1001 x i8], ptr %X, i64 0, i64 %indvars.iv %10 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv7 = sext i8 %10 to i32 %sub = add i32 %sum.014, -48 %add = add i32 %sub, %conv7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %X) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include <stdio.h> int main(){ char x[1001]; int i, temp, now; for(i=0;i<1001;i++) x[i]='\0'; while(1){ scanf("%s",x); if(x[0]=='0')return 0; temp=now=0; while(x[now]!='\0'){ temp+=x[now]-'0'; now++; } for(i=0;i<now;i++) x[i]='\0'; printf("%d\n",temp); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128141/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128141/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %x) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %x, i8 0, i64 1001, i1 false), !tbaa !5 %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 16, !tbaa !5 %cmp242 = icmp eq i8 %0, 48 br i1 %cmp242, label %if.then, label %while.cond4.preheader while.cond4.preheader: ; preds = %entry, %for.end23 %1 = phi i8 [ %6, %for.end23 ], [ %0, %entry ] %cmp8.not35 = icmp eq i8 %1, 0 br i1 %cmp8.not35, label %for.end23, label %while.body10 if.then: ; preds = %for.end23, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %x) #4 ret i32 0 for.cond15.preheader: ; preds = %while.body10 %2 = and i64 %indvars.iv.next, 4294967295 %cmp1639.not = icmp eq i64 %2, 0 br i1 %cmp1639.not, label %for.end23, label %for.body18.preheader for.body18.preheader: ; preds = %for.cond15.preheader %3 = and i64 %indvars.iv.next, 4294967295 call void @llvm.memset.p0.i64(ptr nonnull align 16 %x, i8 0, i64 %3, i1 false), !tbaa !5 br label %for.end23 while.body10: ; preds = %while.cond4.preheader, %while.body10 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body10 ], [ 0, %while.cond4.preheader ] %4 = phi i8 [ %5, %while.body10 ], [ %1, %while.cond4.preheader ] %temp.036 = phi i32 [ %add, %while.body10 ], [ 0, %while.cond4.preheader ] %conv7 = sext i8 %4 to i32 %sub = add i32 %temp.036, -48 %add = add i32 %sub, %conv7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx6 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %indvars.iv.next %5 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8.not = icmp eq i8 %5, 0 br i1 %cmp8.not, label %for.cond15.preheader, label %while.body10, !llvm.loop !8 for.end23: ; preds = %while.cond4.preheader, %for.body18.preheader, %for.cond15.preheader %temp.0.lcssa50 = phi i32 [ %add, %for.body18.preheader ], [ %add, %for.cond15.preheader ], [ 0, %while.cond4.preheader ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %temp.0.lcssa50) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %6 = load i8, ptr %x, align 16, !tbaa !5 %cmp2 = icmp eq i8 %6, 48 br i1 %cmp2, label %if.then, label %while.cond4.preheader } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int a[200010]={0}; int A[200010]={0}; int n; scanf("%d", &n); for(int i=2;i<=n;i++) scanf("%d", &a[i]); for(int i=2;i<=n;i++) A[a[i]]++; for(int i=1;i<=n;i++) printf("%d\n",A[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128185/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128185/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [200010 x i32], align 16 %A = alloca [200010 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) %a, i8 0, i64 800040, i1 false) call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %A) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800040) %A, i8 0, i64 800040, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not32 = icmp slt i32 %0, 2 br i1 %cmp.not32, label %for.cond16.preheader, label %for.body for.cond3.preheader: ; preds = %for.body %cmp4.not34 = icmp slt i32 %5, 2 br i1 %cmp4.not34, label %for.cond16.preheader, label %for.body6.preheader for.body6.preheader: ; preds = %for.cond3.preheader %1 = add nuw i32 %5, 1 %wide.trip.count = zext i32 %1 to i64 %2 = add nsw i64 %wide.trip.count, -2 %3 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %2, 3 %4 = icmp ult i64 %3, 3 br i1 %4, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %2, -4 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 2, %entry ] %arrayidx = getelementptr inbounds [200010 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 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond16.preheader.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader %indvars.iv40.unr = phi i64 [ 2, %for.body6.preheader ], [ %indvars.iv.next41.3, %for.body6 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.body6.epil for.body6.epil: ; preds = %for.cond16.preheader.loopexit.unr-lcssa, %for.body6.epil %indvars.iv40.epil = phi i64 [ %indvars.iv.next41.epil, %for.body6.epil ], [ %indvars.iv40.unr, %for.cond16.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body6.epil ], [ 0, %for.cond16.preheader.loopexit.unr-lcssa ] %arrayidx8.epil = getelementptr inbounds [200010 x i32], ptr %a, i64 0, i64 %indvars.iv40.epil %7 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %idxprom9.epil = sext i32 %7 to i64 %arrayidx10.epil = getelementptr inbounds [200010 x i32], ptr %A, i64 0, i64 %idxprom9.epil %8 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %inc11.epil = add nsw i32 %8, 1 store i32 %inc11.epil, ptr %arrayidx10.epil, align 4, !tbaa !5 %indvars.iv.next41.epil = add nuw nsw i64 %indvars.iv40.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.cond16.preheader, label %for.body6.epil, !llvm.loop !11 for.cond16.preheader: ; preds = %for.cond16.preheader.loopexit.unr-lcssa, %for.body6.epil, %entry, %for.cond3.preheader %9 = phi i32 [ %5, %for.cond3.preheader ], [ %0, %entry ], [ %5, %for.body6.epil ], [ %5, %for.cond16.preheader.loopexit.unr-lcssa ] %cmp17.not36 = icmp slt i32 %9, 1 br i1 %cmp17.not36, label %for.cond.cleanup18, label %for.body19 for.body6: ; preds = %for.body6, %for.body6.preheader.new %indvars.iv40 = phi i64 [ 2, %for.body6.preheader.new ], [ %indvars.iv.next41.3, %for.body6 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.3, %for.body6 ] %arrayidx8 = getelementptr inbounds [200010 x i32], ptr %a, i64 0, i64 %indvars.iv40 %10 = load i32, ptr %arrayidx8, align 8, !tbaa !5 %idxprom9 = sext i32 %10 to i64 %arrayidx10 = getelementptr inbounds [200010 x i32], ptr %A, i64 0, i64 %idxprom9 %11 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %inc11 = add nsw i32 %11, 1 store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next41 = or i64 %indvars.iv40, 1 %arrayidx8.1 = getelementptr inbounds [200010 x i32], ptr %a, i64 0, i64 %indvars.iv.next41 %12 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %idxprom9.1 = sext i32 %12 to i64 %arrayidx10.1 = getelementptr inbounds [200010 x i32], ptr %A, i64 0, i64 %idxprom9.1 %13 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %inc11.1 = add nsw i32 %13, 1 store i32 %inc11.1, ptr %arrayidx10.1, align 4, !tbaa !5 %indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 2 %arrayidx8.2 = getelementptr inbounds [200010 x i32], ptr %a, i64 0, i64 %indvars.iv.next41.1 %14 = load i32, ptr %arrayidx8.2, align 8, !tbaa !5 %idxprom9.2 = sext i32 %14 to i64 %arrayidx10.2 = getelementptr inbounds [200010 x i32], ptr %A, i64 0, i64 %idxprom9.2 %15 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %inc11.2 = add nsw i32 %15, 1 store i32 %inc11.2, ptr %arrayidx10.2, align 4, !tbaa !5 %indvars.iv.next41.2 = add nuw nsw i64 %indvars.iv40, 3 %arrayidx8.3 = getelementptr inbounds [200010 x i32], ptr %a, i64 0, i64 %indvars.iv.next41.2 %16 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5 %idxprom9.3 = sext i32 %16 to i64 %arrayidx10.3 = getelementptr inbounds [200010 x i32], ptr %A, i64 0, i64 %idxprom9.3 %17 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %inc11.3 = add nsw i32 %17, 1 store i32 %inc11.3, ptr %arrayidx10.3, align 4, !tbaa !5 %indvars.iv.next41.3 = add nuw nsw i64 %indvars.iv40, 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.cond16.preheader.loopexit.unr-lcssa, label %for.body6, !llvm.loop !13 for.cond.cleanup18: ; preds = %for.body19, %for.cond16.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %a) #4 ret i32 0 for.body19: ; preds = %for.cond16.preheader, %for.body19 %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body19 ], [ 1, %for.cond16.preheader ] %arrayidx21 = getelementptr inbounds [200010 x i32], ptr %A, i64 0, i64 %indvars.iv43 %18 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18) %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp17.not.not = icmp slt i64 %indvars.iv43, %20 br i1 %cmp17.not.not, label %for.body19, label %for.cond.cleanup18, !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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> typedef struct{ int boss; int sub; }manage; int main(void){ int n, i; manage member[200002] = {{0,0}}; scanf("%d", &n); for(i = 2; i <= n; i++){ scanf("%d", &member[i].boss); member[member[i].boss].sub++; } for(i = 1; i <= n; i++){ printf("%d\n",member[i].sub); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128228/source.c" target datalayout = "e-m:e-p270: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.manage = 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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %member = alloca [200002 x %struct.manage], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 1600016, ptr nonnull %member) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600016) %member, i8 0, i64 1600016, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %0, 2 br i1 %cmp.not24, label %for.cond8.preheader, label %for.body for.cond8.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %4, %for.body ] %cmp9.not26 = icmp slt i32 %1, 1 br i1 %cmp9.not26, label %for.end17, label %for.body10 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 2, %entry ] %arrayidx = getelementptr inbounds [200002 x %struct.manage], ptr %member, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %2 = load i32, ptr %arrayidx, align 8, !tbaa !9 %idxprom5 = sext i32 %2 to i64 %sub = getelementptr inbounds [200002 x %struct.manage], ptr %member, i64 0, i64 %idxprom5, i32 1 %3 = load i32, ptr %sub, align 4, !tbaa !11 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %sub, align 4, !tbaa !11 %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.not.not = icmp slt i64 %indvars.iv, %5 br i1 %cmp.not.not, label %for.body, label %for.cond8.preheader, !llvm.loop !12 for.body10: ; preds = %for.cond8.preheader, %for.body10 %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body10 ], [ 1, %for.cond8.preheader ] %sub13 = getelementptr inbounds [200002 x %struct.manage], ptr %member, i64 0, i64 %indvars.iv29, i32 1 %6 = load i32, ptr %sub13, align 4, !tbaa !11 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp9.not.not = icmp slt i64 %indvars.iv29, %8 br i1 %cmp9.not.not, label %for.body10, label %for.end17, !llvm.loop !14 for.end17: ; preds = %for.body10, %for.cond8.preheader call void @llvm.lifetime.end.p0(i64 1600016, ptr nonnull %member) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"", !6, i64 0, !6, i64 4} !11 = !{!10, !6, i64 4} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13}
#include<stdio.h> int ans[200010]; int a[200010]; int main(void){ int n; scanf("%d",&n); for(int i=1;i<n+1;i++)scanf("%d",&a[i]); for(int i=1;i<n+1;i++)ans[a[i]]++; for(int i=1;i<n+1;i++)printf("%d\n",ans[i]); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128286/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128286/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [200010 x i32] zeroinitializer, align 16 @ans = dso_local local_unnamed_addr global [200010 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 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 %cmp.not34 = icmp slt i32 %0, 1 br i1 %cmp.not34, label %for.cond.cleanup20, label %for.body for.cond3.preheader: ; preds = %for.body %cmp5.not36 = icmp slt i32 %3, 1 br i1 %cmp5.not36, label %for.cond.cleanup20, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond3.preheader %1 = zext i32 %3 to i64 %xtraiter = and i64 %1, 1 %2 = icmp eq i32 %3, 1 br i1 %2, label %for.cond17.preheader.unr-lcssa, label %for.body7.preheader.new for.body7.preheader.new: ; preds = %for.body7.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [200010 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 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond17.preheader.unr-lcssa: ; preds = %for.body7, %for.body7.preheader %indvars.iv42.unr = phi i64 [ 1, %for.body7.preheader ], [ %indvars.iv.next43.1, %for.body7 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond17.preheader, label %for.body7.epil for.body7.epil: ; preds = %for.cond17.preheader.unr-lcssa %arrayidx9.epil = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv42.unr %5 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5 %idxprom10.epil = sext i32 %5 to i64 %arrayidx11.epil = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %idxprom10.epil %6 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5 %inc12.epil = add nsw i32 %6, 1 store i32 %inc12.epil, ptr %arrayidx11.epil, align 4, !tbaa !5 br label %for.cond17.preheader for.cond17.preheader: ; preds = %for.cond17.preheader.unr-lcssa, %for.body7.epil br i1 %cmp5.not36, label %for.cond.cleanup20, label %for.body21 for.body7: ; preds = %for.body7, %for.body7.preheader.new %indvars.iv42 = phi i64 [ 1, %for.body7.preheader.new ], [ %indvars.iv.next43.1, %for.body7 ] %niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.body7 ] %arrayidx9 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv42 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %idxprom10 = sext i32 %7 to i64 %arrayidx11 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %idxprom10 %8 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %inc12 = add nsw i32 %8, 1 store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %arrayidx9.1 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv.next43 %9 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5 %idxprom10.1 = sext i32 %9 to i64 %arrayidx11.1 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %idxprom10.1 %10 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5 %inc12.1 = add nsw i32 %10, 1 store i32 %inc12.1, ptr %arrayidx11.1, align 4, !tbaa !5 %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 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.cond17.preheader.unr-lcssa, label %for.body7, !llvm.loop !11 for.cond.cleanup20: ; preds = %for.body21, %entry, %for.cond3.preheader, %for.cond17.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body21: ; preds = %for.cond17.preheader, %for.body21 %indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body21 ], [ 1, %for.cond17.preheader ] %arrayidx23 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %indvars.iv45 %11 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp19.not.not = icmp slt i64 %indvars.iv45, %13 br i1 %cmp19.not.not, label %for.body21, label %for.cond.cleanup20, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <limits.h> #define max 200000 //qsort(str, n, sizeof(int), up_comp); int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;} int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;} int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;} int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);} int main() { int n, i, num_joshi[max], joshi[max]; scanf("%d", &n); for (i=2; i<=n; i++) { scanf("%d", &num_joshi[i]); joshi[i]=0; } for (i=2; i<=n; i++) { joshi[num_joshi[i]]++; } for (i=1; i<=n; i++) { printf("%d\n", joshi[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128336/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128336/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @up_comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @down_comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @count_digit(i32 noundef %a) local_unnamed_addr #1 { entry: %cmp.not3 = icmp eq i32 %a, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %a.addr.04 = phi i32 [ %div, %while.body ], [ %a, %entry ] %div = sdiv i32 %a.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %a.addr.04.off = add i32 %a.addr.04, 9 %cmp.not = icmp ult i32 %a.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nosync nounwind memory(none) uwtable define dso_local i32 @euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end3, %entry %a.tr = phi i32 [ %a, %entry ], [ %spec.select17, %if.end3 ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %if.end3 ] %spec.select17 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr) %cmp1 = icmp slt i32 %spec.select17, 1 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %tailrecurse %spec.select = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr) %rem = srem i32 %spec.select, %spec.select17 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %cleanup, label %tailrecurse cleanup: ; preds = %if.end3, %tailrecurse %retval.0 = phi i32 [ -1, %tailrecurse ], [ %spec.select17, %if.end3 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %n = alloca i32, align 4 %num_joshi = alloca [200000 x i32], align 16 %joshi = alloca [200000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %num_joshi) #7 call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %joshi) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not33 = icmp slt i32 %0, 2 br i1 %cmp.not33, label %for.cond15.preheader, label %for.body for.cond4.preheader: ; preds = %for.body %cmp5.not35 = icmp slt i32 %5, 2 br i1 %cmp5.not35, label %for.cond15.preheader, label %for.body6.preheader for.body6.preheader: ; preds = %for.cond4.preheader %1 = add nuw i32 %5, 1 %wide.trip.count = zext i32 %1 to i64 %2 = add nsw i64 %wide.trip.count, -2 %3 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %2, 3 %4 = icmp ult i64 %3, 3 br i1 %4, label %for.cond15.preheader.loopexit.unr-lcssa, label %for.body6.preheader.new for.body6.preheader.new: ; preds = %for.body6.preheader %unroll_iter = and i64 %2, -4 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 2, %entry ] %arrayidx = getelementptr inbounds [200000 x i32], ptr %num_joshi, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx3 = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %indvars.iv store i32 0, ptr %arrayidx3, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !11 for.cond15.preheader.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader %indvars.iv41.unr = phi i64 [ 2, %for.body6.preheader ], [ %indvars.iv.next42.3, %for.body6 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond15.preheader, label %for.body6.epil for.body6.epil: ; preds = %for.cond15.preheader.loopexit.unr-lcssa, %for.body6.epil %indvars.iv41.epil = phi i64 [ %indvars.iv.next42.epil, %for.body6.epil ], [ %indvars.iv41.unr, %for.cond15.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body6.epil ], [ 0, %for.cond15.preheader.loopexit.unr-lcssa ] %arrayidx8.epil = getelementptr inbounds [200000 x i32], ptr %num_joshi, i64 0, i64 %indvars.iv41.epil %7 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %idxprom9.epil = sext i32 %7 to i64 %arrayidx10.epil = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %idxprom9.epil %8 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %inc11.epil = add nsw i32 %8, 1 store i32 %inc11.epil, ptr %arrayidx10.epil, align 4, !tbaa !5 %indvars.iv.next42.epil = add nuw nsw i64 %indvars.iv41.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.cond15.preheader, label %for.body6.epil, !llvm.loop !12 for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit.unr-lcssa, %for.body6.epil, %entry, %for.cond4.preheader %9 = phi i32 [ %5, %for.cond4.preheader ], [ %0, %entry ], [ %5, %for.body6.epil ], [ %5, %for.cond15.preheader.loopexit.unr-lcssa ] %cmp16.not37 = icmp slt i32 %9, 1 br i1 %cmp16.not37, label %for.end23, label %for.body17 for.body6: ; preds = %for.body6, %for.body6.preheader.new %indvars.iv41 = phi i64 [ 2, %for.body6.preheader.new ], [ %indvars.iv.next42.3, %for.body6 ] %niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.3, %for.body6 ] %arrayidx8 = getelementptr inbounds [200000 x i32], ptr %num_joshi, i64 0, i64 %indvars.iv41 %10 = load i32, ptr %arrayidx8, align 8, !tbaa !5 %idxprom9 = sext i32 %10 to i64 %arrayidx10 = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %idxprom9 %11 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %inc11 = add nsw i32 %11, 1 store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next42 = or i64 %indvars.iv41, 1 %arrayidx8.1 = getelementptr inbounds [200000 x i32], ptr %num_joshi, i64 0, i64 %indvars.iv.next42 %12 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %idxprom9.1 = sext i32 %12 to i64 %arrayidx10.1 = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %idxprom9.1 %13 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %inc11.1 = add nsw i32 %13, 1 store i32 %inc11.1, ptr %arrayidx10.1, align 4, !tbaa !5 %indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 2 %arrayidx8.2 = getelementptr inbounds [200000 x i32], ptr %num_joshi, i64 0, i64 %indvars.iv.next42.1 %14 = load i32, ptr %arrayidx8.2, align 8, !tbaa !5 %idxprom9.2 = sext i32 %14 to i64 %arrayidx10.2 = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %idxprom9.2 %15 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %inc11.2 = add nsw i32 %15, 1 store i32 %inc11.2, ptr %arrayidx10.2, align 4, !tbaa !5 %indvars.iv.next42.2 = add nuw nsw i64 %indvars.iv41, 3 %arrayidx8.3 = getelementptr inbounds [200000 x i32], ptr %num_joshi, i64 0, i64 %indvars.iv.next42.2 %16 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5 %idxprom9.3 = sext i32 %16 to i64 %arrayidx10.3 = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %idxprom9.3 %17 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5 %inc11.3 = add nsw i32 %17, 1 store i32 %inc11.3, ptr %arrayidx10.3, align 4, !tbaa !5 %indvars.iv.next42.3 = add nuw nsw i64 %indvars.iv41, 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.cond15.preheader.loopexit.unr-lcssa, label %for.body6, !llvm.loop !14 for.body17: ; preds = %for.cond15.preheader, %for.body17 %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body17 ], [ 1, %for.cond15.preheader ] %arrayidx19 = getelementptr inbounds [200000 x i32], ptr %joshi, i64 0, i64 %indvars.iv44 %18 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18) %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1 %19 = load i32, ptr %n, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp16.not.not = icmp slt i64 %indvars.iv44, %20 br i1 %cmp16.not.not, label %for.body17, label %for.end23, !llvm.loop !15 for.end23: ; preds = %for.body17, %for.cond15.preheader call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %joshi) #7 call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %num_joshi) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { 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 #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <stdlib.h> int main() { int a[32],i,n,w,x=0,p,q,r,s,t,perm[120]={12345 ,12354 ,12435 ,12453 ,12543 ,12534 ,13245 ,13254 ,13425 ,13452 ,13542 ,13524 ,14325 ,14352 ,14235 ,14253 ,14523 ,14532 ,15342 ,15324 ,15432 ,15423 ,15243 ,15234 ,21345 ,21354 ,21435 ,21453 ,21543 ,21534 ,23145 ,23154 ,23415 ,23451 ,23541 ,23514 ,24315 ,24351 ,24135 ,24153 ,24513 ,24531 ,25341 ,25314 ,25431 ,25413 ,25143 ,25134 ,32145 ,32154 ,32415 ,32451 ,32541 ,32514 ,31245 ,31254 ,31425 ,31452 ,31542 ,31524 ,34125 ,34152 ,34215 ,34251 ,34521 ,34512 ,35142 ,35124 ,35412 ,35421 ,35241 ,35214 ,42315 ,42351 ,42135 ,42153 ,42513 ,42531 ,43215 ,43251 ,43125 ,43152 ,43512 ,43521 ,41325 ,41352 ,41235 ,41253 ,41523 ,41532 ,45312 ,45321 ,45132 ,45123 ,45213 ,45231 ,52341 ,52314 ,52431 ,52413 ,52143 ,52134 ,53241 ,53214 ,53421 ,53412 ,53142 ,53124 ,54321 ,54312 ,54231 ,54213 ,54123 ,54132 ,51342 ,51324 ,51432 ,51423 ,51243 ,51234}; char b[5]; for (i=6; i<31; i++) { scanf("%d", &a[i]); } for (i = 0; i<120; i++) { sprintf(b, "%d", perm[i]); p = b[0] - '0'; q = b[1] - '0'; r = b[2] - '0'; s = b[3] - '0'; t = b[4] - '0'; n = a[(p*5)+q]+a[(q*5)+p]+a[(r*5)+s]+a[(s*5)+r]+a[(q*5)+r]+a[(r*5)+q]+a[(s*5)+t]+a[(t*5)+s]+a[(r*5)+s]+a[(s*5)+r]+a[(s*5)+t]+a[(t*5)+s]; if (n >= x) { x = n; } } printf("%d",x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12838/source.c" target datalayout = "e-m:e-p270: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.perm = private unnamed_addr constant [120 x i32] [i32 12345, i32 12354, i32 12435, i32 12453, i32 12543, i32 12534, i32 13245, i32 13254, i32 13425, i32 13452, i32 13542, i32 13524, i32 14325, i32 14352, i32 14235, i32 14253, i32 14523, i32 14532, i32 15342, i32 15324, i32 15432, i32 15423, i32 15243, i32 15234, i32 21345, i32 21354, i32 21435, i32 21453, i32 21543, i32 21534, i32 23145, i32 23154, i32 23415, i32 23451, i32 23541, i32 23514, i32 24315, i32 24351, i32 24135, i32 24153, i32 24513, i32 24531, i32 25341, i32 25314, i32 25431, i32 25413, i32 25143, i32 25134, i32 32145, i32 32154, i32 32415, i32 32451, i32 32541, i32 32514, i32 31245, i32 31254, i32 31425, i32 31452, i32 31542, i32 31524, i32 34125, i32 34152, i32 34215, i32 34251, i32 34521, i32 34512, i32 35142, i32 35124, i32 35412, i32 35421, i32 35241, i32 35214, i32 42315, i32 42351, i32 42135, i32 42153, i32 42513, i32 42531, i32 43215, i32 43251, i32 43125, i32 43152, i32 43512, i32 43521, i32 41325, i32 41352, i32 41235, i32 41253, i32 41523, i32 41532, i32 45312, i32 45321, i32 45132, i32 45123, i32 45213, i32 45231, i32 52341, i32 52314, i32 52431, i32 52413, i32 52143, i32 52134, i32 53241, i32 53214, i32 53421, i32 53412, i32 53142, i32 53124, i32 54321, i32 54312, i32 54231, i32 54213, i32 54123, i32 54132, i32 51342, i32 51324, i32 51432, i32 51423, i32 51243, i32 51234], align 16 @.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 [32 x i32], align 16 %b = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %b) #4 %arrayidx = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx.1 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 7 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 8 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 9 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %arrayidx.4 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 10 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %arrayidx.5 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 11 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %arrayidx.6 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 12 %call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6) %arrayidx.7 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 13 %call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.7) %arrayidx.8 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 14 %call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.8) %arrayidx.9 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 15 %call.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.9) %arrayidx.10 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 16 %call.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.10) %arrayidx.11 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 17 %call.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.11) %arrayidx.12 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 18 %call.12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.12) %arrayidx.13 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 19 %call.13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.13) %arrayidx.14 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 20 %call.14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.14) %arrayidx.15 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 21 %call.15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.15) %arrayidx.16 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 22 %call.16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.16) %arrayidx.17 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 23 %call.17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.17) %arrayidx.18 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 24 %call.18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.18) %arrayidx.19 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 25 %call.19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.19) %arrayidx.20 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 26 %call.20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.20) %arrayidx.21 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 27 %call.21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.21) %arrayidx.22 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 28 %call.22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.22) %arrayidx.23 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 29 %call.23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.23) %arrayidx.24 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 30 %call.24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.24) %arrayidx8 = getelementptr inbounds [5 x i8], ptr %b, i64 0, i64 1 %arrayidx11 = getelementptr inbounds [5 x i8], ptr %b, i64 0, i64 2 %arrayidx14 = getelementptr inbounds [5 x i8], ptr %b, i64 0, i64 3 %arrayidx17 = getelementptr inbounds [5 x i8], ptr %b, i64 0, i64 4 br label %for.body3 for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body3 ] %x.0115 = phi i32 [ 0, %entry ], [ %spec.select, %for.body3 ] %arrayidx5 = getelementptr inbounds [120 x i32], ptr @__const.main.perm, i64 0, i64 %indvars.iv %0 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %call6 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) #4 %1 = load i8, ptr %b, align 1, !tbaa !9 %conv = sext i8 %1 to i32 %sub = add nsw i32 %conv, -48 %2 = load i8, ptr %arrayidx8, align 1, !tbaa !9 %conv9 = sext i8 %2 to i32 %sub10 = add nsw i32 %conv9, -48 %3 = load i8, ptr %arrayidx11, align 1, !tbaa !9 %conv12 = sext i8 %3 to i32 %sub13 = add nsw i32 %conv12, -48 %4 = load i8, ptr %arrayidx14, align 1, !tbaa !9 %conv15 = sext i8 %4 to i32 %sub16 = add nsw i32 %conv15, -48 %5 = load i8, ptr %arrayidx17, align 1, !tbaa !9 %conv18 = sext i8 %5 to i32 %sub19 = add nsw i32 %conv18, -48 %mul = mul nsw i32 %sub, 5 %add = add nsw i32 %mul, %sub10 %idxprom20 = sext i32 %add to i64 %arrayidx21 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom20 %6 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %mul22 = mul nsw i32 %sub10, 5 %add23 = add nsw i32 %mul22, %sub %idxprom24 = sext i32 %add23 to i64 %arrayidx25 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom24 %7 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %mul27 = mul nsw i32 %sub13, 5 %add28 = add nsw i32 %mul27, %sub16 %idxprom29 = sext i32 %add28 to i64 %arrayidx30 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom29 %8 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %mul32 = mul nsw i32 %sub16, 5 %add33 = add nsw i32 %mul32, %sub13 %idxprom34 = sext i32 %add33 to i64 %arrayidx35 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom34 %9 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %add38 = add nsw i32 %mul22, %sub13 %idxprom39 = sext i32 %add38 to i64 %arrayidx40 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom39 %10 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %add43 = add nsw i32 %mul27, %sub10 %idxprom44 = sext i32 %add43 to i64 %arrayidx45 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom44 %11 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %add48 = add nsw i32 %mul32, %sub19 %idxprom49 = sext i32 %add48 to i64 %arrayidx50 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom49 %12 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %mul52 = mul nsw i32 %sub19, 5 %add53 = add nsw i32 %mul52, %sub16 %idxprom54 = sext i32 %add53 to i64 %arrayidx55 = getelementptr inbounds [32 x i32], ptr %a, i64 0, i64 %idxprom54 %13 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %reass.add = add i32 %9, %8 %reass.add112 = add i32 %reass.add, %12 %reass.add113 = add i32 %reass.add112, %13 %reass.mul = shl i32 %reass.add113, 1 %add61 = add i32 %7, %6 %add66 = add i32 %add61, %10 %add71 = add i32 %add66, %11 %add76 = add i32 %add71, %reass.mul %spec.select = call i32 @llvm.smax.i32(i32 %add76, i32 %x.0115) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 120 br i1 %exitcond.not, label %for.end81, label %for.body3, !llvm.loop !10 for.end81: ; preds = %for.body3 %call82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 128, 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 @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: 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int n, i; int a[1000000]; int buka[1000000] = { 0 }; scanf("%d", &n); for (i = 0; i < n - 1; i++) { scanf("%d", &a[i]); } for (i = 0; i < n - 1; i++) { buka[a[i] - 1]++; } for (i = 0; i < n; i++) { printf("%d\n", buka[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1000000 x i32], align 16 %buka = alloca [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %buka) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000000) %buka, i8 0, i64 4000000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp33 = icmp sgt i32 %0, 1 br i1 %cmp33, label %for.body, label %for.cond15.preheader for.cond2.preheader: ; preds = %for.body %cmp435 = icmp sgt i32 %2, 1 br i1 %cmp435, label %for.body5.preheader, label %for.cond15.preheader for.body5.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %sub, 1 br i1 %1, label %for.cond15.preheader.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body5 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.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, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %3 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond15.preheader.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader %indvars.iv41.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next42.1, %for.body5 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond15.preheader, label %for.body5.epil for.body5.epil: ; preds = %for.cond15.preheader.loopexit.unr-lcssa %arrayidx7.epil = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv41.unr %4 = load i32, ptr %arrayidx7.epil, align 4, !tbaa !5 %sub8.epil = add nsw i32 %4, -1 %idxprom9.epil = sext i32 %sub8.epil to i64 %arrayidx10.epil = getelementptr inbounds [1000000 x i32], ptr %buka, i64 0, i64 %idxprom9.epil %5 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5 %inc11.epil = add nsw i32 %5, 1 store i32 %inc11.epil, ptr %arrayidx10.epil, align 4, !tbaa !5 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.body5.epil, %for.cond15.preheader.loopexit.unr-lcssa, %entry, %for.cond2.preheader %6 = phi i32 [ %2, %for.cond2.preheader ], [ %0, %entry ], [ %2, %for.cond15.preheader.loopexit.unr-lcssa ], [ %2, %for.body5.epil ] %cmp1637 = icmp sgt i32 %6, 0 br i1 %cmp1637, label %for.body17, label %for.end23 for.body5: ; preds = %for.body5, %for.body5.preheader.new %indvars.iv41 = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next42.1, %for.body5 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ] %arrayidx7 = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv41 %7 = load i32, ptr %arrayidx7, align 8, !tbaa !5 %sub8 = add nsw i32 %7, -1 %idxprom9 = sext i32 %sub8 to i64 %arrayidx10 = getelementptr inbounds [1000000 x i32], ptr %buka, i64 0, i64 %idxprom9 %8 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %inc11 = add nsw i32 %8, 1 store i32 %inc11, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next42 = or i64 %indvars.iv41, 1 %arrayidx7.1 = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv.next42 %9 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %sub8.1 = add nsw i32 %9, -1 %idxprom9.1 = sext i32 %sub8.1 to i64 %arrayidx10.1 = getelementptr inbounds [1000000 x i32], ptr %buka, i64 0, i64 %idxprom9.1 %10 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %inc11.1 = add nsw i32 %10, 1 store i32 %inc11.1, ptr %arrayidx10.1, align 4, !tbaa !5 %indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond15.preheader.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11 for.body17: ; preds = %for.cond15.preheader, %for.body17 %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body17 ], [ 0, %for.cond15.preheader ] %arrayidx19 = getelementptr inbounds [1000000 x i32], ptr %buka, i64 0, i64 %indvars.iv44 %11 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp16 = icmp slt i64 %indvars.iv.next45, %13 br i1 %cmp16, label %for.body17, label %for.end23, !llvm.loop !12 for.end23: ; preds = %for.body17, %for.cond15.preheader call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %buka) #4 call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #include<string.h> int main () { int a,b,i,s=0; scanf("%d",&a); int x[a]; for(i=0;i<a;i++) { x[i]=0; } for(i=0;i<(a-1);i++) { scanf("%d",&b); x[b]++; } for(i=1;i<a;i++) { printf("%d\n",x[i]); } printf("%d\n",0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, 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 %a, align 4, !tbaa !5 %cmp28 = icmp sgt i32 %3, 0 br i1 %cmp28, label %for.cond1.preheader, label %for.end19 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 %cmp231.not = icmp eq i32 %3, 1 br i1 %cmp231.not, label %for.end19, label %for.body3 for.cond11.preheader: ; preds = %for.body3 %6 = icmp sgt i32 %9, 1 br i1 %6, label %for.body13, label %for.end19 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.132 = phi i32 [ %inc9, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %7 = load i32, ptr %b, align 4, !tbaa !5 %idxprom5 = sext i32 %7 to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5 %8 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %inc7 = add nsw i32 %8, 1 store i32 %inc7, ptr %arrayidx6, align 4, !tbaa !5 %inc9 = add nuw nsw i32 %i.132, 1 %9 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %9, -1 %cmp2 = icmp slt i32 %inc9, %sub br i1 %cmp2, label %for.body3, label %for.cond11.preheader, !llvm.loop !9 for.body13: ; preds = %for.cond11.preheader, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ 1, %for.cond11.preheader ] %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %10 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = load i32, ptr %a, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp12 = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp12, label %for.body13, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.body13, %entry, %for.cond1.preheader, %for.cond11.preheader %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind 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"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> int main(){ int N; scanf("%d",&N); int A[N]; int i; for(i = 0; i < N; i++){ A[i] = 0; } int tmp; for(i = 0; i < N-1; i++){ scanf("%d",&tmp); A[tmp-1] += 1; } for(i = 0; i < N; i++){ printf("%d\n",A[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %tmp = 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() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %3, 0 br i1 %cmp27, label %for.end, label %for.cond11.preheader.thread38 for.cond11.preheader.thread38: ; preds = %entry call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #5 br label %for.end19 for.end: ; 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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #5 %cmp230.not = icmp eq i32 %3, 1 br i1 %cmp230.not, label %for.body13.preheader, label %for.body3 for.cond11.preheader: ; preds = %for.body3 %cmp1232 = icmp sgt i32 %8, 0 br i1 %cmp1232, label %for.body13.preheader, label %for.end19 for.body13.preheader: ; preds = %for.end, %for.cond11.preheader br label %for.body13 for.body3: ; preds = %for.end, %for.body3 %i.131 = phi i32 [ %inc9, %for.body3 ], [ 0, %for.end ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp) %6 = load i32, ptr %tmp, align 4, !tbaa !5 %sub5 = add nsw i32 %6, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %idxprom6 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %add = add nsw i32 %7, 1 store i32 %add, ptr %arrayidx7, align 4, !tbaa !5 %inc9 = add nuw nsw i32 %i.131, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %cmp2 = icmp slt i32 %inc9, %sub br i1 %cmp2, label %for.body3, label %for.cond11.preheader, !llvm.loop !9 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ 0, %for.body13.preheader ] %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %9 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %N, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp12 = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp12, label %for.body13, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.body13, %for.cond11.preheader.thread38, %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #5 call void @llvm.stackrestore.p0(ptr %2) 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 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 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"} !11 = distinct !{!11, !10}