Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <stdlib.h> int main() { int n; int f = 0; int a, b; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d %d", &a, &b); if (a == b) { f++; } else { f = 0; } if (f >= 3) { printf("Yes"); return 0; } } printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278903/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278903/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not15 = icmp sgt i32 %0, 0 br i1 %cmp.not15, label %for.body, label %cleanup9 for.cond: ; preds = %for.body %inc7 = add nuw nsw i32 %i.017, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not = icmp slt i32 %inc7, %1 br i1 %cmp.not, label %for.body, label %cleanup9, !llvm.loop !9 for.body: ; preds = %entry, %for.cond %i.017 = phi i32 [ %inc7, %for.cond ], [ 0, %entry ] %f.016 = phi i32 [ %f.1, %for.cond ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %b, align 4, !tbaa !5 %cmp2 = icmp eq i32 %2, %3 %inc = add nsw i32 %f.016, 1 %f.1 = select i1 %cmp2, i32 %inc, i32 0 %cmp3 = icmp sgt i32 %f.1, 2 br i1 %cmp3, label %cleanup9, label %for.cond cleanup9: ; preds = %for.cond, %for.body, %entry %.str.2.sink = phi ptr [ @.str.3, %entry ], [ @.str.2, %for.body ], [ @.str.3, %for.cond ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdbool.h> int main(void){ char s[10], c; int l = 0, cnt = 0; bool ok = true; while((c=getchar())!='\n') s[l++] = c; for(int i=0; i<l; i++){ if('a'<=s[i] && s[i]<='z') cnt++; else if(s[i]=='C'){ if(i<2 || l-2<i) ok = false; } else if(s[i]=='A'){ if(i!=0) ok = false; } else ok = false; } if(ok && cnt==l-2) puts("AC"); else puts("WA"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278947/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278947/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"AC\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"WA\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #3 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i68 = tail call i32 @getc(ptr noundef %0) %sext.mask69 = and i32 %call.i68, 255 %cmp.not70 = icmp eq i32 %sext.mask69, 10 br i1 %cmp.not70, label %if.else50, label %while.body for.cond.preheader: ; preds = %while.body %1 = trunc i64 %indvars.iv.next to i32 %cmp373.not = icmp eq i32 %1, 0 br i1 %cmp373.not, label %if.else50, label %for.body.lr.ph for.body.lr.ph: ; preds = %for.cond.preheader %sub = add nsw i32 %1, -2 %2 = sext i32 %sub to i64 %wide.trip.count = and i64 %indvars.iv.next, 4294967295 %3 = load i8, ptr %s, align 1, !tbaa !9 %4 = add i8 %3, -97 %or.cond.peel = icmp ult i8 %4, 26 %cond = icmp eq i8 %3, 65 %cnt.1.peel = zext i1 %or.cond.peel to i32 %narrow = or i1 %or.cond.peel, %cond %ok.1.peel = zext i1 %narrow to i8 %exitcond.peel.not = icmp eq i32 %1, 1 br i1 %exitcond.peel.not, label %for.cond.cleanup, label %for.body.peel.next for.body.peel.next: ; preds = %for.body.lr.ph %arrayidx6.peel84 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 1 %5 = load i8, ptr %arrayidx6.peel84, align 1, !tbaa !9 %6 = add i8 %5, -97 %or.cond.peel85 = icmp ult i8 %6, 26 %inc15.peel96 = select i1 %or.cond.peel, i32 2, i32 1 %cnt.1.peel98 = select i1 %or.cond.peel85, i32 %inc15.peel96, i32 %cnt.1.peel %ok.1.peel99 = select i1 %or.cond.peel85, i8 %ok.1.peel, i8 0 %exitcond.peel101.not = icmp eq i32 %1, 2 br i1 %exitcond.peel101.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %for.body.peel.next %xtraiter = and i64 %indvars.iv.next, 1 %7 = icmp eq i64 %wide.trip.count, 3 br i1 %7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %8 = add nsw i64 %wide.trip.count, -2 %unroll_iter = sub nsw i64 %8, %xtraiter br label %for.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %call.i72 = phi i32 [ %call.i, %while.body ], [ %call.i68, %entry ] %conv = trunc i32 %call.i72 to i8 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv store i8 %conv, ptr %arrayidx, align 1, !tbaa !9 %9 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %9) %sext.mask = and i32 %call.i, 255 %cmp.not = icmp eq i32 %sext.mask, 10 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !10 for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %cnt.1.lcssa117.ph = phi i32 [ undef, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ] %ok.1.lcssa116.ph = phi i8 [ undef, %for.body.preheader ], [ %ok.1.1, %for.inc.1 ] %indvars.iv80.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next81.1, %for.inc.1 ] %ok.075.unr = phi i8 [ %ok.1.peel99, %for.body.preheader ], [ %ok.1.1, %for.inc.1 ] %cnt.074.unr = phi i32 [ %cnt.1.peel98, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx6.epil = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv80.unr %10 = load i8, ptr %arrayidx6.epil, align 1, !tbaa !9 %11 = add i8 %10, -97 %or.cond.epil = icmp ult i8 %11, 26 br i1 %or.cond.epil, label %if.then.epil, label %if.else.epil if.else.epil: ; preds = %for.body.epil %cond113.epil = icmp eq i8 %10, 67 br i1 %cond113.epil, label %if.then21.epil, label %for.cond.cleanup if.then21.epil: ; preds = %if.else.epil %cmp24.epil = icmp sgt i64 %indvars.iv80.unr, %2 %spec.select67.epil = select i1 %cmp24.epil, i8 0, i8 %ok.075.unr br label %for.cond.cleanup if.then.epil: ; preds = %for.body.epil %inc15.epil = add nsw i32 %cnt.074.unr, 1 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %if.then.epil, %if.then21.epil, %if.else.epil, %for.body.lr.ph, %for.body.peel.next %cnt.1.lcssa = phi i32 [ %cnt.1.peel, %for.body.lr.ph ], [ %cnt.1.peel98, %for.body.peel.next ], [ %cnt.1.lcssa117.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %inc15.epil, %if.then.epil ], [ %cnt.074.unr, %if.then21.epil ], [ %cnt.074.unr, %if.else.epil ] %ok.1.lcssa = phi i8 [ %ok.1.peel, %for.body.lr.ph ], [ %ok.1.peel99, %for.body.peel.next ], [ %ok.1.lcssa116.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %ok.075.unr, %if.then.epil ], [ %spec.select67.epil, %if.then21.epil ], [ 0, %if.else.epil ] %12 = and i8 %ok.1.lcssa, 1 %13 = icmp ne i8 %12, 0 %cmp46 = icmp eq i32 %cnt.1.lcssa, %sub %or.cond66 = select i1 %13, i1 %cmp46, i1 false br i1 %or.cond66, label %if.end52, label %if.else50 for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv80 = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next81.1, %for.inc.1 ] %ok.075 = phi i8 [ %ok.1.peel99, %for.body.preheader.new ], [ %ok.1.1, %for.inc.1 ] %cnt.074 = phi i32 [ %cnt.1.peel98, %for.body.preheader.new ], [ %cnt.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx6 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv80 %14 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %15 = add i8 %14, -97 %or.cond = icmp ult i8 %15, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %for.body %inc15 = add nsw i32 %cnt.074, 1 br label %for.inc if.else: ; preds = %for.body %cond113 = icmp eq i8 %14, 67 br i1 %cond113, label %if.then21, label %for.inc if.then21: ; preds = %if.else %cmp24 = icmp sgt i64 %indvars.iv80, %2 %spec.select67 = select i1 %cmp24, i8 0, i8 %ok.075 br label %for.inc for.inc: ; preds = %if.else, %if.then21, %if.then %cnt.1 = phi i32 [ %inc15, %if.then ], [ %cnt.074, %if.then21 ], [ %cnt.074, %if.else ] %ok.1 = phi i8 [ %ok.075, %if.then ], [ %spec.select67, %if.then21 ], [ 0, %if.else ] %indvars.iv.next81 = or i64 %indvars.iv80, 1 %arrayidx6.1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv.next81 %16 = load i8, ptr %arrayidx6.1, align 1, !tbaa !9 %17 = add i8 %16, -97 %or.cond.1 = icmp ult i8 %17, 26 br i1 %or.cond.1, label %if.then.1, label %if.else.1 if.else.1: ; preds = %for.inc %cond113.1 = icmp eq i8 %16, 67 br i1 %cond113.1, label %if.then21.1, label %for.inc.1 if.then21.1: ; preds = %if.else.1 %cmp24.1 = icmp sgt i64 %indvars.iv.next81, %2 %spec.select67.1 = select i1 %cmp24.1, i8 0, i8 %ok.1 br label %for.inc.1 if.then.1: ; preds = %for.inc %inc15.1 = add nsw i32 %cnt.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then21.1, %if.else.1 %cnt.1.1 = phi i32 [ %inc15.1, %if.then.1 ], [ %cnt.1, %if.then21.1 ], [ %cnt.1, %if.else.1 ] %ok.1.1 = phi i8 [ %ok.1, %if.then.1 ], [ %spec.select67.1, %if.then21.1 ], [ 0, %if.else.1 ] %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 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.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !12 if.else50: ; preds = %entry, %for.cond.preheader, %for.cond.cleanup br label %if.end52 if.end52: ; preds = %for.cond.cleanup, %if.else50 %.str.1.sink = phi ptr [ @.str.1, %if.else50 ], [ @.str, %for.cond.cleanup ] %call51 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 10, 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: 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 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13} !13 = !{!"llvm.loop.peeled.count", i32 2}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define INT_MAX 2147483647 int main(void){ char S[11]; scanf("%s", S); if(S[0] != 'A') { printf("WA\n"); return 0; } int C = 0; int i; int Cindex = 0; for(i=2; i <= strlen(S) - 2; i++) { if(S[i] == 'C') { C++; Cindex = i; } } if(C != 1) { printf("WA\n"); return 0; } for(i=1; S[i] != '\0'; i++) { if(i != Cindex) { if(S[i] < 'a' || S[i] > 'z') { printf("WA\n"); return 0; } } } printf("AC\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_278990/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_278990/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"AC\00", align 1 @str.5 = private unnamed_addr constant [3 x i8] c"WA\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) %0 = load i8, ptr %S, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, 65 br i1 %cmp.not, label %for.cond.preheader, label %cleanup50 for.cond.preheader: ; preds = %entry %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6 %1 = and i64 %call5, -2 %cmp6.not65 = icmp eq i64 %1, 2 br i1 %cmp6.not65, label %cleanup50, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %2 = add i64 %call5, -3 %3 = add i64 %call5, -4 %xtraiter = and i64 %2, 3 %4 = icmp ult i64 %3, 3 br i1 %4, label %for.end.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %2, -4 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %Cindex.068 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select63.3, %for.body ] %C.066 = 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 ] %arrayidx8 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv %5 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %cmp10 = icmp eq i8 %5, 67 %inc = zext i1 %cmp10 to i32 %spec.select = add nuw nsw i32 %C.066, %inc %6 = trunc i64 %indvars.iv to i32 %spec.select63 = select i1 %cmp10, i32 %6, i32 %Cindex.068 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx8.1 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv.next %7 = load i8, ptr %arrayidx8.1, align 1, !tbaa !5 %cmp10.1 = icmp eq i8 %7, 67 %inc.1 = zext i1 %cmp10.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %inc.1 %8 = trunc i64 %indvars.iv.next to i32 %spec.select63.1 = select i1 %cmp10.1, i32 %8, i32 %spec.select63 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %arrayidx8.2 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv.next.1 %9 = load i8, ptr %arrayidx8.2, align 1, !tbaa !5 %cmp10.2 = icmp eq i8 %9, 67 %inc.2 = zext i1 %cmp10.2 to i32 %spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2 %10 = trunc i64 %indvars.iv.next.1 to i32 %spec.select63.2 = select i1 %cmp10.2, i32 %10, i32 %spec.select63.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %arrayidx8.3 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv.next.2 %11 = load i8, ptr %arrayidx8.3, align 1, !tbaa !5 %cmp10.3 = icmp eq i8 %11, 67 %inc.3 = zext i1 %cmp10.3 to i32 %spec.select.3 = add nuw nsw i32 %spec.select.2, %inc.3 %12 = trunc i64 %indvars.iv.next.2 to i32 %spec.select63.3 = select i1 %cmp10.3, i32 %12, i32 %spec.select63.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 %for.end.unr-lcssa, label %for.body, !llvm.loop !8 for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.3, %for.body ] %spec.select63.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select63.3, %for.body ] %indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %Cindex.068.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select63.3, %for.body ] %C.066.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 %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.unr-lcssa ] %Cindex.068.epil = phi i32 [ %spec.select63.epil, %for.body.epil ], [ %Cindex.068.unr, %for.end.unr-lcssa ] %C.066.epil = phi i32 [ %spec.select.epil, %for.body.epil ], [ %C.066.unr, %for.end.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.unr-lcssa ] %arrayidx8.epil = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv.epil %13 = load i8, ptr %arrayidx8.epil, align 1, !tbaa !5 %cmp10.epil = icmp eq i8 %13, 67 %inc.epil = zext i1 %cmp10.epil to i32 %spec.select.epil = add nuw nsw i32 %C.066.epil, %inc.epil %14 = trunc i64 %indvars.iv.epil to i32 %spec.select63.epil = select i1 %cmp10.epil, i32 %14, i32 %Cindex.068.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 %for.end, label %for.body.epil, !llvm.loop !10 for.end: ; preds = %for.body.epil, %for.end.unr-lcssa %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.unr-lcssa ], [ %spec.select.epil, %for.body.epil ] %spec.select63.lcssa = phi i32 [ %spec.select63.lcssa.ph, %for.end.unr-lcssa ], [ %spec.select63.epil, %for.body.epil ] %15 = icmp eq i32 %spec.select.lcssa, 1 %16 = zext i32 %spec.select63.lcssa to i64 br i1 %15, label %for.cond20.preheader, label %cleanup50 for.cond20.preheader: ; preds = %for.end %arrayidx2271 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 1 %17 = load i8, ptr %arrayidx2271, align 1, !tbaa !5 %cmp24.not72 = icmp eq i8 %17, 0 br i1 %cmp24.not72, label %cleanup50, label %for.body26 for.cond20: ; preds = %for.body26 %indvars.iv.next76 = add nuw i64 %indvars.iv75, 1 %arrayidx22 = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 %indvars.iv.next76 %18 = load i8, ptr %arrayidx22, align 1, !tbaa !5 %cmp24.not = icmp eq i8 %18, 0 br i1 %cmp24.not, label %cleanup50, label %for.body26, !llvm.loop !12 for.body26: ; preds = %for.cond20.preheader, %for.cond20 %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.cond20 ], [ 1, %for.cond20.preheader ] %19 = phi i8 [ %18, %for.cond20 ], [ %17, %for.cond20.preheader ] %cmp27.not = icmp ne i64 %indvars.iv75, %16 %20 = add i8 %19, -123 %or.cond = icmp ult i8 %20, -26 %or.cond64 = and i1 %cmp27.not, %or.cond br i1 %or.cond64, label %cleanup50, label %for.cond20 cleanup50: ; preds = %for.cond20, %for.body26, %for.cond20.preheader, %for.end, %for.cond.preheader, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %for.cond.preheader ], [ @str.5, %for.end ], [ @str, %for.cond20.preheader ], [ @str.5, %for.body26 ], [ @str, %for.cond20 ] %puts61 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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 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"} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.unroll.disable"} !12 = distinct !{!12, !9}
#include <stdio.h> #include<math.h> int main(void) { int tc; scanf("%d",&tc); int c,d; while(tc>0){ scanf("%d",&c); d = pow(2,c); printf("%d\n",d-1); tc--; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %tc = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tc) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tc) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %.pr = load i32, ptr %tc, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %.pr, 0 br i1 %cmp5, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %ldexp = call double @ldexp(double 1.000000e+00, i32 %0) #4 %conv3 = fptosi double %ldexp to i32 %sub = add nsw i32 %conv3, -1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) %1 = load i32, ptr %tc, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %tc, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tc) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree willreturn declare double @ldexp(double, i32) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void){ int i,moji,ccount=0; char s[10]; char ans[] = "AC"; scanf("%s",s); for(moji=0; s[moji]!='\0'; moji++); for(i=0; i<moji; i++){ if((s[i] == 'B') | (s[i]>='D' && s[i]<='Z') | s[0] != 'A'){ strcpy(ans,"WA"); } } for(i=2; i<moji-1; i++){ if(s[i] == 'C') ccount++; if(ccount >= 2){ strcpy(ans,"WA"); } } if(ccount == 0){ strcpy(ans,"WA"); } printf("%s\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279090/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279090/source.c" target datalayout = "e-m:e-p270: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.ans = private unnamed_addr constant [3 x i8] c"AC\00", align 1 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"WA\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 %ans = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %ans) #5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @__const.main.ans, i64 3, i1 false) %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.iv92 = phi i32 [ %indvars.iv.next93, %for.cond ], [ -1, %entry ] %indvars.iv82 = phi i32 [ %indvars.iv.next83, %for.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10 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.next83 = add i32 %indvars.iv82, 1 %indvars.iv.next93 = add i32 %indvars.iv92, 1 br i1 %cmp.not, label %for.cond2.preheader, label %for.cond, !llvm.loop !8 for.cond2.preheader: ; preds = %for.cond %1 = trunc i64 %indvars.iv to i32 %cmp375.not = icmp eq i32 %1, 0 br i1 %cmp375.not, label %if.then54, label %for.body5.lr.ph for.body5.lr.ph: ; preds = %for.cond2.preheader %2 = load i8, ptr %s, align 1, !tbaa !5 %.fr = freeze i8 %2 %cmp23.not = icmp eq i8 %.fr, 65 br i1 %cmp23.not, label %for.body5.preheader, label %for.body5.us.preheader for.body5.us.preheader: ; preds = %for.body5.lr.ph %3 = add i32 %indvars.iv82, -1 %xtraiter = and i32 %indvars.iv82, 3 %4 = icmp ult i32 %3, 3 br i1 %4, label %for.cond31.preheader.loopexit100.unr-lcssa, label %for.body5.us.preheader.new for.body5.us.preheader.new: ; preds = %for.body5.us.preheader %unroll_iter = and i32 %indvars.iv82, -4 br label %for.body5.us for.body5.preheader: ; preds = %for.body5.lr.ph %xtraiter101 = and i64 %indvars.iv, 1 %5 = icmp eq i64 %indvars.iv, 1 br i1 %5, label %for.cond31.preheader.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter104 = and i64 %indvars.iv, -2 br label %for.body5 for.body5.us: ; preds = %for.body5.us, %for.body5.us.preheader.new %niter = phi i32 [ 0, %for.body5.us.preheader.new ], [ %niter.next.3, %for.body5.us ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 %niter.next.3 = add i32 %niter, 4 %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond31.preheader.loopexit100.unr-lcssa, label %for.body5.us, !llvm.loop !10 for.cond31.preheader.loopexit.unr-lcssa: ; preds = %for.inc28.1, %for.body5.preheader %indvars.iv84.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next85.1, %for.inc28.1 ] %lcmp.mod103.not = icmp eq i64 %xtraiter101, 0 br i1 %lcmp.mod103.not, label %for.cond31.preheader, label %for.body5.epil for.body5.epil: ; preds = %for.cond31.preheader.loopexit.unr-lcssa %arrayidx7.epil = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv84.unr %6 = load i8, ptr %arrayidx7.epil, align 1, !tbaa !5 %cmp9.epil = icmp eq i8 %6, 66 %7 = add i8 %6, -68 %spec.select.epil = icmp ult i8 %7, 23 %or72.epil = or i1 %cmp9.epil, %spec.select.epil br i1 %or72.epil, label %if.then.epil, label %for.cond31.preheader if.then.epil: ; preds = %for.body5.epil call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %for.cond31.preheader for.cond31.preheader.loopexit100.unr-lcssa: ; preds = %for.body5.us, %for.body5.us.preheader %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond31.preheader, label %for.body5.us.epil for.body5.us.epil: ; preds = %for.cond31.preheader.loopexit100.unr-lcssa, %for.body5.us.epil %epil.iter = phi i32 [ %epil.iter.next, %for.body5.us.epil ], [ 0, %for.cond31.preheader.loopexit100.unr-lcssa ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond31.preheader, label %for.body5.us.epil, !llvm.loop !11 for.cond31.preheader: ; preds = %for.cond31.preheader.loopexit100.unr-lcssa, %for.body5.us.epil, %for.cond31.preheader.loopexit.unr-lcssa, %if.then.epil, %for.body5.epil %cmp3277 = icmp ugt i32 %1, 3 br i1 %cmp3277, label %for.body34.preheader, label %if.then54 for.body34.preheader: ; preds = %for.cond31.preheader %wide.trip.count94 = zext i32 %indvars.iv92 to i64 %xtraiter106 = and i64 %wide.trip.count94, 1 %8 = icmp eq i32 %indvars.iv92, 3 br i1 %8, label %for.end51.unr-lcssa, label %for.body34.preheader.new for.body34.preheader.new: ; preds = %for.body34.preheader %9 = and i64 %wide.trip.count94, 4294967294 %10 = add nsw i64 %9, -4 br label %for.body34 for.body5: ; preds = %for.inc28.1, %for.body5.preheader.new %indvars.iv84 = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next85.1, %for.inc28.1 ] %niter105 = phi i64 [ 0, %for.body5.preheader.new ], [ %niter105.next.1, %for.inc28.1 ] %arrayidx7 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv84 %11 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %cmp9 = icmp eq i8 %11, 66 %12 = add i8 %11, -68 %spec.select = icmp ult i8 %12, 23 %or72 = or i1 %cmp9, %spec.select br i1 %or72, label %if.then, label %for.inc28 if.then: ; preds = %for.body5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %for.inc28 for.inc28: ; preds = %for.body5, %if.then %indvars.iv.next85 = or i64 %indvars.iv84, 1 %arrayidx7.1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv.next85 %13 = load i8, ptr %arrayidx7.1, align 1, !tbaa !5 %cmp9.1 = icmp eq i8 %13, 66 %14 = add i8 %13, -68 %spec.select.1 = icmp ult i8 %14, 23 %or72.1 = or i1 %cmp9.1, %spec.select.1 br i1 %or72.1, label %if.then.1, label %for.inc28.1 if.then.1: ; preds = %for.inc28 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %for.inc28.1 for.inc28.1: ; preds = %if.then.1, %for.inc28 %indvars.iv.next85.1 = add nuw nsw i64 %indvars.iv84, 2 %niter105.next.1 = add i64 %niter105, 2 %niter105.ncmp.1 = icmp eq i64 %niter105.next.1, %unroll_iter104 br i1 %niter105.ncmp.1, label %for.cond31.preheader.loopexit.unr-lcssa, label %for.body5, !llvm.loop !10 for.body34: ; preds = %for.inc49.1, %for.body34.preheader.new %indvars.iv89 = phi i64 [ 2, %for.body34.preheader.new ], [ %indvars.iv.next90.1, %for.inc49.1 ] %ccount.079 = phi i32 [ 0, %for.body34.preheader.new ], [ %spec.select74.1, %for.inc49.1 ] %niter111 = phi i64 [ 0, %for.body34.preheader.new ], [ %niter111.next.1, %for.inc49.1 ] %arrayidx36 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv89 %15 = load i8, ptr %arrayidx36, align 1, !tbaa !5 %cmp38 = icmp eq i8 %15, 67 %inc41 = zext i1 %cmp38 to i32 %spec.select74 = add nuw nsw i32 %ccount.079, %inc41 %cmp43 = icmp ugt i32 %spec.select74, 1 br i1 %cmp43, label %if.then45, label %for.inc49 if.then45: ; preds = %for.body34 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %for.inc49 for.inc49: ; preds = %for.body34, %if.then45 %indvars.iv.next90 = or i64 %indvars.iv89, 1 %arrayidx36.1 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv.next90 %16 = load i8, ptr %arrayidx36.1, align 1, !tbaa !5 %cmp38.1 = icmp eq i8 %16, 67 %inc41.1 = zext i1 %cmp38.1 to i32 %spec.select74.1 = add nuw nsw i32 %spec.select74, %inc41.1 %cmp43.1 = icmp ugt i32 %spec.select74.1, 1 br i1 %cmp43.1, label %if.then45.1, label %for.inc49.1 if.then45.1: ; preds = %for.inc49 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %for.inc49.1 for.inc49.1: ; preds = %if.then45.1, %for.inc49 %indvars.iv.next90.1 = add nuw nsw i64 %indvars.iv89, 2 %niter111.next.1 = add i64 %niter111, 2 %niter111.ncmp.1 = icmp eq i64 %niter111, %10 br i1 %niter111.ncmp.1, label %for.end51.unr-lcssa, label %for.body34, !llvm.loop !13 for.end51.unr-lcssa: ; preds = %for.inc49.1, %for.body34.preheader %spec.select74.lcssa.ph = phi i32 [ undef, %for.body34.preheader ], [ %spec.select74.1, %for.inc49.1 ] %indvars.iv89.unr = phi i64 [ 2, %for.body34.preheader ], [ %indvars.iv.next90.1, %for.inc49.1 ] %ccount.079.unr = phi i32 [ 0, %for.body34.preheader ], [ %spec.select74.1, %for.inc49.1 ] %lcmp.mod108.not = icmp eq i64 %xtraiter106, 0 br i1 %lcmp.mod108.not, label %for.end51, label %for.body34.epil for.body34.epil: ; preds = %for.end51.unr-lcssa %arrayidx36.epil = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv89.unr %17 = load i8, ptr %arrayidx36.epil, align 1, !tbaa !5 %cmp38.epil = icmp eq i8 %17, 67 %inc41.epil = zext i1 %cmp38.epil to i32 %spec.select74.epil = add nuw nsw i32 %ccount.079.unr, %inc41.epil %cmp43.epil = icmp ugt i32 %spec.select74.epil, 1 br i1 %cmp43.epil, label %if.then45.epil, label %for.end51 if.then45.epil: ; preds = %for.body34.epil call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %for.end51 for.end51: ; preds = %for.body34.epil, %if.then45.epil, %for.end51.unr-lcssa %spec.select74.lcssa = phi i32 [ %spec.select74.lcssa.ph, %for.end51.unr-lcssa ], [ %spec.select74.epil, %if.then45.epil ], [ %spec.select74.epil, %for.body34.epil ] %18 = icmp eq i32 %spec.select74.lcssa, 0 br i1 %18, label %if.then54, label %if.end57 if.then54: ; preds = %for.cond2.preheader, %for.cond31.preheader, %for.end51 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %ans, ptr noundef nonnull align 1 dereferenceable(3) @.str.1, i64 3, i1 false) #5 br label %if.end57 if.end57: ; preds = %if.then54, %for.end51 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %ans) #5 call void @llvm.lifetime.end.p0(i64 10, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 ; Function Attrs: 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 @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 = { mustprogress nocallback nofree 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 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 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !9}
#include<stdio.h> int main(){ char s[11]; scanf("%s",s); if(s[0]!='A'||s[1]<'a') { printf("WA"); return 0; } int i,c=0,end=0; for(i=2;i<10&&s[i]!='\0'&&end==0;i++) { if(s[i]=='C'){ if(c==0) c++; else { printf("WA"); return 0; } } else if(s[i]=='\0') end=1; else if(s[i]<'a'){ printf("WA"); return 0; } } if(s[i-1]=='C') c=c-1; if(c<1) printf("WA"); else printf("AC"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279148/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279148/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"WA\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"AC\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) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %cmp = icmp ne i8 %0, 65 %arrayidx2 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx2, align 1 %cmp4 = icmp slt i8 %1, 97 %or.cond = select i1 %cmp, i1 true, i1 %cmp4 br i1 %or.cond, label %cleanup62, label %land.lhs.true.preheader land.lhs.true.preheader: ; preds = %entry %arrayidx9 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx9, align 1, !tbaa !5 switch i8 %2, label %if.else33 [ i8 0, label %for.end i8 67, label %for.inc ] if.else33: ; preds = %land.lhs.true.preheader %cmp37 = icmp slt i8 %2, 97 br i1 %cmp37, label %cleanup62, label %for.inc for.inc: ; preds = %land.lhs.true.preheader, %if.else33 %cmp21.1 = phi i1 [ true, %if.else33 ], [ false, %land.lhs.true.preheader ] %c.1 = phi i32 [ 0, %if.else33 ], [ 1, %land.lhs.true.preheader ] %arrayidx9.1 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx9.1, align 1, !tbaa !5 switch i8 %3, label %if.else33.1 [ i8 0, label %for.end i8 67, label %if.then20.1 ] if.then20.1: ; preds = %for.inc br i1 %cmp21.1, label %for.inc.1, label %cleanup62 if.else33.1: ; preds = %for.inc %cmp37.1 = icmp slt i8 %3, 97 br i1 %cmp37.1, label %cleanup62, label %for.inc.1 for.inc.1: ; preds = %if.else33.1, %if.then20.1 %c.1.1 = phi i32 [ %c.1, %if.else33.1 ], [ 1, %if.then20.1 ] %arrayidx9.2 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 4 %4 = load i8, ptr %arrayidx9.2, align 1, !tbaa !5 switch i8 %4, label %if.else33.2 [ i8 0, label %for.end i8 67, label %if.then20.2 ] if.then20.2: ; preds = %for.inc.1 %cmp21.2 = icmp eq i32 %c.1.1, 0 br i1 %cmp21.2, label %for.inc.2, label %cleanup62 if.else33.2: ; preds = %for.inc.1 %cmp37.2 = icmp slt i8 %4, 97 br i1 %cmp37.2, label %cleanup62, label %for.inc.2 for.inc.2: ; preds = %if.else33.2, %if.then20.2 %c.1.2 = phi i32 [ %c.1.1, %if.else33.2 ], [ 1, %if.then20.2 ] %arrayidx9.3 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 5 %5 = load i8, ptr %arrayidx9.3, align 1, !tbaa !5 switch i8 %5, label %if.else33.3 [ i8 0, label %for.end i8 67, label %if.then20.3 ] if.then20.3: ; preds = %for.inc.2 %cmp21.3 = icmp eq i32 %c.1.2, 0 br i1 %cmp21.3, label %for.inc.3, label %cleanup62 if.else33.3: ; preds = %for.inc.2 %cmp37.3 = icmp slt i8 %5, 97 br i1 %cmp37.3, label %cleanup62, label %for.inc.3 for.inc.3: ; preds = %if.else33.3, %if.then20.3 %c.1.3 = phi i32 [ %c.1.2, %if.else33.3 ], [ 1, %if.then20.3 ] %arrayidx9.4 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 6 %6 = load i8, ptr %arrayidx9.4, align 1, !tbaa !5 switch i8 %6, label %if.else33.4 [ i8 0, label %for.end i8 67, label %if.then20.4 ] if.then20.4: ; preds = %for.inc.3 %cmp21.4 = icmp eq i32 %c.1.3, 0 br i1 %cmp21.4, label %for.inc.4, label %cleanup62 if.else33.4: ; preds = %for.inc.3 %cmp37.4 = icmp slt i8 %6, 97 br i1 %cmp37.4, label %cleanup62, label %for.inc.4 for.inc.4: ; preds = %if.else33.4, %if.then20.4 %c.1.4 = phi i32 [ %c.1.3, %if.else33.4 ], [ 1, %if.then20.4 ] %arrayidx9.5 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 7 %7 = load i8, ptr %arrayidx9.5, align 1, !tbaa !5 switch i8 %7, label %if.else33.5 [ i8 0, label %for.end i8 67, label %if.then20.5 ] if.then20.5: ; preds = %for.inc.4 %cmp21.5 = icmp eq i32 %c.1.4, 0 br i1 %cmp21.5, label %for.inc.5, label %cleanup62 if.else33.5: ; preds = %for.inc.4 %cmp37.5 = icmp slt i8 %7, 97 br i1 %cmp37.5, label %cleanup62, label %for.inc.5 for.inc.5: ; preds = %if.else33.5, %if.then20.5 %c.1.5 = phi i32 [ %c.1.4, %if.else33.5 ], [ 1, %if.then20.5 ] %arrayidx9.6 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 8 %8 = load i8, ptr %arrayidx9.6, align 1, !tbaa !5 switch i8 %8, label %if.else33.6 [ i8 0, label %for.end i8 67, label %if.then20.6 ] if.then20.6: ; preds = %for.inc.5 %cmp21.6 = icmp eq i32 %c.1.5, 0 br i1 %cmp21.6, label %for.inc.6, label %cleanup62 if.else33.6: ; preds = %for.inc.5 %cmp37.6 = icmp slt i8 %8, 97 br i1 %cmp37.6, label %cleanup62, label %for.inc.6 for.inc.6: ; preds = %if.else33.6, %if.then20.6 %c.1.6 = phi i32 [ %c.1.5, %if.else33.6 ], [ 1, %if.then20.6 ] %arrayidx9.7 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 9 %9 = load i8, ptr %arrayidx9.7, align 1, !tbaa !5 switch i8 %9, label %if.else33.7 [ i8 0, label %for.end i8 67, label %if.then20.7 ] if.then20.7: ; preds = %for.inc.6 %cmp21.7 = icmp eq i32 %c.1.6, 0 br i1 %cmp21.7, label %for.end, label %cleanup62 if.else33.7: ; preds = %for.inc.6 %cmp37.7 = icmp slt i8 %9, 97 br i1 %cmp37.7, label %cleanup62, label %for.end for.end: ; preds = %if.then20.7, %if.else33.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %land.lhs.true.preheader %i.0.lcssa = phi i64 [ 1, %land.lhs.true.preheader ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ], [ 8, %for.inc.6 ], [ 9, %if.else33.7 ], [ 9, %if.then20.7 ] %c.0.lcssa = phi i32 [ 0, %land.lhs.true.preheader ], [ %c.1, %for.inc ], [ %c.1.1, %for.inc.1 ], [ %c.1.2, %for.inc.2 ], [ %c.1.3, %for.inc.3 ], [ %c.1.4, %for.inc.4 ], [ %c.1.5, %for.inc.5 ], [ %c.1.6, %for.inc.6 ], [ %c.1.6, %if.else33.7 ], [ 1, %if.then20.7 ] %arrayidx46 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %i.0.lcssa %10 = load i8, ptr %arrayidx46, align 1, !tbaa !5 %cmp48 = icmp eq i8 %10, 67 %sub51 = sext i1 %cmp48 to i32 %spec.select = add nsw i32 %c.0.lcssa, %sub51 %cmp53 = icmp slt i32 %spec.select, 1 %.str.1..str.2 = select i1 %cmp53, ptr @.str.1, ptr @.str.2 br label %cleanup62 cleanup62: ; preds = %for.end, %if.else33, %if.else33.1, %if.else33.2, %if.else33.3, %if.else33.4, %if.else33.5, %if.else33.6, %if.else33.7, %if.then20.1, %if.then20.2, %if.then20.3, %if.then20.4, %if.then20.5, %if.then20.6, %if.then20.7, %entry %.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %if.then20.7 ], [ @.str.1, %if.then20.6 ], [ @.str.1, %if.then20.5 ], [ @.str.1, %if.then20.4 ], [ @.str.1, %if.then20.3 ], [ @.str.1, %if.then20.2 ], [ @.str.1, %if.then20.1 ], [ @.str.1, %if.else33.7 ], [ @.str.1, %if.else33.6 ], [ @.str.1, %if.else33.5 ], [ @.str.1, %if.else33.4 ], [ @.str.1, %if.else33.3 ], [ @.str.1, %if.else33.2 ], [ @.str.1, %if.else33.1 ], [ @.str.1, %if.else33 ], [ %.str.1..str.2, %for.end ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 11, 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"}
#include <stdio.h> int main(void) { int n[100]; int x; int i; scanf("%d", &x); for (i = 0; i < x; i++){ scanf("%d", &n[i]); } for (i = x - 1; i >= 0; i--){ printf("%d", n[i]); if (i != 0){ printf(" "); } } printf("\n"); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279191/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279191/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca [100 x i32], align 16 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %n) #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 %cmp20 = icmp sgt i32 %0, 0 br i1 %cmp20, label %for.body, label %for.end11 for.cond2.preheader: ; preds = %for.body %cmp323 = icmp sgt i32 %2, 0 br i1 %cmp323, label %for.body4.preheader, label %for.end11 for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %n, 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 %x, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.preheader, %for.inc10 %indvars.iv27 = phi i64 [ %1, %for.body4.preheader ], [ %indvars.iv.next28, %for.inc10 ] %indvars.iv.next28 = add nsw i64 %indvars.iv27, -1 %idxprom5 = and i64 %indvars.iv.next28, 4294967295 %arrayidx6 = getelementptr inbounds [100 x i32], ptr %n, i64 0, i64 %idxprom5 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %5 = and i64 %indvars.iv.next28, 4294967295 %cmp8.not = icmp eq i64 %5, 0 br i1 %cmp8.not, label %for.inc10, label %if.then if.then: ; preds = %for.body4 %putchar19 = call i32 @putchar(i32 32) br label %for.inc10 for.inc10: ; preds = %for.body4, %if.then %cmp3 = icmp ugt i64 %indvars.iv27, 1 br i1 %cmp3, label %for.body4, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.inc10, %entry, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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}
#include <stdio.h> int main(void) { int a[100]; int n; int d; scanf("%d", &n); for (d = 0; d < n; d++){ scanf("%d", &a[d]); } n -= 1; for (d = n; d > 0; d--){ printf("%d ", a[d]); } printf("%d\n", a[d]); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279241/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279241/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca [100 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry %sub30 = add i32 %0, -1 store i32 %sub30, ptr %n, align 4, !tbaa !5 br label %for.end9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %sub = add i32 %1, -1 store i32 %sub, ptr %n, align 4, !tbaa !5 %cmp321 = icmp sgt i32 %1, 1 br i1 %cmp321, label %for.body4.preheader, label %for.end9 for.body4.preheader: ; preds = %for.end %3 = zext i32 %sub to i64 br label %for.body4 for.body4: ; preds = %for.body4.preheader, %for.body4 %indvars.iv26 = phi i64 [ %3, %for.body4.preheader ], [ %indvars.iv.next27, %for.body4 ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv26 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %indvars.iv.next27 = add nsw i64 %indvars.iv26, -1 %cmp3 = icmp ugt i64 %indvars.iv26, 1 br i1 %cmp3, label %for.body4, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.body4, %for.end.thread, %for.end %d.1.lcssa = phi i32 [ %sub, %for.end ], [ %sub30, %for.end.thread ], [ 0, %for.body4 ] %idxprom10 = sext i32 %d.1.lcssa to i64 %arrayidx11 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom10 %5 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int n,h[100],i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&h[i]); } for(n=i-1;n>0;n--){ printf("%d ",h[n]); } printf("%d\n",h[0]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279292/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279292/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %h = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %h) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.body, label %for.cond2.preheader.thread for.cond2.preheader.thread: ; preds = %entry store i32 -1, ptr %n, align 4, !tbaa !5 br label %for.end9 for.cond2.preheader: ; preds = %for.body %1 = trunc i64 %indvars.iv.next to i32 %storemerge17 = add nsw i32 %1, -1 store i32 %storemerge17, ptr %n, align 4, !tbaa !5 %cmp318 = icmp sgt i32 %1, 1 br i1 %cmp318, label %for.body4, label %for.end9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %h, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %storemerge19 = phi i32 [ %storemerge, %for.body4 ], [ %storemerge17, %for.cond2.preheader ] %idxprom5 = zext i32 %storemerge19 to i64 %arrayidx6 = getelementptr inbounds [100 x i32], ptr %h, i64 0, i64 %idxprom5 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %5 = load i32, ptr %n, align 4, !tbaa !5 %storemerge = add nsw i32 %5, -1 store i32 %storemerge, ptr %n, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %5, 1 br i1 %cmp3, label %for.body4, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.body4, %for.cond2.preheader.thread, %for.cond2.preheader %6 = load i32, ptr %h, align 16, !tbaa !5 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %h) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int book[1000017]; int main() { int n, i, j, t; scanf("%d", &n); for(i = 1; i <= n; i++) { scanf("%d", &j); book[j] = 1; } t = 0; for(i = 1, j = 1000000; t < n; i++, j--) { if(book[i] == 1) t++; if(book[j] == 1) t++; } printf("%d\n", i-2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27935/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27935/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @book = dso_local local_unnamed_addr global [1000017 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 %j = 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 %j) #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.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end17, label %for.body for.cond2.preheader: ; preds = %for.body %cmp327 = icmp sgt i32 %2, 0 br i1 %cmp327, label %for.body4, label %for.end17 for.body: ; preds = %entry, %for.body %i.026 = phi i32 [ %inc, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %1 = load i32, ptr %j, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [1000017 x i32], ptr @book, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.026, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.026, %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.iv34 = phi i64 [ %indvars.iv.next35, %for.body4 ], [ 1000000, %for.cond2.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.cond2.preheader ] %t.030 = phi i32 [ %t.2, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [1000017 x i32], ptr @book, i64 0, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 %inc8 = zext i1 %cmp7 to i32 %spec.select = add nsw i32 %t.030, %inc8 %arrayidx10 = getelementptr inbounds [1000017 x i32], ptr @book, i64 0, i64 %indvars.iv34 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp eq i32 %4, 1 %inc13 = zext i1 %cmp11 to i32 %t.2 = add nsw i32 %spec.select, %inc13 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next35 = add i64 %indvars.iv34, -1 %cmp3 = icmp slt i32 %t.2, %2 br i1 %cmp3, label %for.body4, label %for.end17.loopexit, !llvm.loop !11 for.end17.loopexit: ; preds = %for.body4 %5 = trunc i64 %indvars.iv.next35 to i32 %6 = trunc i64 %indvars.iv.next to i32 %7 = add nsw i32 %6, -2 br label %for.end17 for.end17: ; preds = %entry, %for.end17.loopexit, %for.cond2.preheader %storemerge.lcssa = phi i32 [ 1000000, %for.cond2.preheader ], [ %5, %for.end17.loopexit ], [ 1000000, %entry ] %i.1.lcssa = phi i32 [ -1, %for.cond2.preheader ], [ %7, %for.end17.loopexit ], [ -1, %entry ] store i32 %storemerge.lcssa, ptr %j, align 4, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.1.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int n; int a[100]; int i; scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%d", &a[i]); } i--; while (i >= 0){ printf("%d", a[i]); if (i != 0){ printf(" "); } i--; } printf("\n"); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279393/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279393/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.body, label %while.end while.cond.preheader: ; preds = %for.body %1 = trunc i64 %indvars.iv.next to i32 %cmp221 = icmp sgt i32 %1, 0 br i1 %cmp221, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %while.cond.preheader %2 = and i64 %indvars.iv.next, 4294967295 %indvars.iv.next2530 = add nsw i64 %2, -1 %arrayidx431 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next2530 %3 = load i32, ptr %arrayidx431, align 4, !tbaa !5 %call532 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %cmp6.not33 = icmp eq i64 %indvars.iv.next2530, 0 br i1 %cmp6.not33, label %while.end, label %if.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9 if.end: ; preds = %while.body.preheader, %if.end %indvars.iv.next2534 = phi i64 [ %indvars.iv.next25, %if.end ], [ %indvars.iv.next2530, %while.body.preheader ] %putchar17 = call i32 @putchar(i32 32) %indvars.iv.next25 = add nsw i64 %indvars.iv.next2534, -1 %arrayidx4 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next25 %6 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %cmp6.not = icmp eq i64 %indvars.iv.next25, 0 br i1 %cmp6.not, label %while.end, label %if.end, !llvm.loop !11 while.end: ; preds = %if.end, %while.body.preheader, %entry, %while.cond.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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}
#include <stdio.h> int main(void) { int a[100],i,n; scanf("%d\n",&n); for(i = 0;i < n;i++){ scanf("%d",&a[i]); } for(i = n-1;i >= 0;i--){ printf("%d",a[i]); if(i==0){ printf("\n"); } else{ printf(" "); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279436/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279436/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [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 [100 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 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 %cmp20 = icmp sgt i32 %0, 0 br i1 %cmp20, label %for.body, label %for.end12 for.cond2.preheader: ; preds = %for.body %cmp323 = icmp sgt i32 %2, 0 br i1 %cmp323, label %for.body4.preheader, label %for.end12 for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.preheader, %for.body4 %indvars.iv27 = phi i64 [ %1, %for.body4.preheader ], [ %indvars.iv.next28, %for.body4 ] %indvars.iv.next28 = add nsw i64 %indvars.iv27, -1 %idxprom5 = and i64 %indvars.iv.next28, 4294967295 %arrayidx6 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom5 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %5 = and i64 %indvars.iv.next28, 4294967295 %cmp8 = icmp eq i64 %5, 0 %. = select i1 %cmp8, i32 10, i32 32 %putchar19 = call i32 @putchar(i32 %.) %cmp3 = icmp ugt i64 %indvars.iv27, 1 br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !11 for.end12: ; preds = %for.body4, %entry, %for.cond2.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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}
#include<stdio.h> int main() { int n,i,max=0; scanf("%d",&n); int arr[100005]; for(i=0;i<n;i++) { int f; scanf("%d",&arr[i]); if(arr[i]<=500000) f=arr[i]-1; else f=1000000-arr[i]; if(f>=max) max=f; } printf("%d\n",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27948/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27948/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %arr = alloca [100005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %arr) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %0, 0 br i1 %cmp21, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %max.023 = phi i32 [ %max.1, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i32], ptr %arr, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4 = icmp slt i32 %1, 500001 %sub = add nsw i32 %1, -1 %sub9 = sub nsw i32 1000000, %1 %f.0 = select i1 %cmp4, i32 %sub, i32 %sub9 %max.1 = call i32 @llvm.smax.i32(i32 %f.0, i32 %max.023) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %max.1, %for.body ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %arr) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int N,M; scanf("%d%d",&N,&M); int city[N]; for (int i = 0; i < N; i++){city[i]=0;} while (M) { int a,b; scanf("%d%d",&a,&b); city[a-1]++; city[b-1]++; M--; } for (int i = 0; i < N; i++) { printf("%d\n",city[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279551/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279551/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %N, align 4, !tbaa !5 %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 %cmp24 = icmp sgt i32 %3, 0 br i1 %cmp24, label %for.body.preheader, label %while.condthread-pre-split for.body.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 br label %while.condthread-pre-split while.condthread-pre-split: ; preds = %for.body.preheader, %entry %.pr = load i32, ptr %M, align 4, !tbaa !5 %tobool.not26 = icmp eq i32 %.pr, 0 br i1 %tobool.not26, label %for.cond10.preheader, label %while.body for.cond10.preheader.loopexit: ; preds = %while.body %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.cond10.preheader for.cond10.preheader: ; preds = %for.cond10.preheader.loopexit, %while.condthread-pre-split %6 = phi i32 [ %.pre, %for.cond10.preheader.loopexit ], [ %3, %while.condthread-pre-split ] %cmp1127 = icmp sgt i32 %6, 0 br i1 %cmp1127, label %for.body13, label %for.cond.cleanup12 while.body: ; preds = %while.condthread-pre-split, %while.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %7 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %7, -1 %idxprom2 = sext i32 %sub to i64 %arrayidx3 = getelementptr inbounds i32, ptr %vla, i64 %idxprom2 %8 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %inc4 = add nsw i32 %8, 1 store i32 %inc4, ptr %arrayidx3, align 4, !tbaa !5 %9 = load i32, ptr %b, align 4, !tbaa !5 %sub5 = add nsw i32 %9, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %idxprom6 %10 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %inc8 = add nsw i32 %10, 1 store i32 %inc8, ptr %arrayidx7, align 4, !tbaa !5 %11 = load i32, ptr %M, align 4, !tbaa !5 %dec = add nsw i32 %11, -1 store i32 %dec, ptr %M, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %for.cond10.preheader.loopexit, label %while.body, !llvm.loop !9 for.cond.cleanup12: ; preds = %for.body13, %for.cond10.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 for.body13: ; preds = %for.cond10.preheader, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ 0, %for.cond10.preheader ] %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %12 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = load i32, ptr %N, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp11 = icmp slt i64 %indvars.iv.next, %14 br i1 %cmp11, label %for.body13, label %for.cond.cleanup12, !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 declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree 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> int main(){ int N, M; scanf("%d %d", &N, &M); int a[M], b[M], keys[N]; for(int i = 0; i < M; i++){ scanf("%d %d", &a[i], &b[i]); } for(int i = 0; i < N; i++){ keys[i] = 0; } for(int i = 0; i < M; i++){ keys[a[i] - 1]++; keys[b[i] - 1]++; } for(int i = 0; i < N; i++){ printf("%d\n", keys[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279595/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279595/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #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 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %M, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %5 = load i32, ptr %N, align 4, !tbaa !5 %6 = zext i32 %5 to i64 %vla2 = alloca i32, i64 %6, align 16 %cmp56 = icmp sgt i32 %3, 0 br i1 %cmp56, label %for.body, label %for.cond7.preheader for.cond7.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.cond7.preheader for.cond7.preheader: ; preds = %for.cond7.preheader.loopexit, %entry %7 = phi i32 [ %5, %entry ], [ %.pre, %for.cond7.preheader.loopexit ] %.lcssa = phi i32 [ %3, %entry ], [ %10, %for.cond7.preheader.loopexit ] %cmp858 = icmp sgt i32 %7, 0 br i1 %cmp858, label %for.body10.preheader, label %for.cond17.preheader for.body10.preheader: ; preds = %for.cond7.preheader %8 = zext i32 %7 to i64 %9 = shl nuw nsw i64 %8, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2, i8 0, i64 %9, i1 false), !tbaa !5 br label %for.cond17.preheader 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 %arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %M, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp, label %for.body, label %for.cond7.preheader.loopexit, !llvm.loop !9 for.cond17.preheader: ; preds = %for.body10.preheader, %for.cond7.preheader %cmp1860 = icmp sgt i32 %.lcssa, 0 br i1 %cmp1860, label %for.body20.preheader, label %for.cond36.preheader for.body20.preheader: ; preds = %for.cond17.preheader %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body20 for.cond36.preheader: ; preds = %for.body20, %for.cond17.preheader br i1 %cmp858, label %for.body39, label %for.cond.cleanup38 for.body20: ; preds = %for.body20.preheader, %for.body20 %indvars.iv69 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next70, %for.body20 ] %arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv69 %12 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %sub = add nsw i32 %12, -1 %idxprom23 = sext i32 %sub to i64 %arrayidx24 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom23 %13 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %inc25 = add nsw i32 %13, 1 store i32 %inc25, ptr %arrayidx24, align 4, !tbaa !5 %arrayidx27 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv69 %14 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %sub28 = add nsw i32 %14, -1 %idxprom29 = sext i32 %sub28 to i64 %arrayidx30 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom29 %15 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %inc31 = add nsw i32 %15, 1 store i32 %inc31, ptr %arrayidx30, align 4, !tbaa !5 %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1 %exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count br i1 %exitcond.not, label %for.cond36.preheader, label %for.body20, !llvm.loop !11 for.cond.cleanup38: ; preds = %for.body39, %for.cond36.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 for.body39: ; preds = %for.cond36.preheader, %for.body39 %indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body39 ], [ 0, %for.cond36.preheader ] %arrayidx41 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv72 %16 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16) %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %17 = load i32, ptr %N, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp37 = icmp slt i64 %indvars.iv.next73, %18 br i1 %cmp37, label %for.body39, label %for.cond.cleanup38, !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 declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree 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} !12 = distinct !{!12, !10}
#include <stdio.h> int main(){ int n,m; scanf("%d%d",&n,&m); int a[m],b[m],road[n]; for (int i=0;i<m;i++){ scanf("%d%d",&a[i],&b[i]); } for (int i=0;i<n;i++){ road[i]=0; for (int j=0;j<m;j++){ if (i+1==a[j]){ road[i]++; } if (i+1==b[j]){ road[i]++; } } printf("%d\n",road[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279652/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279652/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %m, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp54 = icmp sgt i32 %3, 0 br i1 %cmp54, label %for.body, label %for.cond7.preheader for.cond7.preheader: ; preds = %for.body, %entry %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp858 = icmp sgt i32 %5, 0 br i1 %cmp858, label %for.body10, label %for.cond.cleanup9 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 %arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %m, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.cond.cleanup9: ; preds = %for.cond.cleanup15, %for.cond7.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body10: ; preds = %for.cond7.preheader, %for.cond.cleanup15 %indvars.iv64 = phi i64 [ %9, %for.cond.cleanup15 ], [ 0, %for.cond7.preheader ] %8 = load i32, ptr %m, align 4, !tbaa !5 %cmp1456 = icmp sgt i32 %8, 0 %9 = add nuw nsw i64 %indvars.iv64, 1 br i1 %cmp1456, label %for.body16.lr.ph, label %for.cond.cleanup15 for.body16.lr.ph: ; preds = %for.body10 %wide.trip.count = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body16.preheader, label %vector.ph vector.ph: ; preds = %for.body16.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %9, 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.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ] %vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %29, %vector.body ] %10 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load70 = load <4 x i32>, ptr %11, align 16, !tbaa !5 %12 = zext <4 x i32> %wide.load to <4 x i64> %13 = zext <4 x i32> %wide.load70 to <4 x i64> %14 = icmp eq <4 x i64> %broadcast.splat, %12 %15 = icmp eq <4 x i64> %broadcast.splat, %13 %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> %vec.phi, %16 %19 = add <4 x i32> %vec.phi69, %17 %20 = getelementptr inbounds i32, ptr %vla1, i64 %index %wide.load71 = load <4 x i32>, ptr %20, align 16, !tbaa !5 %21 = getelementptr inbounds i32, ptr %20, i64 4 %wide.load72 = load <4 x i32>, ptr %21, align 16, !tbaa !5 %22 = zext <4 x i32> %wide.load71 to <4 x i64> %23 = zext <4 x i32> %wide.load72 to <4 x i64> %24 = icmp eq <4 x i64> %broadcast.splat, %22 %25 = icmp eq <4 x i64> %broadcast.splat, %23 %26 = zext <4 x i1> %24 to <4 x i32> %27 = zext <4 x i1> %25 to <4 x i32> %28 = add <4 x i32> %18, %26 %29 = add <4 x i32> %19, %27 %index.next = add nuw i64 %index, 8 %30 = icmp eq i64 %index.next, %n.vec br i1 %30, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %29, %28 %31 = 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.cond.cleanup15, label %for.body16.preheader for.body16.preheader: ; preds = %for.body16.lr.ph, %middle.block %.ph = phi i32 [ 0, %for.body16.lr.ph ], [ %31, %middle.block ] %indvars.iv61.ph = phi i64 [ 0, %for.body16.lr.ph ], [ %n.vec, %middle.block ] br label %for.body16 for.cond.cleanup15: ; preds = %for.body16, %middle.block, %for.body10 %32 = phi i32 [ 0, %for.body10 ], [ %31, %middle.block ], [ %40, %for.body16 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %32) %33 = load i32, ptr %n, align 4, !tbaa !5 %34 = sext i32 %33 to i64 %cmp8 = icmp slt i64 %9, %34 br i1 %cmp8, label %for.body10, label %for.cond.cleanup9, !llvm.loop !14 for.body16: ; preds = %for.body16.preheader, %for.body16 %35 = phi i32 [ %40, %for.body16 ], [ %.ph, %for.body16.preheader ] %indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body16 ], [ %indvars.iv61.ph, %for.body16.preheader ] %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv61 %36 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %37 = zext i32 %36 to i64 %cmp19 = icmp eq i64 %9, %37 %inc22 = zext i1 %cmp19 to i32 %spec.select = add nsw i32 %35, %inc22 %arrayidx25 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv61 %38 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %39 = zext i32 %38 to i64 %cmp26 = icmp eq i64 %9, %39 %inc30 = zext i1 %cmp26 to i32 %40 = add nsw i32 %spec.select, %inc30 %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup15, label %for.body16, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !13, !12}
#include <stdio.h> int main(void){ int i,j; int n,m; int a[50],b[50]; int co[50]; scanf("%d %d",&n,&m); for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<n;i++) co[i]=0; for(i=0;i<n;i++){ for(j=0;j<m;j++){ if(a[j]==i+1) co[i]++; if(b[j]==i+1) co[i]++; } } for(i=0;i<n;i++){ printf("%d\n",co[i]); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279696/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279696/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca [50 x i32], align 16 %b = alloca [50 x i32], align 16 %co = alloca [50 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %co) #4 %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 %cmp67 = icmp sgt i32 %0, 0 br i1 %cmp67, label %for.body, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body, %entry %.lcssa66 = phi i32 [ %0, %entry ], [ %2, %for.body ] %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp569 = icmp sgt i32 %1, 0 br i1 %cmp569, label %for.cond15.preheader.lr.ph, label %for.end47 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %m, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond15.preheader.lr.ph: ; preds = %for.cond4.preheader %4 = zext i32 %1 to i64 %5 = shl nuw nsw i64 %4, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %co, i8 0, i64 %5, i1 false), !tbaa !5 %cmp1672 = icmp sgt i32 %.lcssa66, 0 br i1 %cmp1672, label %for.cond15.preheader.us.preheader, label %for.body41.preheader for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph %wide.trip.count89 = zext i32 %1 to i64 %wide.trip.count = zext i32 %.lcssa66 to i64 br label %for.cond15.preheader.us for.cond15.preheader.us: ; preds = %for.cond15.preheader.us.preheader, %for.cond15.for.inc36_crit_edge.us %indvars.iv86 = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next87, %for.cond15.for.inc36_crit_edge.us ] %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %arrayidx22.us = getelementptr inbounds [50 x i32], ptr %co, i64 0, i64 %indvars.iv86 br label %for.body17.us for.body17.us: ; preds = %for.cond15.preheader.us, %for.inc33.us %indvars.iv83 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next84, %for.inc33.us ] %arrayidx19.us = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %indvars.iv83 %6 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5 %7 = zext i32 %6 to i64 %cmp20.us = icmp eq i64 %indvars.iv.next87, %7 br i1 %cmp20.us, label %if.then.us, label %if.end.us if.then.us: ; preds = %for.body17.us %8 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %inc23.us = add nsw i32 %8, 1 store i32 %inc23.us, ptr %arrayidx22.us, align 4, !tbaa !5 br label %if.end.us if.end.us: ; preds = %if.then.us, %for.body17.us %arrayidx25.us = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %indvars.iv83 %9 = load i32, ptr %arrayidx25.us, align 4, !tbaa !5 %10 = zext i32 %9 to i64 %cmp27.us = icmp eq i64 %indvars.iv.next87, %10 br i1 %cmp27.us, label %if.then28.us, label %for.inc33.us if.then28.us: ; preds = %if.end.us %11 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %inc31.us = add nsw i32 %11, 1 store i32 %inc31.us, ptr %arrayidx22.us, align 4, !tbaa !5 br label %for.inc33.us for.inc33.us: ; preds = %if.then28.us, %if.end.us %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count br i1 %exitcond.not, label %for.cond15.for.inc36_crit_edge.us, label %for.body17.us, !llvm.loop !11 for.cond15.for.inc36_crit_edge.us: ; preds = %for.inc33.us %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89 br i1 %exitcond90.not, label %for.cond39.preheader, label %for.cond15.preheader.us, !llvm.loop !12 for.cond39.preheader: ; preds = %for.cond15.for.inc36_crit_edge.us br i1 %cmp569, label %for.body41.preheader, label %for.end47 for.body41.preheader: ; preds = %for.cond15.preheader.lr.ph, %for.cond39.preheader br label %for.body41 for.body41: ; preds = %for.body41.preheader, %for.body41 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body41 ], [ 0, %for.body41.preheader ] %arrayidx43 = getelementptr inbounds [50 x i32], ptr %co, i64 0, i64 %indvars.iv91 %12 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %13 = load i32, ptr %n, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp40 = icmp slt i64 %indvars.iv.next92, %14 br i1 %cmp40, label %for.body41, label %for.end47, !llvm.loop !13 for.end47: ; preds = %for.body41, %for.cond4.preheader, %for.cond39.preheader call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %co) #4 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main() { int n, m; scanf("%d %d", &n, &m); int nroad[n]; int i; for(i=0;i<n;i++) { nroad[i] = 0; } for(i=0;i<m;i++) { int ta, tb; scanf("%d %d", &ta, &tb); nroad[ta - 1]++; nroad[tb - 1]++; } for(i=0;i<n;i++) { printf("%d\n", nroad[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279739/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279739/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %ta = alloca i32, align 4 %tb = 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 %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 %cmp31 = icmp sgt i32 %3, 0 br i1 %cmp31, label %for.body.preheader, label %for.cond1.preheader for.body.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 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.body.preheader, %entry %6 = load i32, ptr %m, align 4, !tbaa !5 %cmp233 = icmp sgt i32 %6, 0 br i1 %cmp233, label %for.body3, label %for.cond15.preheader for.cond15.preheader.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.cond1.preheader %7 = phi i32 [ %.pre, %for.cond15.preheader.loopexit ], [ %3, %for.cond1.preheader ] %cmp1635 = icmp sgt i32 %7, 0 br i1 %cmp1635, label %for.body17, label %for.end23 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.134 = phi i32 [ %inc13, %for.body3 ], [ 0, %for.cond1.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ta) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tb) #5 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ta, ptr noundef nonnull %tb) %8 = load i32, ptr %ta, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %idxprom5 = sext i32 %sub to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5 %9 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %inc7 = add nsw i32 %9, 1 store i32 %inc7, ptr %arrayidx6, align 4, !tbaa !5 %10 = load i32, ptr %tb, align 4, !tbaa !5 %sub8 = add nsw i32 %10, -1 %idxprom9 = sext i32 %sub8 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %vla, 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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tb) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ta) #5 %inc13 = add nuw nsw i32 %i.134, 1 %12 = load i32, ptr %m, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc13, %12 br i1 %cmp2, label %for.body3, label %for.cond15.preheader.loopexit, !llvm.loop !9 for.body17: ; preds = %for.cond15.preheader, %for.body17 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body17 ], [ 0, %for.cond15.preheader ] %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %13 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp16 = icmp slt i64 %indvars.iv.next, %15 br i1 %cmp16, label %for.body17, label %for.end23, !llvm.loop !11 for.end23: ; preds = %for.body17, %for.cond15.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree 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<malloc.h> #include<string.h> int main() { int n; scanf("%d", &n); char t; char *s = (char *)malloc(sizeof(char)*n + 1); //scanf("%c", &t); scanf("%s",s); int i,j=0; char *r = (char *)malloc(sizeof(char)*n); r[j++] = s[0]; for (i = 1; i < n; i++) { if ((s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u' || s[i] == 'y') && (s[i - 1] == 'a' || s[i - 1] == 'e' || s[i - 1] == 'i' || s[i - 1] == 'o' || s[i - 1] == 'u' || s[i - 1] == 'y')) { continue; } else { r[j++] = s[i]; } } r[j] = '\0'; printf("%s", r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27979/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27979/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %add = add nsw i64 %conv, 1 %call1 = call noalias ptr @malloc(i64 noundef %add) #6 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call1) %1 = load i32, ptr %n, align 4, !tbaa !5 %conv3 = sext i32 %1 to i64 %call5 = call noalias ptr @malloc(i64 noundef %conv3) #6 %2 = load i8, ptr %call1, align 1, !tbaa !9 store i8 %2, ptr %call5, align 1, !tbaa !9 %cmp124 = icmp sgt i32 %1, 1 br i1 %cmp124, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %1 to i64 %invariant.gep = getelementptr i8, ptr %call1, i64 -1 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 ] %j.0125 = phi i32 [ 1, %for.body.preheader ], [ %j.1, %for.inc ] %arrayidx9 = getelementptr inbounds i8, ptr %call1, i64 %indvars.iv %3 = load i8, ptr %arrayidx9, align 1, !tbaa !9 %4 = add i8 %3, -97 %5 = call i8 @llvm.fshl.i8(i8 %4, i8 %4, i8 7) switch i8 %5, label %if.else [ i8 0, label %land.lhs.true i8 2, label %land.lhs.true i8 4, label %land.lhs.true i8 7, label %land.lhs.true i8 10, label %land.lhs.true i8 12, label %land.lhs.true ] land.lhs.true: ; preds = %for.body, %for.body, %for.body, %for.body, %for.body, %for.body %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv %6 = load i8, ptr %gep, align 1, !tbaa !9 %7 = add i8 %6, -97 %8 = call i8 @llvm.fshl.i8(i8 %7, i8 %7, i8 7) switch i8 %8, label %if.else [ i8 0, label %for.inc i8 2, label %for.inc i8 4, label %for.inc i8 7, label %for.inc i8 10, label %for.inc i8 12, label %for.inc ] if.else: ; preds = %land.lhs.true, %for.body %inc84 = add nsw i32 %j.0125, 1 %idxprom85 = sext i32 %j.0125 to i64 %arrayidx86 = getelementptr inbounds i8, ptr %call5, i64 %idxprom85 store i8 %3, ptr %arrayidx86, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %land.lhs.true, %land.lhs.true, %land.lhs.true, %land.lhs.true, %land.lhs.true, %land.lhs.true, %if.else %j.1 = phi i32 [ %j.0125, %land.lhs.true ], [ %inc84, %if.else ], [ %j.0125, %land.lhs.true ], [ %j.0125, %land.lhs.true ], [ %j.0125, %land.lhs.true ], [ %j.0125, %land.lhs.true ], [ %j.0125, %land.lhs.true ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !10 for.end.loopexit: ; preds = %for.inc %9 = sext i32 %j.1 to i64 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %j.0.lcssa = phi i64 [ 1, %entry ], [ %9, %for.end.loopexit ] %arrayidx89 = getelementptr inbounds i8, ptr %call5, i64 %j.0.lcssa store i8 0, ptr %arrayidx89, align 1, !tbaa !9 %call90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %call5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.fshl.i8(i8, i8, i8) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int n,m; int i,j,k; int cups[3][16]; int cup[3][16]; int temp; int move[2]; int moves[2]; int min; int ccups[3]; scanf("%d %d",&n,&m); while(n && m){ for(i=0;i<3;i++){ scanf("%d",&cups[i][0]); cup[i][0] = cups[i][0]; for(j=1;j<cups[i][0]+1;j++){ scanf("%d",&cups[i][j]); cup[i][j] = cups[i][j]; } } if(cups[0][0] == n || cups[2][0] == n){ printf("0\n"); }else{ move[0] = -1; move[1] = -1; moves[0] = -1; moves[1] = -1; min = -1; for(i=1;i<m+1;i++){ ccups[0] = cups[0][cups[0][0]]; ccups[1] = cups[1][cups[1][0]]; ccups[2] = cups[2][cups[2][0]]; if(ccups[0] > ccups[1] && (move[0] != 1 || move[1] != 0)){ cups[1][cups[1][0]+1] = ccups[0]; cups[0][0]--; cups[1][0]++; move[0] = 0; move[1] = 1; }else if(ccups[1] > ccups[2] && (move[0] != 2 || move[1] != 1)){ cups[2][cups[2][0]+1] = ccups[1]; cups[1][0]--; cups[2][0]++; move[0] = 1; move[1] = 2; }else if(ccups[2] > ccups[1] && (move[0] != 1 || move[1] != 2)){ cups[1][cups[1][0]+1] = ccups[2]; cups[2][0]--; cups[1][0]++; move[0] = 2; move[1] = 1; }else if(ccups[1] > ccups[0] && (move[0] != 0 || move[1] != 1)){ cups[0][cups[0][0]+1] = ccups[1]; cups[1][0]--; cups[0][0]++; move[0] = 1; move[1] = 0; } if(cups[0][0] == n || cups[2][0] == n){ min = i; break; } ccups[0] = cup[0][cup[0][0]]; ccups[1] = cup[1][cup[1][0]]; ccups[2] = cup[2][cup[2][0]]; if(ccups[1] > ccups[0] && (moves[0] != 0 || moves[1] != 1)){ cup[0][cup[0][0]+1] = ccups[1]; cup[1][0]--; cup[0][0]++; moves[0] = 1; moves[1] = 0; }else if(ccups[2] > ccups[1] && (moves[0] != 1 || moves[1] != 2)){ cup[1][cup[1][0]+1] = ccups[2]; cup[2][0]--; cup[1][0]++; moves[0] = 2; moves[1] = 1; }else if(ccups[1] > ccups[2] && (moves[0] != 2 || moves[1] != 1)){ cup[2][cup[2][0]+1] = ccups[1]; cup[1][0]--; cup[2][0]++; moves[0] = 1; moves[1] = 2; }else if(ccups[0] > ccups[1] && (moves[0] != 1 || moves[1] != 0)){ cup[1][cup[1][0]+1] = ccups[0]; cup[0][0]--; cup[1][0]++; moves[0] = 0; moves[1] = 1; } if(cup[0][0] == n || cup[2][0] == n){ min = i; break; } } printf("%d\n",min); } scanf("%d %d",&n,&m); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279854/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %cups = alloca [3 x [16 x i32]], align 16 %cup = alloca [3 x [16 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %cups) #4 call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %cup) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool396 = icmp ne i32 %0, 0 %1 = load i32, ptr %m, align 4 %tobool1397 = icmp ne i32 %1, 0 %2 = select i1 %tobool396, i1 %tobool1397, i1 false br i1 %2, label %for.cond.preheader.lr.ph, label %while.end for.cond.preheader.lr.ph: ; preds = %entry %arrayidx35 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 2 %arrayidx53 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 1 %arrayidx184 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 1 %arrayidx190 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 2 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %if.end316 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %cups) %3 = load i32, ptr %cups, align 16, !tbaa !5 store i32 %3, ptr %cup, align 16, !tbaa !5 %cmp14.not385 = icmp slt i32 %3, 1 br i1 %cmp14.not385, label %for.inc29, label %for.body15 for.body15: ; preds = %for.cond.preheader, %for.body15 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body15 ], [ 1, %for.cond.preheader ] %arrayidx19 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 0, i64 %indvars.iv %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %4 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %arrayidx28 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 0, i64 %indvars.iv store i32 %4, ptr %arrayidx28, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %cups, align 16, !tbaa !5 %6 = sext i32 %5 to i64 %cmp14.not.not = icmp slt i64 %indvars.iv, %6 br i1 %cmp14.not.not, label %for.body15, label %for.inc29, !llvm.loop !9 for.inc29: ; preds = %for.body15, %for.cond.preheader %call3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx53) %7 = load i32, ptr %arrayidx53, align 16, !tbaa !5 store i32 %7, ptr %arrayidx184, align 16, !tbaa !5 %cmp14.not385.1 = icmp slt i32 %7, 1 br i1 %cmp14.not385.1, label %for.inc29.1, label %for.body15.1 for.body15.1: ; preds = %for.inc29, %for.body15.1 %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.body15.1 ], [ 1, %for.inc29 ] %arrayidx19.1 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 1, i64 %indvars.iv.1 %call20.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19.1) %8 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5 %arrayidx28.1 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 1, i64 %indvars.iv.1 store i32 %8, ptr %arrayidx28.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %9 = load i32, ptr %arrayidx53, align 16, !tbaa !5 %10 = sext i32 %9 to i64 %cmp14.not.not.1 = icmp slt i64 %indvars.iv.1, %10 br i1 %cmp14.not.not.1, label %for.body15.1, label %for.inc29.1, !llvm.loop !9 for.inc29.1: ; preds = %for.body15.1, %for.inc29 %call3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx35) %11 = load i32, ptr %arrayidx35, align 16 store i32 %11, ptr %arrayidx190, align 16, !tbaa !5 %cmp14.not385.2 = icmp slt i32 %11, 1 br i1 %cmp14.not385.2, label %for.inc29.2, label %for.body15.2 for.body15.2: ; preds = %for.inc29.1, %for.body15.2 %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %for.body15.2 ], [ 1, %for.inc29.1 ] %arrayidx19.2 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 2, i64 %indvars.iv.2 %call20.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19.2) %12 = load i32, ptr %arrayidx19.2, align 4, !tbaa !5 %arrayidx28.2 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 2, i64 %indvars.iv.2 store i32 %12, ptr %arrayidx28.2, align 4, !tbaa !5 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1 %13 = load i32, ptr %arrayidx35, align 16 %14 = sext i32 %13 to i64 %cmp14.not.not.2 = icmp slt i64 %indvars.iv.2, %14 br i1 %cmp14.not.not.2, label %for.body15.2, label %for.inc29.2, !llvm.loop !9 for.inc29.2: ; preds = %for.body15.2, %for.inc29.1 %15 = phi i32 [ %11, %for.inc29.1 ], [ %13, %for.body15.2 ] %16 = load i32, ptr %cups, align 16, !tbaa !5 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp34 = icmp eq i32 %16, %17 %cmp37 = icmp eq i32 %15, %17 %or.cond398 = or i1 %cmp34, %cmp37 br i1 %or.cond398, label %if.then, label %for.cond43.preheader for.cond43.preheader: ; preds = %for.inc29.2 %18 = load i32, ptr %m, align 4, !tbaa !5 %cmp45.not388 = icmp slt i32 %18, 1 br i1 %cmp45.not388, label %for.end314, label %for.body46.preheader for.body46.preheader: ; preds = %for.cond43.preheader %.pre = load i32, ptr %arrayidx53, align 16, !tbaa !5 br label %for.body46 if.then: ; preds = %for.inc29.2 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end316 for.body46: ; preds = %for.body46.preheader, %for.inc312 %19 = phi i32 [ %52, %for.inc312 ], [ %11, %for.body46.preheader ] %20 = phi i32 [ %50, %for.inc312 ], [ %7, %for.body46.preheader ] %21 = phi i32 [ %51, %for.inc312 ], [ %3, %for.body46.preheader ] %22 = phi i32 [ %38, %for.inc312 ], [ %15, %for.body46.preheader ] %23 = phi i32 [ %36, %for.inc312 ], [ %.pre, %for.body46.preheader ] %24 = phi i32 [ %37, %for.inc312 ], [ %16, %for.body46.preheader ] %moves.sroa.0.0393 = phi i32 [ %moves.sroa.0.1, %for.inc312 ], [ -1, %for.body46.preheader ] %moves.sroa.11.0392 = phi i32 [ %moves.sroa.11.1, %for.inc312 ], [ -1, %for.body46.preheader ] %move.sroa.0.0391 = phi i32 [ %move.sroa.0.1, %for.inc312 ], [ -1, %for.body46.preheader ] %move.sroa.11.0390 = phi i32 [ %move.sroa.11.1, %for.inc312 ], [ -1, %for.body46.preheader ] %i.1389 = phi i32 [ %inc313, %for.inc312 ], [ 1, %for.body46.preheader ] %idxprom50 = sext i32 %24 to i64 %arrayidx51 = getelementptr inbounds [16 x i32], ptr %cups, i64 0, i64 %idxprom50 %25 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %idxprom56 = sext i32 %23 to i64 %arrayidx57 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 1, i64 %idxprom56 %26 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %idxprom62 = sext i32 %22 to i64 %arrayidx63 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 2, i64 %idxprom62 %27 = load i32, ptr %arrayidx63, align 4, !tbaa !5 %cmp67 = icmp sgt i32 %25, %26 br i1 %cmp67, label %land.lhs.true, label %if.else88 land.lhs.true: ; preds = %for.body46 %cmp69 = icmp ne i32 %move.sroa.0.0391, 1 %cmp72 = icmp ne i32 %move.sroa.11.0390, 0 %or.cond = select i1 %cmp69, i1 true, i1 %cmp72 br i1 %or.cond, label %if.then73, label %if.else88 if.then73: ; preds = %land.lhs.true %add78 = add nsw i32 %23, 1 %idxprom79 = sext i32 %add78 to i64 %arrayidx80 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 1, i64 %idxprom79 store i32 %25, ptr %arrayidx80, align 4, !tbaa !5 %28 = load i32, ptr %cups, align 16, !tbaa !5 %dec = add nsw i32 %28, -1 store i32 %dec, ptr %cups, align 16, !tbaa !5 %29 = load i32, ptr %arrayidx53, align 16, !tbaa !5 %inc85 = add nsw i32 %29, 1 store i32 %inc85, ptr %arrayidx53, align 16, !tbaa !5 br label %if.end168 if.else88: ; preds = %land.lhs.true, %for.body46 %cmp91 = icmp sgt i32 %26, %27 br i1 %cmp91, label %land.lhs.true92, label %if.else114 land.lhs.true92: ; preds = %if.else88 %cmp94 = icmp ne i32 %move.sroa.0.0391, 2 %cmp97 = icmp ne i32 %move.sroa.11.0390, 1 %or.cond318 = select i1 %cmp94, i1 true, i1 %cmp97 br i1 %or.cond318, label %if.then98, label %if.else114 if.then98: ; preds = %land.lhs.true92 %add103 = add nsw i32 %22, 1 %idxprom104 = sext i32 %add103 to i64 %arrayidx105 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 2, i64 %idxprom104 store i32 %26, ptr %arrayidx105, align 4, !tbaa !5 %30 = load i32, ptr %arrayidx53, align 16, !tbaa !5 %dec108 = add nsw i32 %30, -1 store i32 %dec108, ptr %arrayidx53, align 16, !tbaa !5 %31 = load i32, ptr %arrayidx35, align 16, !tbaa !5 %inc111 = add nsw i32 %31, 1 store i32 %inc111, ptr %arrayidx35, align 16, !tbaa !5 br label %if.end168 if.else114: ; preds = %land.lhs.true92, %if.else88 %cmp117 = icmp sgt i32 %27, %26 br i1 %cmp117, label %land.lhs.true118, label %if.else140 land.lhs.true118: ; preds = %if.else114 %cmp120 = icmp ne i32 %move.sroa.0.0391, 1 %cmp123 = icmp ne i32 %move.sroa.11.0390, 2 %or.cond319 = select i1 %cmp120, i1 true, i1 %cmp123 br i1 %or.cond319, label %if.then124, label %if.else140 if.then124: ; preds = %land.lhs.true118 %add129 = add nsw i32 %23, 1 %idxprom130 = sext i32 %add129 to i64 %arrayidx131 = getelementptr inbounds [3 x [16 x i32]], ptr %cups, i64 0, i64 1, i64 %idxprom130 store i32 %27, ptr %arrayidx131, align 4, !tbaa !5 %32 = load i32, ptr %arrayidx35, align 16, !tbaa !5 %dec134 = add nsw i32 %32, -1 store i32 %dec134, ptr %arrayidx35, align 16, !tbaa !5 %33 = load i32, ptr %arrayidx53, align 16, !tbaa !5 %inc137 = add nsw i32 %33, 1 store i32 %inc137, ptr %arrayidx53, align 16, !tbaa !5 br label %if.end168 if.else140: ; preds = %land.lhs.true118, %if.else114 %cmp143 = icmp sgt i32 %26, %25 br i1 %cmp143, label %land.lhs.true144, label %if.end168 land.lhs.true144: ; preds = %if.else140 %cmp146 = icmp ne i32 %move.sroa.0.0391, 0 %cmp149 = icmp ne i32 %move.sroa.11.0390, 1 %or.cond320 = select i1 %cmp146, i1 true, i1 %cmp149 br i1 %or.cond320, label %if.then150, label %if.end168 if.then150: ; preds = %land.lhs.true144 %add155 = add nsw i32 %24, 1 %idxprom156 = sext i32 %add155 to i64 %arrayidx157 = getelementptr inbounds [16 x i32], ptr %cups, i64 0, i64 %idxprom156 store i32 %26, ptr %arrayidx157, align 4, !tbaa !5 %34 = load i32, ptr %arrayidx53, align 16, !tbaa !5 %dec160 = add nsw i32 %34, -1 store i32 %dec160, ptr %arrayidx53, align 16, !tbaa !5 %35 = load i32, ptr %cups, align 16, !tbaa !5 %inc163 = add nsw i32 %35, 1 store i32 %inc163, ptr %cups, align 16, !tbaa !5 br label %if.end168 if.end168: ; preds = %if.then98, %if.else140, %if.then150, %land.lhs.true144, %if.then124, %if.then73 %36 = phi i32 [ %inc85, %if.then73 ], [ %dec108, %if.then98 ], [ %inc137, %if.then124 ], [ %dec160, %if.then150 ], [ %23, %land.lhs.true144 ], [ %23, %if.else140 ] %move.sroa.11.1 = phi i32 [ 1, %if.then73 ], [ 2, %if.then98 ], [ 1, %if.then124 ], [ 0, %if.then150 ], [ 1, %land.lhs.true144 ], [ %move.sroa.11.0390, %if.else140 ] %move.sroa.0.1 = phi i32 [ 0, %if.then73 ], [ 1, %if.then98 ], [ 2, %if.then124 ], [ 1, %if.then150 ], [ 0, %land.lhs.true144 ], [ %move.sroa.0.0391, %if.else140 ] %37 = load i32, ptr %cups, align 16, !tbaa !5 %cmp171 = icmp eq i32 %37, %17 %38 = load i32, ptr %arrayidx35, align 16 %cmp175 = icmp eq i32 %38, %17 %or.cond383 = select i1 %cmp171, i1 true, i1 %cmp175 br i1 %or.cond383, label %for.end314, label %if.end177 if.end177: ; preds = %if.end168 %idxprom181 = sext i32 %21 to i64 %arrayidx182 = getelementptr inbounds [16 x i32], ptr %cup, i64 0, i64 %idxprom181 %39 = load i32, ptr %arrayidx182, align 4, !tbaa !5 %idxprom187 = sext i32 %20 to i64 %arrayidx188 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 1, i64 %idxprom187 %40 = load i32, ptr %arrayidx188, align 4, !tbaa !5 %idxprom193 = sext i32 %19 to i64 %arrayidx194 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 2, i64 %idxprom193 %41 = load i32, ptr %arrayidx194, align 4, !tbaa !5 %cmp198 = icmp sgt i32 %40, %39 br i1 %cmp198, label %land.lhs.true199, label %if.else221 land.lhs.true199: ; preds = %if.end177 %cmp201 = icmp ne i32 %moves.sroa.0.0393, 0 %cmp204 = icmp ne i32 %moves.sroa.11.0392, 1 %or.cond321 = select i1 %cmp201, i1 true, i1 %cmp204 br i1 %or.cond321, label %if.then205, label %if.else221 if.then205: ; preds = %land.lhs.true199 %add210 = add nsw i32 %21, 1 %idxprom211 = sext i32 %add210 to i64 %arrayidx212 = getelementptr inbounds [16 x i32], ptr %cup, i64 0, i64 %idxprom211 store i32 %40, ptr %arrayidx212, align 4, !tbaa !5 %42 = load i32, ptr %arrayidx184, align 16, !tbaa !5 %dec215 = add nsw i32 %42, -1 store i32 %dec215, ptr %arrayidx184, align 16, !tbaa !5 %43 = load i32, ptr %cup, align 16, !tbaa !5 %inc218 = add nsw i32 %43, 1 store i32 %inc218, ptr %cup, align 16, !tbaa !5 br label %if.end302 if.else221: ; preds = %land.lhs.true199, %if.end177 %cmp224 = icmp sgt i32 %41, %40 br i1 %cmp224, label %land.lhs.true225, label %if.else247 land.lhs.true225: ; preds = %if.else221 %cmp227 = icmp ne i32 %moves.sroa.0.0393, 1 %cmp230 = icmp ne i32 %moves.sroa.11.0392, 2 %or.cond322 = select i1 %cmp227, i1 true, i1 %cmp230 br i1 %or.cond322, label %if.then231, label %if.else247 if.then231: ; preds = %land.lhs.true225 %add236 = add nsw i32 %20, 1 %idxprom237 = sext i32 %add236 to i64 %arrayidx238 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 1, i64 %idxprom237 store i32 %41, ptr %arrayidx238, align 4, !tbaa !5 %44 = load i32, ptr %arrayidx190, align 16, !tbaa !5 %dec241 = add nsw i32 %44, -1 store i32 %dec241, ptr %arrayidx190, align 16, !tbaa !5 %45 = load i32, ptr %arrayidx184, align 16, !tbaa !5 %inc244 = add nsw i32 %45, 1 store i32 %inc244, ptr %arrayidx184, align 16, !tbaa !5 br label %if.end302 if.else247: ; preds = %land.lhs.true225, %if.else221 %cmp250 = icmp sgt i32 %40, %41 br i1 %cmp250, label %land.lhs.true251, label %if.else273 land.lhs.true251: ; preds = %if.else247 %cmp253 = icmp ne i32 %moves.sroa.0.0393, 2 %cmp256 = icmp ne i32 %moves.sroa.11.0392, 1 %or.cond323 = select i1 %cmp253, i1 true, i1 %cmp256 br i1 %or.cond323, label %if.then257, label %if.else273 if.then257: ; preds = %land.lhs.true251 %add262 = add nsw i32 %19, 1 %idxprom263 = sext i32 %add262 to i64 %arrayidx264 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 2, i64 %idxprom263 store i32 %40, ptr %arrayidx264, align 4, !tbaa !5 %46 = load i32, ptr %arrayidx184, align 16, !tbaa !5 %dec267 = add nsw i32 %46, -1 store i32 %dec267, ptr %arrayidx184, align 16, !tbaa !5 %47 = load i32, ptr %arrayidx190, align 16, !tbaa !5 %inc270 = add nsw i32 %47, 1 store i32 %inc270, ptr %arrayidx190, align 16, !tbaa !5 br label %if.end302 if.else273: ; preds = %land.lhs.true251, %if.else247 %cmp276 = icmp sgt i32 %39, %40 br i1 %cmp276, label %land.lhs.true277, label %if.end302 land.lhs.true277: ; preds = %if.else273 %cmp279 = icmp ne i32 %moves.sroa.0.0393, 1 %cmp282 = icmp ne i32 %moves.sroa.11.0392, 0 %or.cond324 = select i1 %cmp279, i1 true, i1 %cmp282 br i1 %or.cond324, label %if.then283, label %if.end302 if.then283: ; preds = %land.lhs.true277 %add288 = add nsw i32 %20, 1 %idxprom289 = sext i32 %add288 to i64 %arrayidx290 = getelementptr inbounds [3 x [16 x i32]], ptr %cup, i64 0, i64 1, i64 %idxprom289 store i32 %39, ptr %arrayidx290, align 4, !tbaa !5 %48 = load i32, ptr %cup, align 16, !tbaa !5 %dec293 = add nsw i32 %48, -1 store i32 %dec293, ptr %cup, align 16, !tbaa !5 %49 = load i32, ptr %arrayidx184, align 16, !tbaa !5 %inc296 = add nsw i32 %49, 1 store i32 %inc296, ptr %arrayidx184, align 16, !tbaa !5 br label %if.end302 if.end302: ; preds = %if.then231, %if.else273, %if.then283, %land.lhs.true277, %if.then257, %if.then205 %50 = phi i32 [ %dec215, %if.then205 ], [ %inc244, %if.then231 ], [ %dec267, %if.then257 ], [ %inc296, %if.then283 ], [ %20, %land.lhs.true277 ], [ %20, %if.else273 ] %moves.sroa.11.1 = phi i32 [ 0, %if.then205 ], [ 1, %if.then231 ], [ 2, %if.then257 ], [ 1, %if.then283 ], [ 0, %land.lhs.true277 ], [ %moves.sroa.11.0392, %if.else273 ] %moves.sroa.0.1 = phi i32 [ 1, %if.then205 ], [ 2, %if.then231 ], [ 1, %if.then257 ], [ 0, %if.then283 ], [ 1, %land.lhs.true277 ], [ %moves.sroa.0.0393, %if.else273 ] %51 = load i32, ptr %cup, align 16, !tbaa !5 %cmp305 = icmp eq i32 %51, %17 %52 = load i32, ptr %arrayidx190, align 16 %cmp309 = icmp eq i32 %52, %17 %or.cond384 = select i1 %cmp305, i1 true, i1 %cmp309 br i1 %or.cond384, label %for.end314, label %for.inc312 for.inc312: ; preds = %if.end302 %inc313 = add nuw i32 %i.1389, 1 %exitcond.not = icmp eq i32 %i.1389, %18 br i1 %exitcond.not, label %for.end314, label %for.body46, !llvm.loop !11 for.end314: ; preds = %for.inc312, %if.end168, %if.end302, %for.cond43.preheader %min.0 = phi i32 [ -1, %for.cond43.preheader ], [ %i.1389, %if.end302 ], [ %i.1389, %if.end168 ], [ -1, %for.inc312 ] %call315 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %min.0) br label %if.end316 if.end316: ; preds = %for.end314, %if.then %call317 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %53 = load i32, ptr %n, align 4, !tbaa !5 %tobool = icmp ne i32 %53, 0 %54 = load i32, ptr %m, align 4 %tobool1 = icmp ne i32 %54, 0 %55 = select i1 %tobool, i1 %tobool1, i1 false br i1 %55, label %for.cond.preheader, label %while.end, !llvm.loop !12 while.end: ; preds = %if.end316, %entry call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %cup) #4 call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %cups) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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){ double t,x; scanf("%lf %lf", &t, &x); printf("%lf\n", t/(x*1.0)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca double, align 8 %x = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %x) %0 = load double, ptr %t, align 8, !tbaa !5 %1 = load double, ptr %x, align 8, !tbaa !5 %div = fdiv double %0, %1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void) { int t, x; scanf("%d%d", &t, &x); float ans = (float)t / x; printf("%f\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_279955/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_279955/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %x) %0 = load i32, ptr %t, align 4, !tbaa !5 %conv = sitofp i32 %0 to float %1 = load i32, ptr %x, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to float %div = fdiv float %conv, %conv1 %conv2 = fpext float %div to double %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ double a,b; scanf("%lf %lf",&a,&b); printf("%lf",a/b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280003/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280003/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca double, align 8 %b = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load double, ptr %a, align 8, !tbaa !5 %1 = load double, ptr %b, align 8, !tbaa !5 %div = fdiv double %0, %1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ float T, X; scanf("%d %d", &T, &X); printf("%f", T/X); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280054/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280054/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca float, align 4 %X = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T, ptr noundef nonnull %X) %0 = load float, ptr %T, align 4, !tbaa !5 %1 = load float, ptr %X, align 4, !tbaa !5 %div = fdiv float %0, %1 %conv = fpext float %div to double %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ double x,t; scanf("%lf %lf",&t,&x); printf("%lf",t/x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280098/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280098/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca double, align 8 %t = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %x) %0 = load double, ptr %t, align 8, !tbaa !5 %1 = load double, ptr %x, align 8, !tbaa !5 %div = fdiv double %0, %1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3 call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> int main(void){ char str[3000]; char *tok; int m,n; int i1,i2,i3,i4,i44; int gn,gm,sn,sm; int fin=0; int nn,nm; int a[1000][1000]; int b[8000][2]; //searching list int c[8000][2]; //next searching list fgets(str, sizeof(str), stdin); tok=strtok(str," "); m=strtol(tok,NULL,10); tok=strtok(NULL," "); n=strtol(tok,NULL,10); //printf("m=%d,n=%d",m,n); printf("%f",((float)m)/((float)n)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280140/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280140/source.c" target datalayout = "e-m:e-p270: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 [2 x i8] c" \00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [3000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 3000, ptr nonnull %str) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 3000, ptr noundef %0) %call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #4 %call3 = call i64 @strtol(ptr nocapture noundef %call2, ptr noundef null, i32 noundef 10) #4 %conv = trunc i64 %call3 to i32 %call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #4 %call5 = call i64 @strtol(ptr nocapture noundef %call4, ptr noundef null, i32 noundef 10) #4 %conv6 = trunc i64 %call5 to i32 %conv7 = sitofp i32 %conv to float %conv8 = sitofp i32 %conv6 to float %div = fdiv float %conv7, %conv8 %conv9 = fpext float %div to double %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv9) call void @llvm.lifetime.end.p0(i64 3000, ptr nonnull %str) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { float t,x; scanf("%f%f",&t,&x); printf("%f",t/x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280184/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280184/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f%f\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca float, align 4 %x = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %x) %0 = load float, ptr %t, align 4, !tbaa !5 %1 = load float, ptr %x, align 4, !tbaa !5 %div = fdiv float %0, %1 %conv = fpext float %div to double %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <math.h> int main(int argc, char *argv[]) { int t, x; double ans; scanf("%d %d", &t, &x); ans = (double) t / x; printf("%.10f\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280227/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%.10f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %x) %0 = load i32, ptr %t, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %x, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %div = fdiv double %conv, %conv1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int n, i; int cnt1 = 0; int cnt2 = 0; scanf("%d",&n); int an[n]; for(i = 0; i < n; i++) { scanf("%d",&an[i]); } for(i = 0; i < n; i++) { if(an[i]%2 == 0) { cnt2++; if(an[i]%3 == 0 || an[i]%5 == 0) { cnt1++; } } } if(cnt1 == cnt2) { printf("APPROVED"); } else { printf("DENIED"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280270/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280270/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"APPROVED\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"DENIED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp37 = icmp sgt i32 %3, 0 br i1 %cmp37, label %for.body, label %if.end27 for.cond2.preheader: ; preds = %for.body %cmp339 = icmp sgt i32 %27, 0 br i1 %cmp339, label %for.body4.preheader, label %if.end27 for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %27 to i64 %min.iters.check = icmp ult i32 %27, 8 br i1 %min.iters.check, label %for.body4.preheader66, label %vector.ph vector.ph: ; preds = %for.body4.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi61, %vector.body ] %vec.phi56 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi62, %vector.body ] %vec.phi57 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %vector.body ] %vec.phi58 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi60, %vector.body ] %4 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load59 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = and <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %7 = and <4 x i32> %wide.load59, <i32 1, i32 1, i32 1, i32 1> %8 = icmp eq <4 x i32> %6, zeroinitializer %9 = icmp eq <4 x i32> %7, zeroinitializer %10 = srem <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3> %11 = srem <4 x i32> %wide.load59, <i32 3, i32 3, i32 3, i32 3> %12 = icmp eq <4 x i32> %10, zeroinitializer %13 = icmp eq <4 x i32> %11, zeroinitializer %14 = srem <4 x i32> %wide.load, <i32 5, i32 5, i32 5, i32 5> %15 = srem <4 x i32> %wide.load59, <i32 5, i32 5, i32 5, i32 5> %16 = icmp eq <4 x i32> %14, zeroinitializer %17 = icmp eq <4 x i32> %15, zeroinitializer %18 = or <4 x i1> %12, %16 %19 = or <4 x i1> %13, %17 %narrow = select <4 x i1> %8, <4 x i1> %18, <4 x i1> zeroinitializer %20 = zext <4 x i1> %narrow to <4 x i32> %predphi = add <4 x i32> %vec.phi57, %20 %narrow65 = select <4 x i1> %9, <4 x i1> %19, <4 x i1> zeroinitializer %21 = zext <4 x i1> %narrow65 to <4 x i32> %predphi60 = add <4 x i32> %vec.phi58, %21 %22 = xor <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1> %predphi61 = add <4 x i32> %vec.phi, %22 %23 = xor <4 x i32> %7, <i32 1, i32 1, i32 1, i32 1> %predphi62 = add <4 x i32> %vec.phi56, %23 %index.next = add nuw i64 %index, 8 %24 = icmp eq i64 %index.next, %n.vec br i1 %24, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx63 = add <4 x i32> %predphi60, %predphi %25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx63) %bin.rdx = add <4 x i32> %predphi62, %predphi61 %26 = 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.end22, label %for.body4.preheader66 for.body4.preheader66: ; preds = %for.body4.preheader, %middle.block %indvars.iv47.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ] %cnt2.041.ph = phi i32 [ 0, %for.body4.preheader ], [ %26, %middle.block ] %cnt1.040.ph = phi i32 [ 0, %for.body4.preheader ], [ %25, %middle.block ] br label %for.body4 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 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %27 = load i32, ptr %n, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp = icmp slt i64 %indvars.iv.next, %28 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.body4: ; preds = %for.body4.preheader66, %for.inc20 %indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.inc20 ], [ %indvars.iv47.ph, %for.body4.preheader66 ] %cnt2.041 = phi i32 [ %cnt2.1, %for.inc20 ], [ %cnt2.041.ph, %for.body4.preheader66 ] %cnt1.040 = phi i32 [ %cnt1.1, %for.inc20 ], [ %cnt1.040.ph, %for.body4.preheader66 ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv47 %29 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %30 = and i32 %29, 1 %cmp7 = icmp eq i32 %30, 0 br i1 %cmp7, label %if.then, label %for.inc20 if.then: ; preds = %for.body4 %inc8 = add nsw i32 %cnt2.041, 1 %rem11 = srem i32 %29, 3 %cmp12 = icmp eq i32 %rem11, 0 %rem15 = srem i32 %29, 5 %cmp16 = icmp eq i32 %rem15, 0 %or.cond = or i1 %cmp12, %cmp16 %inc18 = zext i1 %or.cond to i32 %spec.select = add nsw i32 %cnt1.040, %inc18 br label %for.inc20 for.inc20: ; preds = %if.then, %for.body4 %cnt1.1 = phi i32 [ %cnt1.040, %for.body4 ], [ %spec.select, %if.then ] %cnt2.1 = phi i32 [ %cnt2.041, %for.body4 ], [ %inc8, %if.then ] %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1 %exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count br i1 %exitcond.not, label %for.end22, label %for.body4, !llvm.loop !14 for.end22: ; preds = %for.inc20, %middle.block %cnt1.1.lcssa = phi i32 [ %25, %middle.block ], [ %cnt1.1, %for.inc20 ] %cnt2.1.lcssa = phi i32 [ %26, %middle.block ], [ %cnt2.1, %for.inc20 ] %cmp23 = icmp eq i32 %cnt1.1.lcssa, %cnt2.1.lcssa %spec.select55 = select i1 %cmp23, ptr @.str.1, ptr @.str.2 br label %if.end27 if.end27: ; preds = %for.end22, %for.cond2.preheader, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %for.cond2.preheader ], [ %spec.select55, %for.end22 ] %call26 = 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 %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include<stdio.h> int main(void){ int n,i,flag; do{ scanf("%d",&n); }while(n<1 || n > 100); int a[n]; for(i = 0;i < n;i++){ do{ scanf("%d",&a[i]); }while(a[i] < 1 || a[i] > 1000); } for(i = 0;i < n;i++) if(a[i] % 2 == 0) if(a[i] % 3 && a[i] % 5) flag++; if(flag) printf("DENIED"); else printf("APPROVED"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280313/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280313/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"DENIED\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"APPROVED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 br label %do.body do.body: ; preds = %do.body, %entry %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, -101 %2 = icmp ult i32 %1, -100 br i1 %2, label %do.body, label %do.end, !llvm.loop !5 do.end: ; preds = %do.body %3 = zext i32 %0 to i64 %4 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %3, align 16 %5 = load i32, ptr %n, align 4, !tbaa !7 %cmp253 = icmp sgt i32 %5, 0 br i1 %cmp253, label %do.body3.preheader, label %if.else do.body3.preheader: ; preds = %do.end, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %do.end ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv br label %do.body3 for.cond15.preheader: ; preds = %for.inc %cmp1655 = icmp sgt i32 %32, 0 br i1 %cmp1655, label %for.body17.preheader, label %if.else for.body17.preheader: ; preds = %for.cond15.preheader %wide.trip.count = zext i32 %32 to i64 %min.iters.check = icmp ult i32 %32, 8 br i1 %min.iters.check, label %for.body17.preheader72, label %vector.ph vector.ph: ; preds = %for.body17.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 undef, i32 0, i32 0, i32 0>, %vector.ph ], [ %26, %vector.body ] %vec.phi70 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ] %6 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !7 %7 = getelementptr inbounds i32, ptr %6, i64 4 %wide.load71 = load <4 x i32>, ptr %7, align 16, !tbaa !7 %8 = trunc <4 x i32> %wide.load to <4 x i1> %9 = trunc <4 x i32> %wide.load71 to <4 x i1> %10 = srem <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3> %11 = srem <4 x i32> %wide.load71, <i32 3, i32 3, i32 3, i32 3> %12 = icmp eq <4 x i32> %10, zeroinitializer %13 = icmp eq <4 x i32> %11, zeroinitializer %14 = or <4 x i1> %12, %8 %15 = or <4 x i1> %13, %9 %16 = srem <4 x i32> %wide.load, <i32 5, i32 5, i32 5, i32 5> %17 = srem <4 x i32> %wide.load71, <i32 5, i32 5, i32 5, i32 5> %18 = icmp eq <4 x i32> %16, zeroinitializer %19 = icmp eq <4 x i32> %17, zeroinitializer %20 = or <4 x i1> %18, %14 %21 = or <4 x i1> %19, %15 %22 = xor <4 x i1> %20, <i1 true, i1 true, i1 true, i1 true> %23 = xor <4 x i1> %21, <i1 true, i1 true, i1 true, i1 true> %24 = zext <4 x i1> %22 to <4 x i32> %25 = zext <4 x i1> %23 to <4 x i32> %26 = add <4 x i32> %vec.phi, %24 %27 = add <4 x i32> %vec.phi70, %25 %index.next = add nuw i64 %index, 8 %28 = icmp eq i64 %index.next, %n.vec br i1 %28, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %27, %26 %29 = 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.end33, label %for.body17.preheader72 for.body17.preheader72: ; preds = %for.body17.preheader, %middle.block %indvars.iv62.ph = phi i64 [ 0, %for.body17.preheader ], [ %n.vec, %middle.block ] %flag.056.ph = phi i32 [ undef, %for.body17.preheader ], [ %29, %middle.block ] br label %for.body17 do.body3: ; preds = %do.body3.preheader, %do.body3 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %30 = load i32, ptr %arrayidx, align 4, !tbaa !7 %31 = add i32 %30, -1001 %or.cond = icmp ult i32 %31, -1000 br i1 %or.cond, label %do.body3, label %for.inc, !llvm.loop !14 for.inc: ; preds = %do.body3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %32 = load i32, ptr %n, align 4, !tbaa !7 %33 = sext i32 %32 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %33 br i1 %cmp2, label %do.body3.preheader, label %for.cond15.preheader, !llvm.loop !15 for.body17: ; preds = %for.body17.preheader72, %for.body17 %indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body17 ], [ %indvars.iv62.ph, %for.body17.preheader72 ] %flag.056 = phi i32 [ %flag.1, %for.body17 ], [ %flag.056.ph, %for.body17.preheader72 ] %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv62 %34 = load i32, ptr %arrayidx19, align 4, !tbaa !7 %35 = and i32 %34, 1 %cmp20 = icmp ne i32 %35, 0 %rem23 = srem i32 %34, 3 %tobool.not = icmp eq i32 %rem23, 0 %or.cond50 = or i1 %cmp20, %tobool.not %rem26 = srem i32 %34, 5 %tobool27.not = icmp eq i32 %rem26, 0 %or.cond51 = or i1 %tobool27.not, %or.cond50 %not.or.cond51 = xor i1 %or.cond51, true %inc29 = zext i1 %not.or.cond51 to i32 %flag.1 = add nsw i32 %flag.056, %inc29 %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count br i1 %exitcond.not, label %for.end33, label %for.body17, !llvm.loop !16 for.end33: ; preds = %for.body17, %middle.block %flag.1.lcssa = phi i32 [ %29, %middle.block ], [ %flag.1, %for.body17 ] %36 = icmp eq i32 %flag.1.lcssa, 0 br i1 %36, label %if.else, label %if.end38 if.else: ; preds = %do.end, %for.cond15.preheader, %for.end33 br label %if.end38 if.end38: ; preds = %for.end33, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.end33 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6, !13, !12}
#include <stdio.h> int main(void) { int i,n; int c[100]; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &c[i]); } for (i = 0; i < n; i++) { if (c[i] % 2 == 0 && c[i] % 3 != 0 && c[i] % 5 != 0) { puts("DENIED"); return 0; } } puts("APPROVED"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280357/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280357/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"DENIED\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"APPROVED\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 [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %cleanup for.cond2.preheader: ; preds = %for.body %cmp334 = icmp sgt i32 %1, 0 br i1 %cmp334, label %for.body4.preheader, label %cleanup for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2: ; preds = %for.body4 %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1 %exitcond.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body4, !llvm.loop !11 for.body4: ; preds = %for.body4.preheader, %for.cond2 %indvars.iv38 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next39, %for.cond2 ] %arrayidx6 = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv38 %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %4 = and i32 %3, 1 %cmp7 = icmp ne i32 %4, 0 %rem10 = srem i32 %3, 3 %cmp11.not = icmp eq i32 %rem10, 0 %or.cond = or i1 %cmp7, %cmp11.not %rem15 = srem i32 %3, 5 %cmp16.not = icmp eq i32 %rem15, 0 %or.cond31 = or i1 %cmp16.not, %or.cond br i1 %or.cond31, label %for.cond2, label %cleanup cleanup: ; preds = %for.cond2, %for.body4, %for.cond2.preheader, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %for.cond2.preheader ], [ @.str.1, %for.body4 ], [ @.str.2, %for.cond2 ] %call21 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 400, 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 @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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <string.h> #define MIN(a, b) ((a)<(b)?(a):(b)) #define MAX(a, b) ((a)>(b)?(a):(b)) typedef long long ll; #define M 100010 int a[M], t[M], sum[M], temp[M]; void solve() { int n, k; scanf("%d%d", &n, &k); int ans = 0; for (int i = 1; i <= n; ++i) { scanf("%d", &a[i]); } for (int i = 1; i <= n; ++i) { scanf("%d", &t[i]); } for (int i = 1; i <= n; ++i) { sum[i] = (a[i]*(1-t[i]) + sum[i-1]); ans += a[i]*t[i]; } int max = 0; for (int i = k; i <= n; ++i) { temp[i] = sum[i] - sum[i-k]; max = MAX(temp[i], max); } printf("%d\n", ans + max); return ; }; int main() { solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28040/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28040/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global [100010 x i32] zeroinitializer, align 16 @t = dso_local global [100010 x i32] zeroinitializer, align 16 @sum = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @temp = dso_local local_unnamed_addr global [100010 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 void @solve() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not79 = icmp slt i32 %0, 1 br i1 %cmp.not79, label %for.cond.cleanup16, label %for.body for.cond3.preheader: ; preds = %for.body %cmp4.not81 = icmp slt i32 %1, 1 br i1 %cmp4.not81, label %for.cond.cleanup16, label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100010 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.cond14.preheader: ; preds = %for.body6 %cmp15.not83 = icmp slt i32 %5, 1 br i1 %cmp15.not83, label %for.cond.cleanup16, label %for.body17.preheader for.body17.preheader: ; preds = %for.cond14.preheader %.pre = load i32, ptr @sum, align 16, !tbaa !5 %3 = zext i32 %5 to i64 %xtraiter = and i64 %3, 1 %4 = icmp eq i32 %5, 1 br i1 %4, label %for.cond.cleanup16.loopexit.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %3, 4294967294 br label %for.body17 for.body6: ; preds = %for.cond3.preheader, %for.body6 %indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body6 ], [ 1, %for.cond3.preheader ] %arrayidx8 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %indvars.iv93 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8) %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp4.not.not = icmp slt i64 %indvars.iv93, %6 br i1 %cmp4.not.not, label %for.body6, label %for.cond14.preheader, !llvm.loop !11 for.cond.cleanup16.loopexit.unr-lcssa: ; preds = %for.body17, %for.body17.preheader %add32.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %add32.1, %for.body17 ] %.unr = phi i32 [ %.pre, %for.body17.preheader ], [ %add.1, %for.body17 ] %indvars.iv96.unr = phi i64 [ 1, %for.body17.preheader ], [ %indvars.iv.next97.1, %for.body17 ] %ans.084.unr = phi i32 [ 0, %for.body17.preheader ], [ %add32.1, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup16, label %for.body17.epil for.body17.epil: ; preds = %for.cond.cleanup16.loopexit.unr-lcssa %arrayidx19.epil = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv96.unr %7 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5 %arrayidx21.epil = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %indvars.iv96.unr %8 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !5 %sub.epil = sub nsw i32 1, %8 %mul.epil = mul nsw i32 %sub.epil, %7 %add.epil = add nsw i32 %mul.epil, %.unr %arrayidx26.epil = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %indvars.iv96.unr store i32 %add.epil, ptr %arrayidx26.epil, align 4, !tbaa !5 %mul31.epil = mul nsw i32 %8, %7 %add32.epil = add nsw i32 %mul31.epil, %ans.084.unr br label %for.cond.cleanup16 for.cond.cleanup16: ; preds = %for.body17.epil, %for.cond.cleanup16.loopexit.unr-lcssa, %entry, %for.cond3.preheader, %for.cond14.preheader %.lcssa108 = phi i32 [ %5, %for.cond14.preheader ], [ %1, %for.cond3.preheader ], [ %0, %entry ], [ %5, %for.cond.cleanup16.loopexit.unr-lcssa ], [ %5, %for.body17.epil ] %ans.0.lcssa = phi i32 [ 0, %for.cond14.preheader ], [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %add32.lcssa.ph, %for.cond.cleanup16.loopexit.unr-lcssa ], [ %add32.epil, %for.body17.epil ] %9 = load i32, ptr %k, align 4, !tbaa !5 %cmp38.not87 = icmp sgt i32 %9, %.lcssa108 br i1 %cmp38.not87, label %for.cond.cleanup39, label %for.body40.preheader for.body40.preheader: ; preds = %for.cond.cleanup16 %10 = sext i32 %9 to i64 %11 = add i32 %.lcssa108, 1 %12 = sub i32 %.lcssa108, %9 %13 = zext i32 %12 to i64 %14 = add nuw nsw i64 %13, 1 %min.iters.check = icmp ult i32 %12, 7 br i1 %min.iters.check, label %for.body40.preheader115, label %vector.ph vector.ph: ; preds = %for.body40.preheader %n.vec = and i64 %14, 8589934584 %ind.end = add nsw i64 %n.vec, %10 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 ], [ %23, %vector.body ] %vec.phi111 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ] %offset.idx = add i64 %index, %10 %15 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5 %16 = getelementptr inbounds i32, ptr %15, i64 4 %wide.load112 = load <4 x i32>, ptr %16, align 4, !tbaa !5 %17 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %index %wide.load113 = load <4 x i32>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load114 = load <4 x i32>, ptr %18, align 16, !tbaa !5 %19 = sub nsw <4 x i32> %wide.load, %wide.load113 %20 = sub nsw <4 x i32> %wide.load112, %wide.load114 %21 = getelementptr inbounds [100010 x i32], ptr @temp, i64 0, i64 %offset.idx store <4 x i32> %19, ptr %21, align 4, !tbaa !5 %22 = getelementptr inbounds i32, ptr %21, i64 4 store <4 x i32> %20, ptr %22, align 4, !tbaa !5 %23 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %19, <4 x i32> %vec.phi) %24 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %20, <4 x i32> %vec.phi111) %index.next = add nuw i64 %index, 8 %25 = icmp eq i64 %index.next, %n.vec br i1 %25, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %23, <4 x i32> %24) %26 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %14, %n.vec br i1 %cmp.n, label %for.cond.cleanup39, label %for.body40.preheader115 for.body40.preheader115: ; preds = %for.body40.preheader, %middle.block %indvars.iv100.ph = phi i64 [ %10, %for.body40.preheader ], [ %ind.end, %middle.block ] %max.088.ph = phi i32 [ 0, %for.body40.preheader ], [ %26, %middle.block ] br label %for.body40 for.body17: ; preds = %for.body17, %for.body17.preheader.new %27 = phi i32 [ %.pre, %for.body17.preheader.new ], [ %add.1, %for.body17 ] %indvars.iv96 = phi i64 [ 1, %for.body17.preheader.new ], [ %indvars.iv.next97.1, %for.body17 ] %ans.084 = phi i32 [ 0, %for.body17.preheader.new ], [ %add32.1, %for.body17 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.body17 ] %arrayidx19 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv96 %28 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %arrayidx21 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %indvars.iv96 %29 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %sub = sub nsw i32 1, %29 %mul = mul nsw i32 %sub, %28 %add = add nsw i32 %mul, %27 %arrayidx26 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %indvars.iv96 store i32 %add, ptr %arrayidx26, align 4, !tbaa !5 %mul31 = mul nsw i32 %29, %28 %add32 = add nsw i32 %mul31, %ans.084 %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %arrayidx19.1 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next97 %30 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5 %arrayidx21.1 = getelementptr inbounds [100010 x i32], ptr @t, i64 0, i64 %indvars.iv.next97 %31 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 1, %31 %mul.1 = mul nsw i32 %sub.1, %30 %add.1 = add nsw i32 %mul.1, %add %arrayidx26.1 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %indvars.iv.next97 store i32 %add.1, ptr %arrayidx26.1, align 4, !tbaa !5 %mul31.1 = mul nsw i32 %31, %30 %add32.1 = add nsw i32 %mul31.1, %add32 %indvars.iv.next97.1 = add nuw nsw i64 %indvars.iv96, 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 !15 for.cond.cleanup39: ; preds = %for.body40, %middle.block, %for.cond.cleanup16 %max.0.lcssa = phi i32 [ 0, %for.cond.cleanup16 ], [ %26, %middle.block ], [ %sub46.max.0, %for.body40 ] %add57 = add nsw i32 %max.0.lcssa, %ans.0.lcssa %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add57) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret void for.body40: ; preds = %for.body40.preheader115, %for.body40 %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body40 ], [ %indvars.iv100.ph, %for.body40.preheader115 ] %max.088 = phi i32 [ %sub46.max.0, %for.body40 ], [ %max.088.ph, %for.body40.preheader115 ] %arrayidx42 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %indvars.iv100 %32 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %33 = sub nsw i64 %indvars.iv100, %10 %arrayidx45 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %33 %34 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %sub46 = sub nsw i32 %32, %34 %arrayidx48 = getelementptr inbounds [100010 x i32], ptr @temp, i64 0, i64 %indvars.iv100 store i32 %sub46, ptr %arrayidx48, align 4, !tbaa !5 %sub46.max.0 = call i32 @llvm.smax.i32(i32 %sub46, i32 %max.088) %indvars.iv.next101 = add nsw i64 %indvars.iv100, 1 %lftr.wideiv = trunc i64 %indvars.iv.next101 to i32 %exitcond104.not = icmp eq i32 %11, %lftr.wideiv br i1 %exitcond104.not, label %for.cond.cleanup39, label %for.body40, !llvm.loop !16 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: tail call void @solve() ret i32 0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13}
#include <stdio.h> int main(void) { int n; scanf("%d", &n); int a[n], i; i = 0; while (i < n) { scanf("%d", &a[i]); i++; } i = 0; while (i < n) { if (a[i] % 2 == 0) { if (!(a[i] % 3 == 0 || a[i] % 5 == 0)) { printf("DENIED"); return 0; } } i++; } printf("APPROVED"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"DENIED\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"APPROVED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %3, 0 br i1 %cmp32, label %while.body, label %cleanup while.cond2.preheader: ; preds = %while.body %cmp334 = icmp sgt i32 %4, 0 br i1 %cmp334, label %while.body4.preheader, label %cleanup while.body4.preheader: ; preds = %while.cond2.preheader %wide.trip.count = zext i32 %4 to i64 br label %while.body4 while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, 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 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %while.body, label %while.cond2.preheader, !llvm.loop !9 while.cond2: ; preds = %while.body4 %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1 %exitcond.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %while.body4, !llvm.loop !11 while.body4: ; preds = %while.body4.preheader, %while.cond2 %indvars.iv38 = phi i64 [ 0, %while.body4.preheader ], [ %indvars.iv.next39, %while.cond2 ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv38 %6 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %7 = and i32 %6, 1 %cmp7 = icmp ne i32 %7, 0 %rem10 = srem i32 %6, 3 %cmp11 = icmp eq i32 %rem10, 0 %or.cond = or i1 %cmp7, %cmp11 %rem14 = srem i32 %6, 5 %cmp15 = icmp eq i32 %rem14, 0 %or.cond31 = or i1 %cmp15, %or.cond br i1 %or.cond31, label %while.cond2, label %cleanup cleanup: ; preds = %while.cond2, %while.body4, %while.cond2.preheader, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %while.cond2.preheader ], [ @.str.1, %while.body4 ], [ @.str.2, %while.cond2 ] %call21 = 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 %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 <math.h> int main (void) { int n; scanf("%d",&n); int array[n]; for (int i=0;i<n;i++){ scanf("%d",&array[i]); } for (int i = 0; i < n; i++) { if (array[i] % 2 == 0 && array[i] % 3 !=0 && array[i] % 5 != 0) { puts("DENIED"); return 0; } } puts("APPROVED"); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280508/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280508/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"DENIED\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"APPROVED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp33 = icmp sgt i32 %3, 0 br i1 %cmp33, label %for.body, label %cleanup24 for.cond3.preheader: ; preds = %for.body %cmp4.not35 = icmp sgt i32 %4, 0 br i1 %cmp4.not35, label %for.body6.preheader, label %cleanup24 for.body6.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %4 to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond3: ; preds = %for.body6 %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %exitcond.not = icmp eq i64 %indvars.iv.next40, %wide.trip.count br i1 %exitcond.not, label %cleanup24, label %for.body6, !llvm.loop !11 for.body6: ; preds = %for.body6.preheader, %for.cond3 %indvars.iv39 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next40, %for.cond3 ] %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv39 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %7 = and i32 %6, 1 %cmp9 = icmp ne i32 %7, 0 %rem12 = srem i32 %6, 3 %cmp13.not = icmp eq i32 %rem12, 0 %or.cond = or i1 %cmp9, %cmp13.not %rem17 = srem i32 %6, 5 %cmp18.not = icmp eq i32 %rem17, 0 %or.cond32 = or i1 %cmp18.not, %or.cond br i1 %or.cond32, label %for.cond3, label %cleanup24 cleanup24: ; preds = %for.cond3, %for.body6, %for.cond3.preheader, %entry %.str.1.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %for.cond3.preheader ], [ @.str.1, %for.body6 ], [ @.str.2, %for.cond3 ] %call19 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.stackrestore.p0(ptr %2) 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: 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 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void) { int n,i,a,f=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a); if(a%2==0){ if(a%3!=0&&a%5!=0){ f=1; } } } if(f==1){ printf("DENIED\n"); } else{ printf("APPROVED\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280551/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280551/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"APPROVED\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"DENIED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.body, label %if.else for.body: ; preds = %entry, %for.body %f.019 = phi i32 [ %f.1, %for.body ], [ 0, %entry ] %i.018 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %1 = load i32, ptr %a, align 4, !tbaa !5 %2 = and i32 %1, 1 %cmp2 = icmp ne i32 %2, 0 %rem3 = srem i32 %1, 3 %cmp4.not = icmp eq i32 %rem3, 0 %or.cond = or i1 %cmp2, %cmp4.not %rem5 = srem i32 %1, 5 %cmp6.not = icmp eq i32 %rem5, 0 %or.cond16 = or i1 %cmp6.not, %or.cond %f.1 = select i1 %or.cond16, i32 %f.019, i32 1 %inc = add nuw nsw i32 %i.018, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %4 = icmp eq i32 %f.1, 1 br i1 %4, label %if.end13, label %if.else if.else: ; preds = %entry, %for.end br label %if.end13 if.end13: ; preds = %for.end, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int N; scanf("%d",&N); int a[N]; for(int i=0;i<N;i++){ scanf("%d",&a[i]); } int j=0; int evencnt=0; int cnt=0; while(j<N){ if(a[j] % 2 == 0){ evencnt++; if((a[j] % 3 == 0) || (a[j] % 5 == 0)){ cnt++; } } j++; } if(evencnt++ == cnt) printf("APPROVED"); else printf("DENIED"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280595/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280595/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"APPROVED\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"DENIED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp33 = icmp sgt i32 %3, 0 br i1 %cmp33, label %for.body, label %if.end24 while.cond.preheader: ; preds = %for.body %cmp235 = icmp sgt i32 %27, 0 br i1 %cmp235, label %while.body.preheader, label %if.end24 while.body.preheader: ; preds = %while.cond.preheader %wide.trip.count = zext i32 %27 to i64 %min.iters.check = icmp ult i32 %27, 8 br i1 %min.iters.check, label %while.body.preheader62, label %vector.ph vector.ph: ; preds = %while.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi57, %vector.body ] %vec.phi52 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi58, %vector.body ] %vec.phi53 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %vector.body ] %vec.phi54 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi56, %vector.body ] %4 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load55 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = and <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %7 = and <4 x i32> %wide.load55, <i32 1, i32 1, i32 1, i32 1> %8 = icmp eq <4 x i32> %6, zeroinitializer %9 = icmp eq <4 x i32> %7, zeroinitializer %10 = srem <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3> %11 = srem <4 x i32> %wide.load55, <i32 3, i32 3, i32 3, i32 3> %12 = icmp eq <4 x i32> %10, zeroinitializer %13 = icmp eq <4 x i32> %11, zeroinitializer %14 = srem <4 x i32> %wide.load, <i32 5, i32 5, i32 5, i32 5> %15 = srem <4 x i32> %wide.load55, <i32 5, i32 5, i32 5, i32 5> %16 = icmp eq <4 x i32> %14, zeroinitializer %17 = icmp eq <4 x i32> %15, zeroinitializer %18 = or <4 x i1> %12, %16 %19 = or <4 x i1> %13, %17 %20 = xor <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1> %predphi = add <4 x i32> %vec.phi53, %20 %21 = xor <4 x i32> %7, <i32 1, i32 1, i32 1, i32 1> %predphi56 = add <4 x i32> %vec.phi54, %21 %narrow = select <4 x i1> %8, <4 x i1> %18, <4 x i1> zeroinitializer %22 = zext <4 x i1> %narrow to <4 x i32> %predphi57 = add <4 x i32> %vec.phi, %22 %narrow61 = select <4 x i1> %9, <4 x i1> %19, <4 x i1> zeroinitializer %23 = zext <4 x i1> %narrow61 to <4 x i32> %predphi58 = add <4 x i32> %vec.phi52, %23 %index.next = add nuw i64 %index, 8 %24 = icmp eq i64 %index.next, %n.vec br i1 %24, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx59 = add <4 x i32> %predphi56, %predphi %25 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx59) %bin.rdx = add <4 x i32> %predphi58, %predphi57 %26 = 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 %while.end, label %while.body.preheader62 while.body.preheader62: ; preds = %while.body.preheader, %middle.block %indvars.iv43.ph = phi i64 [ 0, %while.body.preheader ], [ %n.vec, %middle.block ] %cnt.038.ph = phi i32 [ 0, %while.body.preheader ], [ %26, %middle.block ] %evencnt.037.ph = phi i32 [ 0, %while.body.preheader ], [ %25, %middle.block ] br label %while.body 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 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %27 = load i32, ptr %N, align 4, !tbaa !5 %28 = sext i32 %27 to i64 %cmp = icmp slt i64 %indvars.iv.next, %28 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !13 while.body: ; preds = %while.body.preheader62, %if.end17 %indvars.iv43 = phi i64 [ %indvars.iv.next44, %if.end17 ], [ %indvars.iv43.ph, %while.body.preheader62 ] %cnt.038 = phi i32 [ %cnt.1, %if.end17 ], [ %cnt.038.ph, %while.body.preheader62 ] %evencnt.037 = phi i32 [ %evencnt.1, %if.end17 ], [ %evencnt.037.ph, %while.body.preheader62 ] %arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv43 %29 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %30 = and i32 %29, 1 %cmp5 = icmp eq i32 %30, 0 br i1 %cmp5, label %if.then, label %if.end17 if.then: ; preds = %while.body %inc6 = add nsw i32 %evencnt.037, 1 %rem9 = srem i32 %29, 3 %cmp10 = icmp eq i32 %rem9, 0 %rem13 = srem i32 %29, 5 %cmp14 = icmp eq i32 %rem13, 0 %or.cond = or i1 %cmp10, %cmp14 %inc16 = zext i1 %or.cond to i32 %spec.select = add nsw i32 %cnt.038, %inc16 br label %if.end17 if.end17: ; preds = %if.then, %while.body %evencnt.1 = phi i32 [ %evencnt.037, %while.body ], [ %inc6, %if.then ] %cnt.1 = phi i32 [ %cnt.038, %while.body ], [ %spec.select, %if.then ] %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %exitcond.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %if.end17, %middle.block %evencnt.1.lcssa = phi i32 [ %25, %middle.block ], [ %evencnt.1, %if.end17 ] %cnt.1.lcssa = phi i32 [ %26, %middle.block ], [ %cnt.1, %if.end17 ] %cmp20 = icmp eq i32 %evencnt.1.lcssa, %cnt.1.lcssa %spec.select51 = select i1 %cmp20, ptr @.str.1, ptr @.str.2 br label %if.end24 if.end24: ; preds = %while.end, %while.cond.preheader, %entry %.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %while.cond.preheader ], [ %spec.select51, %while.end ] %call23 = 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 %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include<stdio.h> int main() { int n,a[101],i,f[101]={0},ff=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=0;i<n;i++){ if(a[i]%2==0){ if(a[i]%3!=0 && a[i]%5!=0) f[i]=1; } } for(i=0;i<n;i++){ if(f[i]==1) ff++; } if(ff==0){ printf("APPROVED\n"); }else{ printf("DENIED\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280638/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"DENIED\00", align 1 @str.3 = private unnamed_addr constant [9 x i8] c"APPROVED\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 [101 x i32], align 16 %f = alloca [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %f) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %f, i8 0, i64 404, 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 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %if.end39 for.cond2.preheader: ; preds = %for.body %cmp356 = icmp sgt i32 %22, 0 br i1 %cmp356, label %for.body4.preheader, label %if.end39 for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %22 to i64 %min.iters.check = icmp ult i32 %22, 4 br i1 %min.iters.check, label %for.body4.preheader103, label %vector.ph vector.ph: ; preds = %for.body4.preheader %n.vec = and i64 %wide.trip.count, 4294967292 br label %vector.body vector.body: ; preds = %pred.store.continue85, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue85 ] %1 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5 %2 = trunc <4 x i32> %wide.load to <4 x i1> %3 = srem <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3> %4 = icmp eq <4 x i32> %3, zeroinitializer %5 = or <4 x i1> %4, %2 %6 = srem <4 x i32> %wide.load, <i32 5, i32 5, i32 5, i32 5> %7 = icmp eq <4 x i32> %6, zeroinitializer %8 = or <4 x i1> %7, %5 %9 = xor <4 x i1> %8, <i1 true, i1 true, i1 true, i1 true> %10 = extractelement <4 x i1> %9, i64 0 br i1 %10, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %11 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %index store i32 1, ptr %11, align 16, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %12 = extractelement <4 x i1> %9, i64 1 br i1 %12, label %pred.store.if80, label %pred.store.continue81 pred.store.if80: ; preds = %pred.store.continue %13 = or i64 %index, 1 %14 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %13 store i32 1, ptr %14, align 4, !tbaa !5 br label %pred.store.continue81 pred.store.continue81: ; preds = %pred.store.if80, %pred.store.continue %15 = extractelement <4 x i1> %9, i64 2 br i1 %15, label %pred.store.if82, label %pred.store.continue83 pred.store.if82: ; preds = %pred.store.continue81 %16 = or i64 %index, 2 %17 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %16 store i32 1, ptr %17, align 8, !tbaa !5 br label %pred.store.continue83 pred.store.continue83: ; preds = %pred.store.if82, %pred.store.continue81 %18 = extractelement <4 x i1> %9, i64 3 br i1 %18, label %pred.store.if84, label %pred.store.continue85 pred.store.if84: ; preds = %pred.store.continue83 %19 = or i64 %index, 3 %20 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %19 store i32 1, ptr %20, align 4, !tbaa !5 br label %pred.store.continue85 pred.store.continue85: ; preds = %pred.store.if84, %pred.store.continue83 %index.next = add nuw i64 %index, 4 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %pred.store.continue85 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond23.preheader, label %for.body4.preheader103 for.body4.preheader103: ; preds = %for.body4.preheader, %middle.block %indvars.iv64.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ] br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 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 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp = icmp slt i64 %indvars.iv.next, %23 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.cond23.preheader: ; preds = %for.inc20, %middle.block br i1 %cmp356, label %for.body25.preheader, label %if.end39 for.body25.preheader: ; preds = %for.cond23.preheader %wide.trip.count70 = zext i32 %22 to i64 %min.iters.check88 = icmp ult i32 %22, 8 br i1 %min.iters.check88, label %for.body25.preheader100, label %vector.ph89 vector.ph89: ; preds = %for.body25.preheader %n.vec91 = and i64 %wide.trip.count, 4294967288 br label %vector.body94 vector.body94: ; preds = %vector.body94, %vector.ph89 %index95 = phi i64 [ 0, %vector.ph89 ], [ %index.next99, %vector.body94 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph89 ], [ %30, %vector.body94 ] %vec.phi96 = phi <4 x i32> [ zeroinitializer, %vector.ph89 ], [ %31, %vector.body94 ] %24 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %index95 %wide.load97 = load <4 x i32>, ptr %24, align 16, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load98 = load <4 x i32>, ptr %25, align 16, !tbaa !5 %26 = icmp eq <4 x i32> %wide.load97, <i32 1, i32 1, i32 1, i32 1> %27 = icmp eq <4 x i32> %wide.load98, <i32 1, i32 1, i32 1, i32 1> %28 = zext <4 x i1> %26 to <4 x i32> %29 = zext <4 x i1> %27 to <4 x i32> %30 = add <4 x i32> %vec.phi, %28 %31 = add <4 x i32> %vec.phi96, %29 %index.next99 = add nuw i64 %index95, 8 %32 = icmp eq i64 %index.next99, %n.vec91 br i1 %32, label %middle.block86, label %vector.body94, !llvm.loop !14 middle.block86: ; preds = %vector.body94 %bin.rdx = add <4 x i32> %31, %30 %33 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n93 = icmp eq i64 %n.vec91, %wide.trip.count br i1 %cmp.n93, label %for.end34, label %for.body25.preheader100 for.body25.preheader100: ; preds = %for.body25.preheader, %middle.block86 %indvars.iv67.ph = phi i64 [ 0, %for.body25.preheader ], [ %n.vec91, %middle.block86 ] %ff.060.ph = phi i32 [ 0, %for.body25.preheader ], [ %33, %middle.block86 ] br label %for.body25 for.body4: ; preds = %for.body4.preheader103, %for.inc20 %indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.inc20 ], [ %indvars.iv64.ph, %for.body4.preheader103 ] %arrayidx6 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv64 %34 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %35 = and i32 %34, 1 %cmp7 = icmp ne i32 %35, 0 %rem10 = srem i32 %34, 3 %cmp11.not = icmp eq i32 %rem10, 0 %or.cond = or i1 %cmp7, %cmp11.not %rem14 = srem i32 %34, 5 %cmp15.not = icmp eq i32 %rem14, 0 %or.cond53 = or i1 %cmp15.not, %or.cond br i1 %or.cond53, label %for.inc20, label %if.then16 if.then16: ; preds = %for.body4 %arrayidx18 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %indvars.iv64 store i32 1, ptr %arrayidx18, align 4, !tbaa !5 br label %for.inc20 for.inc20: ; preds = %for.body4, %if.then16 %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1 %exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count br i1 %exitcond.not, label %for.cond23.preheader, label %for.body4, !llvm.loop !15 for.body25: ; preds = %for.body25.preheader100, %for.body25 %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body25 ], [ %indvars.iv67.ph, %for.body25.preheader100 ] %ff.060 = phi i32 [ %spec.select, %for.body25 ], [ %ff.060.ph, %for.body25.preheader100 ] %arrayidx27 = getelementptr inbounds [101 x i32], ptr %f, i64 0, i64 %indvars.iv67 %36 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %cmp28 = icmp eq i32 %36, 1 %inc30 = zext i1 %cmp28 to i32 %spec.select = add nuw nsw i32 %ff.060, %inc30 %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70 br i1 %exitcond71.not, label %for.end34, label %for.body25, !llvm.loop !16 for.end34: ; preds = %for.body25, %middle.block86 %spec.select.lcssa = phi i32 [ %33, %middle.block86 ], [ %spec.select, %for.body25 ] %37 = icmp eq i32 %spec.select.lcssa, 0 %spec.select79 = select i1 %37, ptr @str.3, ptr @str br label %if.end39 if.end39: ; preds = %for.end34, %for.cond23.preheader, %for.cond2.preheader, %entry %str.sink = phi ptr [ @str.3, %entry ], [ @str.3, %for.cond2.preheader ], [ @str.3, %for.cond23.preheader ], [ %spec.select79, %for.end34 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %f) #6 call void @llvm.lifetime.end.p0(i64 404, 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) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10, !12, !11}
#include<stdio.h> int main() { int n,a,i; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%d",&a); if (a%2==0 && a%3!=0 && a%5!=0) { printf("DENIED\n"); return 0; } } printf("APPROVED\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280681/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280681/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"APPROVED\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"DENIED\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.body, label %cleanup for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.016, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9 for.body: ; preds = %entry, %for.cond %i.016 = phi i32 [ %inc, %for.cond ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = and i32 %2, 1 %cmp2 = icmp ne i32 %3, 0 %rem3 = srem i32 %2, 3 %cmp4.not = icmp eq i32 %rem3, 0 %or.cond = or i1 %cmp2, %cmp4.not %rem6 = srem i32 %2, 5 %cmp7.not = icmp eq i32 %rem6, 0 %or.cond14 = or i1 %cmp7.not, %or.cond br i1 %or.cond14, label %for.cond, label %cleanup cleanup: ; preds = %for.cond, %for.body, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.3, %for.body ], [ @str, %for.cond ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int N,A[101],i; scanf("%d",&N); for(i = 0;i < N;i++){ scanf("%d",&A[i]); } for(i = 0;i < N;i++){ if(A[i] % 2 != 0){ continue; }else{ if((A[i] % 3 != 0) && (A[i] % 5 != 0)){ printf("DENIED\n"); return 0; } } } printf("APPROVED\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280724/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280724/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"APPROVED\00", align 1 @str.3 = private unnamed_addr constant [7 x i8] c"DENIED\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 [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp34 = icmp sgt i32 %0, 0 br i1 %cmp34, label %for.body, label %cleanup for.cond2.preheader: ; preds = %for.body %cmp336 = icmp sgt i32 %1, 0 br i1 %cmp336, label %for.body4.preheader, label %cleanup for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2: ; preds = %for.body4 %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body4, !llvm.loop !11 for.body4: ; preds = %for.body4.preheader, %for.cond2 %indvars.iv40 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next41, %for.cond2 ] %arrayidx6 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv40 %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %4 = and i32 %3, 1 %cmp7.not = icmp ne i32 %4, 0 %rem10 = srem i32 %3, 3 %cmp11.not = icmp eq i32 %rem10, 0 %or.cond = or i1 %cmp7.not, %cmp11.not %rem14 = srem i32 %3, 5 %cmp15.not = icmp eq i32 %rem14, 0 %or.cond33 = or i1 %cmp15.not, %or.cond br i1 %or.cond33, label %for.cond2, label %cleanup cleanup: ; preds = %for.cond2, %for.body4, %for.cond2.preheader, %entry %str.sink = phi ptr [ @str, %entry ], [ @str, %for.cond2.preheader ], [ @str.3, %for.body4 ], [ @str, %for.cond2 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #define rep(i,l,r)for(int i=(l);i<(r);i++) #define min(p,q)((p)<(q)?(p):(q)) #define max(p,q)((p)>(q)?(p):(q)) #define INF 1000000000 //ワーシャルフロイド //頂点数(と隣接行列)を引いて全点間最短距離を返す //O(V^3) //* int cost[410][410]; int dddd[410][410]; void waasharuhuroido(int n){ rep(i,0,n)rep(j,0,n)dddd[i][j]=cost[i][j];//辺が無いところはINFにする前処理が必要 rep(k,0,n)rep(i,0,n)rep(j,0,n)dddd[i][j]=min(dddd[i][j],dddd[i][k]+dddd[k][j]); } int h,w; char s[30][30]; int d4[]={0,1,0,-1,0}; #define in(p,q)(0<=(p)&&(p)<h&&0<=(q)&&(q)<w) int main(){ scanf("%d%d",&h,&w); rep(i,0,h)scanf("%s",s[i]); rep(i,0,h*w)rep(j,0,h*w)cost[i][j]=i==j?0:INF; rep(i,0,h)rep(j,0,w)if(s[i][j]=='.'){ rep(k,0,4){ int ii=i+d4[k]; int jj=j+d4[k+1]; if(in(ii,jj)&&s[ii][jj]=='.')cost[i*w+j][ii*w+jj]=1; } } waasharuhuroido(h*w); int ans=0; rep(i,0,h*w)rep(j,0,h*w)if(dddd[i][j]!=INF)ans=max(ans,dddd[i][j]); printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280768/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280768/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @cost = dso_local local_unnamed_addr global [410 x [410 x i32]] zeroinitializer, align 16 @dddd = dso_local local_unnamed_addr global [410 x [410 x i32]] zeroinitializer, align 16 @d4 = dso_local local_unnamed_addr global [5 x i32] [i32 0, i32 1, i32 0, i32 -1, i32 0], align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @h = dso_local global i32 0, align 4 @w = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @s = dso_local global [30 x [30 x i8]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @waasharuhuroido(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp96 = icmp sgt i32 %n, 0 br i1 %cmp96, label %for.cond1.preheader.us.preheader, label %for.cond.cleanup16 for.cond1.preheader.us.preheader: ; preds = %entry %0 = zext i32 %n to i64 %1 = shl nuw nsw i64 %0, 2 %xtraiter = and i64 %0, 3 %2 = icmp ult i32 %n, 4 br i1 %2, label %for.cond14.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader %unroll_iter = and i64 %0, 4294967292 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.3, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.3, %for.cond1.preheader.us ] %3 = mul nuw nsw i64 %indvar, 1640 %scevgep = getelementptr i8, ptr @dddd, i64 %3 %scevgep104 = getelementptr i8, ptr @cost, i64 %3 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep, ptr align 16 %scevgep104, i64 %1, i1 false), !tbaa !5 %4 = mul nuw i64 %indvar, 1640 %5 = add nuw i64 %4, 1640 %scevgep.1 = getelementptr i8, ptr @dddd, i64 %5 %scevgep104.1 = getelementptr i8, ptr @cost, i64 %5 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep.1, ptr align 8 %scevgep104.1, i64 %1, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 1640 %7 = add nuw i64 %6, 3280 %scevgep.2 = getelementptr i8, ptr @dddd, i64 %7 %scevgep104.2 = getelementptr i8, ptr @cost, i64 %7 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.2, ptr align 16 %scevgep104.2, i64 %1, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 1640 %9 = add nuw i64 %8, 4920 %scevgep.3 = getelementptr i8, ptr @dddd, i64 %9 %scevgep104.3 = getelementptr i8, ptr @cost, i64 %9 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep.3, ptr align 8 %scevgep104.3, i64 %1, i1 false), !tbaa !5 %indvar.next.3 = add nuw nsw i64 %indvar, 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.cond14.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !9 for.cond14.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.3, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond14.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond14.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond14.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond14.preheader.unr-lcssa ] %10 = mul nuw nsw i64 %indvar.epil, 1640 %scevgep.epil = getelementptr i8, ptr @dddd, i64 %10 %scevgep104.epil = getelementptr i8, ptr @cost, i64 %10 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep.epil, ptr align 8 %scevgep104.epil, i64 %1, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond14.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !11 for.cond14.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond14.preheader.unr-lcssa br i1 %cmp96, label %for.cond19.preheader.us.preheader, label %for.cond.cleanup16 for.cond19.preheader.us.preheader: ; preds = %for.cond14.preheader %wide.trip.count118 = zext i32 %n to i64 %11 = shl nuw nsw i64 %0, 2 %12 = getelementptr i8, ptr @dddd, i64 %11 %min.iters.check = icmp ult i32 %n, 12 %13 = getelementptr i8, ptr @dddd, i64 %11 %n.vec = and i64 %0, 4294967288 %cmp.n = icmp eq i64 %n.vec, %0 %xtraiter134 = and i64 %wide.trip.count118, 1 %lcmp.mod135.not = icmp eq i64 %xtraiter134, 0 %14 = sub nsw i64 0, %wide.trip.count118 br label %for.cond19.preheader.us for.cond19.preheader.us: ; preds = %for.cond19.preheader.us.preheader, %for.cond19.for.cond.cleanup21_crit_edge.split.us.us %indvars.iv115 = phi i64 [ 0, %for.cond19.preheader.us.preheader ], [ %indvars.iv.next116, %for.cond19.for.cond.cleanup21_crit_edge.split.us.us ] %15 = shl nuw nsw i64 %indvars.iv115, 2 %16 = mul nuw nsw i64 %indvars.iv115, 1640 %scevgep124 = getelementptr i8, ptr @dddd, i64 %16 %scevgep125 = getelementptr i8, ptr %12, i64 %16 %gep = getelementptr i8, ptr getelementptr (i8, ptr @dddd, i64 4), i64 %15 %17 = getelementptr i8, ptr @dddd, i64 %15 %bound0 = icmp ugt ptr %gep, @dddd %bound1 = icmp ult ptr %17, %13 %found.conflict = and i1 %bound0, %bound1 br label %for.cond24.preheader.us.us for.cond24.preheader.us.us: ; preds = %for.cond24.for.cond.cleanup26_crit_edge.us.us, %for.cond19.preheader.us %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.cond24.for.cond.cleanup26_crit_edge.us.us ], [ 0, %for.cond19.preheader.us ] %arrayidx35.us.us = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110, i64 %indvars.iv115 br i1 %min.iters.check, label %for.body27.us.us.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond24.preheader.us.us %18 = mul nuw nsw i64 %indvars.iv110, 1640 %scevgep121 = getelementptr i8, ptr %13, i64 %18 %scevgep120 = getelementptr i8, ptr @dddd, i64 %18 %bound0126 = icmp ult ptr %scevgep120, %scevgep125 %bound1127 = icmp ult ptr %scevgep124, %scevgep121 %found.conflict128 = and i1 %bound0126, %bound1127 %conflict.rdx = or i1 %found.conflict, %found.conflict128 br i1 %conflict.rdx, label %for.body27.us.us.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %19 = load i32, ptr %arrayidx35.us.us, align 4, !tbaa !5, !alias.scope !13 %broadcast.splatinsert132 = insertelement <4 x i32> poison, i32 %19, i64 0 %broadcast.splat133 = shufflevector <4 x i32> %broadcast.splatinsert132, <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 ] %20 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110, i64 %index %wide.load = load <4 x i32>, ptr %20, align 8, !tbaa !5, !alias.scope !16, !noalias !18 %21 = getelementptr inbounds i32, ptr %20, i64 4 %wide.load129 = load <4 x i32>, ptr %21, align 8, !tbaa !5, !alias.scope !16, !noalias !18 %22 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115, i64 %index %wide.load130 = load <4 x i32>, ptr %22, align 8, !tbaa !5, !alias.scope !20 %23 = getelementptr inbounds i32, ptr %22, i64 4 %wide.load131 = load <4 x i32>, ptr %23, align 8, !tbaa !5, !alias.scope !20 %24 = add nsw <4 x i32> %wide.load130, %broadcast.splat133 %25 = add nsw <4 x i32> %wide.load131, %broadcast.splat133 %26 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %24) %27 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load129, <4 x i32> %25) store <4 x i32> %26, ptr %20, align 8, !tbaa !5, !alias.scope !16, !noalias !18 store <4 x i32> %27, ptr %21, align 8, !tbaa !5, !alias.scope !16, !noalias !18 %index.next = add nuw i64 %index, 8 %28 = icmp eq i64 %index.next, %n.vec br i1 %28, label %middle.block, label %vector.body, !llvm.loop !21 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond24.for.cond.cleanup26_crit_edge.us.us, label %for.body27.us.us.preheader for.body27.us.us.preheader: ; preds = %vector.memcheck, %for.cond24.preheader.us.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond24.preheader.us.us ], [ %n.vec, %middle.block ] br i1 %lcmp.mod135.not, label %for.body27.us.us.prol.loopexit, label %for.body27.us.us.prol for.body27.us.us.prol: ; preds = %for.body27.us.us.preheader %arrayidx31.us.us.prol = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110, i64 %indvars.iv.ph %29 = load i32, ptr %arrayidx31.us.us.prol, align 8, !tbaa !5 %30 = load i32, ptr %arrayidx35.us.us, align 4, !tbaa !5 %arrayidx39.us.us.prol = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115, i64 %indvars.iv.ph %31 = load i32, ptr %arrayidx39.us.us.prol, align 8, !tbaa !5 %add.us.us.prol = add nsw i32 %31, %30 %.add.us.us.prol = tail call i32 @llvm.smin.i32(i32 %29, i32 %add.us.us.prol) store i32 %.add.us.us.prol, ptr %arrayidx31.us.us.prol, align 8, !tbaa !5 %indvars.iv.next.prol = or i64 %indvars.iv.ph, 1 br label %for.body27.us.us.prol.loopexit for.body27.us.us.prol.loopexit: ; preds = %for.body27.us.us.prol, %for.body27.us.us.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body27.us.us.preheader ], [ %indvars.iv.next.prol, %for.body27.us.us.prol ] %32 = xor i64 %indvars.iv.ph, %14 %33 = icmp eq i64 %32, -1 br i1 %33, label %for.cond24.for.cond.cleanup26_crit_edge.us.us, label %for.body27.us.us for.body27.us.us: ; preds = %for.body27.us.us.prol.loopexit, %for.body27.us.us %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body27.us.us ], [ %indvars.iv.unr, %for.body27.us.us.prol.loopexit ] %arrayidx31.us.us = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110, i64 %indvars.iv %34 = load i32, ptr %arrayidx31.us.us, align 4, !tbaa !5 %35 = load i32, ptr %arrayidx35.us.us, align 4, !tbaa !5 %arrayidx39.us.us = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115, i64 %indvars.iv %36 = load i32, ptr %arrayidx39.us.us, align 4, !tbaa !5 %add.us.us = add nsw i32 %36, %35 %.add.us.us = tail call i32 @llvm.smin.i32(i32 %34, i32 %add.us.us) store i32 %.add.us.us, ptr %arrayidx31.us.us, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx31.us.us.1 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110, i64 %indvars.iv.next %37 = load i32, ptr %arrayidx31.us.us.1, align 4, !tbaa !5 %38 = load i32, ptr %arrayidx35.us.us, align 4, !tbaa !5 %arrayidx39.us.us.1 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115, i64 %indvars.iv.next %39 = load i32, ptr %arrayidx39.us.us.1, align 4, !tbaa !5 %add.us.us.1 = add nsw i32 %39, %38 %.add.us.us.1 = tail call i32 @llvm.smin.i32(i32 %37, i32 %add.us.us.1) store i32 %.add.us.us.1, ptr %arrayidx31.us.us.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond109.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count118 br i1 %exitcond109.not.1, label %for.cond24.for.cond.cleanup26_crit_edge.us.us, label %for.body27.us.us, !llvm.loop !24 for.cond24.for.cond.cleanup26_crit_edge.us.us: ; preds = %for.body27.us.us.prol.loopexit, %for.body27.us.us, %middle.block %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count118 br i1 %exitcond114.not, label %for.cond19.for.cond.cleanup21_crit_edge.split.us.us, label %for.cond24.preheader.us.us, !llvm.loop !25 for.cond19.for.cond.cleanup21_crit_edge.split.us.us: ; preds = %for.cond24.for.cond.cleanup26_crit_edge.us.us %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1 %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118 br i1 %exitcond119.not, label %for.cond.cleanup16, label %for.cond19.preheader.us, !llvm.loop !26 for.cond.cleanup16: ; preds = %for.cond19.for.cond.cleanup21_crit_edge.split.us.us, %entry, %for.cond14.preheader ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @h, ptr noundef nonnull @w) %0 = load i32, ptr @h, align 4, !tbaa !5 %cmp167 = icmp sgt i32 %0, 0 br i1 %cmp167, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %.lcssa166 = phi i32 [ %0, %entry ], [ %9, %for.body ] %1 = load i32, ptr @w, align 4, !tbaa !5 %mul = mul nsw i32 %1, %.lcssa166 %cmp4171 = icmp sgt i32 %mul, 0 br i1 %cmp4171, label %for.cond7.preheader.us.preheader, label %for.cond24.preheader for.cond7.preheader.us.preheader: ; preds = %for.cond3.preheader %wide.trip.count198 = zext i32 %mul to i64 %min.iters.check = icmp ult i32 %mul, 8 %n.vec = and i64 %wide.trip.count198, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count198 br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.cond.cleanup10_crit_edge.us %indvars.iv195 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next196, %for.cond7.for.cond.cleanup10_crit_edge.us ] br i1 %min.iters.check, label %for.body11.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond7.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 1000000000, i32 1000000000, i32 1000000000, i32 1000000000> %5 = select <4 x i1> %3, <4 x i32> zeroinitializer, <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000> %6 = getelementptr inbounds [410 x [410 x i32]], ptr @cost, i64 0, i64 %indvars.iv195, i64 %index store <4 x i32> %4, ptr %6, align 8, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %5, ptr %7, align 8, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !27 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond7.for.cond.cleanup10_crit_edge.us, label %for.body11.us.preheader for.body11.us.preheader: ; preds = %for.cond7.preheader.us, %middle.block %indvars.iv192.ph = phi i64 [ 0, %for.cond7.preheader.us ], [ %n.vec, %middle.block ] br label %for.body11.us for.body11.us: ; preds = %for.body11.us.preheader, %for.body11.us %indvars.iv192 = phi i64 [ %indvars.iv.next193, %for.body11.us ], [ %indvars.iv192.ph, %for.body11.us.preheader ] %cmp12.us = icmp eq i64 %indvars.iv195, %indvars.iv192 %cond.us = select i1 %cmp12.us, i32 0, i32 1000000000 %arrayidx16.us = getelementptr inbounds [410 x [410 x i32]], ptr @cost, i64 0, i64 %indvars.iv195, i64 %indvars.iv192 store i32 %cond.us, ptr %arrayidx16.us, align 4, !tbaa !5 %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.cond7.for.cond.cleanup10_crit_edge.us, label %for.body11.us, !llvm.loop !28 for.cond7.for.cond.cleanup10_crit_edge.us: ; preds = %for.body11.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.cond24.preheader, label %for.cond7.preheader.us, !llvm.loop !29 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [30 x [30 x i8]], ptr @s, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr @h, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !30 for.cond24.preheader: ; preds = %for.cond7.for.cond.cleanup10_crit_edge.us, %for.cond3.preheader %cmp25179 = icmp sgt i32 %.lcssa166, 0 %cmp30177 = icmp sgt i32 %1, 0 %or.cond = and i1 %cmp25179, %cmp30177 br i1 %or.cond, label %for.cond29.preheader.us.preheader, label %for.cond.cleanup26 for.cond29.preheader.us.preheader: ; preds = %for.cond24.preheader %11 = zext i32 %1 to i64 %wide.trip.count214 = zext i32 %.lcssa166 to i64 %wide.trip.count208 = zext i32 %1 to i64 %12 = load i32, ptr @d4, align 16 %13 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @d4, i64 0, i64 1), align 4 %14 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @d4, i64 0, i64 2), align 8 %15 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @d4, i64 0, i64 3), align 4 %16 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @d4, i64 0, i64 4), align 16 br label %for.cond29.preheader.us for.cond29.preheader.us: ; preds = %for.cond29.preheader.us.preheader, %for.cond29.for.cond.cleanup31_crit_edge.us %indvars.iv210 = phi i64 [ 0, %for.cond29.preheader.us.preheader ], [ %indvars.iv.next211, %for.cond29.for.cond.cleanup31_crit_edge.us ] %17 = mul nsw i64 %indvars.iv210, %11 %18 = trunc i64 %indvars.iv210 to i32 %add.us = add nsw i32 %12, %18 %cmp50.us = icmp sgt i32 %add.us, -1 %cmp52.us = icmp slt i32 %add.us, %.lcssa166 %idxprom61.us = zext i32 %add.us to i64 %mul73.us = mul nsw i32 %add.us, %1 %add.us.1 = add nsw i32 %13, %18 %cmp50.us.1 = icmp sgt i32 %add.us.1, -1 %cmp52.us.1 = icmp slt i32 %add.us.1, %.lcssa166 %idxprom61.us.1 = zext i32 %add.us.1 to i64 %mul73.us.1 = mul nsw i32 %add.us.1, %1 %add.us.2 = add nsw i32 %14, %18 %cmp50.us.2 = icmp sgt i32 %add.us.2, -1 %cmp52.us.2 = icmp slt i32 %add.us.2, %.lcssa166 %idxprom61.us.2 = zext i32 %add.us.2 to i64 %mul73.us.2 = mul nsw i32 %add.us.2, %1 %add.us.3 = add nsw i32 %15, %18 %cmp50.us.3 = icmp sgt i32 %add.us.3, -1 %cmp52.us.3 = icmp slt i32 %add.us.3, %.lcssa166 %idxprom61.us.3 = zext i32 %add.us.3 to i64 %mul73.us.3 = mul nsw i32 %add.us.3, %1 br label %for.body32.us for.body32.us: ; preds = %for.cond29.preheader.us, %for.inc81.us %indvars.iv204 = phi i64 [ 0, %for.cond29.preheader.us ], [ %indvars.iv.next205, %for.inc81.us ] %arrayidx36.us = getelementptr inbounds [30 x [30 x i8]], ptr @s, i64 0, i64 %indvars.iv210, i64 %indvars.iv204 %19 = load i8, ptr %arrayidx36.us, align 1, !tbaa !31 %cmp37.us = icmp eq i8 %19, 46 br i1 %cmp37.us, label %for.cond39.preheader.us, label %for.inc81.us for.inc81.us: ; preds = %if.end.us.2, %land.lhs.true.us.3, %land.lhs.true60.us.3, %if.then68.us.3, %for.body32.us %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %exitcond209.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count208 br i1 %exitcond209.not, label %for.cond29.for.cond.cleanup31_crit_edge.us, label %for.body32.us, !llvm.loop !32 land.lhs.true.us: ; preds = %for.cond39.preheader.us %cmp55.us = icmp sgt i32 %add49.us, -1 %or.cond.us = select i1 %cmp52.us, i1 %cmp55.us, i1 false %cmp58.us = icmp slt i32 %add49.us, %1 %or.cond165.us = select i1 %or.cond.us, i1 %cmp58.us, i1 false br i1 %or.cond165.us, label %land.lhs.true60.us, label %if.end.us land.lhs.true60.us: ; preds = %land.lhs.true.us %idxprom63.us = zext i32 %add49.us to i64 %arrayidx64.us = getelementptr inbounds [30 x [30 x i8]], ptr @s, i64 0, i64 %idxprom61.us, i64 %idxprom63.us %20 = load i8, ptr %arrayidx64.us, align 1, !tbaa !31 %cmp66.us = icmp eq i8 %20, 46 br i1 %cmp66.us, label %if.then68.us, label %if.end.us if.then68.us: ; preds = %land.lhs.true60.us %add74.us = add nsw i32 %mul73.us, %add49.us %idxprom75.us = sext i32 %add74.us to i64 %arrayidx76.us = getelementptr inbounds [410 x [410 x i32]], ptr @cost, i64 0, i64 %24, i64 %idxprom75.us store i32 1, ptr %arrayidx76.us, align 4, !tbaa !5 br label %if.end.us if.end.us: ; preds = %if.then68.us, %land.lhs.true60.us, %land.lhs.true.us, %for.cond39.preheader.us %add49.us.1 = add nsw i32 %14, %25 br i1 %cmp50.us.1, label %land.lhs.true.us.1, label %if.end.us.1 land.lhs.true.us.1: ; preds = %if.end.us %cmp55.us.1 = icmp sgt i32 %add49.us.1, -1 %or.cond.us.1 = select i1 %cmp52.us.1, i1 %cmp55.us.1, i1 false %cmp58.us.1 = icmp slt i32 %add49.us.1, %1 %or.cond165.us.1 = select i1 %or.cond.us.1, i1 %cmp58.us.1, i1 false br i1 %or.cond165.us.1, label %land.lhs.true60.us.1, label %if.end.us.1 land.lhs.true60.us.1: ; preds = %land.lhs.true.us.1 %idxprom63.us.1 = zext i32 %add49.us.1 to i64 %arrayidx64.us.1 = getelementptr inbounds [30 x [30 x i8]], ptr @s, i64 0, i64 %idxprom61.us.1, i64 %idxprom63.us.1 %21 = load i8, ptr %arrayidx64.us.1, align 1, !tbaa !31 %cmp66.us.1 = icmp eq i8 %21, 46 br i1 %cmp66.us.1, label %if.then68.us.1, label %if.end.us.1 if.then68.us.1: ; preds = %land.lhs.true60.us.1 %add74.us.1 = add nsw i32 %mul73.us.1, %add49.us.1 %idxprom75.us.1 = sext i32 %add74.us.1 to i64 %arrayidx76.us.1 = getelementptr inbounds [410 x [410 x i32]], ptr @cost, i64 0, i64 %24, i64 %idxprom75.us.1 store i32 1, ptr %arrayidx76.us.1, align 4, !tbaa !5 br label %if.end.us.1 if.end.us.1: ; preds = %if.then68.us.1, %land.lhs.true60.us.1, %land.lhs.true.us.1, %if.end.us %add49.us.2 = add nsw i32 %15, %25 br i1 %cmp50.us.2, label %land.lhs.true.us.2, label %if.end.us.2 land.lhs.true.us.2: ; preds = %if.end.us.1 %cmp55.us.2 = icmp sgt i32 %add49.us.2, -1 %or.cond.us.2 = select i1 %cmp52.us.2, i1 %cmp55.us.2, i1 false %cmp58.us.2 = icmp slt i32 %add49.us.2, %1 %or.cond165.us.2 = select i1 %or.cond.us.2, i1 %cmp58.us.2, i1 false br i1 %or.cond165.us.2, label %land.lhs.true60.us.2, label %if.end.us.2 land.lhs.true60.us.2: ; preds = %land.lhs.true.us.2 %idxprom63.us.2 = zext i32 %add49.us.2 to i64 %arrayidx64.us.2 = getelementptr inbounds [30 x [30 x i8]], ptr @s, i64 0, i64 %idxprom61.us.2, i64 %idxprom63.us.2 %22 = load i8, ptr %arrayidx64.us.2, align 1, !tbaa !31 %cmp66.us.2 = icmp eq i8 %22, 46 br i1 %cmp66.us.2, label %if.then68.us.2, label %if.end.us.2 if.then68.us.2: ; preds = %land.lhs.true60.us.2 %add74.us.2 = add nsw i32 %mul73.us.2, %add49.us.2 %idxprom75.us.2 = sext i32 %add74.us.2 to i64 %arrayidx76.us.2 = getelementptr inbounds [410 x [410 x i32]], ptr @cost, i64 0, i64 %24, i64 %idxprom75.us.2 store i32 1, ptr %arrayidx76.us.2, align 4, !tbaa !5 br label %if.end.us.2 if.end.us.2: ; preds = %if.then68.us.2, %land.lhs.true60.us.2, %land.lhs.true.us.2, %if.end.us.1 %add49.us.3 = add nsw i32 %16, %25 br i1 %cmp50.us.3, label %land.lhs.true.us.3, label %for.inc81.us land.lhs.true.us.3: ; preds = %if.end.us.2 %cmp55.us.3 = icmp sgt i32 %add49.us.3, -1 %or.cond.us.3 = select i1 %cmp52.us.3, i1 %cmp55.us.3, i1 false %cmp58.us.3 = icmp slt i32 %add49.us.3, %1 %or.cond165.us.3 = select i1 %or.cond.us.3, i1 %cmp58.us.3, i1 false br i1 %or.cond165.us.3, label %land.lhs.true60.us.3, label %for.inc81.us land.lhs.true60.us.3: ; preds = %land.lhs.true.us.3 %idxprom63.us.3 = zext i32 %add49.us.3 to i64 %arrayidx64.us.3 = getelementptr inbounds [30 x [30 x i8]], ptr @s, i64 0, i64 %idxprom61.us.3, i64 %idxprom63.us.3 %23 = load i8, ptr %arrayidx64.us.3, align 1, !tbaa !31 %cmp66.us.3 = icmp eq i8 %23, 46 br i1 %cmp66.us.3, label %if.then68.us.3, label %for.inc81.us if.then68.us.3: ; preds = %land.lhs.true60.us.3 %add74.us.3 = add nsw i32 %mul73.us.3, %add49.us.3 %idxprom75.us.3 = sext i32 %add74.us.3 to i64 %arrayidx76.us.3 = getelementptr inbounds [410 x [410 x i32]], ptr @cost, i64 0, i64 %24, i64 %idxprom75.us.3 store i32 1, ptr %arrayidx76.us.3, align 4, !tbaa !5 br label %for.inc81.us for.cond39.preheader.us: ; preds = %for.body32.us %24 = add nuw nsw i64 %indvars.iv204, %17 %25 = trunc i64 %indvars.iv204 to i32 %add49.us = add nsw i32 %13, %25 br i1 %cmp50.us, label %land.lhs.true.us, label %if.end.us for.cond29.for.cond.cleanup31_crit_edge.us: ; preds = %for.inc81.us %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1 %exitcond215.not = icmp eq i64 %indvars.iv.next211, %wide.trip.count214 br i1 %exitcond215.not, label %for.cond.cleanup26, label %for.cond29.preheader.us, !llvm.loop !33 for.cond.cleanup26: ; preds = %for.cond29.for.cond.cleanup31_crit_edge.us, %for.cond24.preheader br i1 %cmp4171, label %for.cond1.preheader.us.preheader.i, label %for.cond.cleanup93 for.cond1.preheader.us.preheader.i: ; preds = %for.cond.cleanup26 %26 = zext i32 %mul to i64 %27 = shl nuw nsw i64 %26, 2 %xtraiter = and i64 %26, 3 %28 = icmp ult i32 %mul, 4 br i1 %28, label %for.cond19.preheader.us.i.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.i.new for.cond1.preheader.us.preheader.i.new: ; preds = %for.cond1.preheader.us.preheader.i %unroll_iter = and i64 %26, 4294967292 br label %for.cond1.preheader.us.i for.cond1.preheader.us.i: ; preds = %for.cond1.preheader.us.i, %for.cond1.preheader.us.preheader.i.new %indvar.i = phi i64 [ 0, %for.cond1.preheader.us.preheader.i.new ], [ %indvar.next.i.3, %for.cond1.preheader.us.i ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.i.new ], [ %niter.next.3, %for.cond1.preheader.us.i ] %29 = mul nuw nsw i64 %indvar.i, 1640 %scevgep.i = getelementptr i8, ptr @dddd, i64 %29 %scevgep104.i = getelementptr i8, ptr @cost, i64 %29 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i, ptr align 16 %scevgep104.i, i64 %27, i1 false), !tbaa !5 %30 = mul nuw i64 %indvar.i, 1640 %31 = add nuw i64 %30, 1640 %scevgep.i.1 = getelementptr i8, ptr @dddd, i64 %31 %scevgep104.i.1 = getelementptr i8, ptr @cost, i64 %31 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep.i.1, ptr align 8 %scevgep104.i.1, i64 %27, i1 false), !tbaa !5 %32 = mul nuw i64 %indvar.i, 1640 %33 = add nuw i64 %32, 3280 %scevgep.i.2 = getelementptr i8, ptr @dddd, i64 %33 %scevgep104.i.2 = getelementptr i8, ptr @cost, i64 %33 tail call void @llvm.memcpy.p0.p0.i64(ptr align 16 %scevgep.i.2, ptr align 16 %scevgep104.i.2, i64 %27, i1 false), !tbaa !5 %34 = mul nuw i64 %indvar.i, 1640 %35 = add nuw i64 %34, 4920 %scevgep.i.3 = getelementptr i8, ptr @dddd, i64 %35 %scevgep104.i.3 = getelementptr i8, ptr @cost, i64 %35 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep.i.3, ptr align 8 %scevgep104.i.3, i64 %27, i1 false), !tbaa !5 %indvar.next.i.3 = add nuw nsw i64 %indvar.i, 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.cond19.preheader.us.i.preheader.unr-lcssa, label %for.cond1.preheader.us.i, !llvm.loop !9 for.cond19.preheader.us.i.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us.i, %for.cond1.preheader.us.preheader.i %indvar.i.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader.i ], [ %indvar.next.i.3, %for.cond1.preheader.us.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond19.preheader.us.i.preheader, label %for.cond1.preheader.us.i.epil for.cond1.preheader.us.i.epil: ; preds = %for.cond19.preheader.us.i.preheader.unr-lcssa, %for.cond1.preheader.us.i.epil %indvar.i.epil = phi i64 [ %indvar.next.i.epil, %for.cond1.preheader.us.i.epil ], [ %indvar.i.unr, %for.cond19.preheader.us.i.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.i.epil ], [ 0, %for.cond19.preheader.us.i.preheader.unr-lcssa ] %36 = mul nuw nsw i64 %indvar.i.epil, 1640 %scevgep.i.epil = getelementptr i8, ptr @dddd, i64 %36 %scevgep104.i.epil = getelementptr i8, ptr @cost, i64 %36 tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %scevgep.i.epil, ptr align 8 %scevgep104.i.epil, i64 %27, i1 false), !tbaa !5 %indvar.next.i.epil = add nuw nsw i64 %indvar.i.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.cond19.preheader.us.i.preheader, label %for.cond1.preheader.us.i.epil, !llvm.loop !34 for.cond19.preheader.us.i.preheader: ; preds = %for.cond1.preheader.us.i.epil, %for.cond19.preheader.us.i.preheader.unr-lcssa %37 = shl nuw nsw i64 %26, 2 %38 = getelementptr i8, ptr @dddd, i64 %37 %min.iters.check237 = icmp ult i32 %mul, 12 %39 = getelementptr i8, ptr @dddd, i64 %37 %n.vec240 = and i64 %26, 4294967288 %cmp.n242 = icmp eq i64 %n.vec240, %26 %xtraiter253 = and i64 %26, 1 %lcmp.mod254.not = icmp eq i64 %xtraiter253, 0 %40 = sub nsw i64 0, %26 br label %for.cond19.preheader.us.i for.cond19.preheader.us.i: ; preds = %for.cond19.preheader.us.i.preheader, %for.cond19.for.cond.cleanup21_crit_edge.split.us.us.i %indvars.iv115.i = phi i64 [ %indvars.iv.next116.i, %for.cond19.for.cond.cleanup21_crit_edge.split.us.us.i ], [ 0, %for.cond19.preheader.us.i.preheader ] %41 = shl nuw nsw i64 %indvars.iv115.i, 2 %42 = mul nuw nsw i64 %indvars.iv115.i, 1640 %scevgep230 = getelementptr i8, ptr @dddd, i64 %42 %scevgep231 = getelementptr i8, ptr %38, i64 %42 %gep = getelementptr i8, ptr getelementptr (i8, ptr @dddd, i64 4), i64 %41 %43 = getelementptr i8, ptr @dddd, i64 %41 %bound0 = icmp ugt ptr %gep, @dddd %bound1 = icmp ult ptr %43, %39 %found.conflict = and i1 %bound0, %bound1 br label %for.cond24.preheader.us.us.i for.cond24.preheader.us.us.i: ; preds = %for.cond24.for.cond.cleanup26_crit_edge.us.us.i, %for.cond19.preheader.us.i %indvars.iv110.i = phi i64 [ %indvars.iv.next111.i, %for.cond24.for.cond.cleanup26_crit_edge.us.us.i ], [ 0, %for.cond19.preheader.us.i ] %arrayidx35.us.us.i = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110.i, i64 %indvars.iv115.i br i1 %min.iters.check237, label %for.body27.us.us.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond24.preheader.us.us.i %44 = mul nuw nsw i64 %indvars.iv110.i, 1640 %scevgep227 = getelementptr i8, ptr %39, i64 %44 %scevgep = getelementptr i8, ptr @dddd, i64 %44 %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.body27.us.us.i.preheader, label %vector.ph238 vector.ph238: ; preds = %vector.memcheck %45 = load i32, ptr %arrayidx35.us.us.i, align 4, !tbaa !5, !alias.scope !35 %broadcast.splatinsert250 = insertelement <4 x i32> poison, i32 %45, 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 = %vector.body243, %vector.ph238 %index244 = phi i64 [ 0, %vector.ph238 ], [ %index.next252, %vector.body243 ] %46 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110.i, i64 %index244 %wide.load = load <4 x i32>, ptr %46, align 8, !tbaa !5, !alias.scope !38, !noalias !40 %47 = getelementptr inbounds i32, ptr %46, i64 4 %wide.load245 = load <4 x i32>, ptr %47, align 8, !tbaa !5, !alias.scope !38, !noalias !40 %48 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115.i, i64 %index244 %wide.load246 = load <4 x i32>, ptr %48, align 8, !tbaa !5, !alias.scope !42 %49 = getelementptr inbounds i32, ptr %48, i64 4 %wide.load247 = load <4 x i32>, ptr %49, align 8, !tbaa !5, !alias.scope !42 %50 = add nsw <4 x i32> %wide.load246, %broadcast.splat251 %51 = add nsw <4 x i32> %wide.load247, %broadcast.splat251 %52 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %50) %53 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load245, <4 x i32> %51) store <4 x i32> %52, ptr %46, align 8, !tbaa !5, !alias.scope !38, !noalias !40 store <4 x i32> %53, ptr %47, align 8, !tbaa !5, !alias.scope !38, !noalias !40 %index.next252 = add nuw i64 %index244, 8 %54 = icmp eq i64 %index.next252, %n.vec240 br i1 %54, label %middle.block235, label %vector.body243, !llvm.loop !43 middle.block235: ; preds = %vector.body243 br i1 %cmp.n242, label %for.cond24.for.cond.cleanup26_crit_edge.us.us.i, label %for.body27.us.us.i.preheader for.body27.us.us.i.preheader: ; preds = %vector.memcheck, %for.cond24.preheader.us.us.i, %middle.block235 %indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.cond24.preheader.us.us.i ], [ %n.vec240, %middle.block235 ] br i1 %lcmp.mod254.not, label %for.body27.us.us.i.prol.loopexit, label %for.body27.us.us.i.prol for.body27.us.us.i.prol: ; preds = %for.body27.us.us.i.preheader %arrayidx31.us.us.i.prol = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110.i, i64 %indvars.iv.i.ph %55 = load i32, ptr %arrayidx31.us.us.i.prol, align 8, !tbaa !5 %56 = load i32, ptr %arrayidx35.us.us.i, align 4, !tbaa !5 %arrayidx39.us.us.i.prol = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115.i, i64 %indvars.iv.i.ph %57 = load i32, ptr %arrayidx39.us.us.i.prol, align 8, !tbaa !5 %add.us.us.i.prol = add nsw i32 %57, %56 %.add.us.us.i.prol = tail call i32 @llvm.smin.i32(i32 %55, i32 %add.us.us.i.prol) store i32 %.add.us.us.i.prol, ptr %arrayidx31.us.us.i.prol, align 8, !tbaa !5 %indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1 br label %for.body27.us.us.i.prol.loopexit for.body27.us.us.i.prol.loopexit: ; preds = %for.body27.us.us.i.prol, %for.body27.us.us.i.preheader %indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body27.us.us.i.preheader ], [ %indvars.iv.next.i.prol, %for.body27.us.us.i.prol ] %58 = xor i64 %indvars.iv.i.ph, %40 %59 = icmp eq i64 %58, -1 br i1 %59, label %for.cond24.for.cond.cleanup26_crit_edge.us.us.i, label %for.body27.us.us.i for.body27.us.us.i: ; preds = %for.body27.us.us.i.prol.loopexit, %for.body27.us.us.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body27.us.us.i ], [ %indvars.iv.i.unr, %for.body27.us.us.i.prol.loopexit ] %arrayidx31.us.us.i = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110.i, i64 %indvars.iv.i %60 = load i32, ptr %arrayidx31.us.us.i, align 4, !tbaa !5 %61 = load i32, ptr %arrayidx35.us.us.i, align 4, !tbaa !5 %arrayidx39.us.us.i = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115.i, i64 %indvars.iv.i %62 = load i32, ptr %arrayidx39.us.us.i, align 4, !tbaa !5 %add.us.us.i = add nsw i32 %62, %61 %.add.us.us.i = tail call i32 @llvm.smin.i32(i32 %60, i32 %add.us.us.i) store i32 %.add.us.us.i, ptr %arrayidx31.us.us.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx31.us.us.i.1 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv110.i, i64 %indvars.iv.next.i %63 = load i32, ptr %arrayidx31.us.us.i.1, align 4, !tbaa !5 %64 = load i32, ptr %arrayidx35.us.us.i, align 4, !tbaa !5 %arrayidx39.us.us.i.1 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv115.i, i64 %indvars.iv.next.i %65 = load i32, ptr %arrayidx39.us.us.i.1, align 4, !tbaa !5 %add.us.us.i.1 = add nsw i32 %65, %64 %.add.us.us.i.1 = tail call i32 @llvm.smin.i32(i32 %63, i32 %add.us.us.i.1) store i32 %.add.us.us.i.1, ptr %arrayidx31.us.us.i.1, align 4, !tbaa !5 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %exitcond109.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %26 br i1 %exitcond109.not.i.1, label %for.cond24.for.cond.cleanup26_crit_edge.us.us.i, label %for.body27.us.us.i, !llvm.loop !44 for.cond24.for.cond.cleanup26_crit_edge.us.us.i: ; preds = %for.body27.us.us.i.prol.loopexit, %for.body27.us.us.i, %middle.block235 %indvars.iv.next111.i = add nuw nsw i64 %indvars.iv110.i, 1 %exitcond114.not.i = icmp eq i64 %indvars.iv.next111.i, %26 br i1 %exitcond114.not.i, label %for.cond19.for.cond.cleanup21_crit_edge.split.us.us.i, label %for.cond24.preheader.us.us.i, !llvm.loop !25 for.cond19.for.cond.cleanup21_crit_edge.split.us.us.i: ; preds = %for.cond24.for.cond.cleanup26_crit_edge.us.us.i %indvars.iv.next116.i = add nuw nsw i64 %indvars.iv115.i, 1 %exitcond119.not.i = icmp eq i64 %indvars.iv.next116.i, %26 br i1 %exitcond119.not.i, label %waasharuhuroido.exit, label %for.cond19.preheader.us.i, !llvm.loop !26 waasharuhuroido.exit: ; preds = %for.cond19.for.cond.cleanup21_crit_edge.split.us.us.i br i1 %cmp4171, label %for.cond96.preheader.us.preheader, label %for.cond.cleanup93 for.cond96.preheader.us.preheader: ; preds = %waasharuhuroido.exit %wide.trip.count224 = zext i32 %mul to i64 %xtraiter255 = and i64 %26, 1 %66 = icmp eq i32 %mul, 1 %unroll_iter259 = and i64 %26, 4294967294 %lcmp.mod257.not = icmp eq i64 %xtraiter255, 0 br label %for.cond96.preheader.us for.cond96.preheader.us: ; preds = %for.cond96.preheader.us.preheader, %for.cond96.for.cond.cleanup100_crit_edge.us %indvars.iv221 = phi i64 [ 0, %for.cond96.preheader.us.preheader ], [ %indvars.iv.next222, %for.cond96.for.cond.cleanup100_crit_edge.us ] %ans.0186.us = phi i32 [ 0, %for.cond96.preheader.us.preheader ], [ %ans.2.us.lcssa, %for.cond96.for.cond.cleanup100_crit_edge.us ] br i1 %66, label %for.cond96.for.cond.cleanup100_crit_edge.us.unr-lcssa, label %for.body101.us for.body101.us: ; preds = %for.cond96.preheader.us, %for.body101.us %indvars.iv216 = phi i64 [ %indvars.iv.next217.1, %for.body101.us ], [ 0, %for.cond96.preheader.us ] %ans.1182.us = phi i32 [ %ans.2.us.1, %for.body101.us ], [ %ans.0186.us, %for.cond96.preheader.us ] %niter260 = phi i64 [ %niter260.next.1, %for.body101.us ], [ 0, %for.cond96.preheader.us ] %arrayidx105.us = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv221, i64 %indvars.iv216 %67 = load i32, ptr %arrayidx105.us, align 8, !tbaa !5 %cmp106.not.us = icmp eq i32 %67, 1000000000 %ans.1..us = tail call i32 @llvm.smax.i32(i32 %ans.1182.us, i32 %67) %ans.2.us = select i1 %cmp106.not.us, i32 %ans.1182.us, i32 %ans.1..us %indvars.iv.next217 = or i64 %indvars.iv216, 1 %arrayidx105.us.1 = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv221, i64 %indvars.iv.next217 %68 = load i32, ptr %arrayidx105.us.1, align 4, !tbaa !5 %cmp106.not.us.1 = icmp eq i32 %68, 1000000000 %ans.1..us.1 = tail call i32 @llvm.smax.i32(i32 %ans.2.us, i32 %68) %ans.2.us.1 = select i1 %cmp106.not.us.1, i32 %ans.2.us, i32 %ans.1..us.1 %indvars.iv.next217.1 = add nuw nsw i64 %indvars.iv216, 2 %niter260.next.1 = add i64 %niter260, 2 %niter260.ncmp.1 = icmp eq i64 %niter260.next.1, %unroll_iter259 br i1 %niter260.ncmp.1, label %for.cond96.for.cond.cleanup100_crit_edge.us.unr-lcssa, label %for.body101.us, !llvm.loop !45 for.cond96.for.cond.cleanup100_crit_edge.us.unr-lcssa: ; preds = %for.body101.us, %for.cond96.preheader.us %ans.2.us.lcssa.ph = phi i32 [ undef, %for.cond96.preheader.us ], [ %ans.2.us.1, %for.body101.us ] %indvars.iv216.unr = phi i64 [ 0, %for.cond96.preheader.us ], [ %indvars.iv.next217.1, %for.body101.us ] %ans.1182.us.unr = phi i32 [ %ans.0186.us, %for.cond96.preheader.us ], [ %ans.2.us.1, %for.body101.us ] br i1 %lcmp.mod257.not, label %for.cond96.for.cond.cleanup100_crit_edge.us, label %for.body101.us.epil for.body101.us.epil: ; preds = %for.cond96.for.cond.cleanup100_crit_edge.us.unr-lcssa %arrayidx105.us.epil = getelementptr inbounds [410 x [410 x i32]], ptr @dddd, i64 0, i64 %indvars.iv221, i64 %indvars.iv216.unr %69 = load i32, ptr %arrayidx105.us.epil, align 4, !tbaa !5 %cmp106.not.us.epil = icmp eq i32 %69, 1000000000 %ans.1..us.epil = tail call i32 @llvm.smax.i32(i32 %ans.1182.us.unr, i32 %69) %ans.2.us.epil = select i1 %cmp106.not.us.epil, i32 %ans.1182.us.unr, i32 %ans.1..us.epil br label %for.cond96.for.cond.cleanup100_crit_edge.us for.cond96.for.cond.cleanup100_crit_edge.us: ; preds = %for.cond96.for.cond.cleanup100_crit_edge.us.unr-lcssa, %for.body101.us.epil %ans.2.us.lcssa = phi i32 [ %ans.2.us.lcssa.ph, %for.cond96.for.cond.cleanup100_crit_edge.us.unr-lcssa ], [ %ans.2.us.epil, %for.body101.us.epil ] %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1 %exitcond225.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count224 br i1 %exitcond225.not, label %for.cond.cleanup93, label %for.cond96.preheader.us, !llvm.loop !46 for.cond.cleanup93: ; preds = %for.cond96.for.cond.cleanup100_crit_edge.us, %for.cond.cleanup26, %waasharuhuroido.exit %ans.0.lcssa = phi i32 [ 0, %waasharuhuroido.exit ], [ 0, %for.cond.cleanup26 ], [ %ans.2.us.lcssa, %for.cond96.for.cond.cleanup100_crit_edge.us ] %call127 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!14} !14 = distinct !{!14, !15} !15 = distinct !{!15, !"LVerDomain"} !16 = !{!17} !17 = distinct !{!17, !15} !18 = !{!14, !19} !19 = distinct !{!19, !15} !20 = !{!19} !21 = distinct !{!21, !10, !22, !23} !22 = !{!"llvm.loop.isvectorized", i32 1} !23 = !{!"llvm.loop.unroll.runtime.disable"} !24 = distinct !{!24, !10, !22} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10, !22, !23} !28 = distinct !{!28, !10, !23, !22} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = !{!7, !7, i64 0} !32 = distinct !{!32, !10} !33 = distinct !{!33, !10} !34 = distinct !{!34, !12} !35 = !{!36} !36 = distinct !{!36, !37} !37 = distinct !{!37, !"LVerDomain"} !38 = !{!39} !39 = distinct !{!39, !37} !40 = !{!36, !41} !41 = distinct !{!41, !37} !42 = !{!41} !43 = distinct !{!43, !10, !22, !23} !44 = distinct !{!44, !10, !22} !45 = distinct !{!45, !10} !46 = distinct !{!46, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define BUF_SIZE 20 void get_int2(char *line, int size, int *a1, int *a2) { if(!fgets(line, size, stdin)) return; sscanf(line, "%d %d", a1, a2); } int get_int(char *line, int size) { if(!fgets(line, size, stdin)) return 0; int num; sscanf(line, "%d", &num); return num; } struct list { struct list *next; int dst; }; struct list *create_graph(int size) { struct list *graph = malloc(sizeof(struct list)*size); int i; for(i = 0; i < size; i++) { graph[i].next = &graph[i]; } return graph; } void insert(struct list *graph, int src, int dst) { struct list *head = &graph[src]; struct list *elem = malloc(sizeof(struct list)); elem->next = head->next; elem->dst = dst; head->next = elem; return; } #define VERTEX_MAX 100000 static int queue[VERTEX_MAX]; static int start = 0; static int end = 0; void enqueue(int idx) { queue[start++] = idx; } int dequeue() { return queue[end++]; } int is_empty(void) { return start == end; } int main(void) { char line[BUF_SIZE]; int es = get_int(line, BUF_SIZE); int vs = es; struct list *graph = create_graph(vs+1); int i, j; static int dst_count[VERTEX_MAX+1]; for(i = 0; i < es; i++) { int v1, v2; get_int2(line, BUF_SIZE, &v1, &v2); insert(graph, v1, v2); insert(graph, v2, v1); dst_count[v1]++; dst_count[v2]++; } for(i = 1; i <= es; i++) { if(dst_count[i]==1) enqueue(i); } static char res[VERTEX_MAX+1]; while(!is_empty()) { int idx = dequeue(); dst_count[idx]--; res[idx]=1; struct list *head = &graph[idx]; struct list *elem; for(elem = head->next; elem != head; elem = elem->next) { dst_count[elem->dst]--; if(res[elem->dst]) continue; if(dst_count[elem->dst]==1) { enqueue(elem->dst); res[elem->dst]=1; } } } int queries = get_int(line, BUF_SIZE); for(i = 0; i < queries; i++) { int v1, v2; get_int2(line, BUF_SIZE, &v1, &v2); int flag = res[v1]==0 && res[v2]==0; printf("%d\n", flag ? 2 : 1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280818/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280818/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.list = type { ptr, i32 } @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @queue = internal unnamed_addr global [100000 x i32] zeroinitializer, align 16 @start = internal unnamed_addr global i32 0, align 4 @end = internal unnamed_addr global i32 0, align 4 @main.dst_count = internal unnamed_addr global [100001 x i32] zeroinitializer, align 16 @main.res = internal unnamed_addr global [100001 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 void @get_int2(ptr noundef %line, i32 noundef %size, ptr noundef %a1, ptr noundef %a2) local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call ptr @fgets(ptr noundef %line, i32 noundef %size, ptr noundef %0) %tobool.not = icmp eq ptr %call, null br i1 %tobool.not, label %return, label %if.end if.end: ; preds = %entry %call1 = tail call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %line, ptr noundef nonnull @.str, ptr noundef %a1, ptr noundef %a2) #8 br label %return return: ; preds = %entry, %if.end ret void } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @get_int(ptr noundef %line, i32 noundef %size) local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call ptr @fgets(ptr noundef %line, i32 noundef %size, ptr noundef %0) %tobool.not = icmp eq ptr %call, null br i1 %tobool.not, label %return, label %if.end if.end: ; preds = %entry call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #8 %call1 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %line, ptr noundef nonnull @.str.1, ptr noundef nonnull %num) #8 %1 = load i32, ptr %num, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #8 br label %return return: ; preds = %entry, %if.end %retval.0 = phi i32 [ %1, %if.end ], [ 0, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable define dso_local ptr @create_graph(i32 noundef %size) local_unnamed_addr #3 { entry: %conv = sext i32 %size to i64 %mul = shl nsw i64 %conv, 4 %call = tail call noalias ptr @malloc(i64 noundef %mul) #9 %cmp10 = icmp sgt i32 %size, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size to i64 %xtraiter = and i64 %wide.trip.count, 3 %0 = icmp ult i32 %size, 4 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %arrayidx = getelementptr inbounds %struct.list, ptr %call, i64 %indvars.iv store ptr %arrayidx, ptr %arrayidx, align 8, !tbaa !11 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds %struct.list, ptr %call, i64 %indvars.iv.next store ptr %arrayidx.1, ptr %arrayidx.1, align 8, !tbaa !11 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds %struct.list, ptr %call, i64 %indvars.iv.next.1 store ptr %arrayidx.2, ptr %arrayidx.2, align 8, !tbaa !11 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds %struct.list, ptr %call, i64 %indvars.iv.next.2 store ptr %arrayidx.3, ptr %arrayidx.3, align 8, !tbaa !11 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !13 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %arrayidx.epil = getelementptr inbounds %struct.list, ptr %call, i64 %indvars.iv.epil store ptr %arrayidx.epil, ptr %arrayidx.epil, align 8, !tbaa !11 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !15 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry ret ptr %call } ; 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 nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @insert(ptr nocapture noundef %graph, i32 noundef %src, i32 noundef %dst) local_unnamed_addr #5 { entry: %idxprom = sext i32 %src to i64 %arrayidx = getelementptr inbounds %struct.list, ptr %graph, i64 %idxprom %call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #9 %0 = load ptr, ptr %arrayidx, align 8, !tbaa !11 store ptr %0, ptr %call, align 8, !tbaa !11 %dst2 = getelementptr inbounds %struct.list, ptr %call, i64 0, i32 1 store i32 %dst, ptr %dst2, align 8, !tbaa !17 store ptr %call, ptr %arrayidx, align 8, !tbaa !11 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @enqueue(i32 noundef %idx) local_unnamed_addr #6 { entry: %0 = load i32, ptr @start, align 4, !tbaa !9 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @start, align 4, !tbaa !9 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %idxprom store i32 %idx, ptr %arrayidx, align 4, !tbaa !9 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @dequeue() local_unnamed_addr #6 { entry: %0 = load i32, ptr @end, align 4, !tbaa !9 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @end, align 4, !tbaa !9 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 ret i32 %1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @is_empty() local_unnamed_addr #7 { entry: %0 = load i32, ptr @start, align 4, !tbaa !9 %1 = load i32, ptr @end, align 4, !tbaa !9 %cmp = icmp eq i32 %0, %1 %conv = zext i1 %cmp to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num.i111 = alloca i32, align 4 %num.i = alloca i32, align 4 %line = alloca [20 x i8], align 16 %v1 = alloca i32, align 4 %v2 = alloca i32, align 4 %v154 = alloca i32, align 4 %v255 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %line) #8 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 20, ptr noundef %0) %tobool.not.i = icmp eq ptr %call.i, null br i1 %tobool.not.i, label %get_int.exit, label %if.end.i if.end.i: ; preds = %entry call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #8 %call1.i = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str.1, ptr noundef nonnull %num.i) #8 %1 = load i32, ptr %num.i, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #8 br label %get_int.exit get_int.exit: ; preds = %entry, %if.end.i %retval.0.i = phi i32 [ %1, %if.end.i ], [ 0, %entry ] %add = add nsw i32 %retval.0.i, 1 %conv.i = sext i32 %add to i64 %mul.i = shl nsw i64 %conv.i, 4 %call.i91 = call noalias ptr @malloc(i64 noundef %mul.i) #9 %cmp10.i = icmp sgt i32 %retval.0.i, -1 br i1 %cmp10.i, label %for.body.preheader.i, label %for.cond7.preheader.thread for.body.preheader.i: ; preds = %get_int.exit %wide.trip.count.i = zext i32 %add to i64 %2 = add nsw i64 %wide.trip.count.i, -1 %xtraiter = and i64 %wide.trip.count.i, 3 %3 = icmp ult i64 %2, 3 br i1 %3, label %create_graph.exit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967292 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.3, %for.body.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.3, %for.body.i ] %arrayidx.i = getelementptr inbounds %struct.list, ptr %call.i91, i64 %indvars.iv.i store ptr %arrayidx.i, ptr %arrayidx.i, align 8, !tbaa !11 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds %struct.list, ptr %call.i91, i64 %indvars.iv.next.i store ptr %arrayidx.i.1, ptr %arrayidx.i.1, align 8, !tbaa !11 %indvars.iv.next.i.1 = or i64 %indvars.iv.i, 2 %arrayidx.i.2 = getelementptr inbounds %struct.list, ptr %call.i91, i64 %indvars.iv.next.i.1 store ptr %arrayidx.i.2, ptr %arrayidx.i.2, align 8, !tbaa !11 %indvars.iv.next.i.2 = or i64 %indvars.iv.i, 3 %arrayidx.i.3 = getelementptr inbounds %struct.list, ptr %call.i91, i64 %indvars.iv.next.i.2 store ptr %arrayidx.i.3, ptr %arrayidx.i.3, align 8, !tbaa !11 %indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 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 %create_graph.exit.unr-lcssa, label %for.body.i, !llvm.loop !13 create_graph.exit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.3, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %create_graph.exit, label %for.body.i.epil for.body.i.epil: ; preds = %create_graph.exit.unr-lcssa, %for.body.i.epil %indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %for.body.i.epil ], [ %indvars.iv.i.unr, %create_graph.exit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %create_graph.exit.unr-lcssa ] %arrayidx.i.epil = getelementptr inbounds %struct.list, ptr %call.i91, i64 %indvars.iv.i.epil store ptr %arrayidx.i.epil, ptr %arrayidx.i.epil, align 8, !tbaa !11 %indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.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 %create_graph.exit, label %for.body.i.epil, !llvm.loop !18 create_graph.exit: ; preds = %for.body.i.epil, %create_graph.exit.unr-lcssa %cmp124 = icmp sgt i32 %retval.0.i, 0 br i1 %cmp124, label %for.body, label %for.cond7.preheader.thread for.cond7.preheader.thread: ; preds = %create_graph.exit, %get_int.exit %start.promoted157 = load i32, ptr @start, align 4, !tbaa !9 br label %while.cond.preheader for.cond7.preheader: ; preds = %get_int2.exit %start.promoted = load i32, ptr @start, align 4, !tbaa !9 %cmp8.not128 = icmp slt i32 %retval.0.i, 1 br i1 %cmp8.not128, label %while.cond.preheader, label %for.body9.preheader for.body9.preheader: ; preds = %for.cond7.preheader %xtraiter161 = and i64 %2, 1 %4 = icmp eq i32 %add, 2 br i1 %4, label %while.cond.preheader.loopexit.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter165 = and i64 %2, -2 br label %for.body9 for.body: ; preds = %create_graph.exit, %get_int2.exit %i.0125 = phi i32 [ %inc6, %get_int2.exit ], [ 0, %create_graph.exit ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v1) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v2) #8 %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i92 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 20, ptr noundef %5) %tobool.not.i93 = icmp eq ptr %call.i92, null br i1 %tobool.not.i93, label %get_int2.exit, label %if.end.i94 if.end.i94: ; preds = %for.body %call1.i95 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %v1, ptr noundef nonnull %v2) #8 br label %get_int2.exit get_int2.exit: ; preds = %for.body, %if.end.i94 %6 = load i32, ptr %v1, align 4, !tbaa !9 %7 = load i32, ptr %v2, align 4, !tbaa !9 %idxprom.i = sext i32 %6 to i64 %arrayidx.i96 = getelementptr inbounds %struct.list, ptr %call.i91, i64 %idxprom.i %call.i97 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #9 %8 = load ptr, ptr %arrayidx.i96, align 8, !tbaa !11 store ptr %8, ptr %call.i97, align 8, !tbaa !11 %dst2.i = getelementptr inbounds %struct.list, ptr %call.i97, i64 0, i32 1 store i32 %7, ptr %dst2.i, align 8, !tbaa !17 store ptr %call.i97, ptr %arrayidx.i96, align 8, !tbaa !11 %idxprom.i98 = sext i32 %7 to i64 %arrayidx.i99 = getelementptr inbounds %struct.list, ptr %call.i91, i64 %idxprom.i98 %call.i100 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #9 %9 = load ptr, ptr %arrayidx.i99, align 8, !tbaa !11 store ptr %9, ptr %call.i100, align 8, !tbaa !11 %dst2.i101 = getelementptr inbounds %struct.list, ptr %call.i100, i64 0, i32 1 store i32 %6, ptr %dst2.i101, align 8, !tbaa !17 store ptr %call.i100, ptr %arrayidx.i99, align 8, !tbaa !11 %arrayidx = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %idxprom.i %10 = load i32, ptr %arrayidx, align 4, !tbaa !9 %inc = add nsw i32 %10, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !9 %arrayidx4 = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %idxprom.i98 %11 = load i32, ptr %arrayidx4, align 4, !tbaa !9 %inc5 = add nsw i32 %11, 1 store i32 %inc5, ptr %arrayidx4, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v2) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v1) #8 %inc6 = add nuw nsw i32 %i.0125, 1 %exitcond.not = icmp eq i32 %inc6, %retval.0.i br i1 %exitcond.not, label %for.cond7.preheader, label %for.body, !llvm.loop !19 while.cond.preheader.loopexit.unr-lcssa: ; preds = %for.inc13.1, %for.body9.preheader %inc.i126.lcssa.ph = phi i32 [ undef, %for.body9.preheader ], [ %inc.i126.1, %for.inc13.1 ] %indvars.iv.unr = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next.1, %for.inc13.1 ] %inc.i127129.unr = phi i32 [ %start.promoted, %for.body9.preheader ], [ %inc.i126.1, %for.inc13.1 ] %lcmp.mod163.not = icmp eq i64 %xtraiter161, 0 br i1 %lcmp.mod163.not, label %while.cond.preheader, label %for.body9.epil for.body9.epil: ; preds = %while.cond.preheader.loopexit.unr-lcssa %arrayidx11.epil = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %indvars.iv.unr %12 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !9 %cmp12.epil = icmp eq i32 %12, 1 br i1 %cmp12.epil, label %if.then.epil, label %while.cond.preheader if.then.epil: ; preds = %for.body9.epil %inc.i.epil = add nsw i32 %inc.i127129.unr, 1 store i32 %inc.i.epil, ptr @start, align 4, !tbaa !9 %idxprom.i102.epil = sext i32 %inc.i127129.unr to i64 %arrayidx.i103.epil = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %idxprom.i102.epil %13 = trunc i64 %indvars.iv.unr to i32 store i32 %13, ptr %arrayidx.i103.epil, align 4, !tbaa !9 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.loopexit.unr-lcssa, %if.then.epil, %for.body9.epil, %for.cond7.preheader.thread, %for.cond7.preheader %start.promoted138 = phi i32 [ %start.promoted, %for.cond7.preheader ], [ %start.promoted157, %for.cond7.preheader.thread ], [ %inc.i126.lcssa.ph, %while.cond.preheader.loopexit.unr-lcssa ], [ %inc.i127129.unr, %for.body9.epil ], [ %inc.i.epil, %if.then.epil ] %end.promoted = load i32, ptr @end, align 4, !tbaa !9 %cmp.i.not144 = icmp eq i32 %start.promoted138, %end.promoted br i1 %cmp.i.not144, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %while.cond.preheader %14 = sext i32 %end.promoted to i64 br label %while.body for.body9: ; preds = %for.inc13.1, %for.body9.preheader.new %indvars.iv = phi i64 [ 1, %for.body9.preheader.new ], [ %indvars.iv.next.1, %for.inc13.1 ] %inc.i127129 = phi i32 [ %start.promoted, %for.body9.preheader.new ], [ %inc.i126.1, %for.inc13.1 ] %niter166 = phi i64 [ 0, %for.body9.preheader.new ], [ %niter166.next.1, %for.inc13.1 ] %arrayidx11 = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %indvars.iv %15 = load i32, ptr %arrayidx11, align 4, !tbaa !9 %cmp12 = icmp eq i32 %15, 1 br i1 %cmp12, label %if.then, label %for.inc13 if.then: ; preds = %for.body9 %inc.i = add nsw i32 %inc.i127129, 1 store i32 %inc.i, ptr @start, align 4, !tbaa !9 %idxprom.i102 = sext i32 %inc.i127129 to i64 %arrayidx.i103 = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %idxprom.i102 %16 = trunc i64 %indvars.iv to i32 store i32 %16, ptr %arrayidx.i103, align 4, !tbaa !9 br label %for.inc13 for.inc13: ; preds = %for.body9, %if.then %inc.i126 = phi i32 [ %inc.i127129, %for.body9 ], [ %inc.i, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx11.1 = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %indvars.iv.next %17 = load i32, ptr %arrayidx11.1, align 4, !tbaa !9 %cmp12.1 = icmp eq i32 %17, 1 br i1 %cmp12.1, label %if.then.1, label %for.inc13.1 if.then.1: ; preds = %for.inc13 %inc.i.1 = add nsw i32 %inc.i126, 1 store i32 %inc.i.1, ptr @start, align 4, !tbaa !9 %idxprom.i102.1 = sext i32 %inc.i126 to i64 %arrayidx.i103.1 = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %idxprom.i102.1 %18 = trunc i64 %indvars.iv.next to i32 store i32 %18, ptr %arrayidx.i103.1, align 4, !tbaa !9 br label %for.inc13.1 for.inc13.1: ; preds = %if.then.1, %for.inc13 %inc.i126.1 = phi i32 [ %inc.i126, %for.inc13 ], [ %inc.i.1, %if.then.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter166.next.1 = add i64 %niter166, 2 %niter166.ncmp.1 = icmp eq i64 %niter166.next.1, %unroll_iter165 br i1 %niter166.ncmp.1, label %while.cond.preheader.loopexit.unr-lcssa, label %for.body9, !llvm.loop !20 while.cond.loopexit: ; preds = %for.inc46, %while.body %start.promoted131141 = phi i32 [ %start.promoted131142146, %while.body ], [ %start.promoted131139, %for.inc46 ] %19 = trunc i64 %indvars.iv.next152 to i32 %cmp.i.not = icmp eq i32 %start.promoted131141, %19 br i1 %cmp.i.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !21 while.body: ; preds = %while.body.preheader, %while.cond.loopexit %indvars.iv151 = phi i64 [ %14, %while.body.preheader ], [ %indvars.iv.next152, %while.cond.loopexit ] %start.promoted131142146 = phi i32 [ %start.promoted138, %while.body.preheader ], [ %start.promoted131141, %while.cond.loopexit ] %indvars.iv.next152 = add i64 %indvars.iv151, 1 %arrayidx.i107 = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %indvars.iv151 %20 = load i32, ptr %arrayidx.i107, align 4, !tbaa !9 %idxprom18 = sext i32 %20 to i64 %arrayidx19 = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %idxprom18 %21 = load i32, ptr %arrayidx19, align 4, !tbaa !9 %dec = add nsw i32 %21, -1 store i32 %dec, ptr %arrayidx19, align 4, !tbaa !9 %arrayidx21 = getelementptr inbounds [100001 x i8], ptr @main.res, i64 0, i64 %idxprom18 store i8 1, ptr %arrayidx21, align 1, !tbaa !22 %arrayidx23 = getelementptr inbounds %struct.list, ptr %call.i91, i64 %idxprom18 %elem.0134 = load ptr, ptr %arrayidx23, align 8, !tbaa !11 %cmp25.not135 = icmp eq ptr %elem.0134, %arrayidx23 br i1 %cmp25.not135, label %while.cond.loopexit, label %for.body26 for.body26: ; preds = %while.body, %for.inc46 %start.promoted131140 = phi i32 [ %start.promoted131139, %for.inc46 ], [ %start.promoted131142146, %while.body ] %elem.0137 = phi ptr [ %elem.0, %for.inc46 ], [ %elem.0134, %while.body ] %inc.i108133136 = phi i32 [ %inc.i108132, %for.inc46 ], [ %start.promoted131142146, %while.body ] %dst = getelementptr inbounds %struct.list, ptr %elem.0137, i64 0, i32 1 %22 = load i32, ptr %dst, align 8, !tbaa !17 %idxprom27 = sext i32 %22 to i64 %arrayidx28 = getelementptr inbounds [100001 x i32], ptr @main.dst_count, i64 0, i64 %idxprom27 %23 = load i32, ptr %arrayidx28, align 4, !tbaa !9 %dec29 = add nsw i32 %23, -1 store i32 %dec29, ptr %arrayidx28, align 4, !tbaa !9 %arrayidx32 = getelementptr inbounds [100001 x i8], ptr @main.res, i64 0, i64 %idxprom27 %24 = load i8, ptr %arrayidx32, align 1, !tbaa !22 %tobool33.not = icmp eq i8 %24, 0 %cmp39 = icmp eq i32 %dec29, 1 %or.cond = select i1 %tobool33.not, i1 %cmp39, i1 false br i1 %or.cond, label %if.then40, label %for.inc46 if.then40: ; preds = %for.body26 %inc.i108 = add nsw i32 %inc.i108133136, 1 store i32 %inc.i108, ptr @start, align 4, !tbaa !9 %idxprom.i109 = sext i32 %inc.i108133136 to i64 %arrayidx.i110 = getelementptr inbounds [100000 x i32], ptr @queue, i64 0, i64 %idxprom.i109 store i32 %22, ptr %arrayidx.i110, align 4, !tbaa !9 store i8 1, ptr %arrayidx32, align 1, !tbaa !22 br label %for.inc46 for.inc46: ; preds = %if.then40, %for.body26 %start.promoted131139 = phi i32 [ %inc.i108, %if.then40 ], [ %start.promoted131140, %for.body26 ] %inc.i108132 = phi i32 [ %inc.i108, %if.then40 ], [ %inc.i108133136, %for.body26 ] %elem.0 = load ptr, ptr %elem.0137, align 8, !tbaa !11 %cmp25.not = icmp eq ptr %elem.0, %arrayidx23 br i1 %cmp25.not, label %while.cond.loopexit, label %for.body26, !llvm.loop !23 while.cond.while.end_crit_edge: ; preds = %while.cond.loopexit store i32 %start.promoted131141, ptr @end, align 4, !tbaa !9 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %25 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i112 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 20, ptr noundef %25) %tobool.not.i113 = icmp eq ptr %call.i112, null br i1 %tobool.not.i113, label %for.end70, label %get_int.exit117 get_int.exit117: ; preds = %while.end call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i111) #8 %call1.i115 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str.1, ptr noundef nonnull %num.i111) #8 %26 = load i32, ptr %num.i111, align 4, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i111) #8 %cmp52147 = icmp sgt i32 %26, 0 br i1 %cmp52147, label %for.body53, label %for.end70 for.body53: ; preds = %get_int.exit117, %land.end.thread %i.2148 = phi i32 [ %inc69, %land.end.thread ], [ 0, %get_int.exit117 ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v154) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v255) #8 %27 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i118 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 20, ptr noundef %27) %tobool.not.i119 = icmp eq ptr %call.i118, null br i1 %tobool.not.i119, label %get_int2.exit122, label %if.end.i120 if.end.i120: ; preds = %for.body53 %call1.i121 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %v154, ptr noundef nonnull %v255) #8 br label %get_int2.exit122 get_int2.exit122: ; preds = %for.body53, %if.end.i120 %28 = load i32, ptr %v154, align 4, !tbaa !9 %idxprom57 = sext i32 %28 to i64 %arrayidx58 = getelementptr inbounds [100001 x i8], ptr @main.res, i64 0, i64 %idxprom57 %29 = load i8, ptr %arrayidx58, align 1, !tbaa !22 %cmp59 = icmp eq i8 %29, 0 br i1 %cmp59, label %land.end, label %land.end.thread land.end: ; preds = %get_int2.exit122 %30 = load i32, ptr %v255, align 4, !tbaa !9 %idxprom61 = sext i32 %30 to i64 %arrayidx62 = getelementptr inbounds [100001 x i8], ptr @main.res, i64 0, i64 %idxprom61 %31 = load i8, ptr %arrayidx62, align 1, !tbaa !22 %.fr = freeze i8 %31 %cmp64 = icmp eq i8 %.fr, 0 %spec.select = select i1 %cmp64, i32 2, i32 1 br label %land.end.thread land.end.thread: ; preds = %land.end, %get_int2.exit122 %32 = phi i32 [ 1, %get_int2.exit122 ], [ %spec.select, %land.end ] %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v255) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v154) #8 %inc69 = add nuw nsw i32 %i.2148, 1 %exitcond154.not = icmp eq i32 %inc69, %26 br i1 %exitcond154.not, label %for.end70, label %for.body53, !llvm.loop !24 for.end70: ; preds = %land.end.thread, %while.end, %get_int.exit117 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %line) #8 ret i32 0 } ; 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" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind } attributes #9 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!12, !6, i64 0} !12 = !{!"list", !6, i64 0, !10, i64 8} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = !{!12, !10, i64 8} !18 = distinct !{!18, !16} !19 = distinct !{!19, !14} !20 = distinct !{!20, !14} !21 = distinct !{!21, !14} !22 = !{!7, !7, i64 0} !23 = distinct !{!23, !14} !24 = distinct !{!24, !14}
#include<stdio.h> #include<math.h> #include<stdlib.h> #include<string.h> #define max(x,y)(x>y?x:y) #define min(x,y)(x>y?y:x) typedef long long int ll; typedef unsigned long long int ull; ll gcd(ll x,ll y){if(!y)return x;return gcd(y,x%y);} ll lcm(ll x,ll y){return x/gcd(x,y)*y;} void swap(ll *x,ll *y){ll tmp=*x;*x=*y;*y=tmp;} int asc_cmp(const void* X,const void* Y){ll x=*(int*)X,y=*(int*)Y;if(x<y)return -1;else if(x==y)return 0;else return 1;} int desc_cmp(const void* X,const void* Y){ll x=*(int*)X,y=*(int*)Y;if(x<y)return 1;else if(x==y)return 0;else return -1;} int main(){ ll a,b,c,d;scanf("%lld %lld %lld %lld",&a,&b,&c,&d); ll GCD=c*d/gcd(max(c,d),min(c,d)); ll a_c=a/c; ll a_d=a/d; ll a_cd=a/GCD; ll a_cnt=a_c+a_d-a_cd; //printf("%lld\n",a-a_cnt); ll b_c=b/c; ll b_d=b/d; ll b_cd=b/GCD; ll b_cnt=b_c+b_d-b_cd; //printf("%lld %lld\n",b-b_cnt,gcd(d,c)); ll ans=-(a-a_cnt)+(b-b_cnt); if(a%c!=0&&a%d!=0)ans++; printf("%lld\n",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280861/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280861/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [20 x i8] c"%lld %lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %tobool.not4 = icmp eq i64 %y, 0 br i1 %tobool.not4, label %return, label %if.end if.end: ; preds = %entry, %if.end %y.tr6 = phi i64 [ %rem, %if.end ], [ %y, %entry ] %x.tr5 = phi i64 [ %y.tr6, %if.end ], [ %x, %entry ] %rem = srem i64 %x.tr5, %y.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %return, label %if.end return: ; preds = %if.end, %entry %x.tr.lcssa = phi i64 [ %x, %entry ], [ %y.tr6, %if.end ] ret i64 %x.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %tobool.not4.i = icmp eq i64 %y, 0 br i1 %tobool.not4.i, label %gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %y.tr6.i = phi i64 [ %rem.i, %if.end.i ], [ %y, %entry ] %x.tr5.i = phi i64 [ %y.tr6.i, %if.end.i ], [ %x, %entry ] %rem.i = srem i64 %x.tr5.i, %y.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.end.i, %entry %x.tr.lcssa.i = phi i64 [ %x, %entry ], [ %y.tr6.i, %if.end.i ] %div = sdiv i64 %x, %x.tr.lcssa.i %mul = mul nsw i64 %div, %y ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #1 { entry: %0 = load i64, ptr %x, align 8, !tbaa !5 %1 = load i64, ptr %y, align 8, !tbaa !5 store i64 %1, ptr %x, align 8, !tbaa !5 store i64 %0, ptr %y, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @asc_cmp(ptr nocapture noundef readonly %X, ptr nocapture noundef readonly %Y) local_unnamed_addr #3 { entry: %0 = load i32, ptr %X, align 4, !tbaa !9 %1 = load i32, ptr %Y, align 4, !tbaa !9 %cmp = icmp slt i32 %0, %1 %cmp3 = icmp ne i32 %0, %1 %. = zext i1 %cmp3 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @desc_cmp(ptr nocapture noundef readonly %X, ptr nocapture noundef readonly %Y) local_unnamed_addr #3 { entry: %0 = load i32, ptr %X, align 4, !tbaa !9 %1 = load i32, ptr %Y, align 4, !tbaa !9 %cmp = icmp slt i32 %0, %1 %cmp3 = icmp ne i32 %0, %1 %. = sext i1 %cmp3 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 #4 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 %d = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i64, ptr %c, align 8 %1 = load i64, ptr %d, align 8 %mul = mul nsw i64 %1, %0 %cond = call i64 @llvm.smax.i64(i64 %0, i64 %1) %cond5 = call i64 @llvm.smin.i64(i64 %0, i64 %1) %tobool.not4.i = icmp eq i64 %cond5, 0 br i1 %tobool.not4.i, label %gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %y.tr6.i = phi i64 [ %rem.i, %if.end.i ], [ %cond5, %entry ] %x.tr5.i = phi i64 [ %y.tr6.i, %if.end.i ], [ %cond, %entry ] %rem.i = srem i64 %x.tr5.i, %y.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.end.i, %entry %x.tr.lcssa.i = phi i64 [ %cond, %entry ], [ %y.tr6.i, %if.end.i ] %div = sdiv i64 %mul, %x.tr.lcssa.i %2 = load i64, ptr %a, align 8, !tbaa !5 %div7 = sdiv i64 %2, %0 %div8 = sdiv i64 %2, %1 %rem20 = srem i64 %2, %1 %div9 = sdiv i64 %2, %div %3 = load i64, ptr %b, align 8, !tbaa !5 %div10 = sdiv i64 %3, %0 %div11 = sdiv i64 %3, %1 %div12 = sdiv i64 %3, %div %4 = add i64 %div7, %div8 %5 = add i64 %2, %div9 %6 = add i64 %4, %3 %7 = add i64 %5, %div10 %8 = add i64 %7, %div11 %sub15.neg = sub i64 %6, %8 %add18 = add i64 %sub15.neg, %div12 %rem = srem i64 %2, %0 %cmp19.not = icmp eq i64 %rem, 0 %cmp21.not = icmp ne i64 %rem20, 0 %inc = zext i1 %cmp21.not to i64 %spec.select = add nsw i64 %add18, %inc %ans.0 = select i1 %cmp19.not, i64 %add18, i64 %spec.select %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #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 i64 @llvm.smax.i64(i64, i64) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #6 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0}
#include <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部変数 static FILE *szpFpI; // 入力 static long long slA, slB; // A,B static int siC, siD; // C,D static long long slLcm; // C,Dの最小公倍数 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpA; static int siTNo; #endif // 出力 int fOut( char *pcpLine // <I> 1行 ) { char lc1Buf[1024]; #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, pcpLine)) { siRes = -1; } #else printf("%s", pcpLine); #endif return 0; } // 最大公約数 - 取得 int fGetGcd( int piVal1 // <I> 値1 , int piVal2 // <I> 値2 ) { int liWork; // ユークリッドの互除法 if (piVal1 < piVal2) { liWork = piVal1; piVal1 = piVal2; piVal2 = liWork; } while (piVal2 > 0) { liWork = piVal1 % piVal2; piVal1 = piVal2; piVal2 = liWork; } return piVal1; } // 最小公倍数 - 取得 long long fGetLcm( int piVal1 // <I> 値1 , int piVal2 // <I> 値2 ) { // 最大公約数 - 取得 int liGcd = fGetGcd(piVal1, piVal2); // 約数 int liVal1 = piVal1 / liGcd; int liVal2 = piVal2 / liGcd; return (long long)liVal1 * (long long)liVal2 * (long long)liGcd; } // 個数 - 取得 long long fGetCnt( long long plVal // <I> 対象値 ) { long long llCnt = plVal; llCnt -= plVal / (long long)siC; llCnt -= plVal / (long long)siD; llCnt += plVal / slLcm; return llCnt; } // 実行メイン long long fMain( ) { char lc1Buf[1024]; // A,B,C,D - 取得 fgets(lc1Buf, sizeof(lc1Buf), szpFpI); sscanf(lc1Buf, "%lld%lld%d%d", &slA, &slB, &siC, &siD); // C,Dの最小公倍数 - 取得 slLcm = fGetLcm(siC, siD); // 個数 - 取得 long long llCnt = fGetCnt(slB); llCnt -= fGetCnt(slA - 1); return llCnt; } // 1回実行 int fOne( ) { long long llRet; 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 // 実行メイン llRet = fMain(); // 出力 sprintf(lc1Buf, "%lld\n", llRet); fOut(lc1Buf); // 残データ有無 #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_280904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @siC = internal global i32 0, align 4 @siD = internal global i32 0, align 4 @slLcm = internal unnamed_addr global i64 0, align 8 @szpFpI = internal unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [13 x i8] c"%lld%lld%d%d\00", align 1 @slA = internal global i64 0, align 8 @slB = internal global i64 0, align 8 @stdin = external local_unnamed_addr global ptr, align 8 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @fOut(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: nofree nosync nounwind memory(none) uwtable define dso_local i32 @fGetGcd(i32 noundef %piVal1, i32 noundef %piVal2) local_unnamed_addr #3 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %piVal1, i32 %piVal2) %spec.select10 = tail call i32 @llvm.smin.i32(i32 %piVal1, i32 %piVal2) %cmp111 = icmp sgt i32 %spec.select10, 0 br i1 %cmp111, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %piVal2.addr.113 = phi i32 [ %rem, %while.body ], [ %spec.select10, %entry ] %piVal1.addr.112 = phi i32 [ %piVal2.addr.113, %while.body ], [ %spec.select, %entry ] %rem = srem i32 %piVal1.addr.112, %piVal2.addr.113 %cmp1 = icmp sgt i32 %rem, 0 br i1 %cmp1, label %while.body, label %while.end, !llvm.loop !5 while.end: ; preds = %while.body, %entry %piVal1.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %piVal2.addr.113, %while.body ] ret i32 %piVal1.addr.1.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @fGetLcm(i32 noundef %piVal1, i32 noundef %piVal2) local_unnamed_addr #3 { entry: %spec.select.i = tail call i32 @llvm.smax.i32(i32 %piVal1, i32 %piVal2) %spec.select10.i = tail call i32 @llvm.smin.i32(i32 %piVal1, i32 %piVal2) %cmp111.i = icmp sgt i32 %spec.select10.i, 0 br i1 %cmp111.i, label %while.body.i, label %fGetGcd.exit while.body.i: ; preds = %entry, %while.body.i %piVal2.addr.113.i = phi i32 [ %rem.i, %while.body.i ], [ %spec.select10.i, %entry ] %piVal1.addr.112.i = phi i32 [ %piVal2.addr.113.i, %while.body.i ], [ %spec.select.i, %entry ] %rem.i = srem i32 %piVal1.addr.112.i, %piVal2.addr.113.i %cmp1.i = icmp sgt i32 %rem.i, 0 br i1 %cmp1.i, label %while.body.i, label %fGetGcd.exit, !llvm.loop !5 fGetGcd.exit: ; preds = %while.body.i, %entry %piVal1.addr.1.lcssa.i = phi i32 [ %spec.select.i, %entry ], [ %piVal2.addr.113.i, %while.body.i ] %div = sdiv i32 %piVal1, %piVal1.addr.1.lcssa.i %div1 = sdiv i32 %piVal2, %piVal1.addr.1.lcssa.i %conv = sext i32 %div to i64 %conv2 = sext i32 %div1 to i64 %conv3 = sext i32 %piVal1.addr.1.lcssa.i to i64 %mul = mul nsw i64 %conv, %conv3 %mul4 = mul i64 %mul, %conv2 ret i64 %mul4 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @fGetCnt(i64 noundef %plVal) local_unnamed_addr #4 { entry: %0 = load i32, ptr @siC, align 4, !tbaa !7 %conv = sext i32 %0 to i64 %div = sdiv i64 %plVal, %conv %1 = load i32, ptr @siD, align 4, !tbaa !7 %conv1 = sext i32 %1 to i64 %div2 = sdiv i64 %plVal, %conv1 %2 = load i64, ptr @slLcm, align 8, !tbaa !11 %div4 = sdiv i64 %plVal, %2 %3 = add i64 %div, %div2 %sub3 = sub i64 %plVal, %3 %add = add nsw i64 %sub3, %div4 ret i64 %add } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @fMain() local_unnamed_addr #0 { entry: %lc1Buf = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #6 %0 = load ptr, ptr @szpFpI, align 8, !tbaa !13 %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 @slA, ptr noundef nonnull @slB, ptr noundef nonnull @siC, ptr noundef nonnull @siD) #6 %1 = load i32, ptr @siC, align 4, !tbaa !7 %2 = load i32, ptr @siD, align 4, !tbaa !7 %spec.select.i.i = call i32 @llvm.smax.i32(i32 %1, i32 %2) %spec.select10.i.i = call i32 @llvm.smin.i32(i32 %1, i32 %2) %cmp111.i.i = icmp sgt i32 %spec.select10.i.i, 0 br i1 %cmp111.i.i, label %while.body.i.i, label %fGetLcm.exit while.body.i.i: ; preds = %entry, %while.body.i.i %piVal2.addr.113.i.i = phi i32 [ %rem.i.i, %while.body.i.i ], [ %spec.select10.i.i, %entry ] %piVal1.addr.112.i.i = phi i32 [ %piVal2.addr.113.i.i, %while.body.i.i ], [ %spec.select.i.i, %entry ] %rem.i.i = srem i32 %piVal1.addr.112.i.i, %piVal2.addr.113.i.i %cmp1.i.i = icmp sgt i32 %rem.i.i, 0 br i1 %cmp1.i.i, label %while.body.i.i, label %fGetLcm.exit, !llvm.loop !5 fGetLcm.exit: ; preds = %while.body.i.i, %entry %piVal1.addr.1.lcssa.i.i = phi i32 [ %spec.select.i.i, %entry ], [ %piVal2.addr.113.i.i, %while.body.i.i ] %div.i = sdiv i32 %1, %piVal1.addr.1.lcssa.i.i %div1.i = sdiv i32 %2, %piVal1.addr.1.lcssa.i.i %conv.i = sext i32 %div.i to i64 %conv2.i = sext i32 %div1.i to i64 %conv3.i = sext i32 %piVal1.addr.1.lcssa.i.i to i64 %mul.i = mul nsw i64 %conv.i, %conv3.i %mul4.i = mul i64 %mul.i, %conv2.i store i64 %mul4.i, ptr @slLcm, align 8, !tbaa !11 %3 = load i64, ptr @slB, align 8, !tbaa !11 %conv.i8 = sext i32 %1 to i64 %div.i9 = sdiv i64 %3, %conv.i8 %conv1.i = sext i32 %2 to i64 %div2.i = sdiv i64 %3, %conv1.i %div4.i = sdiv i64 %3, %mul4.i %4 = load i64, ptr @slA, align 8, !tbaa !11 %sub = add nsw i64 %4, -1 %div.i11 = sdiv i64 %sub, %conv.i8 %div2.i13 = sdiv i64 %sub, %conv1.i %div4.i14 = sdiv i64 %sub, %mul4.i %5 = add i64 %div.i9, %div2.i %sub3.i15.neg = sub i64 %3, %5 %add.i16.neg = add i64 %sub3.i15.neg, %div4.i %.neg17 = add i64 %add.i16.neg, %div.i11 %reass.sub = sub i64 %.neg17, %4 %.neg = add i64 %reass.sub, 1 %6 = add i64 %.neg, %div2.i13 %sub6 = sub i64 %6, %div4.i14 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #6 ret i64 %sub6 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @fOne() local_unnamed_addr #0 { entry: %lc1Buf = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #6 %0 = load ptr, ptr @stdin, align 8, !tbaa !13 store ptr %0, ptr @szpFpI, align 8, !tbaa !13 %call = tail call i64 @fMain() %call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call) #6 %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) #6 ret i32 0 } ; 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 uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %lc1Buf.i = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf.i) #6 %0 = load ptr, ptr @stdin, align 8, !tbaa !13 store ptr %0, ptr @szpFpI, align 8, !tbaa !13 %call.i = tail call i64 @fMain() %call1.i = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf.i, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call.i) #6 %call.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf.i) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf.i) #6 ret i32 0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !9, i64 0} !13 = !{!14, !14, i64 0} !14 = !{!"any pointer", !9, i64 0}
#include<stdio.h> #include<math.h> long long int get_val(long long int,long long int); int main() { long long int a,b,c,d,e,tmp,res; scanf("%lld %lld %lld %lld",&a,&b,&c,&d); e = get_val(c,d); //printf("%lld\n",e); //res = b - (a - 1) - int($b / $c) + int(($a - 1) / $c) - int($b / $d) + int(($a - 1) / $d) + (int($b / $e) - int(($a - 1) / $e)); res = b - (a - 1); tmp = b/c; res = res - tmp; tmp = (a - 1) / c; res = res + tmp; tmp = b/d; res = res - tmp; tmp = (a - 1) / d; res = res + tmp; tmp = b/e; res = res + tmp; tmp = (a - 1) / e; res = res - tmp; printf("%lld\n",res); return 0; } long long int get_val(long long int a,long long int b) { long long int r, x, tmp,tmp2; x = a * b; /* 自然数 a > b を確認・入替 */ if(a<b) { tmp = a; a = b; b = tmp; } /* ユークリッドの互除法 */ r = a % b; while(r != 0) { a = b; b = r; r = a % b; } tmp = x/b; return tmp; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280948/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280948/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [20 x i8] c"%lld %lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 %d = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i64, ptr %c, align 8, !tbaa !5 %1 = load i64, ptr %d, align 8, !tbaa !5 %spec.select.i = call i64 @llvm.smin.i64(i64 %0, i64 %1) %spec.select15.i = call i64 @llvm.smax.i64(i64 %0, i64 %1) %rem.i = srem i64 %spec.select15.i, %spec.select.i %cmp1.not16.i = icmp eq i64 %rem.i, 0 br i1 %cmp1.not16.i, label %get_val.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %b.addr.118.i = phi i64 [ %r.017.i, %while.body.i ], [ %spec.select.i, %entry ] %r.017.i = phi i64 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ] %rem2.i = srem i64 %b.addr.118.i, %r.017.i %cmp1.not.i = icmp eq i64 %rem2.i, 0 br i1 %cmp1.not.i, label %get_val.exit, label %while.body.i, !llvm.loop !9 get_val.exit: ; preds = %while.body.i, %entry %b.addr.1.lcssa.i = phi i64 [ %spec.select.i, %entry ], [ %r.017.i, %while.body.i ] %mul.i = mul nsw i64 %1, %0 %div.i = sdiv i64 %mul.i, %b.addr.1.lcssa.i %2 = load i64, ptr %b, align 8, !tbaa !5 %3 = load i64, ptr %a, align 8, !tbaa !5 %sub = add nsw i64 %3, -1 %div = sdiv i64 %2, %0 %div5 = sdiv i64 %sub, %0 %div6 = sdiv i64 %2, %1 %div9 = sdiv i64 %sub, %1 %div11 = sdiv i64 %2, %div.i %div14 = sdiv i64 %sub, %div.i %4 = add i64 %div, %3 %reass.sub = sub i64 %2, %4 %.neg29 = add i64 %reass.sub, 1 %5 = add i64 %.neg29, %div5 %sub7 = sub i64 %5, %div6 %add10 = add nsw i64 %sub7, %div9 %add12 = add nsw i64 %add10, %div11 %sub15 = sub i64 %add12, %div14 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub15) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @get_val(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %spec.select = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) %spec.select15 = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) %rem = srem i64 %spec.select15, %spec.select %cmp1.not16 = icmp eq i64 %rem, 0 br i1 %cmp1.not16, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %b.addr.118 = phi i64 [ %r.017, %while.body ], [ %spec.select, %entry ] %r.017 = phi i64 [ %rem2, %while.body ], [ %rem, %entry ] %rem2 = srem i64 %b.addr.118, %r.017 %cmp1.not = icmp eq i64 %rem2, 0 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %b.addr.1.lcssa = phi i64 [ %spec.select, %entry ], [ %r.017, %while.body ] %mul = mul nsw i64 %b, %a %div = sdiv i64 %mul, %b.addr.1.lcssa ret i64 %div } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = { 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { long a, b; long c, d; scanf("%ld%ld%ld%ld", &a, &b, &c, &d); long x = c; long y = d; long base; if (x > y) { base = x; x = y; y = base; } long r = y % x; while (r != 0) { y = x; x = r; r = y % x; } long LCM = c * d / x; a--; long a_num, b_num; a_num = a / c + a / d - a / LCM; b_num = b / c + b / d - b / LCM; long ans = b - a - b_num + a_num; printf("%ld", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_280991/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_280991/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%ld%ld%ld%ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 %d = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i64, ptr %c, align 8, !tbaa !5 %1 = load i64, ptr %d, align 8, !tbaa !5 %spec.select = call i64 @llvm.smax.i64(i64 %0, i64 %1) %spec.select27 = call i64 @llvm.smin.i64(i64 %0, i64 %1) %rem = srem i64 %spec.select, %spec.select27 %cmp1.not28 = icmp eq i64 %rem, 0 br i1 %cmp1.not28, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %x.130 = phi i64 [ %r.029, %while.body ], [ %spec.select27, %entry ] %r.029 = phi i64 [ %rem2, %while.body ], [ %rem, %entry ] %rem2 = srem i64 %x.130, %r.029 %cmp1.not = icmp eq i64 %rem2, 0 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %x.1.lcssa = phi i64 [ %spec.select27, %entry ], [ %r.029, %while.body ] %mul = mul nsw i64 %1, %0 %div = sdiv i64 %mul, %x.1.lcssa %2 = load i64, ptr %a, align 8, !tbaa !5 %dec = add nsw i64 %2, -1 store i64 %dec, ptr %a, align 8, !tbaa !5 %div3 = sdiv i64 %dec, %0 %div4 = sdiv i64 %dec, %1 %div5 = sdiv i64 %dec, %div %3 = load i64, ptr %b, align 8, !tbaa !5 %div6 = sdiv i64 %3, %0 %div7 = sdiv i64 %3, %1 %div9 = sdiv i64 %3, %div %reass.sub = sub i64 %div3, %2 %add8.neg = add i64 %reass.sub, 1 %sub10.neg = add i64 %add8.neg, %div4 %4 = add i64 %sub10.neg, %3 %5 = add i64 %div5, %div6 %6 = add i64 %5, %div7 %sub = sub i64 %4, %6 %add13 = add i64 %sub, %div9 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add13) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> bool g[8][8]; int dfs(int v, int N, bool visited[N]){ bool all = true; for(int i = 0; i < N; i++){ if(visited[i] == false){ all = false; } } if(all){ return 1; } int r = 0; for(int i = 0; i < N; i++){ if(g[v][i] == false){ continue; } if(visited[i]){ continue; } visited[i] = true; r += dfs(i, N, visited); visited[i] = false; } return r; } int main(void){ int N, M; scanf("%d%d", &N, &M); int a[M], b[M]; for(int i = 0; i < M; i++){ scanf("%d%d", &a[i], &b[i]); g[a[i]-1][b[i]-1] = true; g[b[i]-1][a[i]-1] = true; } bool visited[N]; visited[0] = true; for(int i = 1; i < N; i++){ visited[i] = false; } printf("%d\n", dfs(0, N,visited)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281040/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281040/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @g = dso_local local_unnamed_addr global [8 x [8 x i8]] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %v, i32 noundef %N, ptr nocapture noundef %visited) local_unnamed_addr #0 { entry: %cmp50 = icmp slt i32 %N, 1 br i1 %cmp50, label %cleanup, label %iter.check iter.check: ; preds = %entry %wide.trip.count = zext i32 %N to i64 %min.iters.check = icmp ult i32 %N, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check63 = icmp ult i32 %N, 32 br i1 %min.iters.check63, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <16 x i8> [ <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, %vector.ph ], [ %4, %vector.body ] %vec.phi64 = phi <16 x i8> [ <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, %vector.ph ], [ %5, %vector.body ] %0 = getelementptr inbounds i8, ptr %visited, i64 %index %wide.load = load <16 x i8>, ptr %0, align 1, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 16 %wide.load65 = load <16 x i8>, ptr %1, align 1, !tbaa !5 %2 = icmp eq <16 x i8> %wide.load, zeroinitializer %3 = icmp eq <16 x i8> %wide.load65, zeroinitializer %4 = select <16 x i1> %2, <16 x i8> zeroinitializer, <16 x i8> %vec.phi %5 = select <16 x i1> %3, <16 x i8> zeroinitializer, <16 x i8> %vec.phi64 %index.next = add nuw i64 %index, 32 %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 %rdx.select.cmp.not = icmp ne <16 x i8> %4, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1> %rdx.select.cmp6678 = icmp ne <16 x i8> %5, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1> %rdx.select.cmp66 = select <16 x i1> %rdx.select.cmp.not, <16 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <16 x i1> %rdx.select.cmp6678 %7 = bitcast <16 x i1> %rdx.select.cmp66 to i16 %.not = icmp eq i16 %7, 0 %rdx.select67 = zext i1 %.not to i8 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %bc.merge.rdx = phi i8 [ 1, %vector.main.loop.iter.check ], [ %rdx.select67, %vec.epilog.iter.check ] %vec.epilog.resume.val = phi i64 [ 0, %vector.main.loop.iter.check ], [ %n.vec, %vec.epilog.iter.check ] %n.vec69 = and i64 %wide.trip.count, 4294967288 %minmax.ident.splatinsert = insertelement <8 x i8> poison, i8 %bc.merge.rdx, i64 0 %minmax.ident.splat = shufflevector <8 x i8> %minmax.ident.splatinsert, <8 x i8> poison, <8 x i32> zeroinitializer br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index71 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next74, %vec.epilog.vector.body ] %vec.phi72 = phi <8 x i8> [ %minmax.ident.splat, %vec.epilog.ph ], [ %10, %vec.epilog.vector.body ] %8 = getelementptr inbounds i8, ptr %visited, i64 %index71 %wide.load73 = load <8 x i8>, ptr %8, align 1, !tbaa !5 %9 = icmp eq <8 x i8> %wide.load73, zeroinitializer %10 = select <8 x i1> %9, <8 x i8> zeroinitializer, <8 x i8> %vec.phi72 %index.next74 = add nuw i64 %index71, 8 %11 = icmp eq i64 %index.next74, %n.vec69 br i1 %11, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %.scalar = bitcast <8 x i8> %10 to i64 %.not79 = icmp eq i64 %.scalar, 72340172838076673 %rdx.select76 = zext i1 %.not79 to i8 %cmp.n70 = icmp eq i64 %n.vec69, %wide.trip.count br i1 %cmp.n70, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec69, %vec.epilog.middle.block ] %all.051.ph = phi i8 [ 1, %iter.check ], [ %rdx.select67, %vec.epilog.iter.check ], [ %rdx.select76, %vec.epilog.middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %vec.epilog.middle.block, %middle.block %spec.select.lcssa = phi i8 [ %rdx.select67, %middle.block ], [ %rdx.select76, %vec.epilog.middle.block ], [ %spec.select, %for.body ] %12 = and i8 %spec.select.lcssa, 1 %13 = icmp ne i8 %12, 0 %brmerge = or i1 %13, %cmp50 %.mux = zext i8 %12 to i32 br i1 %brmerge, label %cleanup, label %for.body11.lr.ph for.body11.lr.ph: ; preds = %for.cond.cleanup %idxprom12 = sext i32 %v to i64 %wide.trip.count60 = zext i32 %N to i64 br label %for.body11 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %all.051 = phi i8 [ %spec.select, %for.body ], [ %all.051.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds i8, ptr %visited, i64 %indvars.iv %14 = load i8, ptr %arrayidx, align 1, !tbaa !5, !range !14, !noundef !15 %cmp1 = icmp eq i8 %14, 0 %spec.select = select i1 %cmp1, i8 0, i8 %all.051 %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 !16 for.body11: ; preds = %for.body11.lr.ph, %for.inc31 %indvars.iv57 = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next58, %for.inc31 ] %r.054 = phi i32 [ 0, %for.body11.lr.ph ], [ %r.1, %for.inc31 ] %arrayidx15 = getelementptr inbounds [8 x [8 x i8]], ptr @g, i64 0, i64 %idxprom12, i64 %indvars.iv57 %15 = load i8, ptr %arrayidx15, align 1, !tbaa !5, !range !14, !noundef !15 %cmp18 = icmp eq i8 %15, 0 br i1 %cmp18, label %for.inc31, label %if.end21 if.end21: ; preds = %for.body11 %arrayidx23 = getelementptr inbounds i8, ptr %visited, i64 %indvars.iv57 %16 = load i8, ptr %arrayidx23, align 1, !tbaa !5, !range !14, !noundef !15 %tobool24.not = icmp eq i8 %16, 0 br i1 %tobool24.not, label %if.end26, label %for.inc31 if.end26: ; preds = %if.end21 store i8 1, ptr %arrayidx23, align 1, !tbaa !5 %17 = trunc i64 %indvars.iv57 to i32 %call = tail call i32 @dfs(i32 noundef %17, i32 noundef %N, ptr noundef nonnull %visited) %add = add nsw i32 %call, %r.054 store i8 0, ptr %arrayidx23, align 1, !tbaa !5 br label %for.inc31 for.inc31: ; preds = %if.end21, %for.body11, %if.end26 %r.1 = phi i32 [ %r.054, %for.body11 ], [ %r.054, %if.end21 ], [ %add, %if.end26 ] %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60 br i1 %exitcond61.not, label %cleanup, label %for.body11, !llvm.loop !17 cleanup: ; preds = %for.inc31, %for.cond.cleanup, %entry %retval.0 = phi i32 [ %.mux, %for.cond.cleanup ], [ 1, %entry ], [ %r.1, %for.inc31 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #6 %call = 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 !18 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %M, align 4, !tbaa !18 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp47 = icmp sgt i32 %3, 0 br i1 %cmp47, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %5 = load i32, ptr %N, align 4, !tbaa !18 %6 = zext i32 %5 to i64 %vla24 = alloca i8, i64 %6, align 16 store i8 1, ptr %vla24, align 16, !tbaa !5 %cmp2849 = icmp sgt i32 %5, 1 br i1 %cmp2849, label %for.body30.preheader, label %for.cond.cleanup29 for.body30.preheader: ; preds = %for.cond.cleanup %scevgep = getelementptr i8, ptr %vla24, i64 1 %7 = add nsw i32 %5, -1 %8 = zext i32 %7 to i64 call void @llvm.memset.p0.i64(ptr align 1 %scevgep, i8 0, i64 %8, i1 false), !tbaa !5 br label %for.cond.cleanup29 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 %arrayidx3 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3) %9 = load i32, ptr %arrayidx, align 4, !tbaa !18 %sub = add nsw i32 %9, -1 %idxprom7 = sext i32 %sub to i64 %10 = load i32, ptr %arrayidx3, align 4, !tbaa !18 %sub11 = add nsw i32 %10, -1 %idxprom12 = sext i32 %sub11 to i64 %arrayidx13 = getelementptr inbounds [8 x [8 x i8]], ptr @g, i64 0, i64 %idxprom7, i64 %idxprom12 store i8 1, ptr %arrayidx13, align 1, !tbaa !5 %arrayidx23 = getelementptr inbounds [8 x [8 x i8]], ptr @g, i64 0, i64 %idxprom12, i64 %idxprom7 store i8 1, ptr %arrayidx23, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = load i32, ptr %M, align 4, !tbaa !18 %12 = sext i32 %11 to i64 %cmp = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !20 for.cond.cleanup29: ; preds = %for.body30.preheader, %for.cond.cleanup %call36 = call i32 @dfs(i32 noundef 0, i32 noundef %5, ptr noundef nonnull %vla24) %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call36) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 ; Function Attrs: 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(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } 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 = !{!"_Bool", !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 = !{i8 0, i8 2} !15 = !{} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = !{!19, !19, i64 0} !19 = !{!"int", !7, i64 0} !20 = distinct !{!20, !10}
#include<stdio.h> int main(){ int n,m,i,ab[30][2],ans=0,ttyk[10][10]={0},j; scanf("%d%d",&n,&m); for(i=0;i<m;i++){ scanf("%d%d",&ab[i][0],&ab[i][1]); ttyk[ab[i][0]][ab[i][1]]=1; ttyk[ab[i][1]][ab[i][0]]=1; } int dfs[100000][10]={0},st=0,fn=1; dfs[0][0]=1; dfs[0][1]=1; while(fn>st){ int f=0; for(j=1;j<=n;j++){ if(ttyk[dfs[st][0]][j]==1&&dfs[st][j]!=1){ dfs[fn][0]=j; for(i=1;i<=n;i++)dfs[fn][i]=dfs[st][i]; dfs[fn][j]=1; fn++; f=1; } } if(f==0){ for(j=1;j<=n;j++){ if(dfs[st][j]==0)break; } if(j==n+1)ans++; } st++; } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281084/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281084/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %ab = alloca [30 x [2 x i32]], align 16 %ttyk = alloca [10 x [10 x i32]], align 16 %dfs = alloca [100000 x [10 x i32]], align 16 %dfs223 = ptrtoint ptr %dfs to i64 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %ab) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %ttyk) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %ttyk, i8 0, i64 400, i1 false) %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 %cmp124 = icmp sgt i32 %0, 0 br i1 %cmp124, 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 [30 x [2 x i32]], ptr %ab, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [30 x [2 x i32]], ptr %ab, i64 0, i64 %indvars.iv, i64 1 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4) %1 = load i32, ptr %arrayidx, align 8, !tbaa !5 %idxprom9 = sext i32 %1 to i64 %2 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %idxprom14 = sext i32 %2 to i64 %arrayidx15 = getelementptr inbounds [10 x [10 x i32]], ptr %ttyk, i64 0, i64 %idxprom9, i64 %idxprom14 store i32 1, ptr %arrayidx15, align 4, !tbaa !5 %arrayidx25 = getelementptr inbounds [10 x [10 x i32]], ptr %ttyk, i64 0, i64 %idxprom14, i64 %idxprom9 store i32 1, ptr %arrayidx25, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %m, 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 !9 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %dfs) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000000) %dfs, i8 0, i64 4000000, i1 false) store i32 1, ptr %dfs, align 16, !tbaa !5 %arrayidx29 = getelementptr inbounds [10 x i32], ptr %dfs, i64 0, i64 1 store i32 1, ptr %arrayidx29, align 4, !tbaa !5 %5 = load i32, ptr %n, align 4, !tbaa !5 %.fr = freeze i32 %5 %cmp32.not128 = icmp slt i32 %.fr, 1 %add = add i32 %.fr, 1 br i1 %cmp32.not128, label %for.end.split.us.split.us, label %for.cond31.preheader.preheader for.end.split.us.split.us: ; preds = %for.end %cmp87.us.us = icmp eq i32 %.fr, 0 %inc89.us.us = zext i1 %cmp87.us.us to i32 br label %while.end for.cond31.preheader.preheader: ; preds = %for.end %wide.trip.count173 = zext i32 %add to i64 %6 = or i64 %dfs223, 4 %7 = or i64 %dfs223, 4 %8 = add nsw i64 %wide.trip.count173, -1 %min.iters.check = icmp ult i64 %8, 8 %n.vec = and i64 %8, -8 %ind.end = or i64 %n.vec, 1 %cmp.n = icmp eq i64 %8, %n.vec br label %for.cond31.preheader for.cond31.preheader: ; preds = %for.cond31.preheader.preheader, %if.end91 %indvars.iv180 = phi i64 [ 0, %for.cond31.preheader.preheader ], [ %indvars.iv.next181, %if.end91 ] %fn.0142 = phi i32 [ 1, %for.cond31.preheader.preheader ], [ %fn.2208213, %if.end91 ] %ans.0140 = phi i32 [ 0, %for.cond31.preheader.preheader ], [ %ans.1, %if.end91 ] %9 = mul nuw nsw i64 %indvars.iv180, 40 %10 = add i64 %7, %9 %arrayidx35 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180 %11 = sext i32 %fn.0142 to i64 %12 = mul nsw i64 %11, 40 %13 = add i64 %6, %12 br label %for.body33.outer for.body33.outer: ; preds = %for.inc69.thread, %for.cond31.preheader %indvar = phi i64 [ %indvar.next, %for.inc69.thread ], [ 0, %for.cond31.preheader ] %indvars.iv170.ph = phi i64 [ %indvars.iv.next171206, %for.inc69.thread ], [ 1, %for.cond31.preheader ] %cmp72 = phi i1 [ false, %for.inc69.thread ], [ true, %for.cond31.preheader ] %fn.1130.ph = phi i32 [ %inc68, %for.inc69.thread ], [ %fn.0142, %for.cond31.preheader ] %14 = mul i64 %indvar, 40 %15 = add i64 %13, %14 %16 = load i32, ptr %arrayidx35, align 8, !tbaa !5 %idxprom37 = sext i32 %16 to i64 br label %for.body33 for.body33: ; preds = %for.body33.outer, %for.inc69 %indvars.iv170 = phi i64 [ %indvars.iv.next171, %for.inc69 ], [ %indvars.iv170.ph, %for.body33.outer ] %arrayidx40 = getelementptr inbounds [10 x [10 x i32]], ptr %ttyk, i64 0, i64 %idxprom37, i64 %indvars.iv170 %17 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp eq i32 %17, 1 br i1 %cmp41, label %land.lhs.true, label %for.inc69 land.lhs.true: ; preds = %for.body33 %arrayidx45 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv170 %18 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %cmp46.not = icmp eq i32 %18, 1 br i1 %cmp46.not, label %for.inc69, label %if.then if.then: ; preds = %land.lhs.true %idxprom47 = sext i32 %fn.1130.ph to i64 %arrayidx48 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47 %19 = trunc i64 %indvars.iv170 to i32 store i32 %19, ptr %arrayidx48, align 8, !tbaa !5 %20 = sub i64 %15, %10 %diff.check = icmp ult i64 %20, 32 %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check br i1 %or.cond, label %for.body52.preheader, label %vector.body vector.body: ; preds = %if.then, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %if.then ] %offset.idx = or i64 %index, 1 %21 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %offset.idx %wide.load = load <4 x i32>, ptr %21, align 4, !tbaa !5 %22 = getelementptr inbounds i32, ptr %21, i64 4 %wide.load224 = load <4 x i32>, ptr %22, align 4, !tbaa !5 %23 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %offset.idx store <4 x i32> %wide.load, ptr %23, align 4, !tbaa !5 %24 = getelementptr inbounds i32, ptr %23, i64 4 store <4 x i32> %wide.load224, ptr %24, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %25 = icmp eq i64 %index.next, %n.vec br i1 %25, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc69.thread, label %for.body52.preheader for.body52.preheader: ; preds = %if.then, %middle.block %indvars.iv167.ph = phi i64 [ 1, %if.then ], [ %ind.end, %middle.block ] %26 = sub nsw i64 %wide.trip.count173, %indvars.iv167.ph %27 = xor i64 %indvars.iv167.ph, -1 %28 = add nsw i64 %27, %wide.trip.count173 %xtraiter = and i64 %26, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body52.prol.loopexit, label %for.body52.prol for.body52.prol: ; preds = %for.body52.preheader, %for.body52.prol %indvars.iv167.prol = phi i64 [ %indvars.iv.next168.prol, %for.body52.prol ], [ %indvars.iv167.ph, %for.body52.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body52.prol ], [ 0, %for.body52.preheader ] %arrayidx56.prol = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv167.prol %29 = load i32, ptr %arrayidx56.prol, align 4, !tbaa !5 %arrayidx60.prol = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %indvars.iv167.prol store i32 %29, ptr %arrayidx60.prol, align 4, !tbaa !5 %indvars.iv.next168.prol = add nuw nsw i64 %indvars.iv167.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body52.prol.loopexit, label %for.body52.prol, !llvm.loop !14 for.body52.prol.loopexit: ; preds = %for.body52.prol, %for.body52.preheader %indvars.iv167.unr = phi i64 [ %indvars.iv167.ph, %for.body52.preheader ], [ %indvars.iv.next168.prol, %for.body52.prol ] %30 = icmp ult i64 %28, 3 br i1 %30, label %for.inc69.thread, label %for.body52 for.body52: ; preds = %for.body52.prol.loopexit, %for.body52 %indvars.iv167 = phi i64 [ %indvars.iv.next168.3, %for.body52 ], [ %indvars.iv167.unr, %for.body52.prol.loopexit ] %arrayidx56 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv167 %31 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %arrayidx60 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %indvars.iv167 store i32 %31, ptr %arrayidx60, align 4, !tbaa !5 %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1 %arrayidx56.1 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv.next168 %32 = load i32, ptr %arrayidx56.1, align 4, !tbaa !5 %arrayidx60.1 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %indvars.iv.next168 store i32 %32, ptr %arrayidx60.1, align 4, !tbaa !5 %indvars.iv.next168.1 = add nuw nsw i64 %indvars.iv167, 2 %arrayidx56.2 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv.next168.1 %33 = load i32, ptr %arrayidx56.2, align 4, !tbaa !5 %arrayidx60.2 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %indvars.iv.next168.1 store i32 %33, ptr %arrayidx60.2, align 4, !tbaa !5 %indvars.iv.next168.2 = add nuw nsw i64 %indvars.iv167, 3 %arrayidx56.3 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv.next168.2 %34 = load i32, ptr %arrayidx56.3, align 4, !tbaa !5 %arrayidx60.3 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %indvars.iv.next168.2 store i32 %34, ptr %arrayidx60.3, align 4, !tbaa !5 %indvars.iv.next168.3 = add nuw nsw i64 %indvars.iv167, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next168.3, %wide.trip.count173 br i1 %exitcond.not.3, label %for.inc69.thread, label %for.body52, !llvm.loop !16 for.inc69: ; preds = %for.body33, %land.lhs.true %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1 %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173 br i1 %exitcond174.not, label %for.cond31.for.end71_crit_edge.split, label %for.body33, !llvm.loop !17 for.inc69.thread: ; preds = %for.body52.prol.loopexit, %for.body52, %middle.block %arrayidx67 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %idxprom47, i64 %indvars.iv170 store i32 1, ptr %arrayidx67, align 4, !tbaa !5 %inc68 = add nsw i32 %fn.1130.ph, 1 %indvars.iv.next171206 = add nuw nsw i64 %indvars.iv170, 1 %exitcond174.not207 = icmp eq i64 %indvars.iv.next171206, %wide.trip.count173 %indvar.next = add i64 %indvar, 1 br i1 %exitcond174.not207, label %if.end91, label %for.body33.outer, !llvm.loop !17 for.cond31.for.end71_crit_edge.split: ; preds = %for.inc69 br i1 %cmp72, label %for.body76, label %if.end91 for.body76: ; preds = %for.cond31.for.end71_crit_edge.split, %for.inc84 %indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.inc84 ], [ 1, %for.cond31.for.end71_crit_edge.split ] %arrayidx80 = getelementptr inbounds [100000 x [10 x i32]], ptr %dfs, i64 0, i64 %indvars.iv180, i64 %indvars.iv175 %35 = load i32, ptr %arrayidx80, align 4, !tbaa !5 %cmp81 = icmp eq i32 %35, 0 br i1 %cmp81, label %for.end86.split.loop.exit217, label %for.inc84 for.inc84: ; preds = %for.body76 %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %exitcond179.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count173 br i1 %exitcond179.not, label %for.end86, label %for.body76, !llvm.loop !18 for.end86.split.loop.exit217: ; preds = %for.body76 %36 = trunc i64 %indvars.iv175 to i32 br label %for.end86 for.end86: ; preds = %for.inc84, %for.end86.split.loop.exit217 %j.1.lcssa = phi i32 [ %36, %for.end86.split.loop.exit217 ], [ %add, %for.inc84 ] %cmp87 = icmp eq i32 %j.1.lcssa, %add %inc89 = zext i1 %cmp87 to i32 %spec.select = add nsw i32 %ans.0140, %inc89 br label %if.end91 if.end91: ; preds = %for.inc69.thread, %for.end86, %for.cond31.for.end71_crit_edge.split %fn.2208213 = phi i32 [ %fn.1130.ph, %for.cond31.for.end71_crit_edge.split ], [ %fn.1130.ph, %for.end86 ], [ %inc68, %for.inc69.thread ] %ans.1 = phi i32 [ %ans.0140, %for.cond31.for.end71_crit_edge.split ], [ %spec.select, %for.end86 ], [ %ans.0140, %for.inc69.thread ] %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1 %37 = sext i32 %fn.2208213 to i64 %cmp30 = icmp slt i64 %indvars.iv.next181, %37 br i1 %cmp30, label %for.cond31.preheader, label %while.end, !llvm.loop !19 while.end: ; preds = %if.end91, %for.end.split.us.split.us %.us-phi = phi i32 [ %inc89.us.us, %for.end.split.us.split.us ], [ %ans.1, %if.end91 ] %call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %dfs) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %ttyk) #4 call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %ab) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10, !12} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> #include <stdlib.h> #include <limits.h> typedef struct int_list_elem_t { int data; struct int_list_elem_t* prev; struct int_list_elem_t* next; } int_list_elem; typedef struct int_list_t { int_list_elem* head; int_list_elem* tail; unsigned long length; } int_list; int_list* int_list_init() { int_list* lst = (int_list*)calloc(1, sizeof(int_list)); return lst; } unsigned long int_list_length(const int_list* lst) { return lst->length; } int int_list_get(const int_list* lst, unsigned long index) { if (lst->length <= index || index < 0) { printf("index out of range exception\n"); exit(EXIT_FAILURE); } unsigned long i; int_list_elem* obtained_elem; if (index <= lst->length / 2) { obtained_elem = lst->head; for (i = 0; i < index; i++) { obtained_elem = obtained_elem->next; } } else { obtained_elem = lst->tail; for (i = lst->length - 1; i > index; i--) { obtained_elem = obtained_elem->prev; } } return obtained_elem->data; } void int_list_add(int_list* lst, unsigned long index, int data) { if (lst->length < index || index < 0) { printf("index out of range exception\n"); exit(EXIT_FAILURE); } if (lst->length >= ULONG_MAX) { printf("list overflow\n"); exit(EXIT_FAILURE); } int_list_elem* added_elem = (int_list_elem*)malloc(sizeof(int_list_elem)); int_list_elem* elem; unsigned long i; added_elem->data = data; if (index == 0) { added_elem->prev = NULL; added_elem->next = lst->head; lst->head = added_elem; if (added_elem->next == NULL) // if list length = 0 lst->tail = added_elem; else added_elem->next->prev = added_elem; } else if (index == lst->length) { added_elem->next = NULL; added_elem->prev = lst->tail; lst->tail = added_elem; // added_elem->prev != NULL because length != 0 added_elem->prev->next = added_elem; } else { if (index <= lst->length / 2) { elem = lst->head; for (i = 0; i < index; i++) { elem = elem->next; } } else { elem = lst->tail; for (i = lst->length - 1; i > index; i--) { elem = elem->prev; } } elem->prev->next = added_elem; added_elem->prev = elem->prev; elem->prev = added_elem; added_elem->next = elem; } lst->length++; } void int_list_remove(int_list* lst, unsigned long index) { if (lst->length <= index || index < 0) { printf("index out of range exception\n"); exit(EXIT_FAILURE); } unsigned long i; int_list_elem* obtained_elem; if (index == 0) { obtained_elem = lst->head; lst->head = lst->head->next; if (lst->head == NULL) lst->tail = NULL; else lst->head->prev = NULL; } else if (index == lst->length - 1) { obtained_elem = lst->tail; lst->tail = lst->tail->prev; lst->tail->next = NULL; } else { if (index <= lst->length / 2) { obtained_elem = lst->head; for (i = 0; i < index; i++) { obtained_elem = obtained_elem->next; } } else { obtained_elem = lst->tail; for (i = lst->length - 1; i > index; i--) { obtained_elem = obtained_elem->prev; } } obtained_elem->prev->next = obtained_elem->next; obtained_elem->next->prev = obtained_elem->prev; } free(obtained_elem); lst->length--; } void int_list_delete(int_list* lst) { while (lst->length) { int_list_remove(lst, 0); } free(lst); } long count_one_stroke_path(int N, const int* pass, int_list** edge_list, int now) { long count = 0; int i, j; int next; int* next_pass; int goal = 1; int failure = 1; for (i = 0; i < N; i++) { if (pass[i] != 1) { goal = 0; break; } } if (goal) return 1; for (i = 0; i < edge_list[now]->length; i++) { next = int_list_get(edge_list[now], i); if (pass[next] == 0) { next_pass = (int*)malloc(sizeof(int) * N); for (j = 0; j < N; j++) next_pass[j] = pass[j]; next_pass[next] = 1; count += count_one_stroke_path(N, next_pass, edge_list, next); failure = 0; free(next_pass); } } if (failure) return 0; return count; } int main() { int N, M; scanf("%d %d%*c", &N, &M); int* a, *b; a = (int*)malloc(sizeof(int) * M); b = (int*)malloc(sizeof(int) * M); int i, j; for (i = 0; i < M; i++) { scanf("%d %d%*c", &(a[i]), &(b[i])); a[i] -= 1; b[i] -= 1; } int_list** edge_list = (int_list**)malloc(sizeof(int_list*) * N); for (j = 0; j < N; j++) { edge_list[j] = int_list_init(); } for (i = 0; i < M; i++) { for (j = 0; j < N; j++) { if (a[i] == j) int_list_add(edge_list[j], 0, b[i]); if (b[i] == j) int_list_add(edge_list[j], 0, a[i]); } } int* pass = (int*)calloc(N, sizeof(int)); pass[0] = 1; printf("%ld\n", count_one_stroke_path(N, pass, edge_list, 0)); free(a); free(b); for (j = 0; j < N; j++) int_list_delete(edge_list[j]); free(edge_list); free(pass); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281127/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281127/source.c" target datalayout = "e-m:e-p270: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.int_list_t = type { ptr, ptr, i64 } %struct.int_list_elem_t = type { i32, ptr, ptr } @.str.2 = private unnamed_addr constant [9 x i8] c"%d %d%*c\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 @str.4 = private unnamed_addr constant [14 x i8] c"list overflow\00", align 1 @str.6 = private unnamed_addr constant [29 x i8] c"index out of range exception\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(inaccessiblemem: readwrite) uwtable define dso_local noalias ptr @int_list_init() local_unnamed_addr #0 { entry: %call = tail call noalias dereferenceable_or_null(24) ptr @calloc(i64 noundef 1, i64 noundef 24) #11 ret ptr %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 allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @int_list_length(ptr nocapture noundef readonly %lst) local_unnamed_addr #3 { entry: %length = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 2 %0 = load i64, ptr %length, align 8, !tbaa !5 ret i64 %0 } ; Function Attrs: nounwind uwtable define dso_local i32 @int_list_get(ptr nocapture noundef readonly %lst, i64 noundef %index) local_unnamed_addr #4 { entry: %length = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 2 %0 = load i64, ptr %length, align 8, !tbaa !5 %cmp.not = icmp ugt i64 %0, %index br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.6) tail call void @exit(i32 noundef 1) #12 unreachable if.end: ; preds = %entry %div26 = lshr i64 %0, 1 %cmp3.not = icmp ult i64 %div26, %index br i1 %cmp3.not, label %if.else, label %for.cond.preheader for.cond.preheader: ; preds = %if.end %obtained_elem.028 = load ptr, ptr %lst, align 8, !tbaa !11 %cmp529.not = icmp eq i64 %index, 0 br i1 %cmp529.not, label %if.end12, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %xtraiter = and i64 %index, 7 %1 = icmp ult i64 %index, 8 br i1 %1, label %if.end12.loopexit35.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %index, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %obtained_elem.031 = phi ptr [ %obtained_elem.028, %for.body.preheader.new ], [ %obtained_elem.0.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %next = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.031, i64 0, i32 2 %obtained_elem.0 = load ptr, ptr %next, align 8, !tbaa !11 %next.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0, i64 0, i32 2 %obtained_elem.0.1 = load ptr, ptr %next.1, align 8, !tbaa !11 %next.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.1, i64 0, i32 2 %obtained_elem.0.2 = load ptr, ptr %next.2, align 8, !tbaa !11 %next.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.2, i64 0, i32 2 %obtained_elem.0.3 = load ptr, ptr %next.3, align 8, !tbaa !11 %next.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.3, i64 0, i32 2 %obtained_elem.0.4 = load ptr, ptr %next.4, align 8, !tbaa !11 %next.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.4, i64 0, i32 2 %obtained_elem.0.5 = load ptr, ptr %next.5, align 8, !tbaa !11 %next.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.5, i64 0, i32 2 %obtained_elem.0.6 = load ptr, ptr %next.6, align 8, !tbaa !11 %next.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.6, i64 0, i32 2 %obtained_elem.0.7 = load ptr, ptr %next.7, align 8, !tbaa !11 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %if.end12.loopexit35.unr-lcssa, label %for.body, !llvm.loop !12 if.else: ; preds = %if.end %tail = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 %2 = sub i64 %0, %index %3 = xor i64 %index, -1 %4 = add i64 %0, %3 %xtraiter37 = and i64 %2, 7 %lcmp.mod38.not = icmp eq i64 %xtraiter37, 0 br i1 %lcmp.mod38.not, label %for.cond7.prol.loopexit, label %for.cond7.prol for.cond7.prol: ; preds = %if.else, %for.cond7.prol %i.1.in.prol = phi i64 [ %i.1.prol, %for.cond7.prol ], [ %0, %if.else ] %obtained_elem.1.in.prol = phi ptr [ %prev.prol, %for.cond7.prol ], [ %tail, %if.else ] %prol.iter = phi i64 [ %prol.iter.next, %for.cond7.prol ], [ 0, %if.else ] %obtained_elem.1.prol = load ptr, ptr %obtained_elem.1.in.prol, align 8, !tbaa !11 %i.1.prol = add i64 %i.1.in.prol, -1 %prev.prol = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.prol, i64 0, i32 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter37 br i1 %prol.iter.cmp.not, label %for.cond7.prol.loopexit, label %for.cond7.prol, !llvm.loop !14 for.cond7.prol.loopexit: ; preds = %for.cond7.prol, %if.else %i.1.in.unr = phi i64 [ %0, %if.else ], [ %i.1.prol, %for.cond7.prol ] %obtained_elem.1.in.unr = phi ptr [ %tail, %if.else ], [ %prev.prol, %for.cond7.prol ] %obtained_elem.1.lcssa.unr = phi ptr [ undef, %if.else ], [ %obtained_elem.1.prol, %for.cond7.prol ] %5 = icmp ult i64 %4, 7 br i1 %5, label %if.end12, label %for.cond7 for.cond7: ; preds = %for.cond7.prol.loopexit, %for.cond7 %i.1.in = phi i64 [ %i.1.7, %for.cond7 ], [ %i.1.in.unr, %for.cond7.prol.loopexit ] %obtained_elem.1.in = phi ptr [ %prev.7, %for.cond7 ], [ %obtained_elem.1.in.unr, %for.cond7.prol.loopexit ] %obtained_elem.1 = load ptr, ptr %obtained_elem.1.in, align 8, !tbaa !11 %prev = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1, i64 0, i32 1 %obtained_elem.1.1 = load ptr, ptr %prev, align 8, !tbaa !11 %prev.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.1, i64 0, i32 1 %obtained_elem.1.2 = load ptr, ptr %prev.1, align 8, !tbaa !11 %prev.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.2, i64 0, i32 1 %obtained_elem.1.3 = load ptr, ptr %prev.2, align 8, !tbaa !11 %prev.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.3, i64 0, i32 1 %obtained_elem.1.4 = load ptr, ptr %prev.3, align 8, !tbaa !11 %prev.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.4, i64 0, i32 1 %obtained_elem.1.5 = load ptr, ptr %prev.4, align 8, !tbaa !11 %prev.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.5, i64 0, i32 1 %obtained_elem.1.6 = load ptr, ptr %prev.5, align 8, !tbaa !11 %prev.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.6, i64 0, i32 1 %obtained_elem.1.7 = load ptr, ptr %prev.6, align 8, !tbaa !11 %i.1.7 = add i64 %i.1.in, -8 %cmp8.7 = icmp ugt i64 %i.1.7, %index %prev.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.7, i64 0, i32 1 br i1 %cmp8.7, label %for.cond7, label %if.end12, !llvm.loop !16 if.end12.loopexit35.unr-lcssa: ; preds = %for.body, %for.body.preheader %obtained_elem.0.lcssa.ph = phi ptr [ undef, %for.body.preheader ], [ %obtained_elem.0.7, %for.body ] %obtained_elem.031.unr = phi ptr [ %obtained_elem.028, %for.body.preheader ], [ %obtained_elem.0.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %if.end12, label %for.body.epil for.body.epil: ; preds = %if.end12.loopexit35.unr-lcssa, %for.body.epil %obtained_elem.031.epil = phi ptr [ %obtained_elem.0.epil, %for.body.epil ], [ %obtained_elem.031.unr, %if.end12.loopexit35.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %if.end12.loopexit35.unr-lcssa ] %next.epil = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.031.epil, i64 0, i32 2 %obtained_elem.0.epil = load ptr, ptr %next.epil, align 8, !tbaa !11 %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.end12, label %for.body.epil, !llvm.loop !17 if.end12: ; preds = %if.end12.loopexit35.unr-lcssa, %for.body.epil, %for.cond7.prol.loopexit, %for.cond7, %for.cond.preheader %obtained_elem.2 = phi ptr [ %obtained_elem.028, %for.cond.preheader ], [ %obtained_elem.1.lcssa.unr, %for.cond7.prol.loopexit ], [ %obtained_elem.1.7, %for.cond7 ], [ %obtained_elem.0.lcssa.ph, %if.end12.loopexit35.unr-lcssa ], [ %obtained_elem.0.epil, %for.body.epil ] %6 = load i32, ptr %obtained_elem.2, align 8, !tbaa !18 ret i32 %6 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #6 ; Function Attrs: nounwind uwtable define dso_local void @int_list_add(ptr nocapture noundef %lst, i64 noundef %index, i32 noundef %data) local_unnamed_addr #4 { entry: %length = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 2 %0 = load i64, ptr %length, align 8, !tbaa !5 %cmp = icmp ult i64 %0, %index br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts100 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.6) tail call void @exit(i32 noundef 1) #12 unreachable if.end: ; preds = %entry %cmp3 = icmp eq i64 %0, -1 br i1 %cmp3, label %if.then4, label %if.end6 if.then4: ; preds = %if.end %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.4) tail call void @exit(i32 noundef 1) #12 unreachable if.end6: ; preds = %if.end %call7 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #13 store i32 %data, ptr %call7, align 8, !tbaa !18 %cmp9 = icmp eq i64 %index, 0 br i1 %cmp9, label %if.then10, label %if.else18 if.then10: ; preds = %if.end6 %prev = getelementptr inbounds %struct.int_list_elem_t, ptr %call7, i64 0, i32 1 store ptr null, ptr %prev, align 8, !tbaa !21 %1 = load ptr, ptr %lst, align 8, !tbaa !22 %next = getelementptr inbounds %struct.int_list_elem_t, ptr %call7, i64 0, i32 2 store ptr %1, ptr %next, align 8, !tbaa !23 store ptr %call7, ptr %lst, align 8, !tbaa !22 %cmp13 = icmp eq ptr %1, null br i1 %cmp13, label %if.then14, label %if.else if.then14: ; preds = %if.then10 %tail = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 store ptr %call7, ptr %tail, align 8, !tbaa !24 br label %if.end52 if.else: ; preds = %if.then10 %prev16 = getelementptr inbounds %struct.int_list_elem_t, ptr %1, i64 0, i32 1 store ptr %call7, ptr %prev16, align 8, !tbaa !21 br label %if.end52 if.else18: ; preds = %if.end6 %cmp20 = icmp eq i64 %0, %index br i1 %cmp20, label %if.then21, label %if.else28 if.then21: ; preds = %if.else18 %next22 = getelementptr inbounds %struct.int_list_elem_t, ptr %call7, i64 0, i32 2 store ptr null, ptr %next22, align 8, !tbaa !23 %tail23 = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 %2 = load ptr, ptr %tail23, align 8, !tbaa !24 %prev24 = getelementptr inbounds %struct.int_list_elem_t, ptr %call7, i64 0, i32 1 store ptr %2, ptr %prev24, align 8, !tbaa !21 store ptr %call7, ptr %tail23, align 8, !tbaa !24 %next27 = getelementptr inbounds %struct.int_list_elem_t, ptr %2, i64 0, i32 2 store ptr %call7, ptr %next27, align 8, !tbaa !23 br label %if.end52 if.else28: ; preds = %if.else18 %div99 = lshr i64 %0, 1 %cmp30.not = icmp ult i64 %div99, %index br i1 %cmp30.not, label %if.else35, label %for.cond.preheader for.cond.preheader: ; preds = %if.else28 %elem.0102 = load ptr, ptr %lst, align 8, !tbaa !11 %xtraiter = and i64 %index, 7 %3 = icmp ult i64 %index, 8 br i1 %3, label %if.end44.loopexit108.unr-lcssa, label %for.cond.preheader.new for.cond.preheader.new: ; preds = %for.cond.preheader %unroll_iter = and i64 %index, -8 br label %for.body for.body: ; preds = %for.body, %for.cond.preheader.new %elem.0104 = phi ptr [ %elem.0102, %for.cond.preheader.new ], [ %elem.0.7, %for.body ] %niter = phi i64 [ 0, %for.cond.preheader.new ], [ %niter.next.7, %for.body ] %next34 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0104, i64 0, i32 2 %elem.0 = load ptr, ptr %next34, align 8, !tbaa !11 %next34.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0, i64 0, i32 2 %elem.0.1 = load ptr, ptr %next34.1, align 8, !tbaa !11 %next34.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0.1, i64 0, i32 2 %elem.0.2 = load ptr, ptr %next34.2, align 8, !tbaa !11 %next34.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0.2, i64 0, i32 2 %elem.0.3 = load ptr, ptr %next34.3, align 8, !tbaa !11 %next34.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0.3, i64 0, i32 2 %elem.0.4 = load ptr, ptr %next34.4, align 8, !tbaa !11 %next34.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0.4, i64 0, i32 2 %elem.0.5 = load ptr, ptr %next34.5, align 8, !tbaa !11 %next34.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0.5, i64 0, i32 2 %elem.0.6 = load ptr, ptr %next34.6, align 8, !tbaa !11 %next34.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0.6, i64 0, i32 2 %elem.0.7 = load ptr, ptr %next34.7, align 8, !tbaa !11 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %if.end44.loopexit108.unr-lcssa, label %for.body, !llvm.loop !25 if.else35: ; preds = %if.else28 %tail36 = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 %4 = sub i64 %0, %index %5 = xor i64 %index, -1 %6 = add i64 %0, %5 %xtraiter110 = and i64 %4, 7 %lcmp.mod111.not = icmp eq i64 %xtraiter110, 0 br i1 %lcmp.mod111.not, label %for.cond38.prol.loopexit, label %for.cond38.prol for.cond38.prol: ; preds = %if.else35, %for.cond38.prol %elem.1.in.prol = phi ptr [ %prev41.prol, %for.cond38.prol ], [ %tail36, %if.else35 ] %i.1.in.prol = phi i64 [ %i.1.prol, %for.cond38.prol ], [ %0, %if.else35 ] %prol.iter = phi i64 [ %prol.iter.next, %for.cond38.prol ], [ 0, %if.else35 ] %i.1.prol = add i64 %i.1.in.prol, -1 %elem.1.prol = load ptr, ptr %elem.1.in.prol, align 8, !tbaa !11 %prev41.prol = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.prol, i64 0, i32 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter110 br i1 %prol.iter.cmp.not, label %for.cond38.prol.loopexit, label %for.cond38.prol, !llvm.loop !26 for.cond38.prol.loopexit: ; preds = %for.cond38.prol, %if.else35 %elem.1.in.unr = phi ptr [ %tail36, %if.else35 ], [ %prev41.prol, %for.cond38.prol ] %i.1.in.unr = phi i64 [ %0, %if.else35 ], [ %i.1.prol, %for.cond38.prol ] %elem.1.lcssa.unr = phi ptr [ undef, %if.else35 ], [ %elem.1.prol, %for.cond38.prol ] %7 = icmp ult i64 %6, 7 br i1 %7, label %if.end44, label %for.cond38 for.cond38: ; preds = %for.cond38.prol.loopexit, %for.cond38 %elem.1.in = phi ptr [ %prev41.7, %for.cond38 ], [ %elem.1.in.unr, %for.cond38.prol.loopexit ] %i.1.in = phi i64 [ %i.1.7, %for.cond38 ], [ %i.1.in.unr, %for.cond38.prol.loopexit ] %elem.1 = load ptr, ptr %elem.1.in, align 8, !tbaa !11 %prev41 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1, i64 0, i32 1 %elem.1.1 = load ptr, ptr %prev41, align 8, !tbaa !11 %prev41.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.1, i64 0, i32 1 %elem.1.2 = load ptr, ptr %prev41.1, align 8, !tbaa !11 %prev41.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.2, i64 0, i32 1 %elem.1.3 = load ptr, ptr %prev41.2, align 8, !tbaa !11 %prev41.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.3, i64 0, i32 1 %elem.1.4 = load ptr, ptr %prev41.3, align 8, !tbaa !11 %prev41.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.4, i64 0, i32 1 %elem.1.5 = load ptr, ptr %prev41.4, align 8, !tbaa !11 %prev41.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.5, i64 0, i32 1 %elem.1.6 = load ptr, ptr %prev41.5, align 8, !tbaa !11 %prev41.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.6, i64 0, i32 1 %i.1.7 = add i64 %i.1.in, -8 %elem.1.7 = load ptr, ptr %prev41.6, align 8, !tbaa !11 %cmp39.7 = icmp ugt i64 %i.1.7, %index %prev41.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.1.7, i64 0, i32 1 br i1 %cmp39.7, label %for.cond38, label %if.end44, !llvm.loop !27 if.end44.loopexit108.unr-lcssa: ; preds = %for.body, %for.cond.preheader %elem.0.lcssa.ph = phi ptr [ undef, %for.cond.preheader ], [ %elem.0.7, %for.body ] %elem.0104.unr = phi ptr [ %elem.0102, %for.cond.preheader ], [ %elem.0.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %if.end44, label %for.body.epil for.body.epil: ; preds = %if.end44.loopexit108.unr-lcssa, %for.body.epil %elem.0104.epil = phi ptr [ %elem.0.epil, %for.body.epil ], [ %elem.0104.unr, %if.end44.loopexit108.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %if.end44.loopexit108.unr-lcssa ] %next34.epil = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.0104.epil, i64 0, i32 2 %elem.0.epil = load ptr, ptr %next34.epil, align 8, !tbaa !11 %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.end44, label %for.body.epil, !llvm.loop !28 if.end44: ; preds = %if.end44.loopexit108.unr-lcssa, %for.body.epil, %for.cond38.prol.loopexit, %for.cond38 %elem.2 = phi ptr [ %elem.1.lcssa.unr, %for.cond38.prol.loopexit ], [ %elem.1.7, %for.cond38 ], [ %elem.0.lcssa.ph, %if.end44.loopexit108.unr-lcssa ], [ %elem.0.epil, %for.body.epil ] %prev45 = getelementptr inbounds %struct.int_list_elem_t, ptr %elem.2, i64 0, i32 1 %8 = load ptr, ptr %prev45, align 8, !tbaa !21 %next46 = getelementptr inbounds %struct.int_list_elem_t, ptr %8, i64 0, i32 2 store ptr %call7, ptr %next46, align 8, !tbaa !23 %prev48 = getelementptr inbounds %struct.int_list_elem_t, ptr %call7, i64 0, i32 1 store ptr %8, ptr %prev48, align 8, !tbaa !21 store ptr %call7, ptr %prev45, align 8, !tbaa !21 %next50 = getelementptr inbounds %struct.int_list_elem_t, ptr %call7, i64 0, i32 2 store ptr %elem.2, ptr %next50, align 8, !tbaa !23 br label %if.end52 if.end52: ; preds = %if.then21, %if.end44, %if.then14, %if.else %inc54 = add i64 %0, 1 store i64 %inc54, ptr %length, align 8, !tbaa !5 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 #7 ; Function Attrs: nounwind uwtable define dso_local void @int_list_remove(ptr nocapture noundef %lst, i64 noundef %index) local_unnamed_addr #4 { entry: %length = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 2 %0 = load i64, ptr %length, align 8, !tbaa !5 %cmp.not = icmp ugt i64 %0, %index br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.6) tail call void @exit(i32 noundef 1) #12 unreachable if.end: ; preds = %entry %cmp2 = icmp eq i64 %index, 0 br i1 %cmp2, label %if.then3, label %if.else11 if.then3: ; preds = %if.end %1 = load ptr, ptr %lst, align 8, !tbaa !22 %next = getelementptr inbounds %struct.int_list_elem_t, ptr %1, i64 0, i32 2 %2 = load ptr, ptr %next, align 8, !tbaa !23 store ptr %2, ptr %lst, align 8, !tbaa !22 %cmp7 = icmp eq ptr %2, null br i1 %cmp7, label %if.then8, label %if.else if.then8: ; preds = %if.then3 %tail = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 store ptr null, ptr %tail, align 8, !tbaa !24 br label %if.end46 if.else: ; preds = %if.then3 %prev = getelementptr inbounds %struct.int_list_elem_t, ptr %2, i64 0, i32 1 store ptr null, ptr %prev, align 8, !tbaa !21 br label %if.end46 if.else11: ; preds = %if.end %sub = add i64 %0, -1 %cmp13 = icmp eq i64 %sub, %index br i1 %cmp13, label %if.then14, label %if.else21 if.then14: ; preds = %if.else11 %tail15 = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 %3 = load ptr, ptr %tail15, align 8, !tbaa !24 %prev17 = getelementptr inbounds %struct.int_list_elem_t, ptr %3, i64 0, i32 1 %4 = load ptr, ptr %prev17, align 8, !tbaa !21 store ptr %4, ptr %tail15, align 8, !tbaa !24 %next20 = getelementptr inbounds %struct.int_list_elem_t, ptr %4, i64 0, i32 2 store ptr null, ptr %next20, align 8, !tbaa !23 br label %if.end46 if.else21: ; preds = %if.else11 %div81 = lshr i64 %0, 1 %cmp23.not = icmp ult i64 %div81, %index br i1 %cmp23.not, label %if.else28, label %for.cond.preheader for.cond.preheader: ; preds = %if.else21 %obtained_elem.083 = load ptr, ptr %lst, align 8, !tbaa !11 %xtraiter = and i64 %index, 7 %5 = icmp ult i64 %index, 8 br i1 %5, label %if.end38.loopexit93.unr-lcssa, label %for.cond.preheader.new for.cond.preheader.new: ; preds = %for.cond.preheader %unroll_iter = and i64 %index, -8 br label %for.body for.body: ; preds = %for.body, %for.cond.preheader.new %obtained_elem.085 = phi ptr [ %obtained_elem.083, %for.cond.preheader.new ], [ %obtained_elem.0.7, %for.body ] %niter = phi i64 [ 0, %for.cond.preheader.new ], [ %niter.next.7, %for.body ] %next27 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.085, i64 0, i32 2 %obtained_elem.0 = load ptr, ptr %next27, align 8, !tbaa !11 %next27.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0, i64 0, i32 2 %obtained_elem.0.1 = load ptr, ptr %next27.1, align 8, !tbaa !11 %next27.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.1, i64 0, i32 2 %obtained_elem.0.2 = load ptr, ptr %next27.2, align 8, !tbaa !11 %next27.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.2, i64 0, i32 2 %obtained_elem.0.3 = load ptr, ptr %next27.3, align 8, !tbaa !11 %next27.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.3, i64 0, i32 2 %obtained_elem.0.4 = load ptr, ptr %next27.4, align 8, !tbaa !11 %next27.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.4, i64 0, i32 2 %obtained_elem.0.5 = load ptr, ptr %next27.5, align 8, !tbaa !11 %next27.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.5, i64 0, i32 2 %obtained_elem.0.6 = load ptr, ptr %next27.6, align 8, !tbaa !11 %next27.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.6, i64 0, i32 2 %obtained_elem.0.7 = load ptr, ptr %next27.7, align 8, !tbaa !11 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %if.end38.loopexit93.unr-lcssa, label %for.body, !llvm.loop !29 if.else28: ; preds = %if.else21 %tail29 = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 %obtained_elem.186 = load ptr, ptr %tail29, align 8, !tbaa !11 %cmp3387 = icmp ugt i64 %sub, %index br i1 %cmp3387, label %for.body34.preheader, label %if.end38 for.body34.preheader: ; preds = %if.else28 %6 = xor i64 %index, -1 %7 = add i64 %0, %6 %8 = add i64 %0, -2 %9 = sub i64 %8, %index %xtraiter95 = and i64 %7, 7 %lcmp.mod96.not = icmp eq i64 %xtraiter95, 0 br i1 %lcmp.mod96.not, label %for.body34.prol.loopexit, label %for.body34.prol for.body34.prol: ; preds = %for.body34.preheader, %for.body34.prol %obtained_elem.189.prol = phi ptr [ %obtained_elem.1.prol, %for.body34.prol ], [ %obtained_elem.186, %for.body34.preheader ] %i.188.prol = phi i64 [ %dec.prol, %for.body34.prol ], [ %sub, %for.body34.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body34.prol ], [ 0, %for.body34.preheader ] %prev35.prol = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.189.prol, i64 0, i32 1 %dec.prol = add i64 %i.188.prol, -1 %obtained_elem.1.prol = load ptr, ptr %prev35.prol, align 8, !tbaa !11 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter95 br i1 %prol.iter.cmp.not, label %for.body34.prol.loopexit, label %for.body34.prol, !llvm.loop !30 for.body34.prol.loopexit: ; preds = %for.body34.prol, %for.body34.preheader %obtained_elem.189.unr = phi ptr [ %obtained_elem.186, %for.body34.preheader ], [ %obtained_elem.1.prol, %for.body34.prol ] %i.188.unr = phi i64 [ %sub, %for.body34.preheader ], [ %dec.prol, %for.body34.prol ] %obtained_elem.1.lcssa.unr = phi ptr [ undef, %for.body34.preheader ], [ %obtained_elem.1.prol, %for.body34.prol ] %10 = icmp ult i64 %9, 7 br i1 %10, label %if.end38, label %for.body34 for.body34: ; preds = %for.body34.prol.loopexit, %for.body34 %obtained_elem.189 = phi ptr [ %obtained_elem.1.7, %for.body34 ], [ %obtained_elem.189.unr, %for.body34.prol.loopexit ] %i.188 = phi i64 [ %dec.7, %for.body34 ], [ %i.188.unr, %for.body34.prol.loopexit ] %prev35 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.189, i64 0, i32 1 %obtained_elem.1 = load ptr, ptr %prev35, align 8, !tbaa !11 %prev35.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1, i64 0, i32 1 %obtained_elem.1.1 = load ptr, ptr %prev35.1, align 8, !tbaa !11 %prev35.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.1, i64 0, i32 1 %obtained_elem.1.2 = load ptr, ptr %prev35.2, align 8, !tbaa !11 %prev35.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.2, i64 0, i32 1 %obtained_elem.1.3 = load ptr, ptr %prev35.3, align 8, !tbaa !11 %prev35.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.3, i64 0, i32 1 %obtained_elem.1.4 = load ptr, ptr %prev35.4, align 8, !tbaa !11 %prev35.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.4, i64 0, i32 1 %obtained_elem.1.5 = load ptr, ptr %prev35.5, align 8, !tbaa !11 %prev35.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.5, i64 0, i32 1 %obtained_elem.1.6 = load ptr, ptr %prev35.6, align 8, !tbaa !11 %prev35.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.6, i64 0, i32 1 %dec.7 = add i64 %i.188, -8 %obtained_elem.1.7 = load ptr, ptr %prev35.7, align 8, !tbaa !11 %cmp33.7 = icmp ugt i64 %dec.7, %index br i1 %cmp33.7, label %for.body34, label %if.end38, !llvm.loop !31 if.end38.loopexit93.unr-lcssa: ; preds = %for.body, %for.cond.preheader %obtained_elem.0.lcssa.ph = phi ptr [ undef, %for.cond.preheader ], [ %obtained_elem.0.7, %for.body ] %obtained_elem.085.unr = phi ptr [ %obtained_elem.083, %for.cond.preheader ], [ %obtained_elem.0.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %if.end38, label %for.body.epil for.body.epil: ; preds = %if.end38.loopexit93.unr-lcssa, %for.body.epil %obtained_elem.085.epil = phi ptr [ %obtained_elem.0.epil, %for.body.epil ], [ %obtained_elem.085.unr, %if.end38.loopexit93.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %if.end38.loopexit93.unr-lcssa ] %next27.epil = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.085.epil, i64 0, i32 2 %obtained_elem.0.epil = load ptr, ptr %next27.epil, align 8, !tbaa !11 %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.end38, label %for.body.epil, !llvm.loop !32 if.end38: ; preds = %if.end38.loopexit93.unr-lcssa, %for.body.epil, %for.body34.prol.loopexit, %for.body34, %if.else28 %obtained_elem.2 = phi ptr [ %obtained_elem.186, %if.else28 ], [ %obtained_elem.1.lcssa.unr, %for.body34.prol.loopexit ], [ %obtained_elem.1.7, %for.body34 ], [ %obtained_elem.0.lcssa.ph, %if.end38.loopexit93.unr-lcssa ], [ %obtained_elem.0.epil, %for.body.epil ] %next39 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.2, i64 0, i32 2 %11 = load ptr, ptr %next39, align 8, !tbaa !23 %prev40 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.2, i64 0, i32 1 %12 = load ptr, ptr %prev40, align 8, !tbaa !21 %next41 = getelementptr inbounds %struct.int_list_elem_t, ptr %12, i64 0, i32 2 store ptr %11, ptr %next41, align 8, !tbaa !23 %13 = load ptr, ptr %next39, align 8, !tbaa !23 %prev44 = getelementptr inbounds %struct.int_list_elem_t, ptr %13, i64 0, i32 1 store ptr %12, ptr %prev44, align 8, !tbaa !21 br label %if.end46 if.end46: ; preds = %if.then14, %if.end38, %if.then8, %if.else %obtained_elem.3 = phi ptr [ %1, %if.then8 ], [ %1, %if.else ], [ %3, %if.then14 ], [ %obtained_elem.2, %if.end38 ] tail call void @free(ptr noundef nonnull %obtained_elem.3) #14 %14 = load i64, ptr %length, align 8, !tbaa !5 %dec48 = add i64 %14, -1 store i64 %dec48, ptr %length, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nounwind uwtable define dso_local void @int_list_delete(ptr nocapture noundef %lst) local_unnamed_addr #4 { entry: %length = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 2 %0 = load i64, ptr %length, align 8, !tbaa !5 %tobool.not3 = icmp eq i64 %0, 0 br i1 %tobool.not3, label %while.end, label %if.end.i.lr.ph if.end.i.lr.ph: ; preds = %entry %tail.i = getelementptr inbounds %struct.int_list_t, ptr %lst, i64 0, i32 1 br label %if.end.i if.end.i: ; preds = %if.end.i.lr.ph, %if.end.i %1 = load ptr, ptr %lst, align 8, !tbaa !22 %next.i = getelementptr inbounds %struct.int_list_elem_t, ptr %1, i64 0, i32 2 %2 = load ptr, ptr %next.i, align 8, !tbaa !23 store ptr %2, ptr %lst, align 8, !tbaa !22 %cmp7.i = icmp eq ptr %2, null %prev.i = getelementptr inbounds %struct.int_list_elem_t, ptr %2, i64 0, i32 1 %tail.i.sink = select i1 %cmp7.i, ptr %tail.i, ptr %prev.i store ptr null, ptr %tail.i.sink, align 8, !tbaa !11 tail call void @free(ptr noundef nonnull %1) #14 %3 = load i64, ptr %length, align 8, !tbaa !5 %dec48.i = add i64 %3, -1 store i64 %dec48.i, ptr %length, align 8, !tbaa !5 %tobool.not = icmp eq i64 %dec48.i, 0 br i1 %tobool.not, label %while.end, label %if.end.i, !llvm.loop !33 while.end: ; preds = %if.end.i, %entry tail call void @free(ptr noundef nonnull %lst) #14 ret void } ; Function Attrs: nounwind uwtable define dso_local i64 @count_one_stroke_path(i32 noundef %N, ptr nocapture noundef readonly %pass, ptr nocapture noundef readonly %edge_list, i32 noundef %now) local_unnamed_addr #4 { entry: %cmp70 = icmp sgt i32 %N, 0 br i1 %cmp70, 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 !34 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds i32, ptr %pass, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !35 %cmp1.not = icmp eq i32 %0, 1 br i1 %cmp1.not, label %for.cond, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body %idxprom5 = sext i32 %now to i64 %arrayidx6 = getelementptr inbounds ptr, ptr %edge_list, i64 %idxprom5 %1 = load ptr, ptr %arrayidx6, align 8, !tbaa !11 %length74 = getelementptr inbounds %struct.int_list_t, ptr %1, i64 0, i32 2 %2 = load i64, ptr %length74, align 8, !tbaa !5 %cmp775.not = icmp eq i64 %2, 0 br i1 %cmp775.not, label %cleanup, label %if.end.i.us.preheader if.end.i.us.preheader: ; preds = %for.cond4.preheader %conv18 = sext i32 %N to i64 %mul = shl nsw i64 %conv18, 2 %3 = shl nuw nsw i64 %wide.trip.count, 2 br label %if.end.i.us if.end.i.us: ; preds = %if.end.i.us.preheader, %for.inc35.us %4 = phi ptr [ %1, %if.end.i.us.preheader ], [ %9, %for.inc35.us ] %indvars.iv92 = phi i64 [ 0, %if.end.i.us.preheader ], [ %indvars.iv.next93, %for.inc35.us ] %5 = phi i64 [ %2, %if.end.i.us.preheader ], [ %10, %for.inc35.us ] %failure.078.us = phi i32 [ 1, %if.end.i.us.preheader ], [ %failure.1.us, %for.inc35.us ] %count.077.us = phi i64 [ 0, %if.end.i.us.preheader ], [ %count.1.us, %for.inc35.us ] %div26.i.us = lshr i64 %5, 1 %cmp3.not.i.us = icmp ult i64 %div26.i.us, %indvars.iv92 br i1 %cmp3.not.i.us, label %if.else.i.us, label %for.cond.preheader.i.us for.cond.preheader.i.us: ; preds = %if.end.i.us %obtained_elem.028.i.us = load ptr, ptr %4, align 8, !tbaa !11 %cmp529.not.i.us = icmp eq i64 %indvars.iv92, 0 br i1 %cmp529.not.i.us, label %int_list_get.exit.us, label %for.body.i.us.preheader for.body.i.us.preheader: ; preds = %for.cond.preheader.i.us %xtraiter = and i64 %indvars.iv92, 7 %6 = icmp ult i64 %indvars.iv92, 8 br i1 %6, label %int_list_get.exit.us.loopexit97.unr-lcssa, label %for.body.i.us.preheader.new for.body.i.us.preheader.new: ; preds = %for.body.i.us.preheader %unroll_iter = and i64 %indvars.iv92, -8 br label %for.body.i.us for.body.i.us: ; preds = %for.body.i.us, %for.body.i.us.preheader.new %obtained_elem.031.i.us = phi ptr [ %obtained_elem.028.i.us, %for.body.i.us.preheader.new ], [ %obtained_elem.0.i.us.7, %for.body.i.us ] %niter = phi i64 [ 0, %for.body.i.us.preheader.new ], [ %niter.next.7, %for.body.i.us ] %next.i.us = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.031.i.us, i64 0, i32 2 %obtained_elem.0.i.us = load ptr, ptr %next.i.us, align 8, !tbaa !11 %next.i.us.1 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us, i64 0, i32 2 %obtained_elem.0.i.us.1 = load ptr, ptr %next.i.us.1, align 8, !tbaa !11 %next.i.us.2 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us.1, i64 0, i32 2 %obtained_elem.0.i.us.2 = load ptr, ptr %next.i.us.2, align 8, !tbaa !11 %next.i.us.3 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us.2, i64 0, i32 2 %obtained_elem.0.i.us.3 = load ptr, ptr %next.i.us.3, align 8, !tbaa !11 %next.i.us.4 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us.3, i64 0, i32 2 %obtained_elem.0.i.us.4 = load ptr, ptr %next.i.us.4, align 8, !tbaa !11 %next.i.us.5 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us.4, i64 0, i32 2 %obtained_elem.0.i.us.5 = load ptr, ptr %next.i.us.5, align 8, !tbaa !11 %next.i.us.6 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us.5, i64 0, i32 2 %obtained_elem.0.i.us.6 = load ptr, ptr %next.i.us.6, align 8, !tbaa !11 %next.i.us.7 = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.0.i.us.6, i64 0, i32 2 %obtained_elem.0.i.us.7 = load ptr, ptr %next.i.us.7, align 8, !tbaa !11 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %int_list_get.exit.us.loopexit97.unr-lcssa, label %for.body.i.us, !llvm.loop !12 if.else.i.us: ; preds = %if.end.i.us %tail.i.us = getelementptr inbounds %struct.int_list_t, ptr %4, i64 0, i32 1 br label %for.cond7.i.us for.cond7.i.us: ; preds = %for.cond7.i.us, %if.else.i.us %i.1.in.i.us = phi i64 [ %5, %if.else.i.us ], [ %i.1.i.us, %for.cond7.i.us ] %obtained_elem.1.in.i.us = phi ptr [ %tail.i.us, %if.else.i.us ], [ %prev.i.us, %for.cond7.i.us ] %obtained_elem.1.i.us = load ptr, ptr %obtained_elem.1.in.i.us, align 8, !tbaa !11 %i.1.i.us = add i64 %i.1.in.i.us, -1 %cmp8.i.us = icmp ugt i64 %i.1.i.us, %indvars.iv92 %prev.i.us = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.1.i.us, i64 0, i32 1 br i1 %cmp8.i.us, label %for.cond7.i.us, label %int_list_get.exit.us, !llvm.loop !16 int_list_get.exit.us.loopexit97.unr-lcssa: ; preds = %for.body.i.us, %for.body.i.us.preheader %obtained_elem.0.i.us.lcssa.ph = phi ptr [ undef, %for.body.i.us.preheader ], [ %obtained_elem.0.i.us.7, %for.body.i.us ] %obtained_elem.031.i.us.unr = phi ptr [ %obtained_elem.028.i.us, %for.body.i.us.preheader ], [ %obtained_elem.0.i.us.7, %for.body.i.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %int_list_get.exit.us, label %for.body.i.us.epil for.body.i.us.epil: ; preds = %int_list_get.exit.us.loopexit97.unr-lcssa, %for.body.i.us.epil %obtained_elem.031.i.us.epil = phi ptr [ %obtained_elem.0.i.us.epil, %for.body.i.us.epil ], [ %obtained_elem.031.i.us.unr, %int_list_get.exit.us.loopexit97.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.us.epil ], [ 0, %int_list_get.exit.us.loopexit97.unr-lcssa ] %next.i.us.epil = getelementptr inbounds %struct.int_list_elem_t, ptr %obtained_elem.031.i.us.epil, i64 0, i32 2 %obtained_elem.0.i.us.epil = load ptr, ptr %next.i.us.epil, align 8, !tbaa !11 %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 %int_list_get.exit.us, label %for.body.i.us.epil, !llvm.loop !36 int_list_get.exit.us: ; preds = %int_list_get.exit.us.loopexit97.unr-lcssa, %for.body.i.us.epil, %for.cond7.i.us, %for.cond.preheader.i.us %obtained_elem.2.i.us = phi ptr [ %obtained_elem.028.i.us, %for.cond.preheader.i.us ], [ %obtained_elem.1.i.us, %for.cond7.i.us ], [ %obtained_elem.0.i.us.lcssa.ph, %int_list_get.exit.us.loopexit97.unr-lcssa ], [ %obtained_elem.0.i.us.epil, %for.body.i.us.epil ] %7 = load i32, ptr %obtained_elem.2.i.us, align 8, !tbaa !18 %idxprom13.us = sext i32 %7 to i64 %arrayidx14.us = getelementptr inbounds i32, ptr %pass, i64 %idxprom13.us %8 = load i32, ptr %arrayidx14.us, align 4, !tbaa !35 %cmp15.us = icmp eq i32 %8, 0 br i1 %cmp15.us, label %if.then17.us, label %for.inc35.us if.then17.us: ; preds = %int_list_get.exit.us %call19.us = tail call noalias ptr @malloc(i64 noundef %mul) #13 tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %call19.us, ptr nonnull align 4 %pass, i64 %3, i1 false), !tbaa !35 %arrayidx32.us = getelementptr inbounds i32, ptr %call19.us, i64 %idxprom13.us store i32 1, ptr %arrayidx32.us, align 4, !tbaa !35 %call33.us = tail call i64 @count_one_stroke_path(i32 noundef %N, ptr noundef %call19.us, ptr noundef %edge_list, i32 noundef %7) %add.us = add nsw i64 %call33.us, %count.077.us tail call void @free(ptr noundef %call19.us) #14 %.pre = load ptr, ptr %arrayidx6, align 8, !tbaa !11 br label %for.inc35.us for.inc35.us: ; preds = %if.then17.us, %int_list_get.exit.us %9 = phi ptr [ %.pre, %if.then17.us ], [ %4, %int_list_get.exit.us ] %count.1.us = phi i64 [ %add.us, %if.then17.us ], [ %count.077.us, %int_list_get.exit.us ] %failure.1.us = phi i32 [ 0, %if.then17.us ], [ %failure.078.us, %int_list_get.exit.us ] %indvars.iv.next93 = add nuw i64 %indvars.iv92, 1 %length.us = getelementptr inbounds %struct.int_list_t, ptr %9, i64 0, i32 2 %10 = load i64, ptr %length.us, align 8, !tbaa !5 %cmp7.us = icmp ugt i64 %10, %indvars.iv.next93 br i1 %cmp7.us, label %if.end.i.us, label %for.end37.loopexit, !llvm.loop !37 for.end37.loopexit: ; preds = %for.inc35.us %11 = icmp eq i32 %failure.1.us, 0 %12 = select i1 %11, i64 %count.1.us, i64 0 br label %cleanup cleanup: ; preds = %for.cond, %for.cond4.preheader, %for.end37.loopexit, %entry %retval.0 = phi i64 [ 1, %entry ], [ 0, %for.cond4.preheader ], [ %12, %for.end37.loopexit ], [ 1, %for.cond ] ret i64 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #14 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #14 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %M, align 4, !tbaa !35 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #13 %call4 = call noalias ptr @malloc(i64 noundef %mul) #13 %cmp126 = icmp sgt i32 %0, 0 br i1 %cmp126, 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 i32, ptr %call1, i64 %indvars.iv %arrayidx7 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx, ptr noundef %arrayidx7) %1 = load i32, ptr %arrayidx, align 4, !tbaa !35 %sub = add nsw i32 %1, -1 store i32 %sub, ptr %arrayidx, align 4, !tbaa !35 %2 = load i32, ptr %arrayidx7, align 4, !tbaa !35 %sub13 = add nsw i32 %2, -1 store i32 %sub13, ptr %arrayidx7, align 4, !tbaa !35 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %M, align 4, !tbaa !35 %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 !38 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ] %5 = load i32, ptr %N, align 4, !tbaa !35 %conv14 = sext i32 %5 to i64 %mul15 = shl nsw i64 %conv14, 3 %call16 = call noalias ptr @malloc(i64 noundef %mul15) #13 %cmp18128 = icmp slt i32 %5, 1 br i1 %cmp18128, label %for.end58, label %for.body20.preheader for.body20.preheader: ; preds = %for.end %wide.trip.count = zext i32 %5 to i64 br label %for.body20 for.cond27.preheader: ; preds = %for.body20 %cmp28132 = icmp slt i32 %.lcssa, 1 %brmerge = or i1 %cmp28132, %cmp18128 br i1 %brmerge, label %for.end58, label %for.cond31.preheader.us.preheader for.cond31.preheader.us.preheader: ; preds = %for.cond27.preheader %wide.trip.count150 = zext i32 %.lcssa to i64 %wide.trip.count145 = zext i32 %5 to i64 br label %for.cond31.preheader.us for.cond31.preheader.us: ; preds = %for.cond31.preheader.us.preheader, %for.cond31.for.inc56_crit_edge.us %indvars.iv147 = phi i64 [ 0, %for.cond31.preheader.us.preheader ], [ %indvars.iv.next148, %for.cond31.for.inc56_crit_edge.us ] %arrayidx36.us = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv147 %6 = load i32, ptr %arrayidx36.us, align 4, !tbaa !35 %arrayidx42.us = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv147 %7 = zext i32 %6 to i64 %arrayidx40.us = getelementptr inbounds ptr, ptr %call16, i64 %7 br label %for.body34.us for.body34.us: ; preds = %for.cond31.preheader.us, %for.inc53.us %indvars.iv142 = phi i64 [ 0, %for.cond31.preheader.us ], [ %indvars.iv.next143, %for.inc53.us ] %cmp37.us = icmp eq i64 %indvars.iv142, %7 br i1 %cmp37.us, label %if.then.us, label %for.body34.us.if.end.us_crit_edge for.body34.us.if.end.us_crit_edge: ; preds = %for.body34.us %.pre = load i32, ptr %arrayidx42.us, align 4, !tbaa !35 br label %if.end.us if.then.us: ; preds = %for.body34.us %8 = load ptr, ptr %arrayidx40.us, align 8, !tbaa !11 %length.i.us = getelementptr inbounds %struct.int_list_t, ptr %8, i64 0, i32 2 %9 = load i64, ptr %length.i.us, align 8, !tbaa !5 %cmp3.i.us = icmp eq i64 %9, -1 br i1 %cmp3.i.us, label %if.then4.i, label %if.end6.i.us if.end6.i.us: ; preds = %if.then.us %10 = load i32, ptr %arrayidx42.us, align 4, !tbaa !35 %call7.i.us = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #13 store i32 %10, ptr %call7.i.us, align 8, !tbaa !18 %prev.i.us = getelementptr inbounds %struct.int_list_elem_t, ptr %call7.i.us, i64 0, i32 1 store ptr null, ptr %prev.i.us, align 8, !tbaa !21 %11 = load ptr, ptr %8, align 8, !tbaa !22 %next.i.us = getelementptr inbounds %struct.int_list_elem_t, ptr %call7.i.us, i64 0, i32 2 store ptr %11, ptr %next.i.us, align 8, !tbaa !23 store ptr %call7.i.us, ptr %8, align 8, !tbaa !22 %cmp13.i.us = icmp eq ptr %11, null %tail.i.us = getelementptr inbounds %struct.int_list_t, ptr %8, i64 0, i32 1 %prev16.i.us = getelementptr inbounds %struct.int_list_elem_t, ptr %11, i64 0, i32 1 %tail.i.us.sink = select i1 %cmp13.i.us, ptr %tail.i.us, ptr %prev16.i.us store ptr %call7.i.us, ptr %tail.i.us.sink, align 8, !tbaa !11 %inc54.i.us = add nuw i64 %9, 1 store i64 %inc54.i.us, ptr %length.i.us, align 8, !tbaa !5 br label %if.end.us if.end.us: ; preds = %for.body34.us.if.end.us_crit_edge, %if.end6.i.us %12 = phi i32 [ %.pre, %for.body34.us.if.end.us_crit_edge ], [ %10, %if.end6.i.us ] %13 = zext i32 %12 to i64 %cmp45.us = icmp eq i64 %indvars.iv142, %13 br i1 %cmp45.us, label %if.then47.us, label %for.inc53.us if.then47.us: ; preds = %if.end.us %arrayidx49.us = getelementptr inbounds ptr, ptr %call16, i64 %indvars.iv142 %14 = load ptr, ptr %arrayidx49.us, align 8, !tbaa !11 %length.i110.us = getelementptr inbounds %struct.int_list_t, ptr %14, i64 0, i32 2 %15 = load i64, ptr %length.i110.us, align 8, !tbaa !5 %cmp3.i111.us = icmp eq i64 %15, -1 br i1 %cmp3.i111.us, label %if.then4.i122, label %if.end6.i112.us if.end6.i112.us: ; preds = %if.then47.us %call7.i113.us = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #13 store i32 %6, ptr %call7.i113.us, align 8, !tbaa !18 %prev.i114.us = getelementptr inbounds %struct.int_list_elem_t, ptr %call7.i113.us, i64 0, i32 1 store ptr null, ptr %prev.i114.us, align 8, !tbaa !21 %16 = load ptr, ptr %14, align 8, !tbaa !22 %next.i115.us = getelementptr inbounds %struct.int_list_elem_t, ptr %call7.i113.us, i64 0, i32 2 store ptr %16, ptr %next.i115.us, align 8, !tbaa !23 store ptr %call7.i113.us, ptr %14, align 8, !tbaa !22 %cmp13.i116.us = icmp eq ptr %16, null %tail.i121.us = getelementptr inbounds %struct.int_list_t, ptr %14, i64 0, i32 1 %prev16.i118.us = getelementptr inbounds %struct.int_list_elem_t, ptr %16, i64 0, i32 1 %tail.i121.us.sink = select i1 %cmp13.i116.us, ptr %tail.i121.us, ptr %prev16.i118.us store ptr %call7.i113.us, ptr %tail.i121.us.sink, align 8, !tbaa !11 %inc54.i119.us = add nuw i64 %15, 1 store i64 %inc54.i119.us, ptr %length.i110.us, align 8, !tbaa !5 br label %for.inc53.us for.inc53.us: ; preds = %if.end6.i112.us, %if.end.us %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1 %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145 br i1 %exitcond146.not, label %for.cond31.for.inc56_crit_edge.us, label %for.body34.us, !llvm.loop !39 for.cond31.for.inc56_crit_edge.us: ; preds = %for.inc53.us %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150 br i1 %exitcond151.not, label %for.end58, label %for.cond31.preheader.us, !llvm.loop !40 for.body20: ; preds = %for.body20.preheader, %for.body20 %indvars.iv139 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next140, %for.body20 ] %call.i = call noalias dereferenceable_or_null(24) ptr @calloc(i64 noundef 1, i64 noundef 24) #11 %arrayidx23 = getelementptr inbounds ptr, ptr %call16, i64 %indvars.iv139 store ptr %call.i, ptr %arrayidx23, align 8, !tbaa !11 %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1 %exitcond.not = icmp eq i64 %indvars.iv.next140, %wide.trip.count br i1 %exitcond.not, label %for.cond27.preheader, label %for.body20, !llvm.loop !41 if.then4.i: ; preds = %if.then.us %puts.i = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) call void @exit(i32 noundef 1) #12 unreachable if.then4.i122: ; preds = %if.then47.us %puts.i123 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) call void @exit(i32 noundef 1) #12 unreachable for.end58: ; preds = %for.cond31.for.inc56_crit_edge.us, %for.cond27.preheader, %for.end %call60 = call noalias ptr @calloc(i64 noundef %conv14, i64 noundef 4) #11 store i32 1, ptr %call60, align 4, !tbaa !35 %call62 = call i64 @count_one_stroke_path(i32 noundef %5, ptr noundef nonnull %call60, ptr noundef %call16, i32 noundef 0) %call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %call62) call void @free(ptr noundef %call1) #14 call void @free(ptr noundef %call4) #14 %17 = load i32, ptr %N, align 4, !tbaa !35 %cmp65134 = icmp sgt i32 %17, 0 br i1 %cmp65134, label %for.body67, label %for.end72 for.body67: ; preds = %for.end58, %int_list_delete.exit %indvars.iv152 = phi i64 [ %indvars.iv.next153, %int_list_delete.exit ], [ 0, %for.end58 ] %arrayidx69 = getelementptr inbounds ptr, ptr %call16, i64 %indvars.iv152 %18 = load ptr, ptr %arrayidx69, align 8, !tbaa !11 %length.i125 = getelementptr inbounds %struct.int_list_t, ptr %18, i64 0, i32 2 %19 = load i64, ptr %length.i125, align 8, !tbaa !5 %tobool.not3.i = icmp eq i64 %19, 0 br i1 %tobool.not3.i, label %int_list_delete.exit, label %if.end.i.lr.ph.i if.end.i.lr.ph.i: ; preds = %for.body67 %tail.i.i = getelementptr inbounds %struct.int_list_t, ptr %18, i64 0, i32 1 br label %if.end.i.i if.end.i.i: ; preds = %if.end.i.i, %if.end.i.lr.ph.i %20 = load ptr, ptr %18, align 8, !tbaa !22 %next.i.i = getelementptr inbounds %struct.int_list_elem_t, ptr %20, i64 0, i32 2 %21 = load ptr, ptr %next.i.i, align 8, !tbaa !23 store ptr %21, ptr %18, align 8, !tbaa !22 %cmp7.i.i = icmp eq ptr %21, null %prev.i.i = getelementptr inbounds %struct.int_list_elem_t, ptr %21, i64 0, i32 1 %tail.i.sink.i = select i1 %cmp7.i.i, ptr %tail.i.i, ptr %prev.i.i store ptr null, ptr %tail.i.sink.i, align 8, !tbaa !11 call void @free(ptr noundef nonnull %20) #14 %22 = load i64, ptr %length.i125, align 8, !tbaa !5 %dec48.i.i = add i64 %22, -1 store i64 %dec48.i.i, ptr %length.i125, align 8, !tbaa !5 %tobool.not.i = icmp eq i64 %dec48.i.i, 0 br i1 %tobool.not.i, label %int_list_delete.exit, label %if.end.i.i, !llvm.loop !33 int_list_delete.exit: ; preds = %if.end.i.i, %for.body67 call void @free(ptr noundef nonnull %18) #14 %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1 %23 = load i32, ptr %N, align 4, !tbaa !35 %24 = sext i32 %23 to i64 %cmp65 = icmp slt i64 %indvars.iv.next153, %24 br i1 %cmp65, label %for.body67, label %for.end72, !llvm.loop !42 for.end72: ; preds = %int_list_delete.exit, %for.end58 call void @free(ptr noundef %call16) #14 call void @free(ptr noundef %call60) #14 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #14 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #14 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 ; Function Attrs: 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) #10 attributes #0 = { mustprogress nofree nounwind willreturn memory(inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { nofree nounwind "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { 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 #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind } attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #11 = { nounwind allocsize(0,1) } attributes #12 = { noreturn nounwind } attributes #13 = { nounwind allocsize(0) } attributes #14 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE 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 16} !6 = !{!"int_list_t", !7, i64 0, !7, i64 8, !10, i64 16} !7 = !{!"any pointer", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"long", !8, i64 0} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !13} !17 = distinct !{!17, !15} !18 = !{!19, !20, i64 0} !19 = !{!"int_list_elem_t", !20, i64 0, !7, i64 8, !7, i64 16} !20 = !{!"int", !8, i64 0} !21 = !{!19, !7, i64 8} !22 = !{!6, !7, i64 0} !23 = !{!19, !7, i64 16} !24 = !{!6, !7, i64 8} !25 = distinct !{!25, !13} !26 = distinct !{!26, !15} !27 = distinct !{!27, !13} !28 = distinct !{!28, !15} !29 = distinct !{!29, !13} !30 = distinct !{!30, !15} !31 = distinct !{!31, !13} !32 = distinct !{!32, !15} !33 = distinct !{!33, !13} !34 = distinct !{!34, !13} !35 = !{!20, !20, i64 0} !36 = distinct !{!36, !15} !37 = distinct !{!37, !13} !38 = distinct !{!38, !13} !39 = distinct !{!39, !13} !40 = distinct !{!40, !13} !41 = distinct !{!41, !13} !42 = distinct !{!42, !13}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> #include<ctype.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<60) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 20) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 #define PI 3.141592653589793238 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} void cin(ll *n){ scanf("%lld",&(*n)); } ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} double POW_d(double a, double b){double c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;} ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); } ll digits(ll a, ll b){return a/b?1+digits(a/b,b):1;} ll base(ll n, ll a, ll i){return i==1?n%a:base(n/a,a,i-1);} void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); } int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; } int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; } // return smallest p which meets a[p]==val :1 >=:2 >:3 ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; } // return biggest p which meets a[p]==val :1 <=:2 <:3 ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; } // count i which meets ai==x ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; } ll *factors[2] , fac_cnt=0 , is_factor_prepared=0; ll factor_pre(){ rep(i,0,1){ if(is_factor_prepared++) return 0; } ll tmp=(1e6)/2+1, fac_tmp[tmp]; rep(i,0,tmp){fac_tmp[i]=i?2*i+1:2;} rep(i,1,tmp){if(fac_tmp[i]){ repp(j,3,tmp/(2*i+1)+1,2 ){ if( j*(2*i+1)<tmp ) fac_tmp[ (j*(2*i+1)-1)/2 ]=0; } }else continue;} rep(i,0,tmp){if(fac_tmp[i]){ rep(j,0,2){ factors[j] = realloc( factors[j] , sizeof(ll)*( fac_cnt +1 ) ); factors[j][j?fac_cnt++:fac_cnt]=j?0:fac_tmp[i]; } } } return 0; } ll factor(ll n, ll new_common_plus){ factor_pre(); rep(i,0,fac_cnt){ ll cnt=0; rep(j,0,1){ while( ( cnt+= n %factors[0][i]==0 ? 1 : 0 ) && (n/=factors[0][i]) %factors[0][i]==0 ) continue; } factors[1][i]= new_common_plus==1 ? cnt : new_common_plus==2 ? max2(factors[1][i],cnt) : factors[1][i]+cnt ; if( factors[0][i]> n ) break; } return n; } ll judge_prime(ll n){ factor_pre(); rep(i,0,fac_cnt){ if(n<factors[0][i]*factors[0][i] || n==factors[0][i]) break; else if(n%factors[0][i]==0) n/=n; } return n==1?0:1; } ll *mf_arr,*inv_arr,*finv_arr,is_minv_made=0,is_mf_made=0; ll makeinv(ll n , ll mod){ rep(i,0,1){if(is_minv_made++) return 0;} inv_arr = realloc(inv_arr, sizeof(ll)*2 ); finv_arr = realloc(finv_arr, sizeof(ll)*2 ); inv_arr[1]=1;finv_arr[0]=finv_arr[1]=1; rep(i,2,n+1){ inv_arr = realloc(inv_arr, sizeof(ll)*(i+1) ); finv_arr = realloc(finv_arr, sizeof(ll)*(i+1) ); inv_arr[i]= mod - inv_arr[mod%i] * (mod / i) % mod; finv_arr[i] = finv_arr[i - 1] * inv_arr[i] % mod; } return 0; } ll make_mf(ll n, ll mod){ rep(i,0,1){ if(is_mf_made++) return 0; } mf_arr = realloc(mf_arr, sizeof(ll)*2 ); ll x=1; mf_arr[0]=mf_arr[1]=x; rep(i,2,n+1){ x=x*i%mod; mf_arr = realloc(mf_arr, sizeof(ll)*(i+1) ); mf_arr[i]=x; } return 0; } ll m_inv(ll x, ll mod, ll is_fac ){ makeinv(2*1e6+10,mod); return is_fac?finv_arr[x]:inv_arr[x]; } ll m_f(ll x, ll mod){ make_mf(2*1e6+10,mod); return mf_arr[x]; } // ll mod_nck(ll n, ll k, ll mod){ return m_f[n]*finv_arr[k]%mod*finv_arr[n-k]%mod; } ll m_p(ll r,ll n,ll mod){ ll t=1,s=r; while(n>0){ t = (n&1) ? t*s%mod : t; s=s*s%mod; n>>=1; } return r?t:0; } ll m_mul2(ll a, ll b, ll mod){ return a*b%mod; } ll m_mul3(ll a, ll b, ll c, ll mod){ return m_mul2(a*b%mod,c,mod); } ll m_mul4(ll a, ll b, ll c, ll d, ll mod){ return m_mul3(a*b%mod,c,d,mod); } ll m_mul5(ll a, ll b, ll c, ll d, ll e, ll mod){ return m_mul4(a*b%mod,c,d,e,mod); } int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort ); int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); } void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); } ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; } ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; } typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;} int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;} void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} // char s[1151154]; int main(void){ // fgets(s,sizeof(s),stdin); ll n; ll ans=0; cin(&n); // scanf("%s",s); ll a[n],x[15][15],y[15][15]; rep(i,0,n){ cin(&a[i]); rep(j,0,a[i]){ cin(&x[i][j]); cin(&y[i][j]); } } rep(i,0,1<<n){ rep(j,0,n){ if(!base(i,2,j+1)) goto TTT; rep(k,0,a[j]){ if( base(i,2, x[j][k] ) != y[j][k] ){ goto FFF; } } TTT:; if(j==n-1){ ans=max2(ans,__builtin_popcount(i)); } } FFF:; } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281178/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281178/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @fac_cnt = dso_local local_unnamed_addr global i64 0, align 8 @is_factor_prepared = dso_local local_unnamed_addr global i64 0, align 8 @factors = dso_local local_unnamed_addr global [2 x ptr] zeroinitializer, align 16 @is_minv_made = dso_local local_unnamed_addr global i64 0, align 8 @is_mf_made = dso_local local_unnamed_addr global i64 0, align 8 @inv_arr = dso_local local_unnamed_addr global ptr null, align 8 @finv_arr = dso_local local_unnamed_addr global ptr null, align 8 @mf_arr = dso_local local_unnamed_addr global ptr null, align 8 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 { entry: %cmp4 = icmp sgt i64 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi7 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi7, <2 x i64> %wide.load8) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %i.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.05.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader9, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ %i.06.ph, %for.body.preheader9 ] %b.05 = phi i64 [ %cond.i, %for.body ], [ %b.05.ph, %for.body.preheader9 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.06 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.05, i64 %6) %inc = add nuw nsw i64 %i.06, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local double @POW_d(double noundef %a, double noundef %b) local_unnamed_addr #6 { entry: %cmp4 = fcmp ogt double %b, 0.000000e+00 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %c.0.lcssa = phi double [ 1.000000e+00, %entry ], [ %mul, %for.body ] ret double %c.0.lcssa for.body: ; preds = %entry, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %c.05 = phi double [ %mul, %for.body ], [ 1.000000e+00, %entry ] %mul = fmul double %c.05, %a %inc = add nuw nsw i64 %i.06, 1 %conv = sitofp i64 %inc to double %cmp = fcmp olt double %conv, %b br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #7 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %div7 = sdiv i64 %n, %p %add = sub i64 1, %div7 %mul = mul nsw i64 %add, %p br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, %p ret i64 %rem } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #8 { entry: %tobool.not11 = icmp eq i64 %p, 0 br i1 %tobool.not11, label %cond.end, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %p, -2 br label %cond.false cond.false: ; preds = %cond.false.preheader, %POW.exit %indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ] %p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ] %accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ] %1 = xor i64 %indvar, -1 %2 = add i64 %1, %p %sub = add nsw i64 %p.tr13, -1 %cmp3.i = icmp sgt i64 %p.tr13, 1 br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit for.body.i.preheader: ; preds = %cond.false %3 = sub i64 %0, %indvar %xtraiter = and i64 %2, 7 %4 = icmp ult i64 %3, 7 br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %2, -8 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ] %mul.i.7 = mul i64 %c.04.i, 100000000 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18 POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil %c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ] %mul.i.epil = mul nsw i64 %c.04.i.epil, 10 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %POW.exit, label %for.body.i.epil, !llvm.loop !20 POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false %c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ] %sub1 = sub nsw i64 %len, %p.tr13 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1 %5 = load i8, ptr %arrayidx, align 1, !tbaa !21 %conv = sext i8 %5 to i64 %sub2 = add nsw i64 %conv, -48 %mul = mul nsw i64 %sub2, %c.0.lcssa.i %add = add nsw i64 %mul, %accumulator.tr12 %tobool.not = icmp eq i64 %sub, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool.not, label %cond.end, label %cond.false cond.end: ; preds = %POW.exit, %entry %accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ] ret i64 %accumulator.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @digits(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %accumulator.tr = phi i64 [ 0, %entry ], [ %add, %tailrecurse ] %a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse ] %div = sdiv i64 %a.tr, %b %tobool.not = icmp eq i64 %div, 0 %add = add nuw nsw i64 %accumulator.tr, 1 br i1 %tobool.not, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i64 %add } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @base(i64 noundef %n, i64 noundef %a, i64 noundef %i) local_unnamed_addr #6 { entry: %cmp5 = icmp eq i64 %i, 1 br i1 %cmp5, label %cond.true, label %cond.false.preheader cond.false.preheader: ; preds = %entry %0 = add i64 %i, 3 %1 = add i64 %i, -2 %xtraiter = and i64 %0, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cond.false.prol.loopexit, label %cond.false.prol cond.false.prol: ; preds = %cond.false.preheader, %cond.false.prol %i.tr7.prol = phi i64 [ %sub.prol, %cond.false.prol ], [ %i, %cond.false.preheader ] %n.tr6.prol = phi i64 [ %div.prol, %cond.false.prol ], [ %n, %cond.false.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %cond.false.prol ], [ 0, %cond.false.preheader ] %div.prol = sdiv i64 %n.tr6.prol, %a %sub.prol = add nsw i64 %i.tr7.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %cond.false.prol.loopexit, label %cond.false.prol, !llvm.loop !22 cond.false.prol.loopexit: ; preds = %cond.false.prol, %cond.false.preheader %div.lcssa.unr = phi i64 [ undef, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %i.tr7.unr = phi i64 [ %i, %cond.false.preheader ], [ %sub.prol, %cond.false.prol ] %n.tr6.unr = phi i64 [ %n, %cond.false.preheader ], [ %div.prol, %cond.false.prol ] %2 = icmp ult i64 %1, 3 br i1 %2, label %cond.true, label %cond.false cond.true: ; preds = %cond.false.prol.loopexit, %cond.false, %entry %n.tr.lcssa = phi i64 [ %n, %entry ], [ %div.lcssa.unr, %cond.false.prol.loopexit ], [ %div.3, %cond.false ] %rem = srem i64 %n.tr.lcssa, %a ret i64 %rem cond.false: ; preds = %cond.false.prol.loopexit, %cond.false %i.tr7 = phi i64 [ %sub.3, %cond.false ], [ %i.tr7.unr, %cond.false.prol.loopexit ] %n.tr6 = phi i64 [ %div.3, %cond.false ], [ %n.tr6.unr, %cond.false.prol.loopexit ] %div = sdiv i64 %n.tr6, %a %div.1 = sdiv i64 %div, %a %div.2 = sdiv i64 %div.1, %a %div.3 = sdiv i64 %div.2, %a %sub.3 = add nsw i64 %i.tr7, -4 %cmp.3 = icmp eq i64 %sub.3, 1 br i1 %cmp.3, label %cond.true, label %cond.false } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !23 %1 = load i32, ptr %r, align 4, !tbaa !23 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %cmp1 = icmp slt i64 %am, %val %l.r = select i1 %cmp1, ptr %l, ptr %r %cmp6.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp6.not, ptr %r, ptr %l %l.sink = select i1 %cmp, ptr %l.r, ptr %r.l store i32 %div, ptr %l.sink, align 4, !tbaa !23 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 { entry: %cmp = icmp slt i32 %type, 3 %0 = load i32, ptr %l, align 4, !tbaa !23 %1 = load i32, ptr %r, align 4, !tbaa !23 %add3 = add nsw i32 %1, %0 %div4 = sdiv i32 %add3, 2 %cmp1.not = icmp sgt i64 %am, %val %r.l = select i1 %cmp1.not, ptr %r, ptr %l %cmp6 = icmp slt i64 %am, %val %l.r = select i1 %cmp6, ptr %l, ptr %r %l.sink = select i1 %cmp, ptr %r.l, ptr %l.r store i32 %div4, ptr %l.sink, align 4, !tbaa !23 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sge i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp sgt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 { entry: switch i32 %type, label %cond.false6 [ i32 1, label %cond.true i32 2, label %cond.true3 ] cond.true: ; preds = %entry %cmp1 = icmp eq i64 %a, %b br label %cond.end10 cond.true3: ; preds = %entry %cmp4.not = icmp sle i64 %a, %b br label %cond.end10 cond.false6: ; preds = %entry %cmp7 = icmp slt i64 %a, %b br label %cond.end10 cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true %cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ] %cond11 = zext i1 %cond11.in to i32 ret i32 %cond11 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub34 = sub nsw i32 %r, %l %cmp35 = icmp sgt i32 %sub34, 1 br i1 %cmp35, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.i.us = icmp slt i64 %0, %val %spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0 %spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us %sub.us = sub nsw i32 %spec.select51, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !25 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.not.i = icmp sgt i64 %1, %val %spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div %spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2 %sub = sub nsw i32 %spec.select53, %spec.select52 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !25 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ] %idxprom1 = sext i32 %l.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_lower.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i17 = icmp eq i64 %2, %val br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom345 = sext i32 %r.addr.0..lcssa to i64 %arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345 %3 = load i64, ptr %arrayidx446, align 8, !tbaa !5 %cmp1.i23 = icmp eq i64 %3, %val br label %cmp_lower.exit26 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp slt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9 cond.false.thread47: ; preds = %cond.true3.i %idxprom348 = sext i32 %r.addr.0..lcssa to i64 %arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348 %4 = load i64, ptr %arrayidx449, align 8, !tbaa !5 %cmp4.not.i19 = icmp sge i64 %4, %val br label %cmp_lower.exit26 cmp_lower.exit: ; preds = %while.end %cmp7.i = icmp sgt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_lower.exit %idxprom3 = sext i32 %r.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i25 = icmp sgt i64 %5, %val br label %cmp_lower.exit26 cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false %cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ] %6 = sext i32 %r.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i20, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 { entry: %sub33 = sub nsw i32 %r, %l %cmp34 = icmp sgt i32 %sub33, 1 br i1 %cmp34, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %entry %cmp.i = icmp slt i32 %type, 3 br i1 %cmp.i, label %while.body.us, label %while.body while.body.us: ; preds = %while.body.lr.ph, %while.body.us %l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ] %r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ] %add.us = add nsw i32 %l.addr.0, %r.addr.0 %div.us = sdiv i32 %add.us, 2 %idxprom.us = sext i32 %div.us to i64 %arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us %0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5 %cmp1.not.i.us = icmp sgt i64 %0, %val %spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us %spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0 %sub.us = sub nsw i32 %spec.select50, %spec.select %cmp.us = icmp sgt i32 %sub.us, 1 br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !26 while.body: ; preds = %while.body.lr.ph, %while.body %l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ] %r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ] %add = add nsw i32 %l.addr.2, %r.addr.2 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6.i = icmp slt i64 %1, %val %spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2 %spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div %sub = sub nsw i32 %spec.select52, %spec.select51 %cmp = icmp sgt i32 %sub, 1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !26 while.end: ; preds = %while.body, %while.body.us, %entry %r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ] %l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ] %idxprom1 = sext i32 %r.addr.0..lcssa to i64 %arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1 %2 = load i64, ptr %arrayidx2, align 8, !tbaa !5 switch i32 %type, label %cmp_upper.exit [ i32 1, label %cond.true.i i32 2, label %cond.true3.i ] cond.true.i: ; preds = %while.end %cmp1.i = icmp eq i64 %2, %val br i1 %cmp1.i, label %cond.end9, label %cond.false.thread cond.false.thread: ; preds = %cond.true.i %idxprom344 = sext i32 %l.addr.0..lcssa to i64 %arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344 %3 = load i64, ptr %arrayidx445, align 8, !tbaa !5 %cmp1.i22 = icmp eq i64 %3, %val br label %cmp_upper.exit25 cond.true3.i: ; preds = %while.end %cmp4.not.i.not = icmp sgt i64 %2, %val br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9 cond.false.thread46: ; preds = %cond.true3.i %idxprom347 = sext i32 %l.addr.0..lcssa to i64 %arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347 %4 = load i64, ptr %arrayidx448, align 8, !tbaa !5 %cmp4.not.i18 = icmp sle i64 %4, %val br label %cmp_upper.exit25 cmp_upper.exit: ; preds = %while.end %cmp7.i = icmp slt i64 %2, %val br i1 %cmp7.i, label %cond.end9, label %cond.false cond.false: ; preds = %cmp_upper.exit %idxprom3 = sext i32 %l.addr.0..lcssa to i64 %arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %cmp7.i24 = icmp slt i64 %5, %val br label %cmp_upper.exit25 cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false %cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ] %6 = sext i32 %l.addr.0..lcssa to i64 %.pre = select i1 %cond11.in.i19, i64 %6, i64 -1 br label %cond.end9 cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25 %conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ] ret i64 %conv.pre-phi } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #8 { entry: %sub34.i = sub nsw i32 %r, %l %cmp35.i = icmp sgt i32 %sub34.i, 1 br i1 %cmp35.i, label %while.body.us.i, label %while.end.i while.body.us.i: ; preds = %entry, %while.body.us.i %l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ] %r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ] %add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i %div.us.i = sdiv i32 %add.us.i, 2 %idxprom.us.i = sext i32 %div.us.i to i64 %arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i %0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5 %cmp1.i.us.i = icmp slt i64 %0, %x %spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i %spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i %sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i %cmp.us.i = icmp sgt i32 %sub.us.i, 1 br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !25 while.end.i: ; preds = %while.body.us.i, %entry %r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ] %l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ] %idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64 %arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i %1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5 %cmp1.i17.i = icmp eq i64 %1, %x br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i cond.false.thread.i: ; preds = %while.end.i %idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64 %arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i %2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5 %cmp1.i23.i = icmp eq i64 %2, %x %.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1 br label %lower_bound.exit lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i %conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ] %conv = trunc i64 %conv.pre-phi.i to i32 %cmp = icmp eq i32 %conv, -1 br i1 %cmp, label %cond.end, label %cond.false cond.false: ; preds = %lower_bound.exit %sub33.i = sub nsw i32 %r, %conv %cmp34.i = icmp sgt i32 %sub33.i, 1 br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9 while.body.us.i18: ; preds = %cond.false, %while.body.us.i18 %l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ] %r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ] %add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19 %div.us.i22 = sdiv i32 %add.us.i21, 2 %idxprom.us.i23 = sext i32 %div.us.i22 to i64 %arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23 %3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5 %cmp1.not.i.us.i = icmp sgt i64 %3, %x %spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22 %spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20 %sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25 %cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1 br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !26 while.end.i9: ; preds = %while.body.us.i18, %cond.false %r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ] %l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ] %idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64 %arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12 %4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5 %cmp1.i.i = icmp eq i64 %4, %x br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14 cond.false.thread.i14: ; preds = %while.end.i9 %idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64 %arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i %5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5 %cmp1.i22.i = icmp eq i64 %5, %x %.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1 br label %upper_bound.exit upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14 %conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ] %reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i %add = add nsw i64 %reass.sub, 1 br label %cond.end cond.end: ; preds = %lower_bound.exit, %upper_bound.exit %cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ] ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @factor_pre() local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_factor_prepared, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_factor_prepared, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.body6.peel.next, label %return for.body6.peel.next: ; preds = %entry %1 = tail call ptr @llvm.stacksave.p0() %vla116 = alloca [500001 x i64], align 16 store i64 2, ptr %vla116, align 16, !tbaa !5 br label %vector.body vector.body: ; preds = %vector.body, %for.body6.peel.next %index = phi i64 [ 0, %for.body6.peel.next ], [ %index.next.1, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 1, i64 2>, %for.body6.peel.next ], [ %vec.ind.next.1, %vector.body ] %offset.idx = or i64 %index, 1 %2 = shl nuw nsw <2 x i64> %vec.ind, <i64 1, i64 1> %step.add = shl <2 x i64> %vec.ind, <i64 1, i64 1> %3 = or <2 x i64> %2, <i64 1, i64 1> %4 = add <2 x i64> %step.add, <i64 5, i64 5> %5 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx store <2 x i64> %3, ptr %5, align 8, !tbaa !5 %6 = getelementptr inbounds i64, ptr %5, i64 2 store <2 x i64> %4, ptr %6, align 8, !tbaa !5 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %offset.idx.1 = or i64 %index, 5 %7 = shl nuw nsw <2 x i64> %vec.ind.next, <i64 1, i64 1> %step.add.1 = shl <2 x i64> %vec.ind.next, <i64 1, i64 1> %8 = or <2 x i64> %7, <i64 1, i64 1> %9 = add <2 x i64> %step.add.1, <i64 5, i64 5> %10 = getelementptr inbounds i64, ptr %vla116, i64 %offset.idx.1 store <2 x i64> %8, ptr %10, align 8, !tbaa !5 %11 = getelementptr inbounds i64, ptr %10, i64 2 store <2 x i64> %9, ptr %11, align 8, !tbaa !5 %index.next.1 = add nuw nsw i64 %index, 8 %vec.ind.next.1 = add <2 x i64> %vec.ind, <i64 8, i64 8> %12 = icmp eq i64 %index.next.1, 500000 br i1 %12, label %for.body16, label %vector.body, !llvm.loop !27 for.body16: ; preds = %vector.body, %for.inc43 %i12.0124 = phi i64 [ %inc44, %for.inc43 ], [ 1, %vector.body ] %arrayidx17 = getelementptr inbounds i64, ptr %vla116, i64 %i12.0124 %13 = load i64, ptr %arrayidx17, align 8, !tbaa !5 %tobool18.not = icmp eq i64 %13, 0 br i1 %tobool18.not, label %for.inc43, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.body16 %mul21 = shl nuw nsw i64 %i12.0124, 1 %add22 = or i64 %mul21, 1 %div = udiv i64 500001, %add22 %cmp24.not122 = icmp ugt i64 %add22, 166667 br i1 %cmp24.not122, label %for.inc43, label %for.body26 for.body26: ; preds = %for.cond20.preheader, %for.inc38 %j.0123 = phi i64 [ %add39, %for.inc38 ], [ 3, %for.cond20.preheader ] %mul29 = mul nuw nsw i64 %j.0123, %add22 %cmp30 = icmp ult i64 %mul29, 500001 br i1 %cmp30, label %if.then31, label %for.inc38 if.then31: ; preds = %for.body26 %14 = trunc i64 %mul29 to i32 %div35.lhs.trunc = add nsw i32 %14, -1 %div35120 = sdiv i32 %div35.lhs.trunc, 2 %div35.sext = zext i32 %div35120 to i64 %arrayidx36 = getelementptr inbounds i64, ptr %vla116, i64 %div35.sext store i64 0, ptr %arrayidx36, align 8, !tbaa !5 br label %for.inc38 for.inc38: ; preds = %for.body26, %if.then31 %add39 = add nuw nsw i64 %j.0123, 2 %cmp24.not = icmp ugt i64 %add39, %div br i1 %cmp24.not, label %for.inc43, label %for.body26, !llvm.loop !29 for.inc43: ; preds = %for.inc38, %for.cond20.preheader, %for.body16 %inc44 = add nuw nsw i64 %i12.0124, 1 %exitcond128.not = icmp eq i64 %inc44, 500001 br i1 %exitcond128.not, label %for.body51, label %for.body16, !llvm.loop !30 for.cond.cleanup50: ; preds = %for.inc83 tail call void @llvm.stackrestore.p0(ptr %1) br label %return for.body51: ; preds = %for.inc43, %for.inc83 %i47.0126 = phi i64 [ %inc84, %for.inc83 ], [ 0, %for.inc43 ] %arrayidx52 = getelementptr inbounds i64, ptr %vla116, i64 %i47.0126 %15 = load i64, ptr %arrayidx52, align 8, !tbaa !5 %tobool53.not = icmp eq i64 %15, 0 br i1 %tobool53.not, label %for.inc83, label %cond.end75.1 cond.end75.1: ; preds = %for.body51 %16 = load ptr, ptr @factors, align 16, !tbaa !31 %17 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %add61 = shl i64 %17, 3 %mul62 = add i64 %add61, 8 %call = tail call ptr @realloc(ptr noundef %16, i64 noundef %mul62) #20 store ptr %call, ptr @factors, align 16, !tbaa !31 %18 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77 = getelementptr inbounds i64, ptr %call, i64 %18 store i64 %15, ptr %arrayidx77, align 8, !tbaa !5 %19 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !31 %add61.1 = shl i64 %18, 3 %mul62.1 = add i64 %add61.1, 8 %call.1 = tail call ptr @realloc(ptr noundef %19, i64 noundef %mul62.1) #20 store ptr %call.1, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8, !tbaa !31 %20 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %inc73.1 = add nsw i64 %20, 1 store i64 %inc73.1, ptr @fac_cnt, align 8, !tbaa !5 %arrayidx77.1 = getelementptr inbounds i64, ptr %call.1, i64 %20 store i64 0, ptr %arrayidx77.1, align 8, !tbaa !5 br label %for.inc83 for.inc83: ; preds = %cond.end75.1, %for.body51 %inc84 = add nuw nsw i64 %i47.0126, 1 %exitcond129.not = icmp eq i64 %inc84, 500001 br i1 %exitcond129.not, label %for.cond.cleanup50, label %for.body51, !llvm.loop !33 return: ; preds = %entry, %for.cond.cleanup50 ret i64 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #11 ; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #12 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #11 ; Function Attrs: nounwind uwtable define dso_local i64 @factor(i64 noundef %n, i64 noundef %new_common_plus) local_unnamed_addr #10 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp52 = icmp sgt i64 %0, 0 br i1 %cmp52, label %for.cond1.preheader.lr.ph, label %cleanup30 for.cond1.preheader.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !31 %2 = load ptr, ptr getelementptr inbounds ([2 x ptr], ptr @factors, i64 0, i64 1), align 8 br label %for.cond1.preheader for.cond: ; preds = %cond.end22 %inc29 = add nuw nsw i64 %i.054, 1 %3 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp = icmp slt i64 %inc29, %3 br i1 %cmp, label %for.cond1.preheader, label %cleanup30, !llvm.loop !34 for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond %i.054 = phi i64 [ 0, %for.cond1.preheader.lr.ph ], [ %inc29, %for.cond ] %n.addr.053 = phi i64 [ %n, %for.cond1.preheader.lr.ph ], [ %n.addr.3, %for.cond ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.054 %4 = load i64, ptr %arrayidx, align 8, !tbaa !5 br label %while.cond while.cond: ; preds = %for.cond1.preheader, %land.rhs %n.addr.2 = phi i64 [ %div, %land.rhs ], [ %n.addr.053, %for.cond1.preheader ] %cnt.1 = phi i64 [ %add, %land.rhs ], [ 0, %for.cond1.preheader ] %rem = srem i64 %n.addr.2, %4 %div = sdiv i64 %n.addr.2, %4 %cmp5 = icmp eq i64 %rem, 0 %conv = zext i1 %cmp5 to i64 %add = add nuw nsw i64 %cnt.1, %conv %tobool.not = icmp eq i64 %add, 0 br i1 %tobool.not, label %for.inc, label %land.rhs land.rhs: ; preds = %while.cond %rem8 = srem i64 %div, %4 %cmp9 = icmp eq i64 %rem8, 0 br i1 %cmp9, label %while.cond, label %for.inc, !llvm.loop !35 for.inc: ; preds = %land.rhs, %while.cond %n.addr.3 = phi i64 [ %div, %land.rhs ], [ %n.addr.2, %while.cond ] switch i64 %new_common_plus, label %cond.false18 [ i64 1, label %cond.end22 i64 2, label %cond.true15 ] cond.true15: ; preds = %for.inc %arrayidx16 = getelementptr inbounds i64, ptr %2, i64 %i.054 %5 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %5, i64 %add) br label %cond.end22 cond.false18: ; preds = %for.inc %arrayidx19 = getelementptr inbounds i64, ptr %2, i64 %i.054 %6 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %add20 = add nsw i64 %6, %add br label %cond.end22 cond.end22: ; preds = %for.inc, %cond.true15, %cond.false18 %cond23 = phi i64 [ %cond.i, %cond.true15 ], [ %add20, %cond.false18 ], [ %add, %for.inc ] %arrayidx24 = getelementptr inbounds i64, ptr %2, i64 %i.054 store i64 %cond23, ptr %arrayidx24, align 8, !tbaa !5 %7 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp26.not = icmp sgt i64 %7, %n.addr.3 br i1 %cmp26.not, label %cleanup30, label %for.cond cleanup30: ; preds = %cond.end22, %for.cond, %entry %n.addr.4 = phi i64 [ %n, %entry ], [ %n.addr.3, %for.cond ], [ %n.addr.3, %cond.end22 ] ret i64 %n.addr.4 } ; Function Attrs: nounwind uwtable define dso_local i64 @judge_prime(i64 noundef %n) local_unnamed_addr #10 { entry: %call = tail call i64 @factor_pre() %0 = load i64, ptr @fac_cnt, align 8, !tbaa !5 %cmp20 = icmp sgt i64 %0, 0 br i1 %cmp20, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @factors, align 16, !tbaa !31 br label %for.body for.body: ; preds = %for.body.lr.ph, %if.else %i.022 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %if.else ] %n.addr.021 = phi i64 [ %n, %for.body.lr.ph ], [ %spec.select, %if.else ] %arrayidx = getelementptr inbounds i64, ptr %1, i64 %i.022 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %mul = mul nsw i64 %2, %2 %cmp2 = icmp slt i64 %n.addr.021, %mul %cmp4 = icmp eq i64 %n.addr.021, %2 %or.cond = or i1 %cmp4, %cmp2 br i1 %or.cond, label %cleanup, label %if.else if.else: ; preds = %for.body %rem = srem i64 %n.addr.021, %2 %cmp6 = icmp eq i64 %rem, 0 %spec.select = select i1 %cmp6, i64 1, i64 %n.addr.021 %inc = add nuw nsw i64 %i.022, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !36 cleanup: ; preds = %if.else, %for.body, %entry %n.addr.0.lcssa = phi i64 [ %n, %entry ], [ %n.addr.021, %for.body ], [ %spec.select, %if.else ] %cmp9 = icmp ne i64 %n.addr.0.lcssa, 1 %conv = zext i1 %cmp9 to i64 ret i64 %conv } ; Function Attrs: nounwind uwtable define dso_local i64 @makeinv(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_minv_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_minv_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #20 store ptr %call, ptr @inv_arr, align 8, !tbaa !31 %2 = load ptr, ptr @finv_arr, align 8, !tbaa !31 %call2 = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %2, i64 noundef 16) #20 store ptr %call2, ptr @finv_arr, align 8, !tbaa !31 %3 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %arrayidx = getelementptr inbounds i64, ptr %3, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 %arrayidx3 = getelementptr inbounds i64, ptr %call2, i64 1 store i64 1, ptr %arrayidx3, align 8, !tbaa !5 store i64 1, ptr %call2, align 8, !tbaa !5 %cmp7.not43 = icmp slt i64 %n, 2 br i1 %cmp7.not43, label %return, label %for.body9 for.body9: ; preds = %for.end, %for.body9 %4 = phi ptr [ %6, %for.body9 ], [ %3, %for.end ] %i5.044 = phi i64 [ %add10, %for.body9 ], [ 2, %for.end ] %add10 = add nuw nsw i64 %i5.044, 1 %mul = shl i64 %add10, 3 %call11 = tail call ptr @realloc(ptr noundef nonnull %4, i64 noundef %mul) #20 store ptr %call11, ptr @inv_arr, align 8, !tbaa !31 %5 = load ptr, ptr @finv_arr, align 8, !tbaa !31 %call14 = tail call ptr @realloc(ptr noundef %5, i64 noundef %mul) #20 store ptr %call14, ptr @finv_arr, align 8, !tbaa !31 %6 = load ptr, ptr @inv_arr, align 8, !tbaa !31 %rem = srem i64 %mod, %i5.044 %arrayidx15 = getelementptr inbounds i64, ptr %6, i64 %rem %7 = load i64, ptr %arrayidx15, align 8, !tbaa !5 %div = sdiv i64 %mod, %i5.044 %mul16 = mul nsw i64 %div, %7 %rem17 = srem i64 %mul16, %mod %sub = sub nsw i64 %mod, %rem17 %arrayidx18 = getelementptr inbounds i64, ptr %6, i64 %i5.044 store i64 %sub, ptr %arrayidx18, align 8, !tbaa !5 %8 = getelementptr i64, ptr %call14, i64 %i5.044 %arrayidx20 = getelementptr i64, ptr %8, i64 -1 %9 = load i64, ptr %arrayidx20, align 8, !tbaa !5 %mul22 = mul nsw i64 %9, %sub %rem23 = srem i64 %mul22, %mod store i64 %rem23, ptr %8, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i5.044, %n br i1 %exitcond.not, label %return, label %for.body9, !llvm.loop !37 return: ; preds = %for.body9, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @make_mf(i64 noundef %n, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc = add nsw i64 %0, 1 store i64 %inc, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %for.end, label %return for.end: ; preds = %entry %1 = load ptr, ptr @mf_arr, align 8, !tbaa !31 %call = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %1, i64 noundef 16) #20 store ptr %call, ptr @mf_arr, align 8, !tbaa !31 %arrayidx = getelementptr inbounds i64, ptr %call, i64 1 store i64 1, ptr %arrayidx, align 8, !tbaa !5 store i64 1, ptr %call, align 8, !tbaa !5 %cmp5.not24 = icmp slt i64 %n, 2 br i1 %cmp5.not24, label %return, label %for.body7 for.body7: ; preds = %for.end, %for.body7 %2 = phi ptr [ %call10, %for.body7 ], [ %call, %for.end ] %i3.026 = phi i64 [ %add8, %for.body7 ], [ 2, %for.end ] %x.025 = phi i64 [ %rem, %for.body7 ], [ 1, %for.end ] %mul = mul nsw i64 %i3.026, %x.025 %rem = srem i64 %mul, %mod %add8 = add nuw nsw i64 %i3.026, 1 %mul9 = shl i64 %add8, 3 %call10 = tail call ptr @realloc(ptr noundef nonnull %2, i64 noundef %mul9) #20 %arrayidx11 = getelementptr inbounds i64, ptr %call10, i64 %i3.026 store i64 %rem, ptr %arrayidx11, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %i3.026, %n br i1 %exitcond.not, label %return.loopexit, label %for.body7, !llvm.loop !38 return.loopexit: ; preds = %for.body7 store ptr %call10, ptr @mf_arr, align 8, !tbaa !31 br label %return return: ; preds = %return.loopexit, %for.end, %entry ret i64 0 } ; Function Attrs: nounwind uwtable define dso_local i64 @m_inv(i64 noundef %x, i64 noundef %mod, i64 noundef %is_fac) local_unnamed_addr #10 { entry: %call = tail call i64 @makeinv(i64 noundef 2000010, i64 noundef %mod) %tobool.not = icmp eq i64 %is_fac, 0 %inv_arr.val = load ptr, ptr @inv_arr, align 8 %finv_arr.val = load ptr, ptr @finv_arr, align 8 %.pn = select i1 %tobool.not, ptr %inv_arr.val, ptr %finv_arr.val %cond.in = getelementptr inbounds i64, ptr %.pn, i64 %x %cond = load i64, ptr %cond.in, align 8, !tbaa !5 ret i64 %cond } ; Function Attrs: nounwind uwtable define dso_local i64 @m_f(i64 noundef %x, i64 noundef %mod) local_unnamed_addr #10 { entry: %0 = load i64, ptr @is_mf_made, align 8, !tbaa !5 %inc.i = add nsw i64 %0, 1 store i64 %inc.i, ptr @is_mf_made, align 8, !tbaa !5 %tobool.not.i = icmp eq i64 %0, 0 %.pre = load ptr, ptr @mf_arr, align 8, !tbaa !31 br i1 %tobool.not.i, label %for.end.i, label %make_mf.exit for.end.i: ; preds = %entry %call.i = tail call dereferenceable_or_null(16) ptr @realloc(ptr noundef %.pre, i64 noundef 16) #20 %arrayidx.i = getelementptr inbounds i64, ptr %call.i, i64 1 store i64 1, ptr %arrayidx.i, align 8, !tbaa !5 store i64 1, ptr %call.i, align 8, !tbaa !5 br label %for.body7.i for.body7.i: ; preds = %for.body7.i, %for.end.i %1 = phi ptr [ %call10.i, %for.body7.i ], [ %call.i, %for.end.i ] %i3.026.i = phi i64 [ %add8.i, %for.body7.i ], [ 2, %for.end.i ] %x.025.i = phi i64 [ %rem.i, %for.body7.i ], [ 1, %for.end.i ] %mul.i = mul nsw i64 %x.025.i, %i3.026.i %rem.i = srem i64 %mul.i, %mod %add8.i = add nuw nsw i64 %i3.026.i, 1 %mul9.i = shl i64 %add8.i, 3 %call10.i = tail call ptr @realloc(ptr noundef nonnull %1, i64 noundef %mul9.i) #20 %arrayidx11.i = getelementptr inbounds i64, ptr %call10.i, i64 %i3.026.i store i64 %rem.i, ptr %arrayidx11.i, align 8, !tbaa !5 %exitcond.not.i = icmp eq i64 %i3.026.i, 2000010 br i1 %exitcond.not.i, label %return.loopexit.i, label %for.body7.i, !llvm.loop !38 return.loopexit.i: ; preds = %for.body7.i store ptr %call10.i, ptr @mf_arr, align 8, !tbaa !31 br label %make_mf.exit make_mf.exit: ; preds = %entry, %return.loopexit.i %2 = phi ptr [ %.pre, %entry ], [ %call10.i, %return.loopexit.i ] %arrayidx = getelementptr inbounds i64, ptr %2, i64 %x %3 = load i64, ptr %arrayidx, align 8, !tbaa !5 ret i64 %3 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @m_p(i64 noundef %r, i64 noundef %n, i64 noundef %mod) local_unnamed_addr #6 { entry: %cmp16 = icmp sgt i64 %n, 0 br i1 %cmp16, label %while.body, label %while.end while.body: ; preds = %entry, %cond.end %s.019 = phi i64 [ %rem2, %cond.end ], [ %r, %entry ] %t.018 = phi i64 [ %cond, %cond.end ], [ 1, %entry ] %n.addr.017 = phi i64 [ %shr, %cond.end ], [ %n, %entry ] %and = and i64 %n.addr.017, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.true: ; preds = %while.body %mul = mul nsw i64 %s.019, %t.018 %rem = srem i64 %mul, %mod br label %cond.end cond.end: ; preds = %while.body, %cond.true %cond = phi i64 [ %rem, %cond.true ], [ %t.018, %while.body ] %mul1 = mul nsw i64 %s.019, %s.019 %rem2 = srem i64 %mul1, %mod %shr = lshr i64 %n.addr.017, 1 %cmp.not = icmp ult i64 %n.addr.017, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !39 while.end: ; preds = %cond.end, %entry %t.0.lcssa = phi i64 [ 1, %entry ], [ %cond, %cond.end ] %tobool3.not = icmp eq i64 %r, 0 %cond7 = select i1 %tobool3.not, i64 0, i64 %t.0.lcssa ret i64 %cond7 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul2(i64 noundef %a, i64 noundef %b, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul3(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod ret i64 %rem.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul4(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod ret i64 %rem.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @m_mul5(i64 noundef %a, i64 noundef %b, i64 noundef %c, i64 noundef %d, i64 noundef %e, i64 noundef %mod) local_unnamed_addr #7 { entry: %mul = mul nsw i64 %b, %a %rem = srem i64 %mul, %mod %mul.i = mul nsw i64 %rem, %c %rem.i = srem i64 %mul.i, %mod %mul.i.i = mul nsw i64 %rem.i, %d %rem.i.i = srem i64 %mul.i.i, %mod %mul.i.i.i = mul nsw i64 %rem.i.i, %e %rem.i.i.i = srem i64 %mul.i.i.i, %mod ret i64 %rem.i.i.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #14 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #21 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #13 { entry: %0 = load i8, ptr %a, align 1, !tbaa !21 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !21 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #22 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #16 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #22 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #2 { entry: %0 = zext i32 %size to i64 %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #22 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #2 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #21 tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #22 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #15 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #17 { entry: %cmp8 = icmp sgt i64 %n, 1 br i1 %cmp8, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ] %0 = mul nsw i64 %i.010, %size %arrayidx = getelementptr inbounds i8, ptr %s, i64 %0 %sub = add nsw i64 %i.010, -1 %1 = mul nsw i64 %sub, %size %arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #21 %tobool.not = icmp ne i32 %call, 0 %inc = zext i1 %tobool.not to i64 %spec.select = add nuw nsw i64 %ans.09, %inc %inc2 = add nuw nsw i64 %i.010, 1 %exitcond.not = icmp eq i64 %inc2, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !40 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #8 { entry: %cmp9 = icmp sgt i64 %n, 1 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = add i64 %n, -1 %min.iters.check = icmp ult i64 %n, 5 br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ] %vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx %wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i64, ptr %1, i64 2 %wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5 %3 = getelementptr i64, ptr %1, i64 -1 %wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = getelementptr i64, ptr %1, i64 1 %wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5 %5 = icmp ne <2 x i64> %wide.load, %wide.load14 %6 = icmp ne <2 x i64> %wide.load13, %wide.load15 %7 = zext <2 x i1> %5 to <2 x i64> %8 = zext <2 x i1> %6 to <2 x i64> %9 = add <2 x i64> %vec.phi, %7 %10 = add <2 x i64> %vec.phi12, %8 %index.next = add nuw i64 %index, 4 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !41 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16 for.body.preheader16: ; preds = %for.body.preheader, %middle.block %i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] %ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] ret i64 %ans.0.lcssa for.body: ; preds = %for.body.preheader16, %for.body %i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ] %ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011 %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1 %14 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %cmp2.not = icmp ne i64 %13, %14 %inc = zext i1 %cmp2.not to i64 %spec.select = add nuw nsw i64 %ans.010, %inc %inc3 = add nuw nsw i64 %i.011, 1 %exitcond.not = icmp eq i64 %inc3, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !42 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %p, align 8, !tbaa !43 %1 = load i64, ptr %q, align 8, !tbaa !43 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #13 { entry: %0 = load i64, ptr %q, align 8, !tbaa !43 %1 = load i64, ptr %p, align 8, !tbaa !43 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #22 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #22 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %x = alloca [15 x [15 x i64]], align 16 %y = alloca [15 x [15 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #22 %call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 call void @llvm.lifetime.start.p0(i64 1800, ptr nonnull %x) #22 call void @llvm.lifetime.start.p0(i64 1800, ptr nonnull %y) #22 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp113 = icmp sgt i64 %2, 0 br i1 %cmp113, label %for.body, label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond.cleanup4, %entry %.lcssa = phi i64 [ %2, %entry ], [ %14, %for.cond.cleanup4 ] %sh_prom = trunc i64 %.lcssa to i32 %shl = shl nuw i32 1, %sh_prom %cmp15124.not = icmp eq i32 %sh_prom, 31 br i1 %cmp15124.not, label %cleanup57, label %for.cond20.preheader.lr.ph for.cond20.preheader.lr.ph: ; preds = %for.cond14.preheader %cmp21117 = icmp sgt i64 %.lcssa, 0 %sub = add nsw i64 %.lcssa, -1 br i1 %cmp21117, label %for.cond20.preheader.us.preheader, label %cleanup57 for.cond20.preheader.us.preheader: ; preds = %for.cond20.preheader.lr.ph %3 = call i32 @llvm.smax.i32(i32 %shl, i32 1) %smax = zext i32 %3 to i64 br label %for.cond20.preheader.us for.cond20.preheader.us: ; preds = %for.cond20.preheader.us.preheader, %for.inc55.us %i13.0126.us = phi i64 [ %inc56.us, %for.inc55.us ], [ 0, %for.cond20.preheader.us.preheader ] %ans.0125.us = phi i64 [ %ans.1110.us, %for.inc55.us ], [ 0, %for.cond20.preheader.us.preheader ] %rem.i99103.us = and i64 %i13.0126.us, 1 %conv46.us = trunc i64 %i13.0126.us to i32 %4 = call i32 @llvm.ctpop.i32(i32 %conv46.us), !range !45 %conv47.us = zext i32 %4 to i64 br label %for.body24.us for.body24.us: ; preds = %for.cond20.preheader.us, %TTT.us %j19.0120.us = phi i64 [ 0, %for.cond20.preheader.us ], [ %add.us, %TTT.us ] %ans.1118.us = phi i64 [ %ans.0125.us, %for.cond20.preheader.us ], [ %ans.2.us, %TTT.us ] %add.us = add nuw nsw i64 %j19.0120.us, 1 %cmp5.i.us = icmp eq i64 %j19.0120.us, 0 br i1 %cmp5.i.us, label %base.exit.us, label %cond.false.i.us.preheader cond.false.i.us.preheader: ; preds = %for.body24.us %xtraiter = and i64 %j19.0120.us, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cond.false.i.us.prol.loopexit, label %cond.false.i.us.prol cond.false.i.us.prol: ; preds = %cond.false.i.us.preheader, %cond.false.i.us.prol %i.tr7.i.us.prol = phi i64 [ %sub.i.us.prol, %cond.false.i.us.prol ], [ %add.us, %cond.false.i.us.preheader ] %n.tr6.i.us.prol = phi i64 [ %div.i.us.prol, %cond.false.i.us.prol ], [ %i13.0126.us, %cond.false.i.us.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %cond.false.i.us.prol ], [ 0, %cond.false.i.us.preheader ] %div.i.us.prol = sdiv i64 %n.tr6.i.us.prol, 2 %sub.i.us.prol = add nsw i64 %i.tr7.i.us.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %cond.false.i.us.prol.loopexit, label %cond.false.i.us.prol, !llvm.loop !46 cond.false.i.us.prol.loopexit: ; preds = %cond.false.i.us.prol, %cond.false.i.us.preheader %div.i.us.lcssa.unr = phi i64 [ undef, %cond.false.i.us.preheader ], [ %div.i.us.prol, %cond.false.i.us.prol ] %i.tr7.i.us.unr = phi i64 [ %add.us, %cond.false.i.us.preheader ], [ %sub.i.us.prol, %cond.false.i.us.prol ] %n.tr6.i.us.unr = phi i64 [ %i13.0126.us, %cond.false.i.us.preheader ], [ %div.i.us.prol, %cond.false.i.us.prol ] %5 = icmp ult i64 %j19.0120.us, 4 br i1 %5, label %base.exit.us.loopexit, label %cond.false.i.us cond.false.i.us: ; preds = %cond.false.i.us.prol.loopexit, %cond.false.i.us %i.tr7.i.us = phi i64 [ %sub.i.us.3, %cond.false.i.us ], [ %i.tr7.i.us.unr, %cond.false.i.us.prol.loopexit ] %n.tr6.i.us = phi i64 [ %div.i.us.3, %cond.false.i.us ], [ %n.tr6.i.us.unr, %cond.false.i.us.prol.loopexit ] %div.i.us.3 = sdiv i64 %n.tr6.i.us, 16 %sub.i.us.3 = add nsw i64 %i.tr7.i.us, -4 %cmp.i.us.3 = icmp eq i64 %sub.i.us.3, 1 br i1 %cmp.i.us.3, label %base.exit.us.loopexit, label %cond.false.i.us base.exit.us.loopexit: ; preds = %cond.false.i.us, %cond.false.i.us.prol.loopexit %div.i.us.lcssa = phi i64 [ %div.i.us.lcssa.unr, %cond.false.i.us.prol.loopexit ], [ %div.i.us.3, %cond.false.i.us ] %.pre = and i64 %div.i.us.lcssa, 1 br label %base.exit.us base.exit.us: ; preds = %base.exit.us.loopexit, %for.body24.us %.pre-phi = phi i64 [ %.pre, %base.exit.us.loopexit ], [ %rem.i99103.us, %for.body24.us ] %tobool.not.us = icmp eq i64 %.pre-phi, 0 br i1 %tobool.not.us, label %TTT.us, label %for.cond25.preheader.us for.body30.us: ; preds = %for.cond25.preheader.us, %for.inc40.us %k.0116.us = phi i64 [ %inc41.us, %for.inc40.us ], [ 0, %for.cond25.preheader.us ] %arrayidx32.us = getelementptr inbounds [15 x [15 x i64]], ptr %x, i64 0, i64 %j19.0120.us, i64 %k.0116.us %6 = load i64, ptr %arrayidx32.us, align 8, !tbaa !5 %cmp5.i91.us = icmp eq i64 %6, 1 br i1 %cmp5.i91.us, label %base.exit100.thread.us, label %cond.false.i92.us.preheader cond.false.i92.us.preheader: ; preds = %for.body30.us %7 = add i64 %6, 3 %8 = add i64 %6, -2 %xtraiter144 = and i64 %7, 3 %lcmp.mod145.not = icmp eq i64 %xtraiter144, 0 br i1 %lcmp.mod145.not, label %cond.false.i92.us.prol.loopexit, label %cond.false.i92.us.prol cond.false.i92.us.prol: ; preds = %cond.false.i92.us.preheader, %cond.false.i92.us.prol %i.tr7.i93.us.prol = phi i64 [ %sub.i96.us.prol, %cond.false.i92.us.prol ], [ %6, %cond.false.i92.us.preheader ] %n.tr6.i94.us.prol = phi i64 [ %div.i95.us.prol, %cond.false.i92.us.prol ], [ %i13.0126.us, %cond.false.i92.us.preheader ] %prol.iter146 = phi i64 [ %prol.iter146.next, %cond.false.i92.us.prol ], [ 0, %cond.false.i92.us.preheader ] %div.i95.us.prol = sdiv i64 %n.tr6.i94.us.prol, 2 %sub.i96.us.prol = add nsw i64 %i.tr7.i93.us.prol, -1 %prol.iter146.next = add i64 %prol.iter146, 1 %prol.iter146.cmp.not = icmp eq i64 %prol.iter146.next, %xtraiter144 br i1 %prol.iter146.cmp.not, label %cond.false.i92.us.prol.loopexit, label %cond.false.i92.us.prol, !llvm.loop !47 cond.false.i92.us.prol.loopexit: ; preds = %cond.false.i92.us.prol, %cond.false.i92.us.preheader %div.i95.us.lcssa.unr = phi i64 [ undef, %cond.false.i92.us.preheader ], [ %div.i95.us.prol, %cond.false.i92.us.prol ] %i.tr7.i93.us.unr = phi i64 [ %6, %cond.false.i92.us.preheader ], [ %sub.i96.us.prol, %cond.false.i92.us.prol ] %n.tr6.i94.us.unr = phi i64 [ %i13.0126.us, %cond.false.i92.us.preheader ], [ %div.i95.us.prol, %cond.false.i92.us.prol ] %9 = icmp ult i64 %8, 3 br i1 %9, label %base.exit100.us, label %cond.false.i92.us cond.false.i92.us: ; preds = %cond.false.i92.us.prol.loopexit, %cond.false.i92.us %i.tr7.i93.us = phi i64 [ %sub.i96.us.3, %cond.false.i92.us ], [ %i.tr7.i93.us.unr, %cond.false.i92.us.prol.loopexit ] %n.tr6.i94.us = phi i64 [ %div.i95.us.3, %cond.false.i92.us ], [ %n.tr6.i94.us.unr, %cond.false.i92.us.prol.loopexit ] %div.i95.us.3 = sdiv i64 %n.tr6.i94.us, 16 %sub.i96.us.3 = add nsw i64 %i.tr7.i93.us, -4 %cmp.i97.us.3 = icmp eq i64 %sub.i96.us.3, 1 br i1 %cmp.i97.us.3, label %base.exit100.us, label %cond.false.i92.us base.exit100.us: ; preds = %cond.false.i92.us, %cond.false.i92.us.prol.loopexit %div.i95.us.lcssa = phi i64 [ %div.i95.us.lcssa.unr, %cond.false.i92.us.prol.loopexit ], [ %div.i95.us.3, %cond.false.i92.us ] %rem.i99.us = srem i64 %div.i95.us.lcssa, 2 %arrayidx35.us = getelementptr inbounds [15 x [15 x i64]], ptr %y, i64 0, i64 %j19.0120.us, i64 %k.0116.us %10 = load i64, ptr %arrayidx35.us, align 8, !tbaa !5 %cmp36.not.us = icmp eq i64 %rem.i99.us, %10 br i1 %cmp36.not.us, label %for.inc40.us, label %for.inc55.us base.exit100.thread.us: ; preds = %for.body30.us %arrayidx35104.us = getelementptr inbounds [15 x [15 x i64]], ptr %y, i64 0, i64 %j19.0120.us, i64 %k.0116.us %11 = load i64, ptr %arrayidx35104.us, align 8, !tbaa !5 %cmp36.not105.us = icmp eq i64 %rem.i99103.us, %11 br i1 %cmp36.not105.us, label %for.inc40.us, label %for.inc55.us for.inc55.us: ; preds = %TTT.us, %base.exit100.us, %base.exit100.thread.us %ans.1110.us = phi i64 [ %ans.1118.us, %base.exit100.thread.us ], [ %ans.1118.us, %base.exit100.us ], [ %ans.2.us, %TTT.us ] %inc56.us = add nuw nsw i64 %i13.0126.us, 1 %exitcond134.not = icmp eq i64 %inc56.us, %smax br i1 %exitcond134.not, label %cleanup57, label %for.cond20.preheader.us, !llvm.loop !48 for.inc40.us: ; preds = %base.exit100.thread.us, %base.exit100.us %inc41.us = add nuw nsw i64 %k.0116.us, 1 %exitcond.not = icmp eq i64 %inc41.us, %12 br i1 %exitcond.not, label %TTT.us, label %for.body30.us, !llvm.loop !49 TTT.us: ; preds = %for.inc40.us, %for.cond25.preheader.us, %base.exit.us %cmp43.us = icmp eq i64 %j19.0120.us, %sub %cond.i.us = call i64 @llvm.smax.i64(i64 %ans.1118.us, i64 %conv47.us) %ans.2.us = select i1 %cmp43.us, i64 %cond.i.us, i64 %ans.1118.us %exitcond133.not = icmp eq i64 %add.us, %.lcssa br i1 %exitcond133.not, label %for.inc55.us, label %for.body24.us, !llvm.loop !50 for.cond25.preheader.us: ; preds = %base.exit.us %arrayidx26.us = getelementptr inbounds i64, ptr %vla, i64 %j19.0120.us %12 = load i64, ptr %arrayidx26.us, align 8, !tbaa !5 %cmp27.not115.us = icmp sgt i64 %12, 0 br i1 %cmp27.not115.us, label %for.body30.us, label %TTT.us for.body: ; preds = %entry, %for.cond.cleanup4 %i.0114 = phi i64 [ %inc11, %for.cond.cleanup4 ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.0114 %call.i88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %13 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp3111 = icmp sgt i64 %13, 0 br i1 %cmp3111, label %for.body5, label %for.cond.cleanup4 for.cond.cleanup4: ; preds = %for.body5, %for.body %inc11 = add nuw nsw i64 %i.0114, 1 %14 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc11, %14 br i1 %cmp, label %for.body, label %for.cond14.preheader, !llvm.loop !51 for.body5: ; preds = %for.body, %for.body5 %j.0112 = phi i64 [ %inc, %for.body5 ], [ 0, %for.body ] %arrayidx7 = getelementptr inbounds [15 x [15 x i64]], ptr %x, i64 0, i64 %i.0114, i64 %j.0112 %call.i89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %arrayidx9 = getelementptr inbounds [15 x [15 x i64]], ptr %y, i64 0, i64 %i.0114, i64 %j.0112 %call.i90 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %inc = add nuw nsw i64 %j.0112, 1 %15 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp3 = icmp slt i64 %inc, %15 br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !52 cleanup57: ; preds = %for.inc55.us, %for.cond20.preheader.lr.ph, %for.cond14.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond14.preheader ], [ 0, %for.cond20.preheader.lr.ph ], [ %ans.1110.us, %for.inc55.us ] %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1800, ptr nonnull %y) #22 call void @llvm.lifetime.end.p0(i64 1800, ptr nonnull %x) #22 call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #22 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.ctpop.i32(i32) #18 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #19 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #12 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { 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 #14 = { 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 #15 = { 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 #16 = { 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 #17 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #18 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #19 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #20 = { nounwind allocsize(1) } attributes #21 = { nounwind willreturn memory(read) } attributes #22 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !17} !21 = !{!7, !7, i64 0} !22 = distinct !{!22, !17} !23 = !{!24, !24, i64 0} !24 = !{!"int", !7, i64 0} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10, !28, !11, !12} !28 = !{!"llvm.loop.peeled.count", i32 1} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = !{!32, !32, i64 0} !32 = !{!"any pointer", !7, i64 0} !33 = distinct !{!33, !10} !34 = distinct !{!34, !10} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = distinct !{!38, !10} !39 = distinct !{!39, !10} !40 = distinct !{!40, !10} !41 = distinct !{!41, !10, !11, !12} !42 = distinct !{!42, !10, !12, !11} !43 = !{!44, !6, i64 0} !44 = !{!"", !6, i64 0, !6, i64 8} !45 = !{i32 0, i32 33} !46 = distinct !{!46, !17} !47 = distinct !{!47, !17} !48 = distinct !{!48, !10} !49 = distinct !{!49, !10} !50 = distinct !{!50, !10} !51 = distinct !{!51, !10} !52 = distinct !{!52, !10}
#include <stdio.h> #include <string.h> #define N 15 int main() { static int aa[N], xx[N][N - 1], yy[N][N - 1], honest[N]; int n, i, j, b, k, yes, ans; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &aa[i]); for (j = 0; j < aa[i]; j++) scanf("%d%d", &xx[i][j], &yy[i][j]), xx[i][j]--; } ans = -1; for (b = 0; b < 1 << n; b++) { memset(honest, 0, n * sizeof *honest); for (i = 0; i < n; i++) if (b & 1 << i) honest[i] = 1; yes = 1; k = 0; for (i = 0; i < n; i++) if (honest[i]) { k++; for (j = 0; j < aa[i]; j++) if (honest[xx[i][j]] != yy[i][j]) yes = 0; } if (yes && ans < k) ans = k; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281228/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.aa = internal global [15 x i32] zeroinitializer, align 16 @main.xx = internal global [15 x [14 x i32]] zeroinitializer, align 16 @main.yy = internal global [15 x [14 x i32]] zeroinitializer, align 16 @main.honest = internal unnamed_addr global [15 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp112 = icmp sgt i32 %0, 0 br i1 %cmp112, label %for.body, label %for.body25.lr.ph.thread for.body25.lr.ph.thread: ; preds = %entry %shl176 = shl nuw nsw i32 1, %0 %conv182 = sext i32 %0 to i64 %mul183 = shl nsw i64 %conv182, 2 br label %for.body25.preheader for.cond23.preheader: ; preds = %for.inc20 %shl = shl nuw i32 1, %23 %cmp24126.not = icmp eq i32 %23, 31 br i1 %cmp24126.not, label %for.end79, label %for.body25.lr.ph for.body25.lr.ph: ; preds = %for.cond23.preheader %conv = sext i32 %23 to i64 %mul = shl nsw i64 %conv, 2 %cmp27114 = icmp sgt i32 %23, 0 br i1 %cmp27114, label %for.body25.us.preheader, label %for.body25.preheader for.body25.preheader: ; preds = %for.body25.lr.ph.thread, %for.body25.lr.ph %mul186 = phi i64 [ %mul183, %for.body25.lr.ph.thread ], [ %mul, %for.body25.lr.ph ] %shl179185 = phi i32 [ %shl176, %for.body25.lr.ph.thread ], [ %shl, %for.body25.lr.ph ] %smax = call i32 @llvm.smax.i32(i32 %shl179185, i32 1) %xtraiter = and i32 %smax, 7 %1 = icmp ult i32 %smax, 8 br i1 %1, label %for.end79.loopexit189.unr-lcssa, label %for.body25.preheader.new for.body25.preheader.new: ; preds = %for.body25.preheader %unroll_iter = and i32 %smax, 2147483640 br label %for.body25 for.body25.us.preheader: ; preds = %for.body25.lr.ph %smax173 = call i32 @llvm.smax.i32(i32 %shl, i32 1) %wide.trip.count = zext i32 %23 to i64 %xtraiter190 = and i64 %wide.trip.count, 1 %2 = icmp eq i32 %23, 1 %unroll_iter193 = and i64 %wide.trip.count, 4294967294 %lcmp.mod192.not = icmp eq i64 %xtraiter190, 0 br label %for.body29.us.preheader for.body29.us.preheader: ; preds = %for.cond36.for.end71_crit_edge.us, %for.body25.us.preheader %ans.0128.us = phi i32 [ %ans.1.us, %for.cond36.for.end71_crit_edge.us ], [ -1, %for.body25.us.preheader ] %b.0127.us = phi i32 [ %inc78.us, %for.cond36.for.end71_crit_edge.us ], [ 0, %for.body25.us.preheader ] call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul, i1 false) br i1 %2, label %for.body39.us.preheader.unr-lcssa, label %for.body29.us for.body39.us: ; preds = %for.body39.us.preheader, %for.inc69.us %indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.inc69.us ], [ 0, %for.body39.us.preheader ] %yes.0123.us = phi i32 [ %yes.3.us, %for.inc69.us ], [ 1, %for.body39.us.preheader ] %k.0122.us = phi i32 [ %k.1.us, %for.inc69.us ], [ 0, %for.body39.us.preheader ] %arrayidx41.us = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %indvars.iv168 %3 = load i32, ptr %arrayidx41.us, align 4, !tbaa !5 %tobool42.not.us = icmp eq i32 %3, 0 br i1 %tobool42.not.us, label %for.inc69.us, label %if.then43.us if.then43.us: ; preds = %for.body39.us %inc44.us = add nsw i32 %k.0122.us, 1 %arrayidx47.us = getelementptr inbounds [15 x i32], ptr @main.aa, i64 0, i64 %indvars.iv168 %4 = load i32, ptr %arrayidx47.us, align 4, !tbaa !5 %cmp48116.us = icmp sgt i32 %4, 0 br i1 %cmp48116.us, label %for.body50.us.preheader, label %for.inc69.us for.body50.us.preheader: ; preds = %if.then43.us %wide.trip.count166 = zext i32 %4 to i64 %xtraiter195 = and i64 %wide.trip.count166, 1 %5 = icmp eq i32 %4, 1 br i1 %5, label %for.inc69.us.loopexit.unr-lcssa, label %for.body50.us.preheader.new for.body50.us.preheader.new: ; preds = %for.body50.us.preheader %unroll_iter199 = and i64 %wide.trip.count166, 4294967294 br label %for.body50.us for.body50.us: ; preds = %for.body50.us, %for.body50.us.preheader.new %indvars.iv163 = phi i64 [ 0, %for.body50.us.preheader.new ], [ %indvars.iv.next164.1, %for.body50.us ] %yes.1118.us = phi i32 [ %yes.0123.us, %for.body50.us.preheader.new ], [ %spec.select.us.1, %for.body50.us ] %niter200 = phi i64 [ 0, %for.body50.us.preheader.new ], [ %niter200.next.1, %for.body50.us ] %arrayidx54.us = getelementptr inbounds [15 x [14 x i32]], ptr @main.xx, i64 0, i64 %indvars.iv168, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx54.us, align 8, !tbaa !5 %idxprom55.us = sext i32 %6 to i64 %arrayidx56.us = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %idxprom55.us %7 = load i32, ptr %arrayidx56.us, align 4, !tbaa !5 %arrayidx60.us = getelementptr inbounds [15 x [14 x i32]], ptr @main.yy, i64 0, i64 %indvars.iv168, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx60.us, align 8, !tbaa !5 %cmp61.not.us = icmp eq i32 %7, %8 %indvars.iv.next164 = or i64 %indvars.iv163, 1 %arrayidx54.us.1 = getelementptr inbounds [15 x [14 x i32]], ptr @main.xx, i64 0, i64 %indvars.iv168, i64 %indvars.iv.next164 %9 = load i32, ptr %arrayidx54.us.1, align 4, !tbaa !5 %idxprom55.us.1 = sext i32 %9 to i64 %arrayidx56.us.1 = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %idxprom55.us.1 %10 = load i32, ptr %arrayidx56.us.1, align 4, !tbaa !5 %arrayidx60.us.1 = getelementptr inbounds [15 x [14 x i32]], ptr @main.yy, i64 0, i64 %indvars.iv168, i64 %indvars.iv.next164 %11 = load i32, ptr %arrayidx60.us.1, align 4, !tbaa !5 %cmp61.not.us.1 = icmp eq i32 %10, %11 %12 = select i1 %cmp61.not.us.1, i1 %cmp61.not.us, i1 false %spec.select.us.1 = select i1 %12, i32 %yes.1118.us, i32 0 %indvars.iv.next164.1 = add nuw nsw i64 %indvars.iv163, 2 %niter200.next.1 = add i64 %niter200, 2 %niter200.ncmp.1 = icmp eq i64 %niter200.next.1, %unroll_iter199 br i1 %niter200.ncmp.1, label %for.inc69.us.loopexit.unr-lcssa, label %for.body50.us, !llvm.loop !9 for.inc69.us.loopexit.unr-lcssa: ; preds = %for.body50.us, %for.body50.us.preheader %spec.select.us.lcssa.ph = phi i32 [ undef, %for.body50.us.preheader ], [ %spec.select.us.1, %for.body50.us ] %indvars.iv163.unr = phi i64 [ 0, %for.body50.us.preheader ], [ %indvars.iv.next164.1, %for.body50.us ] %yes.1118.us.unr = phi i32 [ %yes.0123.us, %for.body50.us.preheader ], [ %spec.select.us.1, %for.body50.us ] %lcmp.mod197.not = icmp eq i64 %xtraiter195, 0 br i1 %lcmp.mod197.not, label %for.inc69.us, label %for.body50.us.epil for.body50.us.epil: ; preds = %for.inc69.us.loopexit.unr-lcssa %arrayidx54.us.epil = getelementptr inbounds [15 x [14 x i32]], ptr @main.xx, i64 0, i64 %indvars.iv168, i64 %indvars.iv163.unr %13 = load i32, ptr %arrayidx54.us.epil, align 4, !tbaa !5 %idxprom55.us.epil = sext i32 %13 to i64 %arrayidx56.us.epil = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %idxprom55.us.epil %14 = load i32, ptr %arrayidx56.us.epil, align 4, !tbaa !5 %arrayidx60.us.epil = getelementptr inbounds [15 x [14 x i32]], ptr @main.yy, i64 0, i64 %indvars.iv168, i64 %indvars.iv163.unr %15 = load i32, ptr %arrayidx60.us.epil, align 4, !tbaa !5 %cmp61.not.us.epil = icmp eq i32 %14, %15 %spec.select.us.epil = select i1 %cmp61.not.us.epil, i32 %yes.1118.us.unr, i32 0 br label %for.inc69.us for.inc69.us: ; preds = %for.body50.us.epil, %for.inc69.us.loopexit.unr-lcssa, %if.then43.us, %for.body39.us %k.1.us = phi i32 [ %k.0122.us, %for.body39.us ], [ %inc44.us, %if.then43.us ], [ %inc44.us, %for.inc69.us.loopexit.unr-lcssa ], [ %inc44.us, %for.body50.us.epil ] %yes.3.us = phi i32 [ %yes.0123.us, %for.body39.us ], [ %yes.0123.us, %if.then43.us ], [ %spec.select.us.lcssa.ph, %for.inc69.us.loopexit.unr-lcssa ], [ %spec.select.us.epil, %for.body50.us.epil ] %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count br i1 %exitcond172.not, label %for.cond36.for.end71_crit_edge.us, label %for.body39.us, !llvm.loop !11 for.body29.us: ; preds = %for.body29.us.preheader, %for.inc33.us.1 %indvars.iv159 = phi i64 [ %indvars.iv.next160.1, %for.inc33.us.1 ], [ 0, %for.body29.us.preheader ] %niter194 = phi i64 [ %niter194.next.1, %for.inc33.us.1 ], [ 0, %for.body29.us.preheader ] %16 = trunc i64 %indvars.iv159 to i32 %shl30.us = shl nuw i32 1, %16 %and.us = and i32 %shl30.us, %b.0127.us %tobool.not.us = icmp eq i32 %and.us, 0 br i1 %tobool.not.us, label %for.inc33.us, label %if.then.us if.then.us: ; preds = %for.body29.us %arrayidx32.us = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %indvars.iv159 store i32 1, ptr %arrayidx32.us, align 8, !tbaa !5 br label %for.inc33.us for.inc33.us: ; preds = %if.then.us, %for.body29.us %indvars.iv.next160 = or i64 %indvars.iv159, 1 %17 = trunc i64 %indvars.iv.next160 to i32 %shl30.us.1 = shl nuw i32 1, %17 %and.us.1 = and i32 %shl30.us.1, %b.0127.us %tobool.not.us.1 = icmp eq i32 %and.us.1, 0 br i1 %tobool.not.us.1, label %for.inc33.us.1, label %if.then.us.1 if.then.us.1: ; preds = %for.inc33.us %arrayidx32.us.1 = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %indvars.iv.next160 store i32 1, ptr %arrayidx32.us.1, align 4, !tbaa !5 br label %for.inc33.us.1 for.inc33.us.1: ; preds = %if.then.us.1, %for.inc33.us %indvars.iv.next160.1 = add nuw nsw i64 %indvars.iv159, 2 %niter194.next.1 = add i64 %niter194, 2 %niter194.ncmp.1 = icmp eq i64 %niter194.next.1, %unroll_iter193 br i1 %niter194.ncmp.1, label %for.body39.us.preheader.unr-lcssa, label %for.body29.us, !llvm.loop !12 for.body39.us.preheader.unr-lcssa: ; preds = %for.inc33.us.1, %for.body29.us.preheader %indvars.iv159.unr = phi i64 [ 0, %for.body29.us.preheader ], [ %indvars.iv.next160.1, %for.inc33.us.1 ] br i1 %lcmp.mod192.not, label %for.body39.us.preheader, label %for.body29.us.epil for.body29.us.epil: ; preds = %for.body39.us.preheader.unr-lcssa %18 = trunc i64 %indvars.iv159.unr to i32 %shl30.us.epil = shl nuw i32 1, %18 %and.us.epil = and i32 %shl30.us.epil, %b.0127.us %tobool.not.us.epil = icmp eq i32 %and.us.epil, 0 br i1 %tobool.not.us.epil, label %for.body39.us.preheader, label %if.then.us.epil if.then.us.epil: ; preds = %for.body29.us.epil %arrayidx32.us.epil = getelementptr inbounds [15 x i32], ptr @main.honest, i64 0, i64 %indvars.iv159.unr store i32 1, ptr %arrayidx32.us.epil, align 4, !tbaa !5 br label %for.body39.us.preheader for.body39.us.preheader: ; preds = %for.body29.us.epil, %if.then.us.epil, %for.body39.us.preheader.unr-lcssa br label %for.body39.us for.cond36.for.end71_crit_edge.us: ; preds = %for.inc69.us %tobool72.not.us = icmp ne i32 %yes.3.us, 0 %cmp73.us = icmp slt i32 %ans.0128.us, %k.1.us %or.cond.us = select i1 %tobool72.not.us, i1 %cmp73.us, i1 false %ans.1.us = select i1 %or.cond.us, i32 %k.1.us, i32 %ans.0128.us %inc78.us = add nuw nsw i32 %b.0127.us, 1 %exitcond174.not = icmp eq i32 %inc78.us, %smax173 br i1 %exitcond174.not, label %for.end79, label %for.body29.us.preheader, !llvm.loop !13 for.body: ; preds = %entry, %for.inc20 %indvars.iv156 = phi i64 [ %indvars.iv.next157, %for.inc20 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [15 x i32], ptr @main.aa, i64 0, i64 %indvars.iv156 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %19 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp5110 = icmp sgt i32 %19, 0 br i1 %cmp5110, label %for.body6, label %for.inc20 for.body6: ; preds = %for.body, %for.body6 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ 0, %for.body ] %arrayidx10 = getelementptr inbounds [15 x [14 x i32]], ptr @main.xx, i64 0, i64 %indvars.iv156, i64 %indvars.iv %arrayidx14 = getelementptr inbounds [15 x [14 x i32]], ptr @main.yy, i64 0, i64 %indvars.iv156, i64 %indvars.iv %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10, ptr noundef nonnull %arrayidx14) %20 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %dec = add nsw i32 %20, -1 store i32 %dec, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %21 = load i32, ptr %arrayidx, align 4, !tbaa !5 %22 = sext i32 %21 to i64 %cmp5 = icmp slt i64 %indvars.iv.next, %22 br i1 %cmp5, label %for.body6, label %for.inc20, !llvm.loop !14 for.inc20: ; preds = %for.body6, %for.body %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1 %23 = load i32, ptr %n, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp = icmp slt i64 %indvars.iv.next157, %24 br i1 %cmp, label %for.body, label %for.cond23.preheader, !llvm.loop !15 for.body25: ; preds = %for.body25, %for.body25.preheader.new %niter = phi i32 [ 0, %for.body25.preheader.new ], [ %niter.next.7, %for.body25 ] call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end79.loopexit189.unr-lcssa, label %for.body25, !llvm.loop !13 for.end79.loopexit189.unr-lcssa: ; preds = %for.body25, %for.body25.preheader %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end79, label %for.body25.epil for.body25.epil: ; preds = %for.end79.loopexit189.unr-lcssa, %for.body25.epil %epil.iter = phi i32 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.end79.loopexit189.unr-lcssa ] call void @llvm.memset.p0.i64(ptr nonnull align 16 @main.honest, i8 0, i64 %mul186, i1 false) %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.end79, label %for.body25.epil, !llvm.loop !16 for.end79: ; preds = %for.end79.loopexit189.unr-lcssa, %for.body25.epil, %for.cond36.for.end71_crit_edge.us, %for.cond23.preheader %ans.0.lcssa = phi i32 [ -1, %for.cond23.preheader ], [ %ans.1.us, %for.cond36.for.end71_crit_edge.us ], [ 0, %for.body25.epil ], [ 0, %for.end79.loopexit189.unr-lcssa ] %call80 = 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 %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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <string.h> #include <stdlib.h> typedef long long ll; typedef int keytype; int gcd(int a, int b){ return (a % b) ? gcd(b, a % b) : b;} int lcm(int a, int b){ return (a / gcd(a, b)) * b;} void quicksort(keytype a[], int first, int last) { int i, j; keytype x, t; x = a[(first + last) / 2]; i = first; j = last; for ( ; ; ) { while (a[i] < x) i++; while (x < a[j]) j--; if (i >= j) break; t = a[i]; a[i] = a[j]; a[j] = t; i++; j--; } if (first < i - 1) quicksort(a, first , i - 1); if (j + 1 < last) quicksort(a, j + 1, last); } int is_prime(int x){ if(x <= 1) return 0; for(int i = 2; i * i <= x; i++){ if(x % i == 0) return 0; } return 1; } int is_substr(char s[], char t[], int i){ int flag = 1; if(s[i] == '\0') flag = 0; for(int j = 0; j < strlen(t); ++j, ++i){ if(s[i] != t[j]){ flag = 0; break; } } return flag; } // factor list, number of factors, natural number void factorize(int ftr[], int *num, int n){ int a = 2, cnt = 0; while(n >= a){ if(n % a == 0){ n = n / a; ftr[cnt++] = a; }else{ a++; } } *num = cnt; } void comb(int size1, int size2, int v[size1][size2]){ for(int i = 0; i < size1; i++){ v[i][0] = 1; v[i][i] = 1; } for(int k = 1; k < size1; k++){ for(int j = 1; j < k; j++){ v[k][j] = (v[k-1][j-1] + v[k-1][j]); } } } int abs_val(int a, int b){ if(a > b) return a - b; else return b - a; } int main(){ char s[27]; scanf("%s", s); for(int i = 0; i < strlen(s); ++i){ for(int j = i + 1; j < strlen(s); ++j){ if(s[i] == s[j]){ puts("no"); return 0; } } } puts("yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281279/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281279/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"no\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %a.tr = phi i32 [ %a, %entry ], [ %b.tr, %tailrecurse ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ] %rem = srem i32 %a.tr, %b.tr %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i32 %b.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i, %entry %a.tr.i = phi i32 [ %a, %entry ], [ %b.tr.i, %tailrecurse.i ] %b.tr.i = phi i32 [ %b, %entry ], [ %rem.i, %tailrecurse.i ] %rem.i = srem i32 %a.tr.i, %b.tr.i %tobool.not.i = icmp eq i32 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %tailrecurse.i gcd.exit: ; preds = %tailrecurse.i %div = sdiv i32 %a, %b.tr.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @quicksort(ptr nocapture noundef %a, i32 noundef %first, i32 noundef %last) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end23, %entry %first.tr = phi i32 [ %first, %entry ], [ %add24, %if.end23 ] %add = add nsw i32 %first.tr, %last %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %for.cond for.cond: ; preds = %if.end, %tailrecurse %j.0 = phi i32 [ %last, %tailrecurse ], [ %dec19, %if.end ] %i.0 = phi i32 [ %first.tr, %tailrecurse ], [ %inc18, %if.end ] %1 = sext i32 %i.0 to i64 br label %while.cond while.cond: ; preds = %while.cond, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ %1, %for.cond ] %arrayidx2 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp slt i32 %2, %0 %indvars.iv.next = add i64 %indvars.iv, 1 br i1 %cmp, label %while.cond, label %while.cond3.preheader, !llvm.loop !9 while.cond3.preheader: ; preds = %while.cond %arrayidx2.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %3 = trunc i64 %indvars.iv to i32 %4 = sext i32 %j.0 to i64 br label %while.cond3 while.cond3: ; preds = %while.cond3, %while.cond3.preheader %indvars.iv61 = phi i64 [ %indvars.iv.next62, %while.cond3 ], [ %4, %while.cond3.preheader ] %arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv61 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp slt i32 %0, %5 %indvars.iv.next62 = add i64 %indvars.iv61, -1 br i1 %cmp6, label %while.cond3, label %while.end8, !llvm.loop !11 while.end8: ; preds = %while.cond3 %6 = trunc i64 %indvars.iv61 to i32 %cmp9.not = icmp slt i32 %3, %6 br i1 %cmp9.not, label %if.end, label %for.end if.end: ; preds = %while.end8 %arrayidx5.le = getelementptr inbounds i32, ptr %a, i64 %indvars.iv61 store i32 %5, ptr %arrayidx2.le, align 4, !tbaa !5 store i32 %2, ptr %arrayidx5.le, align 4, !tbaa !5 %inc18 = add nsw i32 %3, 1 %dec19 = add nsw i32 %6, -1 br label %for.cond for.end: ; preds = %while.end8 %sub = add nsw i32 %3, -1 %cmp20 = icmp sgt i32 %sub, %first.tr br i1 %cmp20, label %if.then21, label %if.end23 if.then21: ; preds = %for.end tail call void @quicksort(ptr noundef nonnull %a, i32 noundef %first.tr, i32 noundef %sub) br label %if.end23 if.end23: ; preds = %if.then21, %for.end %add24 = add nsw i32 %6, 1 %cmp25 = icmp slt i32 %add24, %last br i1 %cmp25, label %tailrecurse, label %if.end28 if.end28: ; preds = %if.end23 ret void } ; 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @is_prime(i32 noundef %x) local_unnamed_addr #0 { entry: %cmp = icmp slt i32 %x, 2 br i1 %cmp, label %return, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp1.not10 = icmp ult i32 %x, 4 br i1 %cmp1.not10, label %return, label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.011, 1 %mul = mul nsw i32 %inc, %inc %cmp1.not = icmp sgt i32 %mul, %x br i1 %cmp1.not, label %cleanup.loopexit, label %for.body, !llvm.loop !12 for.body: ; preds = %for.cond.preheader, %for.cond %i.011 = phi i32 [ %inc, %for.cond ], [ 2, %for.cond.preheader ] %rem = srem i32 %x, %i.011 %cmp2 = icmp ne i32 %rem, 0 br i1 %cmp2, label %for.cond, label %cleanup.loopexit cleanup.loopexit: ; preds = %for.body, %for.cond %0 = zext i1 %cmp2 to i32 br label %return return: ; preds = %for.cond.preheader, %cleanup.loopexit, %entry %retval.1 = phi i32 [ 0, %entry ], [ 1, %for.cond.preheader ], [ %0, %cleanup.loopexit ] ret i32 %retval.1 } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @is_substr(ptr nocapture noundef readonly %s, ptr nocapture noundef readonly %t, i32 noundef %i) local_unnamed_addr #3 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds i8, ptr %s, i64 %idxprom %0 = load i8, ptr %arrayidx, align 1, !tbaa !13 %cmp = icmp ne i8 %0, 0 %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #11 %cmp323.not = icmp eq i64 %call, 0 br i1 %cmp323.not, label %cleanup, label %for.body for.body: ; preds = %entry, %for.inc %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.inc ], [ %idxprom, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv28 %1 = load i8, ptr %arrayidx6, align 1, !tbaa !13 %arrayidx9 = getelementptr inbounds i8, ptr %t, i64 %indvars.iv %2 = load i8, ptr %arrayidx9, align 1, !tbaa !13 %cmp11.not = icmp eq i8 %1, %2 br i1 %cmp11.not, label %for.inc, label %cleanup for.inc: ; preds = %for.body %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next29 = add i64 %indvars.iv28, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !14 cleanup: ; preds = %for.inc, %for.body, %entry %flag.0.shrunk = phi i1 [ %cmp, %entry ], [ false, %for.body ], [ %cmp, %for.inc ] %flag.0 = zext i1 %flag.0.shrunk to i32 ret i32 %flag.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable define dso_local void @factorize(ptr nocapture noundef writeonly %ftr, ptr nocapture noundef writeonly %num, i32 noundef %n) local_unnamed_addr #5 { entry: %cmp.not10 = icmp slt i32 %n, 2 br i1 %cmp.not10, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %cnt.013 = phi i32 [ %cnt.1, %if.end ], [ 0, %entry ] %a.012 = phi i32 [ %a.1, %if.end ], [ 2, %entry ] %n.addr.011 = phi i32 [ %n.addr.1, %if.end ], [ %n, %entry ] %rem = srem i32 %n.addr.011, %a.012 %div = sdiv i32 %n.addr.011, %a.012 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %while.body %inc = add nsw i32 %cnt.013, 1 %idxprom = sext i32 %cnt.013 to i64 %arrayidx = getelementptr inbounds i32, ptr %ftr, i64 %idxprom store i32 %a.012, ptr %arrayidx, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %inc2 = add nsw i32 %a.012, 1 br label %if.end if.end: ; preds = %if.else, %if.then %n.addr.1 = phi i32 [ %div, %if.then ], [ %n.addr.011, %if.else ] %a.1 = phi i32 [ %a.012, %if.then ], [ %inc2, %if.else ] %cnt.1 = phi i32 [ %inc, %if.then ], [ %cnt.013, %if.else ] %cmp.not = icmp slt i32 %n.addr.1, %a.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %if.end, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %if.end ] store i32 %cnt.0.lcssa, ptr %num, align 4, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @comb(i32 noundef %size1, i32 noundef %size2, ptr nocapture noundef %v) local_unnamed_addr #6 { entry: %v73 = ptrtoint ptr %v to i64 %0 = zext i32 %size2 to i64 %cmp53 = icmp sgt i32 %size1, 0 br i1 %cmp53, label %for.body.preheader, label %for.cond.cleanup8 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size1 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %size1, 4 br i1 %1, label %for.cond6.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond6.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond6.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond6.preheader.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond6.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond6.preheader.unr-lcssa ] %2 = mul nuw nsw i64 %indvars.iv.epil, %0 %arrayidx.epil = getelementptr inbounds i32, ptr %v, i64 %2 store i32 1, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx5.epil = getelementptr inbounds i32, ptr %arrayidx.epil, i64 %indvars.iv.epil store i32 1, ptr %arrayidx5.epil, align 4, !tbaa !5 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond6.preheader, label %for.body.epil, !llvm.loop !16 for.cond6.preheader: ; preds = %for.body.epil, %for.cond6.preheader.unr-lcssa %cmp757 = icmp sgt i32 %size1, 1 br i1 %cmp757, label %for.cond10.preheader.preheader, label %for.cond.cleanup8 for.cond10.preheader.preheader: ; preds = %for.cond6.preheader %wide.trip.count70 = zext i32 %size1 to i64 %3 = shl nuw nsw i64 %0, 2 %4 = add i64 %3, %v73 %5 = add i64 %4, 4 %6 = shl nuw nsw i64 %0, 2 %diff.check74 = icmp ult i32 %size2, 8 br label %for.cond10.preheader for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %7 = mul nuw nsw i64 %indvars.iv, %0 %arrayidx = getelementptr inbounds i32, ptr %v, i64 %7 store i32 1, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv store i32 1, ptr %arrayidx5, align 4, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %8 = mul nuw nsw i64 %indvars.iv.next, %0 %arrayidx.1 = getelementptr inbounds i32, ptr %v, i64 %8 store i32 1, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx5.1 = getelementptr inbounds i32, ptr %arrayidx.1, i64 %indvars.iv.next store i32 1, ptr %arrayidx5.1, align 4, !tbaa !5 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %9 = mul nuw nsw i64 %indvars.iv.next.1, %0 %arrayidx.2 = getelementptr inbounds i32, ptr %v, i64 %9 store i32 1, ptr %arrayidx.2, align 4, !tbaa !5 %arrayidx5.2 = getelementptr inbounds i32, ptr %arrayidx.2, i64 %indvars.iv.next.1 store i32 1, ptr %arrayidx5.2, align 4, !tbaa !5 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %10 = mul nuw nsw i64 %indvars.iv.next.2, %0 %arrayidx.3 = getelementptr inbounds i32, ptr %v, i64 %10 store i32 1, ptr %arrayidx.3, align 4, !tbaa !5 %arrayidx5.3 = getelementptr inbounds i32, ptr %arrayidx.3, i64 %indvars.iv.next.2 store i32 1, ptr %arrayidx5.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add nuw i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond6.preheader.unr-lcssa, label %for.body, !llvm.loop !18 for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.cond.cleanup12 %indvar = phi i64 [ 0, %for.cond10.preheader.preheader ], [ %indvar.next, %for.cond.cleanup12 ] %indvars.iv66 = phi i64 [ 1, %for.cond10.preheader.preheader ], [ %indvars.iv.next67, %for.cond.cleanup12 ] %11 = mul i64 %6, %indvar %12 = add i64 %5, %11 %13 = add i64 %11, %v73 %cmp1155 = icmp ugt i64 %indvars.iv66, 1 br i1 %cmp1155, label %for.body13.lr.ph, label %for.cond.cleanup12 for.body13.lr.ph: ; preds = %for.cond10.preheader %14 = add nsw i64 %indvars.iv66, -1 %15 = mul nuw nsw i64 %14, %0 %arrayidx15 = getelementptr inbounds i32, ptr %v, i64 %15 %16 = mul nuw nsw i64 %indvars.iv66, %0 %arrayidx25 = getelementptr inbounds i32, ptr %v, i64 %16 %invariant.gep = getelementptr i32, ptr %arrayidx15, i64 -1 %min.iters.check = icmp ult i64 %indvar, 8 br i1 %min.iters.check, label %for.body13.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.body13.lr.ph %17 = sub i64 %12, %13 %diff.check = icmp ult i64 %17, 32 %conflict.rdx = or i1 %diff.check, %diff.check74 br i1 %conflict.rdx, label %for.body13.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %indvar, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = or i64 %index, 1 %18 = getelementptr i32, ptr %invariant.gep, i64 %offset.idx %wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = getelementptr i32, ptr %18, i64 4 %wide.load75 = load <4 x i32>, ptr %19, align 4, !tbaa !5 %20 = getelementptr inbounds i32, ptr %arrayidx15, i64 %offset.idx %wide.load76 = load <4 x i32>, ptr %20, align 4, !tbaa !5 %21 = getelementptr inbounds i32, ptr %20, i64 4 %wide.load77 = load <4 x i32>, ptr %21, align 4, !tbaa !5 %22 = add nsw <4 x i32> %wide.load76, %wide.load %23 = add nsw <4 x i32> %wide.load77, %wide.load75 %24 = getelementptr inbounds i32, ptr %arrayidx25, i64 %offset.idx store <4 x i32> %22, ptr %24, align 4, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 store <4 x i32> %23, ptr %25, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %indvar, %n.vec br i1 %cmp.n, label %for.cond.cleanup12, label %for.body13.preheader for.body13.preheader: ; preds = %vector.memcheck, %for.body13.lr.ph, %middle.block %indvars.iv60.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %for.body13.lr.ph ], [ %ind.end, %middle.block ] %27 = sub i64 %indvars.iv66, %indvars.iv60.ph %28 = sub i64 %indvar, %indvars.iv60.ph %xtraiter78 = and i64 %27, 3 %lcmp.mod79.not = icmp eq i64 %xtraiter78, 0 br i1 %lcmp.mod79.not, label %for.body13.prol.loopexit, label %for.body13.prol for.body13.prol: ; preds = %for.body13.preheader, %for.body13.prol %indvars.iv60.prol = phi i64 [ %indvars.iv.next61.prol, %for.body13.prol ], [ %indvars.iv60.ph, %for.body13.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body13.prol ], [ 0, %for.body13.preheader ] %gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv60.prol %29 = load i32, ptr %gep.prol, align 4, !tbaa !5 %arrayidx23.prol = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv60.prol %30 = load i32, ptr %arrayidx23.prol, align 4, !tbaa !5 %add.prol = add nsw i32 %30, %29 %arrayidx27.prol = getelementptr inbounds i32, ptr %arrayidx25, i64 %indvars.iv60.prol store i32 %add.prol, ptr %arrayidx27.prol, align 4, !tbaa !5 %indvars.iv.next61.prol = add nuw nsw i64 %indvars.iv60.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter78 br i1 %prol.iter.cmp.not, label %for.body13.prol.loopexit, label %for.body13.prol, !llvm.loop !22 for.body13.prol.loopexit: ; preds = %for.body13.prol, %for.body13.preheader %indvars.iv60.unr = phi i64 [ %indvars.iv60.ph, %for.body13.preheader ], [ %indvars.iv.next61.prol, %for.body13.prol ] %31 = icmp ult i64 %28, 3 br i1 %31, label %for.cond.cleanup12, label %for.body13 for.cond.cleanup8: ; preds = %for.cond.cleanup12, %entry, %for.cond6.preheader ret void for.cond.cleanup12: ; preds = %for.body13.prol.loopexit, %for.body13, %middle.block, %for.cond10.preheader %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %exitcond71.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count70 %indvar.next = add i64 %indvar, 1 br i1 %exitcond71.not, label %for.cond.cleanup8, label %for.cond10.preheader, !llvm.loop !23 for.body13: ; preds = %for.body13.prol.loopexit, %for.body13 %indvars.iv60 = phi i64 [ %indvars.iv.next61.3, %for.body13 ], [ %indvars.iv60.unr, %for.body13.prol.loopexit ] %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv60 %32 = load i32, ptr %gep, align 4, !tbaa !5 %arrayidx23 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv60 %33 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %add = add nsw i32 %33, %32 %arrayidx27 = getelementptr inbounds i32, ptr %arrayidx25, i64 %indvars.iv60 store i32 %add, ptr %arrayidx27, align 4, !tbaa !5 %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %gep.1 = getelementptr i32, ptr %arrayidx15, i64 %indvars.iv60 %34 = load i32, ptr %gep.1, align 4, !tbaa !5 %arrayidx23.1 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv.next61 %35 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %add.1 = add nsw i32 %35, %34 %arrayidx27.1 = getelementptr inbounds i32, ptr %arrayidx25, i64 %indvars.iv.next61 store i32 %add.1, ptr %arrayidx27.1, align 4, !tbaa !5 %indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 2 %gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next61.1 %36 = load i32, ptr %gep.2, align 4, !tbaa !5 %arrayidx23.2 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv.next61.1 %37 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5 %add.2 = add nsw i32 %37, %36 %arrayidx27.2 = getelementptr inbounds i32, ptr %arrayidx25, i64 %indvars.iv.next61.1 store i32 %add.2, ptr %arrayidx27.2, align 4, !tbaa !5 %indvars.iv.next61.2 = add nuw nsw i64 %indvars.iv60, 3 %gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next61.2 %38 = load i32, ptr %gep.3, align 4, !tbaa !5 %arrayidx23.3 = getelementptr inbounds i32, ptr %arrayidx15, i64 %indvars.iv.next61.2 %39 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5 %add.3 = add nsw i32 %39, %38 %arrayidx27.3 = getelementptr inbounds i32, ptr %arrayidx25, i64 %indvars.iv.next61.2 store i32 %add.3, ptr %arrayidx27.3, align 4, !tbaa !5 %indvars.iv.next61.3 = add nuw nsw i64 %indvars.iv60, 4 %exitcond65.not.3 = icmp eq i64 %indvars.iv.next61.3, %indvars.iv66 br i1 %exitcond65.not.3, label %for.cond.cleanup12, label %for.body13, !llvm.loop !24 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @abs_val(i32 noundef %a, i32 noundef %b) local_unnamed_addr #7 { entry: %sub = sub nsw i32 %a, %b %retval.0 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #8 { entry: %s = alloca [27 x i8], align 16 call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %s) #12 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #11 %cmp.not37.not = icmp eq i64 %call2, 0 br i1 %cmp.not37.not, label %cleanup25, label %for.body for.cond.loopexit: ; preds = %for.cond4, %for.body %indvars.iv.next = add nuw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next44, %call2 br i1 %exitcond.not, label %cleanup25, label %for.body, !llvm.loop !25 for.body: ; preds = %entry, %for.cond.loopexit %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.cond.loopexit ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond.loopexit ], [ 1, %entry ] %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %cmp8.not34 = icmp ugt i64 %call2, %indvars.iv.next44 br i1 %cmp8.not34, label %for.body11.lr.ph, label %for.cond.loopexit for.body11.lr.ph: ; preds = %for.body %arrayidx = getelementptr inbounds [27 x i8], ptr %s, i64 0, i64 %indvars.iv43 %0 = load i8, ptr %arrayidx, align 1, !tbaa !13 br label %for.body11 for.cond4: ; preds = %for.body11 %indvars.iv.next41 = add nuw i64 %indvars.iv40, 1 %cmp8.not = icmp ugt i64 %call2, %indvars.iv.next41 br i1 %cmp8.not, label %for.body11, label %for.cond.loopexit, !llvm.loop !26 for.body11: ; preds = %for.body11.lr.ph, %for.cond4 %indvars.iv40 = phi i64 [ %indvars.iv, %for.body11.lr.ph ], [ %indvars.iv.next41, %for.cond4 ] %arrayidx14 = getelementptr inbounds [27 x i8], ptr %s, i64 0, i64 %indvars.iv40 %1 = load i8, ptr %arrayidx14, align 1, !tbaa !13 %cmp16 = icmp eq i8 %0, %1 br i1 %cmp16, label %cleanup25, label %for.cond4 cleanup25: ; preds = %for.cond.loopexit, %for.body11, %entry %.str.1.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body11 ], [ @.str.2, %for.cond.loopexit ] %call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %s) #12 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #10 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { 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 #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #11 = { nounwind willreturn memory(read) } attributes #12 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!7, !7, i64 0} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !20, !21} !20 = !{!"llvm.loop.isvectorized", i32 1} !21 = !{!"llvm.loop.unroll.runtime.disable"} !22 = distinct !{!22, !17} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10, !20} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10}
#include <stdio.h> #include <string.h> int main(void){ char st[27],alp[26]; int i,n; scanf("%s",st); n=strlen(st); for(i=0;i<26;i++) alp[i]=0; for(i=0;i<n;i++){ alp[st[i]-'a']++; if(alp[st[i]-'a'] >= 2){printf("no\n");return 0;} } printf("yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281321/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281321/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [4 x i8] c"yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"no\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %st = alloca [27 x i8], align 16 %alp = alloca [26 x i8], align 16 call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %st) #6 call void @llvm.lifetime.start.p0(i64 26, ptr nonnull %alp) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %st) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %st) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(26) %alp, i8 0, i64 26, i1 false), !tbaa !5 %conv = trunc i64 %call2 to i32 %cmp539 = icmp sgt i32 %conv, 0 br i1 %cmp539, label %for.body7.preheader, label %cleanup for.body7.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 br label %for.body7 for.cond4: ; preds = %for.body7 %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.body7, !llvm.loop !8 for.body7: ; preds = %for.body7.preheader, %for.cond4 %indvars.iv = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next, %for.cond4 ] %arrayidx9 = getelementptr inbounds [27 x i8], ptr %st, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %conv10 = sext i8 %0 to i64 %sub = add nsw i64 %conv10, -97 %arrayidx12 = getelementptr inbounds [26 x i8], ptr %alp, i64 0, i64 %sub %1 = load i8, ptr %arrayidx12, align 1, !tbaa !5 %inc13 = add i8 %1, 1 store i8 %inc13, ptr %arrayidx12, align 1, !tbaa !5 %cmp21 = icmp sgt i8 %inc13, 1 br i1 %cmp21, label %cleanup, label %for.cond4 cleanup: ; preds = %for.cond4, %for.body7, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.3, %for.body7 ], [ @str, %for.cond4 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %alp) #6 call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %st) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(){ char S[27]; int a[27], i, len; scanf("%s", S); len = strlen(S); for(i=0; i<27; i++){ a[i] = 0; } for(i=0; i<len; i++){ if(a[S[i]-'a'] == 0) a[S[i]-'a']++; else{ printf("no\n"); return 0; } } printf("yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281365/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281365/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [4 x i8] c"yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"no\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [27 x i8], align 16 %a = alloca [27 x i32], align 16 call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %S) #6 call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %a) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(108) %a, i8 0, i64 108, i1 false), !tbaa !5 %conv = trunc i64 %call2 to i32 %cmp538 = icmp sgt i32 %conv, 0 br i1 %cmp538, label %for.body7.preheader, label %cleanup for.body7.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 br label %for.body7 for.body7: ; preds = %for.body7.preheader, %if.then %indvars.iv = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next, %if.then ] %arrayidx9 = getelementptr inbounds [27 x i8], ptr %S, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx9, align 1, !tbaa !9 %conv10 = sext i8 %0 to i64 %sub = add nsw i64 %conv10, -97 %arrayidx12 = getelementptr inbounds [27 x i32], ptr %a, i64 0, i64 %sub %1 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp eq i32 %1, 0 br i1 %cmp13, label %if.then, label %cleanup if.then: ; preds = %for.body7 store i32 1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body7, !llvm.loop !10 cleanup: ; preds = %if.then, %for.body7, %entry %str.sink = phi ptr [ @str, %entry ], [ @str.3, %for.body7 ], [ @str, %if.then ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %S) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <inttypes.h> int main(void) { uint_fast8_t a[26] = { 0 }; char s[27]; scanf("%s", s); char *p = s; while (*p != '\0') { if (++a[*p++ - 'a'] > 1) { puts("no"); return 0; } } puts("yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"no\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [26 x i8], align 16 %s = alloca [27 x i8], align 16 call void @llvm.lifetime.start.p0(i64 26, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(26) %a, i8 0, i64 26, i1 false) call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %while.cond while.cond: ; preds = %while.body, %entry %p.0 = phi ptr [ %s, %entry ], [ %incdec.ptr, %while.body ] %0 = load i8, ptr %p.0, align 1, !tbaa !5 %cmp.not = icmp eq i8 %0, 0 br i1 %cmp.not, label %cleanup, label %while.body while.body: ; preds = %while.cond %conv = sext i8 %0 to i64 %incdec.ptr = getelementptr inbounds i8, ptr %p.0, i64 1 %sub = add nsw i64 %conv, -97 %arrayidx = getelementptr inbounds [26 x i8], ptr %a, i64 0, i64 %sub %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %inc = add i8 %1, 1 store i8 %inc, ptr %arrayidx, align 1, !tbaa !5 %cmp5 = icmp ugt i8 %inc, 1 br i1 %cmp5, label %cleanup, label %while.cond, !llvm.loop !8 cleanup: ; preds = %while.cond, %while.body %.str.2.sink = phi ptr [ @.str.1, %while.body ], [ @.str.2, %while.cond ] %call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 26, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int c,i,a[26]={}; while((c=getchar())!=EOF){ a[c-97]++; if(a[c-97]==2){ printf("no"); return 0; } } for(i=0;i<26;i++){ if(a[i]>=2){ printf("no"); return 0; } } printf("yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281488/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"no\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"yes\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false) br label %while.cond while.cond: ; preds = %while.body, %entry %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %cmp.not = icmp eq i32 %call.i, -1 br i1 %cmp.not, label %for.body.preheader, label %while.body for.body.preheader: ; preds = %while.cond %1 = load <16 x i32>, ptr %a, align 16 %.fr = freeze <16 x i32> %1 %2 = icmp sgt <16 x i32> %.fr, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %arrayidx8.16 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16 %3 = load <8 x i32>, ptr %arrayidx8.16, align 16 %.fr48 = freeze <8 x i32> %3 %4 = icmp sgt <8 x i32> %.fr48, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %arrayidx8.24 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24 %5 = load i32, ptr %arrayidx8.24, align 16 %.fr49 = freeze i32 %5 %cmp9.24 = icmp sgt i32 %.fr49, 1 %arrayidx8.25 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25 %6 = load i32, ptr %arrayidx8.25, align 4 %cmp9.25 = icmp sgt i32 %6, 1 %7 = bitcast <16 x i1> %2 to i16 %8 = icmp ne i16 %7, 0 %9 = bitcast <8 x i1> %4 to i8 %10 = icmp ne i8 %9, 0 %op.rdx = or i1 %8, %10 %op.rdx46 = or i1 %op.rdx, %cmp9.24 %op.rdx47 = select i1 %op.rdx46, i1 true, i1 %cmp9.25 %.str..str.1 = select i1 %op.rdx47, ptr @.str, ptr @.str.1 br label %cleanup while.body: ; preds = %while.cond %sub = add nsw i32 %call.i, -97 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %idxprom %11 = load i32, ptr %arrayidx, align 4, !tbaa !9 %inc = add nsw i32 %11, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !9 %cmp4 = icmp eq i32 %inc, 2 br i1 %cmp4, label %cleanup, label %while.cond, !llvm.loop !11 cleanup: ; preds = %while.body, %for.body.preheader %.str.1.sink = phi ptr [ %.str..str.1, %for.body.preheader ], [ @.str, %while.body ] %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 104, 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: 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 @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 @getc(ptr nocapture 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 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define MOD 998244353 char s[200001]; long long n; int main() { long long ns, ne; char buf; scanf("%I64d", &n); scanf("%s", s); buf = s[0]; for (ns = 0; ns < n - 1; ns++) { if (buf == s[ns + 1]) continue; else break; } buf = s[n - 1]; for (ne = n - 1; ne > 0; ne--) { if (buf == s[ne - 1]) continue; else break; } if (s[0] == s[n - 1]) { printf("%I64d", ((ns + 2) * (n - ne + 1) % MOD)); } else { printf("%I64d", ns + 1 + (n - ne) + 1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28156/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28156/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%I64d\00", align 1 @n = dso_local global i64 0, align 8 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @s = dso_local global [200001 x i8] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s) %0 = load i8, ptr @s, align 16, !tbaa !5 %1 = load i64, ptr @n, align 8, !tbaa !8 %sub = add i64 %1, -1 %smax = tail call i64 @llvm.smax.i64(i64 %sub, i64 0) br label %for.cond for.cond: ; preds = %for.body, %entry %ns.0 = phi i64 [ 0, %entry ], [ %add, %for.body ] %exitcond.not = icmp eq i64 %ns.0, %smax br i1 %exitcond.not, label %for.end, label %for.body for.body: ; preds = %for.cond %add = add nuw nsw i64 %ns.0, 1 %arrayidx = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %add %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp3 = icmp eq i8 %0, %2 br i1 %cmp3, label %for.cond, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %for.cond %ns.0.lcssa = phi i64 [ %ns.0, %for.body ], [ %smax, %for.cond ] %arrayidx6 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %sub %3 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %smin = tail call i64 @llvm.smin.i64(i64 %sub, i64 0) br label %for.cond8 for.cond8: ; preds = %for.body11, %for.end %ne.0 = phi i64 [ %sub, %for.end ], [ %sub13, %for.body11 ] %cmp9 = icmp sgt i64 %ne.0, 0 br i1 %cmp9, label %for.body11, label %for.end21 for.body11: ; preds = %for.cond8 %sub13 = add nsw i64 %ne.0, -1 %arrayidx14 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %sub13 %4 = load i8, ptr %arrayidx14, align 1, !tbaa !5 %cmp16 = icmp eq i8 %3, %4 br i1 %cmp16, label %for.cond8, label %for.end21, !llvm.loop !12 for.end21: ; preds = %for.body11, %for.cond8 %ne.0.lcssa = phi i64 [ %ne.0, %for.body11 ], [ %smin, %for.cond8 ] %cmp26 = icmp eq i8 %0, %3 %add29 = add nuw i64 %ns.0.lcssa, 2 br i1 %cmp26, label %if.then28, label %if.else33 if.then28: ; preds = %for.end21 %sub30 = add i64 %1, 1 %add31 = sub i64 %sub30, %ne.0.lcssa %mul = mul nsw i64 %add31, %add29 %rem = srem i64 %mul, 998244353 br label %if.end if.else33: ; preds = %for.end21 %add36 = add i64 %add29, %1 %add37 = sub i64 %add36, %ne.0.lcssa br label %if.end if.end: ; preds = %if.else33, %if.then28 %add37.sink = phi i64 [ %add37, %if.else33 ], [ %rem, %if.then28 ] %call38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add37.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"long long", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include<stdio.h> void swap(int *a, int *b){ int temp = *a; *a = *b; *b = temp; } int bubbleSort(int A[],int N){ int i,j; int sw = 0; unsigned short flag = 1; for(i=0;flag;i++){ flag = 0; for(j=N-1;j>=i+1;j--){ if(A[j]<A[j-1]){ swap(&A[j],&A[j-1]); flag = 1; sw++; } } } return sw; } int main(void){ int i,A[100],N,sw; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d",&A[i]); sw = bubbleSort(A,N); for(i=0;i<N;i++){ if (i) printf(" "); printf("%d",A[i]); } printf("\n%d\n",sw); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281602/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281602/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress 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(argmem: readwrite) uwtable define dso_local i32 @bubbleSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #2 { entry: %0 = sext i32 %N to i64 %invariant.gep = getelementptr i32, ptr %A, i64 -2 br label %for.cond1.preheader for.cond.loopexit: ; preds = %for.inc %tobool.not = icmp eq i16 %flag.2, 0 br i1 %tobool.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !9 for.cond1.preheader: ; preds = %entry, %for.cond.loopexit %indvars.iv36 = phi i64 [ 0, %entry ], [ %indvars.iv.next37, %for.cond.loopexit ] %sw.034 = phi i32 [ 0, %entry ], [ %sw.2, %for.cond.loopexit ] %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1 %cmp.not.not26 = icmp slt i64 %indvars.iv.next37, %0 br i1 %cmp.not.not26, label %for.body2, label %for.end14 for.body2: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %0, %for.cond1.preheader ] %flag.129 = phi i16 [ %flag.2, %for.inc ], [ 0, %for.cond1.preheader ] %sw.128 = phi i32 [ %sw.2, %for.inc ], [ %sw.034, %for.cond1.preheader ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %2 = load i32, ptr %gep, align 4, !tbaa !5 %cmp6 = icmp slt i32 %1, %2 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body2 store i32 %2, ptr %arrayidx, align 4, !tbaa !5 store i32 %1, ptr %gep, align 4, !tbaa !5 %inc = add nsw i32 %sw.128, 1 br label %for.inc for.inc: ; preds = %for.body2, %if.then %sw.2 = phi i32 [ %inc, %if.then ], [ %sw.128, %for.body2 ] %flag.2 = phi i16 [ 1, %if.then ], [ %flag.129, %for.body2 ] %cmp.not.not = icmp sgt i64 %indvars.iv.next, %indvars.iv.next37 br i1 %cmp.not.not, label %for.body2, label %for.cond.loopexit, !llvm.loop !11 for.end14: ; preds = %for.cond1.preheader, %for.cond.loopexit %sw.1.lcssa42 = phi i32 [ %sw.2, %for.cond.loopexit ], [ %sw.034, %for.cond1.preheader ] ret i32 %sw.1.lcssa42 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %A = alloca [100 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %0, 0 br i1 %cmp20, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre30 = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !12 for.end.loopexit: ; preds = %for.body %3 = icmp sgt i32 %1, 0 br label %for.end for.end: ; preds = %entry.for.end_crit_edge, %for.end.loopexit %.pre-phi = phi i64 [ %.pre30, %entry.for.end_crit_edge ], [ %2, %for.end.loopexit ] %cmp422 = phi i1 [ false, %entry.for.end_crit_edge ], [ %3, %for.end.loopexit ] %invariant.gep.i = getelementptr i32, ptr %A, i64 -2 %smax = call i64 @llvm.smax.i64(i64 %.pre-phi, i64 1) %4 = add nsw i64 %smax, -1 br label %for.cond1.preheader.i for.cond.loopexit.i: ; preds = %for.inc.i %tobool.not.i = icmp eq i16 %flag.2.i, 0 br i1 %tobool.not.i, label %bubbleSort.exit, label %for.cond1.preheader.i, !llvm.loop !9 for.cond1.preheader.i: ; preds = %for.cond.loopexit.i, %for.end %indvars.iv36.i = phi i64 [ 0, %for.end ], [ %indvars.iv.next37.i, %for.cond.loopexit.i ] %sw.034.i = phi i32 [ 0, %for.end ], [ %sw.2.i, %for.cond.loopexit.i ] %indvars.iv.next37.i = add nuw nsw i64 %indvars.iv36.i, 1 %exitcond.not = icmp eq i64 %indvars.iv36.i, %4 br i1 %exitcond.not, label %bubbleSort.exit, label %for.body2.i for.body2.i: ; preds = %for.cond1.preheader.i, %for.inc.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %.pre-phi, %for.cond1.preheader.i ] %flag.129.i = phi i16 [ %flag.2.i, %for.inc.i ], [ 0, %for.cond1.preheader.i ] %sw.128.i = phi i32 [ %sw.2.i, %for.inc.i ], [ %sw.034.i, %for.cond1.preheader.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i %5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i %6 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp6.i = icmp slt i32 %5, %6 br i1 %cmp6.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body2.i store i32 %6, ptr %arrayidx.i, align 4, !tbaa !5 store i32 %5, ptr %gep.i, align 4, !tbaa !5 %inc.i = add nsw i32 %sw.128.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body2.i %sw.2.i = phi i32 [ %inc.i, %if.then.i ], [ %sw.128.i, %for.body2.i ] %flag.2.i = phi i16 [ 1, %if.then.i ], [ %flag.129.i, %for.body2.i ] %cmp.not.not.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv.next37.i br i1 %cmp.not.not.i, label %for.body2.i, label %for.cond.loopexit.i, !llvm.loop !11 bubbleSort.exit: ; preds = %for.cond.loopexit.i, %for.cond1.preheader.i %sw.1.lcssa42.i = phi i32 [ %sw.2.i, %for.cond.loopexit.i ], [ %sw.034.i, %for.cond1.preheader.i ] br i1 %cmp422, label %if.end.peel, label %for.end12 if.end.peel: ; preds = %bubbleSort.exit %.pre = load i32, ptr %A, align 16, !tbaa !5 %call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %7 = load i32, ptr %N, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %7, 1 br i1 %cmp4.peel, label %if.end, label %for.end12 if.end: ; preds = %if.end.peel, %if.end %indvars.iv26 = phi i64 [ %indvars.iv.next27, %if.end ], [ 1, %if.end.peel ] %putchar = call i32 @putchar(i32 32) %arrayidx8 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv26 %8 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1 %9 = load i32, ptr %N, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next27, %10 br i1 %cmp4, label %if.end, label %for.end12, !llvm.loop !13 for.end12: ; preds = %if.end, %if.end.peel, %bubbleSort.exit %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sw.1.lcssa42.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #define N 100 #define swap(a,b) a^=b^=a^=b int main(){ int length, i, j, a[N], flag = 0; scanf("%d", &length); for(i = 0; i < length; i++) scanf("%d", &a[i]); for(i = 0; i < length - 1; i++){ for(j = length - 1; j >= i + 1; j--){ if(a[j] < a[j-1]){ swap(a[j], a[j-1]); flag++; } } } for(i = 0; i < length; i++){ printf("%d", a[i]); if(i != length - 1) printf(" "); } printf("\n%d\n", flag); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281653/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %length = alloca i32, align 4 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %length) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %length) %0 = load i32, ptr %length, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.body, label %for.end46 for.cond2.preheader: ; preds = %for.body %cmp370 = icmp sgt i32 %3, 1 br i1 %cmp370, label %for.cond6.preheader.preheader, label %for.cond33.preheader for.cond6.preheader.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %3, -1 %1 = zext i32 %3 to i64 %2 = add nsw i64 %1, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx10.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %2 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %length, 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.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc30 %indvars.iv81 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next82, %for.inc30 ] %flag.072 = phi i32 [ 0, %for.cond6.preheader.preheader ], [ %flag.2, %for.inc30 ] %.pre = load i32, ptr %arrayidx10.phi.trans.insert, align 4, !tbaa !5 br label %for.body8 for.cond33.preheader: ; preds = %for.inc30, %for.cond2.preheader %flag.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %flag.2, %for.inc30 ] %cmp3474 = icmp sgt i32 %3, 0 br i1 %cmp3474, label %for.body35, label %for.end46 for.body8: ; preds = %for.cond6.preheader, %for.inc28 %5 = phi i32 [ %.pre, %for.cond6.preheader ], [ %7, %for.inc28 ] %indvars.iv78 = phi i64 [ %2, %for.cond6.preheader ], [ %indvars.iv.next79, %for.inc28 ] %flag.169 = phi i32 [ %flag.072, %for.cond6.preheader ], [ %flag.2, %for.inc28 ] %indvars.iv.next79 = add nsw i64 %indvars.iv78, -1 %arrayidx13 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next79 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp slt i32 %5, %6 br i1 %cmp14, label %if.then, label %for.inc28 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv78 store i32 %5, ptr %arrayidx13, align 4, !tbaa !5 store i32 %6, ptr %arrayidx10, align 4, !tbaa !5 %inc27 = add nsw i32 %flag.169, 1 br label %for.inc28 for.inc28: ; preds = %for.body8, %if.then %7 = phi i32 [ %5, %if.then ], [ %6, %for.body8 ] %flag.2 = phi i32 [ %inc27, %if.then ], [ %flag.169, %for.body8 ] %cmp7.not.not = icmp sgt i64 %indvars.iv.next79, %indvars.iv81 br i1 %cmp7.not.not, label %for.body8, label %for.inc30, !llvm.loop !11 for.inc30: ; preds = %for.inc28 %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count br i1 %exitcond.not, label %for.cond33.preheader, label %for.cond6.preheader, !llvm.loop !12 for.body35: ; preds = %for.cond33.preheader, %for.inc44 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.inc44 ], [ 0, %for.cond33.preheader ] %arrayidx37 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv84 %8 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %9 = load i32, ptr %length, align 4, !tbaa !5 %sub39 = add nsw i32 %9, -1 %10 = zext i32 %sub39 to i64 %cmp40.not = icmp eq i64 %indvars.iv84, %10 br i1 %cmp40.not, label %for.inc44, label %if.then41 if.then41: ; preds = %for.body35 %putchar = call i32 @putchar(i32 32) %.pre87 = load i32, ptr %length, align 4, !tbaa !5 br label %for.inc44 for.inc44: ; preds = %for.body35, %if.then41 %11 = phi i32 [ %9, %for.body35 ], [ %.pre87, %if.then41 ] %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %12 = sext i32 %11 to i64 %cmp34 = icmp slt i64 %indvars.iv.next85, %12 br i1 %cmp34, label %for.body35, label %for.end46, !llvm.loop !13 for.end46: ; preds = %for.inc44, %entry, %for.cond33.preheader %flag.0.lcssa91 = phi i32 [ %flag.0.lcssa, %for.cond33.preheader ], [ 0, %entry ], [ %flag.0.lcssa, %for.inc44 ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %flag.0.lcssa91) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %length) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #define LOOP_INIT 0 /* ?????????????????? */ #define SORT_CNT_INIT 0 /* ??????????????°????????????????????? */ #define TRUE 1 /* ??£?????? */ #define FALSE 0 /* ????????? */ #define TESTCASE_ARRAY_MAX 100 /* ????´???????????????§??? */ #define EXIT_SUCCESS 0 /* ??£????????????????????? */ #define PREV_ITEM( x ) x - 1 /* 1?????????????´? */ int main( void ) { unsigned char aubW_Dtestcase[ TESTCASE_ARRAY_MAX ]; /* ????´??????? */ unsigned char ubW_Dtc_cnt; /* ????´???° */ unsigned char ubW_Dchange; /* ????????¨?????° */ unsigned char ubW_Ctc_loop_cnt; /* ????????????????????? */ unsigned short usW_Csort_cnt = SORT_CNT_INIT; /* ??????????????°???????????? */ unsigned char ubW_Floop_flug = TRUE; /* ?????????????????° */ scanf("%d", &ubW_Dtc_cnt ); /* ????´???°?????\??? */ /* ??\?????¨????????? */ for( ubW_Ctc_loop_cnt = LOOP_INIT; ubW_Ctc_loop_cnt < ubW_Dtc_cnt; ubW_Ctc_loop_cnt++ ){ scanf("%d", &aubW_Dtestcase[ ubW_Ctc_loop_cnt ] ); /* ????´??????\??? */ } /* ?????????????????°???TRUE??????????????? */ while( ubW_Floop_flug ){ ubW_Floop_flug = FALSE; /* ?????????????????°???FALSE??? */ /* ???????????¨????????? */ for( ubW_Ctc_loop_cnt = LOOP_INIT; ubW_Ctc_loop_cnt < ubW_Dtc_cnt; ubW_Ctc_loop_cnt++ ){ /* 1?????????????´?????????¨???????´?????????§????????´??? */ if( aubW_Dtestcase[ ubW_Ctc_loop_cnt ] < aubW_Dtestcase[ PREV_ITEM( ubW_Ctc_loop_cnt ) ] ){ ubW_Dchange = aubW_Dtestcase[ ubW_Ctc_loop_cnt ]; /* ????????¨?????°???????´?????????? */ aubW_Dtestcase[ ubW_Ctc_loop_cnt ] = aubW_Dtestcase[ PREV_ITEM( ubW_Ctc_loop_cnt ) ]; /* ?????¨???????´????1?????????????´????????????? */ aubW_Dtestcase[ PREV_ITEM( ubW_Ctc_loop_cnt ) ] = ubW_Dchange; /* 1?????????????´?????????¨???????´????????????? */ ubW_Floop_flug = TRUE; /* ?????????????????°???TRUE??? */ usW_Csort_cnt++; /* ??????????????°???????????????+1 */ } else{ /* else?????????????????????????????\ */ } }/* ???????????¨?????????????????? */ }/* ?????????????????°???TRUE???????????????????????? */ /* ????????¨????????? */ for( ubW_Ctc_loop_cnt = LOOP_INIT; ubW_Ctc_loop_cnt < PREV_ITEM( ubW_Dtc_cnt ); ubW_Ctc_loop_cnt++ ){ printf("%d ", aubW_Dtestcase[ ubW_Ctc_loop_cnt ] ); /* ????´???°-1?????§???????´?????????? */ } printf("%d\n", aubW_Dtestcase[ PREV_ITEM( ubW_Dtc_cnt ) ]); /* ?????????????´??????????????????? */ printf("%d\n", usW_Csort_cnt); /* ??????????????°????????? */ return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281710/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %aubW_Dtestcase = alloca [100 x i8], align 16 %ubW_Dtc_cnt = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %aubW_Dtestcase) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ubW_Dtc_cnt) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ubW_Dtc_cnt) %0 = load i8, ptr %ubW_Dtc_cnt, align 1, !tbaa !5 %cmp71.not = icmp eq i8 %0, 0 br i1 %cmp71.not, label %for.end48, label %for.body while.cond.preheader: ; preds = %for.body %cmp773.not = icmp eq i8 %8, 0 br i1 %cmp773.not, label %for.end48, label %for.cond4.preheader.us.preheader for.cond4.preheader.us.preheader: ; preds = %while.cond.preheader %wide.trip.count = zext i8 %8 to i64 %arrayidx15.us.phi.trans.insert = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 -1 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i8 %8, 1 %unroll_iter = and i64 %wide.trip.count, 254 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond4.preheader.us for.cond4.preheader.us: ; preds = %for.cond4.preheader.us.preheader, %for.cond4.while.cond.loopexit_crit_edge.us %usW_Csort_cnt.079.us = phi i16 [ %usW_Csort_cnt.2.us.lcssa, %for.cond4.while.cond.loopexit_crit_edge.us ], [ 0, %for.cond4.preheader.us.preheader ] %.pre = load i8, ptr %arrayidx15.us.phi.trans.insert, align 1, !tbaa !5 br i1 %1, label %for.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa, label %for.body9.us for.body9.us: ; preds = %for.cond4.preheader.us, %for.inc32.us.1 %2 = phi i8 [ %6, %for.inc32.us.1 ], [ %.pre, %for.cond4.preheader.us ] %indvars.iv88 = phi i64 [ %indvars.iv.next89.1, %for.inc32.us.1 ], [ 0, %for.cond4.preheader.us ] %ubW_Floop_flug.176.us = phi i8 [ %ubW_Floop_flug.2.us.1, %for.inc32.us.1 ], [ 0, %for.cond4.preheader.us ] %usW_Csort_cnt.175.us = phi i16 [ %usW_Csort_cnt.2.us.1, %for.inc32.us.1 ], [ %usW_Csort_cnt.079.us, %for.cond4.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc32.us.1 ], [ 0, %for.cond4.preheader.us ] %arrayidx11.us = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %indvars.iv88 %3 = load i8, ptr %arrayidx11.us, align 2, !tbaa !5 %cmp17.us = icmp ult i8 %3, %2 br i1 %cmp17.us, label %if.then.us, label %for.inc32.us if.then.us: ; preds = %for.body9.us %sub.us = add nsw i64 %indvars.iv88, -1 %arrayidx15.us = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %sub.us store i8 %2, ptr %arrayidx11.us, align 2, !tbaa !5 store i8 %3, ptr %arrayidx15.us, align 1, !tbaa !5 %inc31.us = add i16 %usW_Csort_cnt.175.us, 1 br label %for.inc32.us for.inc32.us: ; preds = %if.then.us, %for.body9.us %4 = phi i8 [ %2, %if.then.us ], [ %3, %for.body9.us ] %usW_Csort_cnt.2.us = phi i16 [ %inc31.us, %if.then.us ], [ %usW_Csort_cnt.175.us, %for.body9.us ] %ubW_Floop_flug.2.us = phi i8 [ 1, %if.then.us ], [ %ubW_Floop_flug.176.us, %for.body9.us ] %indvars.iv.next89 = or i64 %indvars.iv88, 1 %arrayidx11.us.1 = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %indvars.iv.next89 %5 = load i8, ptr %arrayidx11.us.1, align 1, !tbaa !5 %cmp17.us.1 = icmp ult i8 %5, %4 br i1 %cmp17.us.1, label %if.then.us.1, label %for.inc32.us.1 if.then.us.1: ; preds = %for.inc32.us %arrayidx15.us.1 = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %indvars.iv88 store i8 %4, ptr %arrayidx11.us.1, align 1, !tbaa !5 store i8 %5, ptr %arrayidx15.us.1, align 2, !tbaa !5 %inc31.us.1 = add i16 %usW_Csort_cnt.2.us, 1 br label %for.inc32.us.1 for.inc32.us.1: ; preds = %if.then.us.1, %for.inc32.us %6 = phi i8 [ %4, %if.then.us.1 ], [ %5, %for.inc32.us ] %usW_Csort_cnt.2.us.1 = phi i16 [ %inc31.us.1, %if.then.us.1 ], [ %usW_Csort_cnt.2.us, %for.inc32.us ] %ubW_Floop_flug.2.us.1 = phi i8 [ 1, %if.then.us.1 ], [ %ubW_Floop_flug.2.us, %for.inc32.us ] %indvars.iv.next89.1 = add nuw nsw i64 %indvars.iv88, 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.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa, label %for.body9.us, !llvm.loop !8 for.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa: ; preds = %for.inc32.us.1, %for.cond4.preheader.us %usW_Csort_cnt.2.us.lcssa.ph = phi i16 [ undef, %for.cond4.preheader.us ], [ %usW_Csort_cnt.2.us.1, %for.inc32.us.1 ] %ubW_Floop_flug.2.us.lcssa.ph = phi i8 [ undef, %for.cond4.preheader.us ], [ %ubW_Floop_flug.2.us.1, %for.inc32.us.1 ] %.unr = phi i8 [ %.pre, %for.cond4.preheader.us ], [ %6, %for.inc32.us.1 ] %indvars.iv88.unr = phi i64 [ 0, %for.cond4.preheader.us ], [ %indvars.iv.next89.1, %for.inc32.us.1 ] %ubW_Floop_flug.176.us.unr = phi i8 [ 0, %for.cond4.preheader.us ], [ %ubW_Floop_flug.2.us.1, %for.inc32.us.1 ] %usW_Csort_cnt.175.us.unr = phi i16 [ %usW_Csort_cnt.079.us, %for.cond4.preheader.us ], [ %usW_Csort_cnt.2.us.1, %for.inc32.us.1 ] br i1 %lcmp.mod.not, label %for.cond4.while.cond.loopexit_crit_edge.us, label %for.body9.us.epil for.body9.us.epil: ; preds = %for.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa %arrayidx11.us.epil = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %indvars.iv88.unr %7 = load i8, ptr %arrayidx11.us.epil, align 1, !tbaa !5 %cmp17.us.epil = icmp ult i8 %7, %.unr br i1 %cmp17.us.epil, label %if.then.us.epil, label %for.cond4.while.cond.loopexit_crit_edge.us if.then.us.epil: ; preds = %for.body9.us.epil %sub.us.epil = add nsw i64 %indvars.iv88.unr, -1 %arrayidx15.us.epil = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %sub.us.epil store i8 %.unr, ptr %arrayidx11.us.epil, align 1, !tbaa !5 store i8 %7, ptr %arrayidx15.us.epil, align 1, !tbaa !5 %inc31.us.epil = add i16 %usW_Csort_cnt.175.us.unr, 1 br label %for.cond4.while.cond.loopexit_crit_edge.us for.cond4.while.cond.loopexit_crit_edge.us: ; preds = %for.body9.us.epil, %if.then.us.epil, %for.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa %usW_Csort_cnt.2.us.lcssa = phi i16 [ %usW_Csort_cnt.2.us.lcssa.ph, %for.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa ], [ %inc31.us.epil, %if.then.us.epil ], [ %usW_Csort_cnt.175.us.unr, %for.body9.us.epil ] %ubW_Floop_flug.2.us.lcssa = phi i8 [ %ubW_Floop_flug.2.us.lcssa.ph, %for.cond4.while.cond.loopexit_crit_edge.us.unr-lcssa ], [ 1, %if.then.us.epil ], [ %ubW_Floop_flug.176.us.unr, %for.body9.us.epil ] %tobool.not.us = icmp eq i8 %ubW_Floop_flug.2.us.lcssa, 0 br i1 %tobool.not.us, label %for.cond35.preheader, label %for.cond4.preheader.us, !llvm.loop !10 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i8, ptr %ubW_Dtc_cnt, align 1, !tbaa !5 %9 = zext i8 %8 to i64 %cmp = icmp ult i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond35.preheader: ; preds = %for.cond4.while.cond.loopexit_crit_edge.us %conv3780 = zext i8 %8 to i32 %sub3881 = add nsw i32 %conv3780, -1 %cmp3982 = icmp ugt i8 %8, 1 br i1 %cmp3982, label %for.body41, label %for.end48 for.body41: ; preds = %for.cond35.preheader, %for.body41 %ubW_Ctc_loop_cnt.283 = phi i8 [ %inc47, %for.body41 ], [ 0, %for.cond35.preheader ] %idxprom42 = zext i8 %ubW_Ctc_loop_cnt.283 to i64 %arrayidx43 = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %idxprom42 %10 = load i8, ptr %arrayidx43, align 1, !tbaa !5 %conv44 = zext i8 %10 to i32 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv44) %inc47 = add nuw i8 %ubW_Ctc_loop_cnt.283, 1 %conv36 = zext i8 %inc47 to i32 %11 = load i8, ptr %ubW_Dtc_cnt, align 1, !tbaa !5 %conv37 = zext i8 %11 to i32 %sub38 = add nsw i32 %conv37, -1 %cmp39 = icmp sgt i32 %sub38, %conv36 br i1 %cmp39, label %for.body41, label %for.end48, !llvm.loop !12 for.end48: ; preds = %for.body41, %entry, %while.cond.preheader, %for.cond35.preheader %.us-phi96.shrunk = phi i16 [ %usW_Csort_cnt.2.us.lcssa, %for.cond35.preheader ], [ 0, %while.cond.preheader ], [ 0, %entry ], [ %usW_Csort_cnt.2.us.lcssa, %for.body41 ] %sub38.lcssa = phi i32 [ %sub3881, %for.cond35.preheader ], [ -1, %while.cond.preheader ], [ -1, %entry ], [ %sub38, %for.body41 ] %.us-phi96 = zext i16 %.us-phi96.shrunk to i32 %idxprom51 = sext i32 %sub38.lcssa to i64 %arrayidx52 = getelementptr inbounds [100 x i8], ptr %aubW_Dtestcase, i64 0, i64 %idxprom51 %12 = load i8, ptr %arrayidx52, align 1, !tbaa !5 %conv53 = zext i8 %12 to i32 %call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv53) %call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi96) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ubW_Dtc_cnt) #3 call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %aubW_Dtestcase) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int n,i,j,k,a[100],tmp,count=0; char input[4001],*p; fgets(input,sizeof input,stdin); sscanf(input,"%d",&n); fgets(input,sizeof input,stdin); p=strtok(input," "); a[0]=atoi(p); for(i=1;i<n;i++){ p=strtok(NULL," "); a[i]=atoi(p); } k=n-1; for(i=0;i<n-1;i++){ for(j=0;j<k;j++){ if(a[j]>a[j+1]){ tmp=a[j]; a[j]=a[j+1]; a[j+1]=tmp; count++; } } k--; } for(i=0;i<n;i++){ printf("%d",a[i]); if(i!=n-1){ printf(" "); } } printf("\n%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281754/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281754/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c" \00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [100 x i32], align 16 %input = alloca [4001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4001, ptr nonnull %input) #5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %input, i32 noundef 4001, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %input, ptr noundef nonnull @.str, ptr noundef nonnull %n) #5 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call4 = call ptr @fgets(ptr noundef nonnull %input, i32 noundef 4001, ptr noundef %1) %call6 = call ptr @strtok(ptr noundef nonnull %input, ptr noundef nonnull @.str.1) #5 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %call6, ptr noundef null, i32 noundef 10) #5 %conv.i = trunc i64 %call.i to i32 store i32 %conv.i, ptr %a, align 16, !tbaa !9 %2 = load i32, ptr %n, align 4, !tbaa !9 %cmp77 = icmp sgt i32 %2, 1 br i1 %cmp77, label %for.body, label %for.cond40.preheader for.cond11.preheader: ; preds = %for.body %sub12 = add i32 %3, -1 %cmp1384 = icmp sgt i32 %3, 1 br i1 %cmp1384, label %for.cond15.preheader, label %for.cond40.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %call8 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.1) #5 %call.i75 = call i64 @strtol(ptr nocapture noundef nonnull %call8, ptr noundef null, i32 noundef 10) #5 %conv.i76 = trunc i64 %call.i75 to i32 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv store i32 %conv.i76, ptr %arrayidx10, align 4, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !9 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond11.preheader, !llvm.loop !11 for.cond15.preheader: ; preds = %for.cond11.preheader, %for.end36 %indvars.iv96 = phi i32 [ %indvars.iv.next97, %for.end36 ], [ %sub12, %for.cond11.preheader ] %k.087.in = phi i32 [ %k.087, %for.end36 ], [ %3, %for.cond11.preheader ] %count.086 = phi i32 [ %count.1.lcssa, %for.end36 ], [ 0, %for.cond11.preheader ] %i.185 = phi i32 [ %inc38, %for.end36 ], [ 0, %for.cond11.preheader ] %5 = zext i32 %indvars.iv96 to i64 %k.087 = add nsw i32 %k.087.in, -1 %cmp1679 = icmp sgt i32 %k.087.in, 1 br i1 %cmp1679, label %for.body17.preheader, label %for.end36 for.body17.preheader: ; preds = %for.cond15.preheader %.pre = load i32, ptr %a, align 16, !tbaa !9 %xtraiter = and i64 %5, 1 %6 = icmp eq i32 %indvars.iv96, 1 br i1 %6, label %for.end36.loopexit.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %5, 4294967294 br label %for.body17 for.cond40.preheader: ; preds = %for.end36, %entry, %for.cond11.preheader %7 = phi i32 [ %3, %for.cond11.preheader ], [ %2, %entry ], [ %3, %for.end36 ] %count.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ 0, %entry ], [ %count.1.lcssa, %for.end36 ] %cmp4189 = icmp sgt i32 %7, 0 br i1 %cmp4189, label %for.body42, label %for.end53 for.body17: ; preds = %for.inc34.1, %for.body17.preheader.new %8 = phi i32 [ %.pre, %for.body17.preheader.new ], [ %12, %for.inc34.1 ] %indvars.iv93 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next94.1, %for.inc34.1 ] %count.181 = phi i32 [ %count.086, %for.body17.preheader.new ], [ %count.2.1, %for.inc34.1 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.inc34.1 ] %indvars.iv.next94 = or i64 %indvars.iv93, 1 %arrayidx21 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next94 %9 = load i32, ptr %arrayidx21, align 4, !tbaa !9 %cmp22 = icmp sgt i32 %8, %9 br i1 %cmp22, label %if.then, label %for.inc34 if.then: ; preds = %for.body17 %arrayidx19 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv93 store i32 %9, ptr %arrayidx19, align 8, !tbaa !9 store i32 %8, ptr %arrayidx21, align 4, !tbaa !9 %inc33 = add nsw i32 %count.181, 1 br label %for.inc34 for.inc34: ; preds = %for.body17, %if.then %10 = phi i32 [ %8, %if.then ], [ %9, %for.body17 ] %count.2 = phi i32 [ %inc33, %if.then ], [ %count.181, %for.body17 ] %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 2 %arrayidx21.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next94.1 %11 = load i32, ptr %arrayidx21.1, align 8, !tbaa !9 %cmp22.1 = icmp sgt i32 %10, %11 br i1 %cmp22.1, label %if.then.1, label %for.inc34.1 if.then.1: ; preds = %for.inc34 %arrayidx19.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next94 store i32 %11, ptr %arrayidx19.1, align 4, !tbaa !9 store i32 %10, ptr %arrayidx21.1, align 8, !tbaa !9 %inc33.1 = add nsw i32 %count.2, 1 br label %for.inc34.1 for.inc34.1: ; preds = %if.then.1, %for.inc34 %12 = phi i32 [ %10, %if.then.1 ], [ %11, %for.inc34 ] %count.2.1 = phi i32 [ %inc33.1, %if.then.1 ], [ %count.2, %for.inc34 ] %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.end36.loopexit.unr-lcssa, label %for.body17, !llvm.loop !13 for.end36.loopexit.unr-lcssa: ; preds = %for.inc34.1, %for.body17.preheader %count.2.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %count.2.1, %for.inc34.1 ] %.unr = phi i32 [ %.pre, %for.body17.preheader ], [ %12, %for.inc34.1 ] %indvars.iv93.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next94.1, %for.inc34.1 ] %count.181.unr = phi i32 [ %count.086, %for.body17.preheader ], [ %count.2.1, %for.inc34.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end36, label %for.body17.epil for.body17.epil: ; preds = %for.end36.loopexit.unr-lcssa %indvars.iv.next94.epil = add nuw nsw i64 %indvars.iv93.unr, 1 %arrayidx21.epil = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next94.epil %13 = load i32, ptr %arrayidx21.epil, align 4, !tbaa !9 %cmp22.epil = icmp sgt i32 %.unr, %13 br i1 %cmp22.epil, label %if.then.epil, label %for.end36 if.then.epil: ; preds = %for.body17.epil %arrayidx19.epil = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv93.unr store i32 %13, ptr %arrayidx19.epil, align 4, !tbaa !9 store i32 %.unr, ptr %arrayidx21.epil, align 4, !tbaa !9 %inc33.epil = add nsw i32 %count.181.unr, 1 br label %for.end36 for.end36: ; preds = %for.end36.loopexit.unr-lcssa, %if.then.epil, %for.body17.epil, %for.cond15.preheader %count.1.lcssa = phi i32 [ %count.086, %for.cond15.preheader ], [ %count.2.lcssa.ph, %for.end36.loopexit.unr-lcssa ], [ %inc33.epil, %if.then.epil ], [ %count.181.unr, %for.body17.epil ] %inc38 = add nuw nsw i32 %i.185, 1 %indvars.iv.next97 = add i32 %indvars.iv96, -1 %exitcond98.not = icmp eq i32 %inc38, %sub12 br i1 %exitcond98.not, label %for.cond40.preheader, label %for.cond15.preheader, !llvm.loop !14 for.body42: ; preds = %for.cond40.preheader, %for.inc51 %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.inc51 ], [ 0, %for.cond40.preheader ] %arrayidx44 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv99 %14 = load i32, ptr %arrayidx44, align 4, !tbaa !9 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14) %15 = load i32, ptr %n, align 4, !tbaa !9 %sub46 = add nsw i32 %15, -1 %16 = zext i32 %sub46 to i64 %cmp47.not = icmp eq i64 %indvars.iv99, %16 br i1 %cmp47.not, label %for.inc51, label %if.then48 if.then48: ; preds = %for.body42 %putchar = call i32 @putchar(i32 32) %.pre102 = load i32, ptr %n, align 4, !tbaa !9 br label %for.inc51 for.inc51: ; preds = %for.body42, %if.then48 %17 = phi i32 [ %15, %for.body42 ], [ %.pre102, %if.then48 ] %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %18 = sext i32 %17 to i64 %cmp41 = icmp slt i64 %indvars.iv.next100, %18 br i1 %cmp41, label %for.body42, label %for.end53, !llvm.loop !15 for.end53: ; preds = %for.inc51, %for.cond40.preheader %call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4001, ptr nonnull %input) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) 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 #3 ; 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 "no-trapping-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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include<stdio.h> int main(){ int i,j,A[101],a,swap=0,N; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } for(i=0;i<N;i++){ for(j=N-1;j>i;j--){ if(A[j]<A[j-1]){ a=A[j]; A[j]=A[j-1]; A[j-1]=a; swap++; } } } for(i=0;i<N;i++){ if(i>0){ printf(" "); } printf("%d",A[i]); } printf("\n%d\n",swap); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281804/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281804/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca [101 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %A) #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 %cmp63 = icmp sgt i32 %0, 0 br i1 %cmp63, label %for.body, label %for.end42 for.cond2.preheader: ; preds = %for.body %cmp371 = icmp sgt i32 %4, 0 br i1 %cmp371, label %for.cond5.preheader.lr.ph, label %for.end42 for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %j.065 = add nsw i32 %4, -1 %1 = zext i32 %4 to i64 %2 = add nsw i64 %1, -1 %3 = zext i32 %j.065 to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 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 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.inc27 %indvars.iv87 = phi i64 [ 0, %for.cond5.preheader.lr.ph ], [ %indvars.iv.next88, %for.inc27 ] %swap.073 = phi i32 [ 0, %for.cond5.preheader.lr.ph ], [ %swap.1.lcssa, %for.inc27 ] %cmp666 = icmp ult i64 %indvars.iv87, %3 br i1 %cmp666, label %for.body7, label %for.inc27 for.cond30.preheader: ; preds = %for.inc27 br i1 %cmp371, label %if.end36.peel, label %for.end42 if.end36.peel: ; preds = %for.cond30.preheader %.pre = load i32, ptr %A, align 16, !tbaa !5 %call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %6 = load i32, ptr %N, align 4, !tbaa !5 %cmp31.peel = icmp sgt i32 %6, 1 br i1 %cmp31.peel, label %if.end36, label %for.end42 for.body7: ; preds = %for.cond5.preheader, %for.inc25 %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.inc25 ], [ %1, %for.cond5.preheader ] %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.inc25 ], [ %2, %for.cond5.preheader ] %swap.168 = phi i32 [ %swap.2, %for.inc25 ], [ %swap.073, %for.cond5.preheader ] %indvars.iv.next82 = add nsw i64 %indvars.iv81, -1 %arrayidx9 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv79 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %8 = add nsw i64 %indvars.iv81, -2 %arrayidx12 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %8 %9 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp slt i32 %7, %9 br i1 %cmp13, label %if.then, label %for.inc25 if.then: ; preds = %for.body7 store i32 %9, ptr %arrayidx9, align 4, !tbaa !5 store i32 %7, ptr %arrayidx12, align 4, !tbaa !5 %inc24 = add nsw i32 %swap.168, 1 br label %for.inc25 for.inc25: ; preds = %for.body7, %if.then %swap.2 = phi i32 [ %inc24, %if.then ], [ %swap.168, %for.body7 ] %indvars.iv.next80 = add nsw i64 %indvars.iv79, -1 %cmp6 = icmp sgt i64 %indvars.iv.next80, %indvars.iv87 br i1 %cmp6, label %for.body7, label %for.inc27, !llvm.loop !11 for.inc27: ; preds = %for.inc25, %for.cond5.preheader %swap.1.lcssa = phi i32 [ %swap.073, %for.cond5.preheader ], [ %swap.2, %for.inc25 ] %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %exitcond.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond5.preheader, !llvm.loop !12 if.end36: ; preds = %if.end36.peel, %if.end36 %indvars.iv90 = phi i64 [ %indvars.iv.next91, %if.end36 ], [ 1, %if.end36.peel ] %putchar = call i32 @putchar(i32 32) %arrayidx38 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv90 %10 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %11 = load i32, ptr %N, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp31 = icmp slt i64 %indvars.iv.next91, %12 br i1 %cmp31, label %if.end36, label %for.end42, !llvm.loop !13 for.end42: ; preds = %if.end36, %entry, %for.cond2.preheader, %if.end36.peel, %for.cond30.preheader %swap.0.lcssa98 = phi i32 [ %swap.1.lcssa, %for.cond30.preheader ], [ %swap.1.lcssa, %if.end36.peel ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %swap.1.lcssa, %if.end36 ] %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %swap.0.lcssa98) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> int main() { int a,N,i,j,A[100],count; while(1) { scanf("%d",&N); if(N<1 || 100<N) printf("error\n"); else break; } while(1) { count = 0; for(i=0; i<N; i++) scanf("%d",&A[i]); for(i=0; i<N; i++) if(A[i]<0 || 100<A[i]) count++; if(count==0) break; else printf("error\n"); } for(i=0; i<N-1; i++) { for(j=N-1; j>=0; j--) { if(A[j] < A[j-1]) { a = A[j]; A[j] = A[j-1]; A[j-1] = a; count++; } } } for(i=0; i<N; i++) { printf("%d",A[i]); if(i!=N-1) printf(" "); } printf("\n"); printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281848/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281848/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"error\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #5 %call103 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4 %1 = add i32 %0, -101 %or.cond104 = icmp ult i32 %1, -100 br i1 %or.cond104, label %if.then, label %while.cond3.preheader while.cond3.preheader: ; preds = %if.then, %entry %2 = phi i32 [ %0, %entry ], [ %3, %if.then ] %cmp5105152 = icmp sgt i32 %2, 0 br i1 %cmp5105152, label %for.body, label %for.end73 if.then: ; preds = %entry, %if.then %puts101 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %3 = load i32, ptr %N, align 4 %4 = add i32 %3, -101 %or.cond = icmp ult i32 %4, -100 br i1 %or.cond, label %if.then, label %while.cond3.preheader for.cond7.preheader: ; preds = %for.body %cmp8107 = icmp sgt i32 %15, 0 br i1 %cmp8107, label %for.body9.preheader, label %for.end73 for.body9.preheader: ; preds = %for.cond7.preheader %wide.trip.count = zext i32 %15 to i64 %min.iters.check = icmp ult i32 %15, 8 br i1 %min.iters.check, label %for.body9.preheader155, label %vector.ph vector.ph: ; preds = %for.body9.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.phi153 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %5 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load154 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = icmp ugt <4 x i32> %wide.load, <i32 100, i32 100, i32 100, i32 100> %8 = icmp ugt <4 x i32> %wide.load154, <i32 100, i32 100, i32 100, i32 100> %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi153, %10 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = 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.end22, label %for.body9.preheader155 for.body9.preheader155: ; preds = %for.body9.preheader, %middle.block %indvars.iv124.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec, %middle.block ] %count.0109.ph = phi i32 [ 0, %for.body9.preheader ], [ %14, %middle.block ] br label %for.body9 for.body: ; preds = %while.cond3.preheader, %for.body.backedge %indvars.iv = phi i64 [ %indvars.iv.be, %for.body.backedge ], [ 0, %while.cond3.preheader ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %15 = load i32, ptr %N, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp5 = icmp slt i64 %indvars.iv.next, %16 br i1 %cmp5, label %for.body.backedge, label %for.cond7.preheader for.body.backedge: ; preds = %for.body, %if.else25 %indvars.iv.be = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %if.else25 ] br label %for.body, !llvm.loop !13 for.body9: ; preds = %for.body9.preheader155, %for.body9 %indvars.iv124 = phi i64 [ %indvars.iv.next125, %for.body9 ], [ %indvars.iv124.ph, %for.body9.preheader155 ] %count.0109 = phi i32 [ %count.1, %for.body9 ], [ %count.0109.ph, %for.body9.preheader155 ] %arrayidx11 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv124 %17 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %or.cond102 = icmp ugt i32 %17, 100 %inc18 = zext i1 %or.cond102 to i32 %count.1 = add nuw nsw i32 %count.0109, %inc18 %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1 %exitcond.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count br i1 %exitcond.not, label %for.end22, label %for.body9, !llvm.loop !14 for.end22: ; preds = %for.body9, %middle.block %count.1.lcssa = phi i32 [ %14, %middle.block ], [ %count.1, %for.body9 ] %cmp23 = icmp eq i32 %count.1.lcssa, 0 br i1 %cmp23, label %for.cond29.preheader, label %if.else25 for.cond29.preheader: ; preds = %for.end22 %cmp30115 = icmp sgt i32 %15, 1 br i1 %cmp30115, label %for.cond33.preheader.us.preheader, label %for.cond60.preheader for.cond33.preheader.us.preheader: ; preds = %for.cond29.preheader %18 = zext i32 %15 to i64 %19 = add nsw i64 %18, -1 %arrayidx37.us.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %19 %20 = add i32 %15, -2 %xtraiter = and i64 %18, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %indvars.iv.next128.prol = add nsw i64 %18, -2 %arrayidx40.us.prol = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next128.prol %arrayidx37.us.prol = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %19 %21 = icmp eq i64 %19, 0 br label %for.cond33.preheader.us for.cond33.preheader.us: ; preds = %for.cond33.preheader.us.preheader, %for.cond33.for.inc57_crit_edge.us %count.2117.us = phi i32 [ %count.4.us.lcssa, %for.cond33.for.inc57_crit_edge.us ], [ 0, %for.cond33.preheader.us.preheader ] %i.2116.us = phi i32 [ %inc58.us, %for.cond33.for.inc57_crit_edge.us ], [ 0, %for.cond33.preheader.us.preheader ] %.pre134 = load i32, ptr %arrayidx37.us.phi.trans.insert, align 4, !tbaa !5 br i1 %lcmp.mod.not, label %for.body35.us.prol.loopexit, label %for.body35.us.prol for.body35.us.prol: ; preds = %for.cond33.preheader.us %22 = load i32, ptr %arrayidx40.us.prol, align 4, !tbaa !5 %cmp41.us.prol = icmp slt i32 %.pre134, %22 br i1 %cmp41.us.prol, label %if.then42.us.prol, label %for.body35.us.prol.loopexit if.then42.us.prol: ; preds = %for.body35.us.prol store i32 %22, ptr %arrayidx37.us.prol, align 4, !tbaa !5 store i32 %.pre134, ptr %arrayidx40.us.prol, align 4, !tbaa !5 %inc53.us.prol = add nsw i32 %count.2117.us, 1 br label %for.body35.us.prol.loopexit for.body35.us.prol.loopexit: ; preds = %for.body35.us.prol, %if.then42.us.prol, %for.cond33.preheader.us %.unr = phi i32 [ %.pre134, %for.cond33.preheader.us ], [ %.pre134, %if.then42.us.prol ], [ %22, %for.body35.us.prol ] %indvars.iv127.unr = phi i64 [ %19, %for.cond33.preheader.us ], [ %indvars.iv.next128.prol, %if.then42.us.prol ], [ %indvars.iv.next128.prol, %for.body35.us.prol ] %count.3113.us.unr = phi i32 [ %count.2117.us, %for.cond33.preheader.us ], [ %inc53.us.prol, %if.then42.us.prol ], [ %count.2117.us, %for.body35.us.prol ] %count.4.us.lcssa.unr = phi i32 [ undef, %for.cond33.preheader.us ], [ %inc53.us.prol, %if.then42.us.prol ], [ %count.2117.us, %for.body35.us.prol ] br i1 %21, label %for.cond33.for.inc57_crit_edge.us, label %for.body35.us for.body35.us: ; preds = %for.body35.us.prol.loopexit, %for.inc55.us.1 %23 = phi i32 [ %27, %for.inc55.us.1 ], [ %.unr, %for.body35.us.prol.loopexit ] %indvars.iv127 = phi i64 [ %indvars.iv.next128.1, %for.inc55.us.1 ], [ %indvars.iv127.unr, %for.body35.us.prol.loopexit ] %count.3113.us = phi i32 [ %count.4.us.1, %for.inc55.us.1 ], [ %count.3113.us.unr, %for.body35.us.prol.loopexit ] %indvars.iv.next128 = add nsw i64 %indvars.iv127, -1 %arrayidx40.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next128 %24 = load i32, ptr %arrayidx40.us, align 4, !tbaa !5 %cmp41.us = icmp slt i32 %23, %24 br i1 %cmp41.us, label %if.then42.us, label %for.inc55.us if.then42.us: ; preds = %for.body35.us %arrayidx37.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv127 store i32 %24, ptr %arrayidx37.us, align 4, !tbaa !5 store i32 %23, ptr %arrayidx40.us, align 4, !tbaa !5 %inc53.us = add nsw i32 %count.3113.us, 1 br label %for.inc55.us for.inc55.us: ; preds = %if.then42.us, %for.body35.us %25 = phi i32 [ %23, %if.then42.us ], [ %24, %for.body35.us ] %count.4.us = phi i32 [ %inc53.us, %if.then42.us ], [ %count.3113.us, %for.body35.us ] %indvars.iv.next128.1 = add nsw i64 %indvars.iv127, -2 %arrayidx40.us.1 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next128.1 %26 = load i32, ptr %arrayidx40.us.1, align 4, !tbaa !5 %cmp41.us.1 = icmp slt i32 %25, %26 br i1 %cmp41.us.1, label %if.then42.us.1, label %for.inc55.us.1 if.then42.us.1: ; preds = %for.inc55.us %arrayidx37.us.1 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next128 store i32 %26, ptr %arrayidx37.us.1, align 4, !tbaa !5 store i32 %25, ptr %arrayidx40.us.1, align 4, !tbaa !5 %inc53.us.1 = add nsw i32 %count.4.us, 1 br label %for.inc55.us.1 for.inc55.us.1: ; preds = %if.then42.us.1, %for.inc55.us %27 = phi i32 [ %25, %if.then42.us.1 ], [ %26, %for.inc55.us ] %count.4.us.1 = phi i32 [ %inc53.us.1, %if.then42.us.1 ], [ %count.4.us, %for.inc55.us ] %cmp34.us.1 = icmp sgt i64 %indvars.iv127, 1 br i1 %cmp34.us.1, label %for.body35.us, label %for.cond33.for.inc57_crit_edge.us, !llvm.loop !15 for.cond33.for.inc57_crit_edge.us: ; preds = %for.inc55.us.1, %for.body35.us.prol.loopexit %count.4.us.lcssa = phi i32 [ %count.4.us.lcssa.unr, %for.body35.us.prol.loopexit ], [ %count.4.us.1, %for.inc55.us.1 ] %inc58.us = add nuw nsw i32 %i.2116.us, 1 %exitcond130.not = icmp eq i32 %i.2116.us, %20 br i1 %exitcond130.not, label %for.cond60.preheader, label %for.cond33.preheader.us, !llvm.loop !16 if.else25: ; preds = %for.end22 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %.pre = load i32, ptr %N, align 4, !tbaa !5 %cmp5105 = icmp sgt i32 %.pre, 0 br i1 %cmp5105, label %for.body.backedge, label %for.end73 for.cond60.preheader: ; preds = %for.cond33.for.inc57_crit_edge.us, %for.cond29.preheader %count.2.lcssa = phi i32 [ 0, %for.cond29.preheader ], [ %count.4.us.lcssa, %for.cond33.for.inc57_crit_edge.us ] br i1 %cmp8107, label %for.body62, label %for.end73 for.body62: ; preds = %for.cond60.preheader, %for.inc71 %indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.inc71 ], [ 0, %for.cond60.preheader ] %arrayidx64 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv131 %28 = load i32, ptr %arrayidx64, align 4, !tbaa !5 %call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28) %29 = load i32, ptr %N, align 4, !tbaa !5 %sub66 = add nsw i32 %29, -1 %30 = zext i32 %sub66 to i64 %cmp67.not = icmp eq i64 %indvars.iv131, %30 br i1 %cmp67.not, label %for.inc71, label %if.then68 if.then68: ; preds = %for.body62 %putchar100 = call i32 @putchar(i32 32) %.pre135 = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc71 for.inc71: ; preds = %for.body62, %if.then68 %31 = phi i32 [ %29, %for.body62 ], [ %.pre135, %if.then68 ] %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %32 = sext i32 %31 to i64 %cmp61 = icmp slt i64 %indvars.iv.next132, %32 br i1 %cmp61, label %for.body62, label %for.end73, !llvm.loop !17 for.end73: ; preds = %for.cond7.preheader, %if.else25, %for.inc71, %while.cond3.preheader, %for.cond60.preheader %count.2.lcssa147 = phi i32 [ %count.2.lcssa, %for.cond60.preheader ], [ 0, %while.cond3.preheader ], [ %count.2.lcssa, %for.inc71 ], [ 0, %if.else25 ], [ 0, %for.cond7.preheader ] %putchar = call i32 @putchar(i32 10) %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %count.2.lcssa147) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int N = 100; int count = 0; void BubbleSort(int A[], int n){ int k, l, tmp; for(k = 0; k <= n-1; k++){ for(l = n-1; l >= k+1; l--){ if(A[l] < A[l-1]){ tmp = A[l]; A[l] = A[l-1]; A[l-1] = tmp; count++; } } } } int main(){ int i, j, n; int A[N+1]; scanf("%d", &n); for(i = 0; i < n; i++){ scanf("%d", &A[i]); } BubbleSort(A, n); for(j = 1; j <= n; j++){ if(j > 1){printf(" "); } printf("%d", A[j-1]); } printf("\n"); printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281891/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281891/source.c" target datalayout = "e-m:e-p270: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 local_unnamed_addr global i32 100, align 4 @count = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @BubbleSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp.not.not42 = icmp sgt i32 %n, 0 br i1 %cmp.not.not42, label %for.cond2.preheader.lr.ph, label %for.end21 for.cond2.preheader.lr.ph: ; preds = %entry %0 = zext i32 %n to i64 %wide.trip.count = zext i32 %n to i64 %invariant.gep = getelementptr i32, ptr %A, i64 -2 br label %for.cond2.preheader for.cond.loopexit: ; preds = %for.inc, %for.cond2.preheader %exitcond.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count br i1 %exitcond.not, label %for.end21, label %for.cond2.preheader, !llvm.loop !5 for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.cond.loopexit %indvars.iv46 = phi i64 [ 0, %for.cond2.preheader.lr.ph ], [ %indvars.iv.next47, %for.cond.loopexit ] %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1 %cmp3.not.not39 = icmp ult i64 %indvars.iv.next47, %0 br i1 %cmp3.not.not39, label %for.body4, label %for.cond.loopexit for.body4: ; preds = %for.cond2.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %0, %for.cond2.preheader ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next %1 = load i32, ptr %arrayidx, align 4, !tbaa !7 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %2 = load i32, ptr %gep, align 4, !tbaa !7 %cmp8 = icmp slt i32 %1, %2 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body4 store i32 %2, ptr %arrayidx, align 4, !tbaa !7 store i32 %1, ptr %gep, align 4, !tbaa !7 %3 = load i32, ptr @count, align 4, !tbaa !7 %inc = add nsw i32 %3, 1 store i32 %inc, ptr @count, align 4, !tbaa !7 br label %for.inc for.inc: ; preds = %for.body4, %if.then %cmp3.not.not = icmp sgt i64 %indvars.iv.next, %indvars.iv.next47 br i1 %cmp3.not.not, label %for.body4, label %for.cond.loopexit, !llvm.loop !11 for.end21: ; preds = %for.cond.loopexit, %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: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %0 = load i32, ptr @N, align 4, !tbaa !7 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = tail call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %3 = load i32, ptr %n, align 4, !tbaa !7 %cmp21 = icmp sgt i32 %3, 0 br i1 %cmp21, label %for.body, label %for.end12 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 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !7 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body %cmp.not.not42.i = icmp sgt i32 %4, 0 br i1 %cmp.not.not42.i, label %for.cond2.preheader.lr.ph.i, label %for.end12 for.cond2.preheader.lr.ph.i: ; preds = %for.end %6 = zext i32 %4 to i64 %invariant.gep.i = getelementptr i32, ptr %vla, i64 -2 %count.promoted25 = load i32, ptr @count, align 4, !tbaa !7 br label %for.cond2.preheader.i for.cond.loopexit.i: ; preds = %for.inc.i, %for.cond2.preheader.i %count.promoted26 = phi i32 [ %count.promoted29, %for.cond2.preheader.i ], [ %count.promoted27, %for.inc.i ] %exitcond.not.i = icmp eq i64 %indvars.iv.next47.i, %6 br i1 %exitcond.not.i, label %BubbleSort.exit, label %for.cond2.preheader.i, !llvm.loop !5 for.cond2.preheader.i: ; preds = %for.cond.loopexit.i, %for.cond2.preheader.lr.ph.i %count.promoted29 = phi i32 [ %count.promoted25, %for.cond2.preheader.lr.ph.i ], [ %count.promoted26, %for.cond.loopexit.i ] %indvars.iv46.i = phi i64 [ 0, %for.cond2.preheader.lr.ph.i ], [ %indvars.iv.next47.i, %for.cond.loopexit.i ] %indvars.iv.next47.i = add nuw nsw i64 %indvars.iv46.i, 1 %cmp3.not.not39.i = icmp ult i64 %indvars.iv.next47.i, %6 br i1 %cmp3.not.not39.i, label %for.body4.i, label %for.cond.loopexit.i for.body4.i: ; preds = %for.cond2.preheader.i, %for.inc.i %count.promoted28 = phi i32 [ %count.promoted27, %for.inc.i ], [ %count.promoted29, %for.cond2.preheader.i ] %inc.i24 = phi i32 [ %inc.i23, %for.inc.i ], [ %count.promoted29, %for.cond2.preheader.i ] %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %6, %for.cond2.preheader.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.i %7 = load i32, ptr %arrayidx.i, align 4, !tbaa !7 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i %8 = load i32, ptr %gep.i, align 4, !tbaa !7 %cmp8.i = icmp slt i32 %7, %8 br i1 %cmp8.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body4.i store i32 %8, ptr %arrayidx.i, align 4, !tbaa !7 store i32 %7, ptr %gep.i, align 4, !tbaa !7 %inc.i = add nsw i32 %inc.i24, 1 store i32 %inc.i, ptr @count, align 4, !tbaa !7 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body4.i %count.promoted27 = phi i32 [ %inc.i, %if.then.i ], [ %count.promoted28, %for.body4.i ] %inc.i23 = phi i32 [ %inc.i, %if.then.i ], [ %inc.i24, %for.body4.i ] %cmp3.not.not.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv.next47.i br i1 %cmp3.not.not.i, label %for.body4.i, label %for.cond.loopexit.i, !llvm.loop !11 BubbleSort.exit: ; preds = %for.cond.loopexit.i %cmp3.not30 = icmp slt i32 %4, 1 br i1 %cmp3.not30, label %for.end12, label %if.end.peel if.end.peel: ; preds = %BubbleSort.exit %.pre = load i32, ptr %vla, align 16, !tbaa !7 %call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %9 = load i32, ptr %n, align 4, !tbaa !7 %cmp3.not.not.peel = icmp sgt i32 %9, 1 br i1 %cmp3.not.not.peel, label %for.body4.peel.next, label %for.end12 for.body4.peel.next: ; preds = %if.end.peel %invariant.gep = getelementptr i32, ptr %vla, i64 -1 br label %if.end if.end: ; preds = %for.body4.peel.next, %if.end %indvars.iv34 = phi i64 [ 2, %for.body4.peel.next ], [ %indvars.iv.next35, %if.end ] %putchar20 = call i32 @putchar(i32 32) %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv34 %10 = load i32, ptr %gep, align 4, !tbaa !7 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1 %11 = load i32, ptr %n, align 4, !tbaa !7 %12 = sext i32 %11 to i64 %cmp3.not.not = icmp slt i64 %indvars.iv34, %12 br i1 %cmp3.not.not, label %if.end, label %for.end12, !llvm.loop !13 for.end12: ; preds = %if.end, %entry, %for.end, %if.end.peel, %BubbleSort.exit %putchar = call i32 @putchar(i32 10) %13 = load i32, ptr @count, align 4, !tbaa !7 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 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 nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6, !14} !14 = !{!"llvm.loop.peeled.count", i32 1}
/* Bubble Sort */ #include <stdio.h> /*---x??¨y???????????\????????????---*/ void swap(int *x, int *y) { int temp; temp = *x; *x = *y; *y = temp; } int main(void) { int A[100], N, i, j, n = 0; scanf("%d", &N); //????´?????????°N??????????????? for (i = 0; i < N; i++) scanf("%d", &A[i]); //????´???????????????? for (i = 0; i < N; i++) { //bubble sort for (j = N - 1; j > i; j--) if (A[j] < A[j - 1]) { swap(&A[j], &A[j - 1]); n++; } } for (i = 0; i < N; i++) //???????????????????´?????????? printf("%d%c", A[i], i == N - 1 ? '\n' : ' '); printf("%d\n", n); //??\?????????????????°n????????? return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281934/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281934/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%c\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !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: %A = alloca [100 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 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 %cmp53 = icmp sgt i32 %0, 0 br i1 %cmp53, label %for.body, label %for.end35 for.cond2.preheader: ; preds = %for.body %cmp361 = icmp sgt i32 %4, 0 br i1 %cmp361, label %for.cond5.preheader.lr.ph, label %for.end35 for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %j.055 = add nsw i32 %4, -1 %1 = zext i32 %4 to i64 %2 = add nsw i64 %1, -1 %3 = zext i32 %j.055 to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.inc22 %indvars.iv77 = phi i64 [ 0, %for.cond5.preheader.lr.ph ], [ %indvars.iv.next78, %for.inc22 ] %n.063 = phi i32 [ 0, %for.cond5.preheader.lr.ph ], [ %n.1.lcssa, %for.inc22 ] %cmp656 = icmp ult i64 %indvars.iv77, %3 br i1 %cmp656, label %for.body7, label %for.inc22 for.cond25.preheader: ; preds = %for.inc22 br i1 %cmp361, label %for.body27, label %for.end35 for.body7: ; preds = %for.cond5.preheader, %for.inc20 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.inc20 ], [ %1, %for.cond5.preheader ] %indvars.iv69 = phi i64 [ %indvars.iv.next70, %for.inc20 ], [ %2, %for.cond5.preheader ] %n.158 = phi i32 [ %n.2, %for.inc20 ], [ %n.063, %for.cond5.preheader ] %indvars.iv.next72 = add nsw i64 %indvars.iv71, -1 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv69 %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %7 = add nsw i64 %indvars.iv71, -2 %arrayidx12 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %7 %8 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp slt i32 %6, %8 br i1 %cmp13, label %if.then, label %for.inc20 if.then: ; preds = %for.body7 store i32 %8, ptr %arrayidx9, align 4, !tbaa !5 store i32 %6, ptr %arrayidx12, align 4, !tbaa !5 %inc19 = add nsw i32 %n.158, 1 br label %for.inc20 for.inc20: ; preds = %for.body7, %if.then %n.2 = phi i32 [ %inc19, %if.then ], [ %n.158, %for.body7 ] %indvars.iv.next70 = add nsw i64 %indvars.iv69, -1 %cmp6 = icmp sgt i64 %indvars.iv.next70, %indvars.iv77 br i1 %cmp6, label %for.body7, label %for.inc22, !llvm.loop !11 for.inc22: ; preds = %for.inc20, %for.cond5.preheader %n.1.lcssa = phi i32 [ %n.063, %for.cond5.preheader ], [ %n.2, %for.inc20 ] %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count br i1 %exitcond.not, label %for.cond25.preheader, label %for.cond5.preheader, !llvm.loop !12 for.body27: ; preds = %for.cond25.preheader, %for.body27 %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body27 ], [ 0, %for.cond25.preheader ] %9 = phi i32 [ %12, %for.body27 ], [ %4, %for.cond25.preheader ] %arrayidx29 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv80 %10 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %sub30 = add nsw i32 %9, -1 %11 = zext i32 %sub30 to i64 %cmp31 = icmp eq i64 %indvars.iv80, %11 %cond = select i1 %cmp31, i32 10, i32 32 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10, i32 noundef %cond) %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %12 = load i32, ptr %N, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp26 = icmp slt i64 %indvars.iv.next81, %13 br i1 %cmp26, label %for.body27, label %for.end35, !llvm.loop !13 for.end35: ; preds = %for.body27, %entry, %for.cond2.preheader, %for.cond25.preheader %n.0.lcssa87 = phi i32 [ %n.1.lcssa, %for.cond25.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %n.1.lcssa, %for.body27 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %n.0.lcssa87) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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> void bubbleSort(int A[],int N){ int flag = 1 ;// ????????£??\????´?????????¨?????? int n,i,j; int count=0; while(flag){ flag = 0; for(j=N-1;j>=1;j--){ if (A[j] < A[j-1]){ n=A[j]; A[j]=A[j-1]; A[j-1]=n; count++; flag = 1; } } } for(i=0;i<N-1;i++){ printf("%d ",A[i]); } printf("%d\n",A[N-1]); printf("%d\n",count); } int main() { int i,n; int num[100]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&num[i]); } bubbleSort(num,n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_281978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_281978/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @bubbleSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp50 = icmp sgt i32 %N, 1 br i1 %cmp50, label %for.cond.preheader.us.preheader, label %for.cond15.preheader.thread for.cond15.preheader.thread: ; preds = %entry %sub1665 = add i32 %N, -1 br label %for.end23 for.cond.preheader.us.preheader: ; preds = %entry %0 = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.backedge, %for.cond.preheader.us.preheader %indvars.iv = phi i64 [ %0, %for.cond.preheader.us.preheader ], [ %indvars.iv.be, %for.body.us.backedge ] %count.153.us = phi i32 [ 0, %for.cond.preheader.us.preheader ], [ %count.2.us, %for.body.us.backedge ] %flag.151.us = phi i32 [ 0, %for.cond.preheader.us.preheader ], [ %flag.151.us.be, %for.body.us.backedge ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom.us = and i64 %indvars.iv.next, 4294967295 %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %idxprom.us %1 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %sub1.us = add i64 %indvars.iv, 4294967294 %idxprom2.us = and i64 %sub1.us, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us %2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %1, %2 br i1 %cmp4.us, label %if.then.us, label %for.inc.us if.then.us: ; preds = %for.body.us store i32 %2, ptr %arrayidx.us, align 4, !tbaa !5 store i32 %1, ptr %arrayidx3.us, align 4, !tbaa !5 %inc.us = add nsw i32 %count.153.us, 1 br label %for.inc.us for.inc.us: ; preds = %if.then.us, %for.body.us %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.151.us, %for.body.us ] %count.2.us = phi i32 [ %inc.us, %if.then.us ], [ %count.153.us, %for.body.us ] %cmp.us = icmp sgt i64 %indvars.iv, 2 br i1 %cmp.us, label %for.body.us.backedge, label %for.cond.while.cond.loopexit_crit_edge.us for.body.us.backedge: ; preds = %for.inc.us, %for.cond.while.cond.loopexit_crit_edge.us %indvars.iv.be = phi i64 [ %indvars.iv.next, %for.inc.us ], [ %0, %for.cond.while.cond.loopexit_crit_edge.us ] %flag.151.us.be = phi i32 [ %flag.2.us, %for.inc.us ], [ 0, %for.cond.while.cond.loopexit_crit_edge.us ] br label %for.body.us, !llvm.loop !9 for.cond.while.cond.loopexit_crit_edge.us: ; preds = %for.inc.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond15.preheader, label %for.body.us.backedge for.cond15.preheader: ; preds = %for.cond.while.cond.loopexit_crit_edge.us %sub16 = add i32 %N, -1 br i1 %cmp50, label %for.body18.preheader, label %for.end23 for.body18.preheader: ; preds = %for.cond15.preheader %wide.trip.count = zext i32 %sub16 to i64 br label %for.body18 for.body18: ; preds = %for.body18.preheader, %for.body18 %indvars.iv60 = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next61, %for.body18 ] %arrayidx20 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv60 %3 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3) %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count br i1 %exitcond.not, label %for.end23, label %for.body18, !llvm.loop !11 for.end23: ; preds = %for.body18, %for.cond15.preheader.thread, %for.cond15.preheader %sub1667 = phi i32 [ %sub1665, %for.cond15.preheader.thread ], [ %sub16, %for.cond15.preheader ], [ %sub16, %for.body18 ] %.us-phi66 = phi i32 [ 0, %for.cond15.preheader.thread ], [ %count.2.us, %for.cond15.preheader ], [ %count.2.us, %for.body18 ] %idxprom25 = sext i32 %sub1667 to i64 %arrayidx26 = getelementptr inbounds i32, ptr %A, i64 %idxprom25 %4 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %call27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi66) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %num = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %num) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.cond15.preheader.thread.i for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body %cmp50.i = icmp sgt i32 %1, 1 br i1 %cmp50.i, label %for.cond.preheader.us.preheader.i, label %for.cond15.preheader.thread.i for.cond15.preheader.thread.i: ; preds = %entry, %for.end %.lcssa10 = phi i32 [ %1, %for.end ], [ %0, %entry ] %sub1665.i = add i32 %.lcssa10, -1 br label %bubbleSort.exit for.cond.preheader.us.preheader.i: ; preds = %for.end %3 = zext i32 %1 to i64 br label %for.body.us.i for.body.us.i: ; preds = %for.body.us.i.backedge, %for.cond.preheader.us.preheader.i %indvars.iv.i = phi i64 [ %3, %for.cond.preheader.us.preheader.i ], [ %indvars.iv.i.be, %for.body.us.i.backedge ] %count.153.us.i = phi i32 [ 0, %for.cond.preheader.us.preheader.i ], [ %count.2.us.i, %for.body.us.i.backedge ] %flag.151.us.i = phi i32 [ 0, %for.cond.preheader.us.preheader.i ], [ %flag.151.us.i.be, %for.body.us.i.backedge ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %idxprom.us.i = and i64 %indvars.iv.next.i, 4294967295 %arrayidx.us.i = getelementptr inbounds i32, ptr %num, i64 %idxprom.us.i %4 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 %sub1.us.i = add nuw nsw i64 %indvars.iv.i, 4294967294 %idxprom2.us.i = and i64 %sub1.us.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %num, i64 %idxprom2.us.i %5 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp slt i32 %4, %5 br i1 %cmp4.us.i, label %if.then.us.i, label %for.inc.us.i if.then.us.i: ; preds = %for.body.us.i store i32 %5, ptr %arrayidx.us.i, align 4, !tbaa !5 store i32 %4, ptr %arrayidx3.us.i, align 4, !tbaa !5 %inc.us.i = add nsw i32 %count.153.us.i, 1 br label %for.inc.us.i for.inc.us.i: ; preds = %if.then.us.i, %for.body.us.i %flag.2.us.i = phi i32 [ 1, %if.then.us.i ], [ %flag.151.us.i, %for.body.us.i ] %count.2.us.i = phi i32 [ %inc.us.i, %if.then.us.i ], [ %count.153.us.i, %for.body.us.i ] %cmp.us.i = icmp sgt i64 %indvars.iv.i, 2 br i1 %cmp.us.i, label %for.body.us.i.backedge, label %for.cond.while.cond.loopexit_crit_edge.us.i for.body.us.i.backedge: ; preds = %for.inc.us.i, %for.cond.while.cond.loopexit_crit_edge.us.i %indvars.iv.i.be = phi i64 [ %indvars.iv.next.i, %for.inc.us.i ], [ %3, %for.cond.while.cond.loopexit_crit_edge.us.i ] %flag.151.us.i.be = phi i32 [ %flag.2.us.i, %for.inc.us.i ], [ 0, %for.cond.while.cond.loopexit_crit_edge.us.i ] br label %for.body.us.i, !llvm.loop !9 for.cond.while.cond.loopexit_crit_edge.us.i: ; preds = %for.inc.us.i %tobool.not.us.i = icmp eq i32 %flag.2.us.i, 0 br i1 %tobool.not.us.i, label %for.body18.preheader.i, label %for.body.us.i.backedge for.body18.preheader.i: ; preds = %for.cond.while.cond.loopexit_crit_edge.us.i %sub16.i = add i32 %1, -1 %wide.trip.count.i = zext i32 %sub16.i to i64 br label %for.body18.i for.body18.i: ; preds = %for.body18.i, %for.body18.preheader.i %indvars.iv60.i = phi i64 [ 0, %for.body18.preheader.i ], [ %indvars.iv.next61.i, %for.body18.i ] %arrayidx20.i = getelementptr inbounds i32, ptr %num, i64 %indvars.iv60.i %6 = load i32, ptr %arrayidx20.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %indvars.iv.next61.i = add nuw nsw i64 %indvars.iv60.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next61.i, %wide.trip.count.i br i1 %exitcond.not.i, label %bubbleSort.exit, label %for.body18.i, !llvm.loop !11 bubbleSort.exit: ; preds = %for.body18.i, %for.cond15.preheader.thread.i %sub1667.i = phi i32 [ %sub1665.i, %for.cond15.preheader.thread.i ], [ %sub16.i, %for.body18.i ] %.us-phi66.i = phi i32 [ 0, %for.cond15.preheader.thread.i ], [ %count.2.us.i, %for.body18.i ] %idxprom25.i = sext i32 %sub1667.i to i64 %arrayidx26.i = getelementptr inbounds i32, ptr %num, i64 %idxprom25.i %7 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5 %call27.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %call28.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi66.i) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %num) #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 = !{!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 i, T, l[1000], r[1000]; scanf("%d", &T); for(i = 0; i < T; i++) scanf("%d%d", &l[i], &r[i]); for (i = 0; i < T; i++) printf("%d %d\n", l[i], 2*l[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28202/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28202/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca i32, align 4 %l = alloca [1000 x i32], align 16 %r = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %0, 0 br i1 %cmp22, label %for.body, label %for.end14 for.cond4.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 0 br i1 %1, label %for.body6, label %for.end14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %l, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1000 x i32], ptr %r, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %T, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.body6: ; preds = %for.cond4.preheader, %for.body6 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body6 ], [ 0, %for.cond4.preheader ] %arrayidx8 = getelementptr inbounds [1000 x i32], ptr %l, i64 0, i64 %indvars.iv27 %4 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %mul = shl nsw i32 %4, 1 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4, i32 noundef %mul) %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1 %5 = load i32, ptr %T, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp5 = icmp slt i64 %indvars.iv.next28, %6 br i1 %cmp5, label %for.body6, label %for.end14, !llvm.loop !11 for.end14: ; preds = %for.body6, %entry, %for.cond4.preheader call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %l) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { int i,j,N,A[100],flag=1,n=0,x; scanf("%d",&N); for(i=0;i<N;i++) { scanf("%d",&A[i]); } while(flag) { flag=0; for(j=N-1;j>=1;j--) { if(A[j]<A[j-1]) { x=A[j]; A[j]=A[j-1]; A[j-1]=x; flag=1; n++; } } } for(i=0;i<N-1;i++) { printf("%d ",A[i]); } printf("%d\n%d\n",A[N-1],n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282063/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282063/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp52 = icmp sgt i32 %0, 0 br i1 %cmp52, label %for.body, label %for.cond24.preheader.for.end33_crit_edge while.cond.preheader: ; preds = %for.body %cmp355 = icmp sgt i32 %4, 1 br i1 %cmp355, label %for.cond2.preheader.us.preheader, label %for.cond24.preheader.for.end33_crit_edge for.cond2.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader %indvars.iv70 = phi i64 [ %1, %for.cond2.preheader.us.preheader ], [ %indvars.iv70.be, %for.body4.us.backedge ] %n.158.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %n.2.us, %for.body4.us.backedge ] %flag.157.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %flag.157.us.be, %for.body4.us.backedge ] %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1 %idxprom5.us = and i64 %indvars.iv.next71, 4294967295 %arrayidx6.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom5.us %2 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %sub7.us = add i64 %indvars.iv70, 4294967294 %idxprom8.us = and i64 %sub7.us, 4294967295 %arrayidx9.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom8.us %3 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp slt i32 %2, %3 br i1 %cmp10.us, label %if.then.us, label %for.inc22.us if.then.us: ; preds = %for.body4.us store i32 %3, ptr %arrayidx6.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5 %inc21.us = add nsw i32 %n.158.us, 1 br label %for.inc22.us for.inc22.us: ; preds = %if.then.us, %for.body4.us %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.157.us, %for.body4.us ] %n.2.us = phi i32 [ %inc21.us, %if.then.us ], [ %n.158.us, %for.body4.us ] %cmp3.us = icmp sgt i64 %indvars.iv70, 2 br i1 %cmp3.us, label %for.body4.us.backedge, label %for.cond2.while.cond.loopexit_crit_edge.us for.body4.us.backedge: ; preds = %for.inc22.us, %for.cond2.while.cond.loopexit_crit_edge.us %indvars.iv70.be = phi i64 [ %indvars.iv.next71, %for.inc22.us ], [ %1, %for.cond2.while.cond.loopexit_crit_edge.us ] %flag.157.us.be = phi i32 [ %flag.2.us, %for.inc22.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ] br label %for.body4.us, !llvm.loop !9 for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc22.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond24.preheader, label %for.body4.us.backedge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us br i1 %cmp355, label %for.body27, label %for.cond24.preheader.for.end33_crit_edge for.cond24.preheader.for.end33_crit_edge: ; preds = %entry, %while.cond.preheader, %for.cond24.preheader %.us-phi82 = phi i32 [ %n.2.us, %for.cond24.preheader ], [ 0, %while.cond.preheader ], [ 0, %entry ] %6 = phi i32 [ %4, %for.cond24.preheader ], [ %4, %while.cond.preheader ], [ %0, %entry ] %sub2563 = add nsw i32 %6, -1 %.pre = sext i32 %sub2563 to i64 br label %for.end33 for.body27: ; preds = %for.cond24.preheader, %for.body27 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body27 ], [ 0, %for.cond24.preheader ] %arrayidx29 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv73 %7 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %sub25 = add nsw i32 %8, -1 %9 = sext i32 %sub25 to i64 %cmp26 = icmp slt i64 %indvars.iv.next74, %9 br i1 %cmp26, label %for.body27, label %for.end33, !llvm.loop !12 for.end33: ; preds = %for.body27, %for.cond24.preheader.for.end33_crit_edge %.us-phi81 = phi i32 [ %.us-phi82, %for.cond24.preheader.for.end33_crit_edge ], [ %n.2.us, %for.body27 ] %idxprom35.pre-phi = phi i64 [ %.pre, %for.cond24.preheader.for.end33_crit_edge ], [ %9, %for.body27 ] %arrayidx36 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom35.pre-phi %10 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10, i32 noundef %.us-phi81) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #define N 100 void swap(int *,int *); int main(){ int n,A[N]; int i,j,flag=0,change=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } flag=1; i=0; while(flag){ flag=0; for(j=n-1;j>=i+1;j--){ if(A[j]<A[j-1]){ swap(&A[j],&A[j-1]); change++; flag=1; } } i++; } for(i=0;i<n-1;i++) printf("%d ",A[i]); if(i==n-1)printf("%d\n",A[i]); printf("%d\n",change); return 0; } void swap(int *a,int *b){ int tmp; tmp=*a; *a=*b; *b=tmp; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282106/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282106/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #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 %entry.while.cond.preheader_crit_edge entry.while.cond.preheader_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry.while.cond.preheader_crit_edge %.pre-phi = phi i64 [ %.pre, %entry.while.cond.preheader_crit_edge ], [ %3, %for.body ] %1 = phi i32 [ %0, %entry.while.cond.preheader_crit_edge ], [ %2, %for.body ] br label %for.cond2.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.cond.loopexit: ; preds = %for.inc17 %tobool.not = icmp eq i32 %flag.2, 0 br i1 %tobool.not, label %for.cond20.preheader, label %for.cond2.preheader, !llvm.loop !11 for.cond2.preheader: ; preds = %while.cond.preheader, %while.cond.loopexit %indvars.iv78 = phi i64 [ 0, %while.cond.preheader ], [ %indvars.iv.next79, %while.cond.loopexit ] %change.065 = phi i32 [ 0, %while.cond.preheader ], [ %change.2, %while.cond.loopexit ] %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %cmp3.not.not56 = icmp sgt i64 %.pre-phi, %indvars.iv.next79 br i1 %cmp3.not.not56, label %for.body4, label %for.cond20.preheader for.cond20.preheader: ; preds = %for.cond2.preheader, %while.cond.loopexit %change.1.lcssa87 = phi i32 [ %change.2, %while.cond.loopexit ], [ %change.065, %for.cond2.preheader ] %sub2166 = add nsw i32 %1, -1 %cmp2267 = icmp sgt i32 %1, 1 br i1 %cmp2267, label %for.body23, label %for.end29 for.body4: ; preds = %for.cond2.preheader, %for.inc17 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.inc17 ], [ %.pre-phi, %for.cond2.preheader ] %change.159 = phi i32 [ %change.2, %for.inc17 ], [ %change.065, %for.cond2.preheader ] %flag.158 = phi i32 [ %flag.2, %for.inc17 ], [ 0, %for.cond2.preheader ] %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1 %arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next75 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %5 = add nsw i64 %indvars.iv74, -2 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %5 %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp slt i32 %4, %6 br i1 %cmp10, label %if.then, label %for.inc17 if.then: ; preds = %for.body4 store i32 %6, ptr %arrayidx6, align 4, !tbaa !5 store i32 %4, ptr %arrayidx9, align 4, !tbaa !5 %inc16 = add nsw i32 %change.159, 1 br label %for.inc17 for.inc17: ; preds = %for.body4, %if.then %flag.2 = phi i32 [ 1, %if.then ], [ %flag.158, %for.body4 ] %change.2 = phi i32 [ %inc16, %if.then ], [ %change.159, %for.body4 ] %cmp3.not.not = icmp sgt i64 %indvars.iv.next75, %indvars.iv.next79 br i1 %cmp3.not.not, label %for.body4, label %while.cond.loopexit, !llvm.loop !12 for.body23: ; preds = %for.cond20.preheader, %for.body23 %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body23 ], [ 0, %for.cond20.preheader ] %arrayidx25 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv81 %7 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %sub21 = add nsw i32 %8, -1 %9 = sext i32 %sub21 to i64 %cmp22 = icmp slt i64 %indvars.iv.next82, %9 br i1 %cmp22, label %for.body23, label %for.end29.loopexit, !llvm.loop !13 for.end29.loopexit: ; preds = %for.body23 %10 = trunc i64 %indvars.iv.next82 to i32 br label %for.end29 for.end29: ; preds = %for.end29.loopexit, %for.cond20.preheader %i.2.lcssa = phi i32 [ 0, %for.cond20.preheader ], [ %10, %for.end29.loopexit ] %sub21.lcssa = phi i32 [ %sub2166, %for.cond20.preheader ], [ %sub21, %for.end29.loopexit ] %cmp31 = icmp eq i32 %i.2.lcssa, %sub21.lcssa br i1 %cmp31, label %if.then32, label %if.end36 if.then32: ; preds = %for.end29 %idxprom33 = zext i32 %i.2.lcssa to i64 %arrayidx34 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom33 %11 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) br label %if.end36 if.end36: ; preds = %if.then32, %for.end29 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %change.1.lcssa87) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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> int main() { int q; scanf("%d", &q); /* note: it is guaranteed at least one * solution exists. This is why this * approach works. * * it is always the case that x != y * because of that. */ while (q--) { int x, y; scanf("%d %d", &x, &y); printf("%d %d\n", x, 2*x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28215/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28215/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %dec3 = add nsw i32 %0, -1 store i32 %dec3, ptr %q, align 4, !tbaa !5 %tobool.not4 = icmp eq i32 %0, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i32, ptr %x, align 4, !tbaa !5 %mul = shl nsw i32 %1, 1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 %2 = load i32, ptr %q, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %q, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int i,j,k,tmp,N,a[128],b=0; scanf("%d",&N); for(k = 0;k < N;k++){ scanf("%d",&a[k]); } for(i = 0;i < N;i++){ for(j = 0;j < N-1;j++){ if(a[j] > a[j+1]){ tmp = a[j]; a[j] = a[j+1]; a[j+1] = tmp; b++; } } } for(k = 0;k < N-1;k++){ printf("%d ",a[k]); } printf("%d\n",a[N-1]); printf("%d\n",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282193/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282193/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a = alloca [128 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp60 = icmp sgt i32 %0, 0 br i1 %cmp60, label %for.body, label %for.cond2.preheader.for.cond30.preheader_crit_edge for.cond2.preheader: ; preds = %for.body %cmp366 = icmp sgt i32 %9, 0 br i1 %cmp366, label %for.cond5.preheader.lr.ph, label %for.cond2.preheader.for.cond30.preheader_crit_edge for.cond2.preheader.for.cond30.preheader_crit_edge: ; preds = %entry, %for.cond2.preheader %1 = phi i32 [ %9, %for.cond2.preheader ], [ %0, %entry ] %.pre85 = add nsw i32 %1, -1 br label %for.cond30.preheader.for.end39_crit_edge for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %sub = add i32 %9, -1 %cmp662.not = icmp eq i32 %9, 1 br i1 %cmp662.not, label %for.cond30.preheader.for.end39_crit_edge, label %for.cond5.preheader.us.preheader for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph %wide.trip.count = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count, 1 %2 = icmp eq i32 %sub, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc27_crit_edge.us %b.068.us = phi i32 [ %b.2.us.lcssa, %for.cond5.for.inc27_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ] %i.067.us = phi i32 [ %inc28.us, %for.cond5.for.inc27_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ] %.pre = load i32, ptr %a, align 16, !tbaa !5 br i1 %2, label %for.cond5.for.inc27_crit_edge.us.unr-lcssa, label %for.body7.us for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc24.us.1 %3 = phi i32 [ %7, %for.inc24.us.1 ], [ %.pre, %for.cond5.preheader.us ] %indvars.iv78 = phi i64 [ %indvars.iv.next79.1, %for.inc24.us.1 ], [ 0, %for.cond5.preheader.us ] %b.164.us = phi i32 [ %b.2.us.1, %for.inc24.us.1 ], [ %b.068.us, %for.cond5.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc24.us.1 ], [ 0, %for.cond5.preheader.us ] %indvars.iv.next79 = or i64 %indvars.iv78, 1 %arrayidx11.us = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv.next79 %4 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.us = icmp sgt i32 %3, %4 br i1 %cmp12.us, label %if.then.us, label %for.inc24.us if.then.us: ; preds = %for.body7.us %arrayidx9.us = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv78 store i32 %4, ptr %arrayidx9.us, align 8, !tbaa !5 store i32 %3, ptr %arrayidx11.us, align 4, !tbaa !5 %inc23.us = add nsw i32 %b.164.us, 1 br label %for.inc24.us for.inc24.us: ; preds = %if.then.us, %for.body7.us %5 = phi i32 [ %3, %if.then.us ], [ %4, %for.body7.us ] %b.2.us = phi i32 [ %inc23.us, %if.then.us ], [ %b.164.us, %for.body7.us ] %indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2 %arrayidx11.us.1 = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv.next79.1 %6 = load i32, ptr %arrayidx11.us.1, align 8, !tbaa !5 %cmp12.us.1 = icmp sgt i32 %5, %6 br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc24.us.1 if.then.us.1: ; preds = %for.inc24.us %arrayidx9.us.1 = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv.next79 store i32 %6, ptr %arrayidx9.us.1, align 4, !tbaa !5 store i32 %5, ptr %arrayidx11.us.1, align 8, !tbaa !5 %inc23.us.1 = add nsw i32 %b.2.us, 1 br label %for.inc24.us.1 for.inc24.us.1: ; preds = %if.then.us.1, %for.inc24.us %7 = phi i32 [ %5, %if.then.us.1 ], [ %6, %for.inc24.us ] %b.2.us.1 = phi i32 [ %inc23.us.1, %if.then.us.1 ], [ %b.2.us, %for.inc24.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.cond5.for.inc27_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !9 for.cond5.for.inc27_crit_edge.us.unr-lcssa: ; preds = %for.inc24.us.1, %for.cond5.preheader.us %b.2.us.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us ], [ %b.2.us.1, %for.inc24.us.1 ] %.unr = phi i32 [ %.pre, %for.cond5.preheader.us ], [ %7, %for.inc24.us.1 ] %indvars.iv78.unr = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next79.1, %for.inc24.us.1 ] %b.164.us.unr = phi i32 [ %b.068.us, %for.cond5.preheader.us ], [ %b.2.us.1, %for.inc24.us.1 ] br i1 %lcmp.mod.not, label %for.cond5.for.inc27_crit_edge.us, label %for.body7.us.epil for.body7.us.epil: ; preds = %for.cond5.for.inc27_crit_edge.us.unr-lcssa %indvars.iv.next79.epil = add nuw nsw i64 %indvars.iv78.unr, 1 %arrayidx11.us.epil = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv.next79.epil %8 = load i32, ptr %arrayidx11.us.epil, align 4, !tbaa !5 %cmp12.us.epil = icmp sgt i32 %.unr, %8 br i1 %cmp12.us.epil, label %if.then.us.epil, label %for.cond5.for.inc27_crit_edge.us if.then.us.epil: ; preds = %for.body7.us.epil %arrayidx9.us.epil = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv78.unr store i32 %8, ptr %arrayidx9.us.epil, align 4, !tbaa !5 store i32 %.unr, ptr %arrayidx11.us.epil, align 4, !tbaa !5 %inc23.us.epil = add nsw i32 %b.164.us.unr, 1 br label %for.cond5.for.inc27_crit_edge.us for.cond5.for.inc27_crit_edge.us: ; preds = %for.body7.us.epil, %if.then.us.epil, %for.cond5.for.inc27_crit_edge.us.unr-lcssa %b.2.us.lcssa = phi i32 [ %b.2.us.lcssa.ph, %for.cond5.for.inc27_crit_edge.us.unr-lcssa ], [ %inc23.us.epil, %if.then.us.epil ], [ %b.164.us.unr, %for.body7.us.epil ] %inc28.us = add nuw nsw i32 %i.067.us, 1 %exitcond81.not = icmp eq i32 %inc28.us, %9 br i1 %exitcond81.not, label %for.cond30.preheader, label %for.cond5.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [128 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 %9 = load i32, ptr %N, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12 for.cond30.preheader: ; preds = %for.cond5.for.inc27_crit_edge.us %cmp3271 = icmp sgt i32 %9, 1 br i1 %cmp3271, label %for.body33, label %for.cond30.preheader.for.end39_crit_edge for.cond30.preheader.for.end39_crit_edge: ; preds = %for.cond5.preheader.lr.ph, %for.cond2.preheader.for.cond30.preheader_crit_edge, %for.cond30.preheader %b.0.lcssa93 = phi i32 [ %b.2.us.lcssa, %for.cond30.preheader ], [ 0, %for.cond2.preheader.for.cond30.preheader_crit_edge ], [ 0, %for.cond5.preheader.lr.ph ] %sub3170.pre-phi91 = phi i32 [ %sub, %for.cond30.preheader ], [ %.pre85, %for.cond2.preheader.for.cond30.preheader_crit_edge ], [ 0, %for.cond5.preheader.lr.ph ] %.pre86 = sext i32 %sub3170.pre-phi91 to i64 br label %for.end39 for.body33: ; preds = %for.cond30.preheader, %for.body33 %indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body33 ], [ 0, %for.cond30.preheader ] %arrayidx35 = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %indvars.iv82 %11 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %12 = load i32, ptr %N, align 4, !tbaa !5 %sub31 = add nsw i32 %12, -1 %13 = sext i32 %sub31 to i64 %cmp32 = icmp slt i64 %indvars.iv.next83, %13 br i1 %cmp32, label %for.body33, label %for.end39, !llvm.loop !13 for.end39: ; preds = %for.body33, %for.cond30.preheader.for.end39_crit_edge %b.0.lcssa92 = phi i32 [ %b.0.lcssa93, %for.cond30.preheader.for.end39_crit_edge ], [ %b.2.us.lcssa, %for.body33 ] %idxprom41.pre-phi = phi i64 [ %.pre86, %for.cond30.preheader.for.end39_crit_edge ], [ %13, %for.body33 ] %arrayidx42 = getelementptr inbounds [128 x i32], ptr %a, i64 0, i64 %idxprom41.pre-phi %14 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14) %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %b.0.lcssa92) call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int i, j, k, kosuu, box, CGcount = 0, a[101]; scanf("%d", &kosuu); for(i = 1;i <= kosuu;i++){ scanf("%d", &a[i]); } for(i = 1;i <= kosuu;i++) { for(j = kosuu;j > i;j--) { if (a[j] < a[j-1]) { box = a[j-1]; a[j-1] = a[j]; a[j] = box; CGcount++; } } } for(k = 1;k < kosuu;k++) { printf("%d ", a[k]); } printf("%d\n%d\n", a[kosuu], CGcount); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282236/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282236/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %kosuu = alloca i32, align 4 %a = alloca [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kosuu) #3 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %kosuu) %0 = load i32, ptr %kosuu, align 4, !tbaa !5 %cmp.not60 = icmp slt i32 %0, 1 br i1 %cmp.not60, label %for.cond29.preheader.for.end37_crit_edge, label %for.body for.cond2.preheader: ; preds = %for.body %cmp3.not66 = icmp slt i32 %3, 1 br i1 %cmp3.not66, label %for.cond29.preheader.for.end37_crit_edge, label %for.cond5.preheader.preheader for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %3 to i64 %2 = add nuw i32 %3, 1 %wide.trip.count = zext i32 %2 to i64 %arrayidx9.phi.trans.insert = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %1 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [101 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 %kosuu, 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.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.inc26 %indvars.iv79 = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next80, %for.inc26 ] %CGcount.068 = phi i32 [ 0, %for.cond5.preheader.preheader ], [ %CGcount.1.lcssa, %for.inc26 ] %cmp662 = icmp ult i64 %indvars.iv79, %1 br i1 %cmp662, label %for.body7.preheader, label %for.inc26 for.body7.preheader: ; preds = %for.cond5.preheader %.pre = load i32, ptr %arrayidx9.phi.trans.insert, align 4, !tbaa !5 br label %for.body7 for.cond29.preheader: ; preds = %for.inc26 %cmp3070 = icmp sgt i32 %3, 1 br i1 %cmp3070, label %for.body31, label %for.cond29.preheader.for.end37_crit_edge for.cond29.preheader.for.end37_crit_edge: ; preds = %entry, %for.cond2.preheader, %for.cond29.preheader %CGcount.0.lcssa90 = phi i32 [ %CGcount.1.lcssa, %for.cond29.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ] %5 = phi i32 [ %3, %for.cond29.preheader ], [ %3, %for.cond2.preheader ], [ %0, %entry ] %.pre85 = sext i32 %5 to i64 br label %for.end37 for.body7: ; preds = %for.body7.preheader, %for.inc24 %6 = phi i32 [ %.pre, %for.body7.preheader ], [ %8, %for.inc24 ] %indvars.iv76 = phi i64 [ %1, %for.body7.preheader ], [ %indvars.iv.next77, %for.inc24 ] %CGcount.164 = phi i32 [ %CGcount.068, %for.body7.preheader ], [ %CGcount.2, %for.inc24 ] %indvars.iv.next77 = add nsw i64 %indvars.iv76, -1 %arrayidx11 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv.next77 %7 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp slt i32 %6, %7 br i1 %cmp12, label %if.then, label %for.inc24 if.then: ; preds = %for.body7 %arrayidx9 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv76 store i32 %6, ptr %arrayidx11, align 4, !tbaa !5 store i32 %7, ptr %arrayidx9, align 4, !tbaa !5 %inc23 = add nsw i32 %CGcount.164, 1 br label %for.inc24 for.inc24: ; preds = %for.body7, %if.then %8 = phi i32 [ %6, %if.then ], [ %7, %for.body7 ] %CGcount.2 = phi i32 [ %inc23, %if.then ], [ %CGcount.164, %for.body7 ] %cmp6 = icmp sgt i64 %indvars.iv.next77, %indvars.iv79 br i1 %cmp6, label %for.body7, label %for.inc26, !llvm.loop !11 for.inc26: ; preds = %for.inc24, %for.cond5.preheader %CGcount.1.lcssa = phi i32 [ %CGcount.068, %for.cond5.preheader ], [ %CGcount.2, %for.inc24 ] %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count br i1 %exitcond.not, label %for.cond29.preheader, label %for.cond5.preheader, !llvm.loop !12 for.body31: ; preds = %for.cond29.preheader, %for.body31 %indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body31 ], [ 1, %for.cond29.preheader ] %arrayidx33 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv82 %9 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %10 = load i32, ptr %kosuu, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp30 = icmp slt i64 %indvars.iv.next83, %11 br i1 %cmp30, label %for.body31, label %for.end37, !llvm.loop !13 for.end37: ; preds = %for.body31, %for.cond29.preheader.for.end37_crit_edge %CGcount.0.lcssa89 = phi i32 [ %CGcount.0.lcssa90, %for.cond29.preheader.for.end37_crit_edge ], [ %CGcount.1.lcssa, %for.body31 ] %idxprom38.pre-phi = phi i64 [ %.pre85, %for.cond29.preheader.for.end37_crit_edge ], [ %11, %for.body31 ] %arrayidx39 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %idxprom38.pre-phi %12 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12, i32 noundef %CGcount.0.lcssa89) call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kosuu) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int t; scanf("%d", &t); long long a, b; for(int i=0;i<t;i++) { scanf("%I64d%I64d", &a, &b); if(a==1) printf("%I64d %I64d\n", a, b); else if(a*2<=b) printf("%I64d %I64d\n", a, a*2); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28228/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%I64d%I64d\00", align 1 @.str.2 = private unnamed_addr constant [13 x i8] c"%I64d %I64d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 for.body: ; preds = %entry, %for.inc %i.011 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i64, ptr %a, align 8, !tbaa !9 %cmp2 = icmp eq i64 %1, 1 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body %2 = load i64, ptr %b, align 8, !tbaa !9 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef 1, i64 noundef %2) br label %for.inc if.else: ; preds = %for.body %mul = shl nsw i64 %1, 1 %3 = load i64, ptr %b, align 8, !tbaa !9 %cmp4.not = icmp sgt i64 %mul, %3 br i1 %cmp4.not, label %for.inc, label %if.then5 if.then5: ; preds = %if.else %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %1, i64 noundef %mul) br label %for.inc for.inc: ; preds = %if.then, %if.then5, %if.else %inc = add nuw nsw i32 %i.011, 1 %4 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int flag = 1; int i,j,N,v,a[10000]; int c =0; scanf("%d", &N); for ( i = 0; i < N; i++ ){ scanf("%d", &a[i]); } while ( flag ) { flag = 0; for ( j = N - 1; j >0; j-- ) { if ( a[j] < a[j - 1] ) { v = a[j]; a[j] = a[j - 1]; a[j - 1] = v; flag = 1; c++; } } } for ( i = 0; i < N; i++ ) { if(i>0){ printf(" "); } printf("%d", a[i]); } printf("\n"); printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282322/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282322/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %a = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp55 = icmp sgt i32 %0, 0 br i1 %cmp55, label %for.body, label %for.end36 while.cond.preheader: ; preds = %for.body %cmp358 = icmp sgt i32 %4, 1 br i1 %cmp358, label %for.cond2.preheader.us.preheader, label %for.cond24.preheader for.cond2.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader %indvars.iv70 = phi i64 [ %1, %for.cond2.preheader.us.preheader ], [ %indvars.iv70.be, %for.body4.us.backedge ] %c.161.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %c.2.us, %for.body4.us.backedge ] %flag.160.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %flag.160.us.be, %for.body4.us.backedge ] %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1 %idxprom5.us = and i64 %indvars.iv.next71, 4294967295 %arrayidx6.us = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %idxprom5.us %2 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %sub7.us = add i64 %indvars.iv70, 4294967294 %idxprom8.us = and i64 %sub7.us, 4294967295 %arrayidx9.us = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %idxprom8.us %3 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp slt i32 %2, %3 br i1 %cmp10.us, label %if.then.us, label %for.inc22.us if.then.us: ; preds = %for.body4.us store i32 %3, ptr %arrayidx6.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5 %inc21.us = add nsw i32 %c.161.us, 1 br label %for.inc22.us for.inc22.us: ; preds = %if.then.us, %for.body4.us %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.160.us, %for.body4.us ] %c.2.us = phi i32 [ %inc21.us, %if.then.us ], [ %c.161.us, %for.body4.us ] %cmp3.us = icmp sgt i64 %indvars.iv70, 2 br i1 %cmp3.us, label %for.body4.us.backedge, label %for.cond2.while.cond.loopexit_crit_edge.us for.body4.us.backedge: ; preds = %for.inc22.us, %for.cond2.while.cond.loopexit_crit_edge.us %indvars.iv70.be = phi i64 [ %indvars.iv.next71, %for.inc22.us ], [ %1, %for.cond2.while.cond.loopexit_crit_edge.us ] %flag.160.us.be = phi i32 [ %flag.2.us, %for.inc22.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ] br label %for.body4.us, !llvm.loop !9 for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc22.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond24.preheader, label %for.body4.us.backedge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 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 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us, %while.cond.preheader %.us-phi = phi i32 [ 0, %while.cond.preheader ], [ %c.2.us, %for.cond2.while.cond.loopexit_crit_edge.us ] %cmp2566 = icmp sgt i32 %4, 0 br i1 %cmp2566, label %if.end30.peel, label %for.end36 if.end30.peel: ; preds = %for.cond24.preheader %.pre = load i32, ptr %a, align 16, !tbaa !5 %call33.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %6 = load i32, ptr %N, align 4, !tbaa !5 %cmp25.peel = icmp sgt i32 %6, 1 br i1 %cmp25.peel, label %if.end30, label %for.end36 if.end30: ; preds = %if.end30.peel, %if.end30 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %if.end30 ], [ 1, %if.end30.peel ] %putchar54 = call i32 @putchar(i32 32) %arrayidx32 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv73 %7 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp25 = icmp slt i64 %indvars.iv.next74, %9 br i1 %cmp25, label %if.end30, label %for.end36, !llvm.loop !12 for.end36: ; preds = %if.end30, %entry, %if.end30.peel, %for.cond24.preheader %.us-phi81 = phi i32 [ %.us-phi, %for.cond24.preheader ], [ %.us-phi, %if.end30.peel ], [ 0, %entry ], [ %.us-phi, %if.end30 ] %putchar = call i32 @putchar(i32 10) %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.us-phi81) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> int main(void){ int c=0,n,t,i,j,k,a[100],f=1; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } while(f){ f=0; for(i=n-1;i>=1;i--){ if(a[i]<a[i-1]){ t=a[i]; a[i]=a[i-1]; a[i-1]=t; f=1; c++; } } } for(i=0;i<n;i++){ if(i!=0) printf(" "); printf("%d",a[i]); } printf("\n%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282366/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282366/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.end36 while.cond.preheader: ; preds = %for.body %cmp357 = icmp sgt i32 %4, 1 br i1 %cmp357, label %for.cond2.preheader.us.preheader, label %for.cond24.preheader for.cond2.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader %indvars.iv69 = phi i64 [ %1, %for.cond2.preheader.us.preheader ], [ %indvars.iv69.be, %for.body4.us.backedge ] %f.160.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %f.160.us.be, %for.body4.us.backedge ] %c.159.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %c.2.us, %for.body4.us.backedge ] %indvars.iv.next70 = add nsw i64 %indvars.iv69, -1 %idxprom5.us = and i64 %indvars.iv.next70, 4294967295 %arrayidx6.us = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom5.us %2 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %sub7.us = add i64 %indvars.iv69, 4294967294 %idxprom8.us = and i64 %sub7.us, 4294967295 %arrayidx9.us = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom8.us %3 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp slt i32 %2, %3 br i1 %cmp10.us, label %if.then.us, label %for.inc22.us if.then.us: ; preds = %for.body4.us store i32 %3, ptr %arrayidx6.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5 %inc21.us = add nsw i32 %c.159.us, 1 br label %for.inc22.us for.inc22.us: ; preds = %if.then.us, %for.body4.us %c.2.us = phi i32 [ %inc21.us, %if.then.us ], [ %c.159.us, %for.body4.us ] %f.2.us = phi i32 [ 1, %if.then.us ], [ %f.160.us, %for.body4.us ] %cmp3.us = icmp sgt i64 %indvars.iv69, 2 br i1 %cmp3.us, label %for.body4.us.backedge, label %for.cond2.while.cond.loopexit_crit_edge.us for.body4.us.backedge: ; preds = %for.inc22.us, %for.cond2.while.cond.loopexit_crit_edge.us %indvars.iv69.be = phi i64 [ %indvars.iv.next70, %for.inc22.us ], [ %1, %for.cond2.while.cond.loopexit_crit_edge.us ] %f.160.us.be = phi i32 [ %f.2.us, %for.inc22.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ] br label %for.body4.us, !llvm.loop !9 for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc22.us %tobool.not.us = icmp eq i32 %f.2.us, 0 br i1 %tobool.not.us, label %for.cond24.preheader, label %for.body4.us.backedge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us, %while.cond.preheader %.us-phi = phi i32 [ 0, %while.cond.preheader ], [ %c.2.us, %for.cond2.while.cond.loopexit_crit_edge.us ] %cmp2565 = icmp sgt i32 %4, 0 br i1 %cmp2565, label %if.end30.peel, label %for.end36 if.end30.peel: ; preds = %for.cond24.preheader %.pre = load i32, ptr %a, align 16, !tbaa !5 %call33.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp25.peel = icmp sgt i32 %6, 1 br i1 %cmp25.peel, label %if.end30, label %for.end36 if.end30: ; preds = %if.end30.peel, %if.end30 %indvars.iv72 = phi i64 [ %indvars.iv.next73, %if.end30 ], [ 1, %if.end30.peel ] %putchar = call i32 @putchar(i32 32) %arrayidx32 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv72 %7 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp25 = icmp slt i64 %indvars.iv.next73, %9 br i1 %cmp25, label %if.end30, label %for.end36, !llvm.loop !12 for.end36: ; preds = %if.end30, %entry, %if.end30.peel, %for.cond24.preheader %.us-phi80 = phi i32 [ %.us-phi, %for.cond24.preheader ], [ %.us-phi, %if.end30.peel ], [ 0, %entry ], [ %.us-phi, %if.end30 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi80) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #define max 100 int bubbleSort(int*,int); int main(){ int n,num[max],count; scanf("%d",&n); for(int i = 0;i<n;i++){ scanf("%d",&num[i]); } count = bubbleSort(num,n); for(int i = 0;i < n;i++){ printf("%d",num[i]); if(i < n-1)printf(" "); } printf("\n%d\n",count); return 0; } int bubbleSort(int *num,int n){ int tmp; int count = 0; int flog = 1; int i = 0; while(flog){ flog = 0; for(int j = n-1;j > i;j--){ if(num[j] < num[j-1]){ tmp = num[j]; num[j] = num[j-1]; num[j-1] = tmp; count++; flog = 1; } } i++; } return count; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282409/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282409/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%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 %num = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %num) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %0, 0 br i1 %cmp22, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre31 = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup.loopexit: ; preds = %for.body %1 = icmp sgt i32 %5, 0 br label %for.cond.cleanup for.cond.cleanup: ; preds = %entry.for.cond.cleanup_crit_edge, %for.cond.cleanup.loopexit %.pre-phi = phi i64 [ %.pre31, %entry.for.cond.cleanup_crit_edge ], [ %6, %for.cond.cleanup.loopexit ] %cmp524 = phi i1 [ false, %entry.for.cond.cleanup_crit_edge ], [ %1, %for.cond.cleanup.loopexit ] %2 = add nsw i64 %.pre-phi, -1 %invariant.gep.i = getelementptr i32, ptr %num, i64 -2 %smax = call i64 @llvm.smax.i64(i64 %2, i64 0) br label %for.cond.preheader.i for.cond.preheader.i: ; preds = %for.cond.cleanup.i, %for.cond.cleanup %indvars.iv46.i = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next47.i, %for.cond.cleanup.i ] %count.038.i = phi i32 [ 0, %for.cond.cleanup ], [ %count.2.i, %for.cond.cleanup.i ] %exitcond.not = icmp eq i64 %indvars.iv46.i, %smax br i1 %exitcond.not, label %bubbleSort.exit, label %for.body.i for.cond.cleanup.i: ; preds = %for.inc.i %indvars.iv.next47.i = add nuw nsw i64 %indvars.iv46.i, 1 %tobool.not.i = icmp eq i32 %flog.2.i, 0 br i1 %tobool.not.i, label %bubbleSort.exit, label %for.cond.preheader.i, !llvm.loop !9 for.body.i: ; preds = %for.cond.preheader.i, %for.inc.i %indvars.iv40.i = phi i64 [ %indvars.iv.next41.i, %for.inc.i ], [ %.pre-phi, %for.cond.preheader.i ] %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %2, %for.cond.preheader.i ] %flog.134.i = phi i32 [ %flog.2.i, %for.inc.i ], [ 0, %for.cond.preheader.i ] %count.133.i = phi i32 [ %count.2.i, %for.inc.i ], [ %count.038.i, %for.cond.preheader.i ] %indvars.iv.next41.i = add nsw i64 %indvars.iv40.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %num, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv40.i %4 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp4.i = icmp slt i32 %3, %4 br i1 %cmp4.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i store i32 %4, ptr %arrayidx.i, align 4, !tbaa !5 store i32 %3, ptr %gep.i, align 4, !tbaa !5 %inc.i = add nsw i32 %count.133.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %count.2.i = phi i32 [ %inc.i, %if.then.i ], [ %count.133.i, %for.body.i ] %flog.2.i = phi i32 [ 1, %if.then.i ], [ %flog.134.i, %for.body.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %cmp.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv46.i br i1 %cmp.i, label %for.body.i, label %for.cond.cleanup.i, !llvm.loop !11 bubbleSort.exit: ; preds = %for.cond.preheader.i, %for.cond.cleanup.i %count.1.lcssa53.i = phi i32 [ %count.2.i, %for.cond.cleanup.i ], [ %count.038.i, %for.cond.preheader.i ] br i1 %cmp524, label %for.body7, label %for.cond.cleanup6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %num, 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 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !12 for.cond.cleanup6: ; preds = %for.inc13, %bubbleSort.exit %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.1.lcssa53.i) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %num) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body7: ; preds = %bubbleSort.exit, %for.inc13 %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.inc13 ], [ 0, %bubbleSort.exit ] %arrayidx9 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %indvars.iv28 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %9 = sext i32 %sub to i64 %cmp11 = icmp slt i64 %indvars.iv28, %9 br i1 %cmp11, label %if.then, label %for.inc13 if.then: ; preds = %for.body7 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc13 for.inc13: ; preds = %for.body7, %if.then %10 = phi i32 [ %8, %for.body7 ], [ %.pre, %if.then ] %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1 %11 = sext i32 %10 to i64 %cmp5 = icmp slt i64 %indvars.iv.next29, %11 br i1 %cmp5, label %for.body7, label %for.cond.cleanup6, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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 norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @bubbleSort(ptr nocapture noundef %num, i32 noundef %n) local_unnamed_addr #3 { entry: %j.031 = add nsw i32 %n, -1 %0 = sext i32 %n to i64 %1 = add nsw i64 %0, -1 %2 = sext i32 %j.031 to i64 %invariant.gep = getelementptr i32, ptr %num, i64 -2 br label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %indvars.iv46 = phi i64 [ 0, %entry ], [ %indvars.iv.next47, %for.cond.cleanup ] %count.038 = phi i32 [ 0, %entry ], [ %count.2, %for.cond.cleanup ] %cmp32 = icmp slt i64 %indvars.iv46, %2 br i1 %cmp32, label %for.body, label %while.end for.cond.cleanup: ; preds = %for.inc %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1 %tobool.not = icmp eq i32 %flog.2, 0 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.inc ], [ %0, %for.cond.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %1, %for.cond.preheader ] %flog.134 = phi i32 [ %flog.2, %for.inc ], [ 0, %for.cond.preheader ] %count.133 = phi i32 [ %count.2, %for.inc ], [ %count.038, %for.cond.preheader ] %indvars.iv.next41 = add nsw i64 %indvars.iv40, -1 %arrayidx = getelementptr inbounds i32, ptr %num, i64 %indvars.iv %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv40 %4 = load i32, ptr %gep, align 4, !tbaa !5 %cmp4 = icmp slt i32 %3, %4 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body store i32 %4, ptr %arrayidx, align 4, !tbaa !5 store i32 %3, ptr %gep, align 4, !tbaa !5 %inc = add nsw i32 %count.133, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %count.2 = phi i32 [ %inc, %if.then ], [ %count.133, %for.body ] %flog.2 = phi i32 [ 1, %if.then ], [ %flog.134, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp = icmp sgt i64 %indvars.iv.next, %indvars.iv46 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 while.end: ; preds = %for.cond.preheader, %for.cond.cleanup %count.1.lcssa53 = phi i32 [ %count.2, %for.cond.cleanup ], [ %count.038, %for.cond.preheader ] ret i32 %count.1.lcssa53 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> void bubbleSort(int *A, int N); int main(void){ int a[100],n; int i; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); bubbleSort(a,n); return 0; } void bubbleSort(int *A, int N){ int tmp; int i,j; int flag=1,cnt=0; while(flag){ flag=0; for(j=N-1;j>=1;j--){ if(A[j]<A[j-1]){ tmp=A[j]; A[j]=A[j-1]; A[j-1]=tmp; flag=1; cnt++; } } } for(i=0;i<N-1;i++) printf("%d ",A[i]); printf("%d\n",A[N-1]); printf("%d\n",cnt); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282452/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282452/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca [100 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.cond15.preheader.thread.i for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp50.i = icmp sgt i32 %1, 1 br i1 %cmp50.i, label %for.cond.preheader.us.preheader.i, label %for.cond15.preheader.thread.i for.cond15.preheader.thread.i: ; preds = %entry, %for.end %.lcssa10 = phi i32 [ %1, %for.end ], [ %0, %entry ] %sub1665.i = add i32 %.lcssa10, -1 br label %bubbleSort.exit for.cond.preheader.us.preheader.i: ; preds = %for.end %3 = zext i32 %1 to i64 br label %for.body.us.i for.body.us.i: ; preds = %for.body.us.i.backedge, %for.cond.preheader.us.preheader.i %indvars.iv.i = phi i64 [ %3, %for.cond.preheader.us.preheader.i ], [ %indvars.iv.i.be, %for.body.us.i.backedge ] %cnt.153.us.i = phi i32 [ 0, %for.cond.preheader.us.preheader.i ], [ %cnt.2.us.i, %for.body.us.i.backedge ] %flag.152.us.i = phi i32 [ 0, %for.cond.preheader.us.preheader.i ], [ %flag.152.us.i.be, %for.body.us.i.backedge ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %idxprom.us.i = and i64 %indvars.iv.next.i, 4294967295 %arrayidx.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom.us.i %4 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 %sub1.us.i = add nuw nsw i64 %indvars.iv.i, 4294967294 %idxprom2.us.i = and i64 %sub1.us.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.us.i %5 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp slt i32 %4, %5 br i1 %cmp4.us.i, label %if.then.us.i, label %for.inc.us.i if.then.us.i: ; preds = %for.body.us.i store i32 %5, ptr %arrayidx.us.i, align 4, !tbaa !5 store i32 %4, ptr %arrayidx3.us.i, align 4, !tbaa !5 %inc.us.i = add nsw i32 %cnt.153.us.i, 1 br label %for.inc.us.i for.inc.us.i: ; preds = %if.then.us.i, %for.body.us.i %flag.2.us.i = phi i32 [ 1, %if.then.us.i ], [ %flag.152.us.i, %for.body.us.i ] %cnt.2.us.i = phi i32 [ %inc.us.i, %if.then.us.i ], [ %cnt.153.us.i, %for.body.us.i ] %cmp.us.i = icmp sgt i64 %indvars.iv.i, 2 br i1 %cmp.us.i, label %for.body.us.i.backedge, label %for.cond.while.cond.loopexit_crit_edge.us.i for.body.us.i.backedge: ; preds = %for.inc.us.i, %for.cond.while.cond.loopexit_crit_edge.us.i %indvars.iv.i.be = phi i64 [ %indvars.iv.next.i, %for.inc.us.i ], [ %3, %for.cond.while.cond.loopexit_crit_edge.us.i ] %flag.152.us.i.be = phi i32 [ %flag.2.us.i, %for.inc.us.i ], [ 0, %for.cond.while.cond.loopexit_crit_edge.us.i ] br label %for.body.us.i, !llvm.loop !11 for.cond.while.cond.loopexit_crit_edge.us.i: ; preds = %for.inc.us.i %tobool.not.us.i = icmp eq i32 %flag.2.us.i, 0 br i1 %tobool.not.us.i, label %for.body18.preheader.i, label %for.body.us.i.backedge for.body18.preheader.i: ; preds = %for.cond.while.cond.loopexit_crit_edge.us.i %sub16.i = add i32 %1, -1 %wide.trip.count.i = zext i32 %sub16.i to i64 br label %for.body18.i for.body18.i: ; preds = %for.body18.i, %for.body18.preheader.i %indvars.iv60.i = phi i64 [ 0, %for.body18.preheader.i ], [ %indvars.iv.next61.i, %for.body18.i ] %arrayidx20.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv60.i %6 = load i32, ptr %arrayidx20.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %indvars.iv.next61.i = add nuw nsw i64 %indvars.iv60.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next61.i, %wide.trip.count.i br i1 %exitcond.not.i, label %bubbleSort.exit, label %for.body18.i, !llvm.loop !12 bubbleSort.exit: ; preds = %for.body18.i, %for.cond15.preheader.thread.i %sub1667.i = phi i32 [ %sub1665.i, %for.cond15.preheader.thread.i ], [ %sub16.i, %for.body18.i ] %.us-phi66.i = phi i32 [ 0, %for.cond15.preheader.thread.i ], [ %cnt.2.us.i, %for.body18.i ] %idxprom25.i = sext i32 %sub1667.i to i64 %arrayidx26.i = getelementptr inbounds i32, ptr %a, i64 %idxprom25.i %7 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5 %call27.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %call28.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi66.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 400, 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 uwtable define dso_local void @bubbleSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp50 = icmp sgt i32 %N, 1 br i1 %cmp50, label %for.cond.preheader.us.preheader, label %for.cond15.preheader.thread for.cond15.preheader.thread: ; preds = %entry %sub1665 = add i32 %N, -1 br label %for.end23 for.cond.preheader.us.preheader: ; preds = %entry %0 = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.backedge, %for.cond.preheader.us.preheader %indvars.iv = phi i64 [ %0, %for.cond.preheader.us.preheader ], [ %indvars.iv.be, %for.body.us.backedge ] %cnt.153.us = phi i32 [ 0, %for.cond.preheader.us.preheader ], [ %cnt.2.us, %for.body.us.backedge ] %flag.152.us = phi i32 [ 0, %for.cond.preheader.us.preheader ], [ %flag.152.us.be, %for.body.us.backedge ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom.us = and i64 %indvars.iv.next, 4294967295 %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %idxprom.us %1 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %sub1.us = add i64 %indvars.iv, 4294967294 %idxprom2.us = and i64 %sub1.us, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us %2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %1, %2 br i1 %cmp4.us, label %if.then.us, label %for.inc.us if.then.us: ; preds = %for.body.us store i32 %2, ptr %arrayidx.us, align 4, !tbaa !5 store i32 %1, ptr %arrayidx3.us, align 4, !tbaa !5 %inc.us = add nsw i32 %cnt.153.us, 1 br label %for.inc.us for.inc.us: ; preds = %if.then.us, %for.body.us %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.152.us, %for.body.us ] %cnt.2.us = phi i32 [ %inc.us, %if.then.us ], [ %cnt.153.us, %for.body.us ] %cmp.us = icmp sgt i64 %indvars.iv, 2 br i1 %cmp.us, label %for.body.us.backedge, label %for.cond.while.cond.loopexit_crit_edge.us for.body.us.backedge: ; preds = %for.inc.us, %for.cond.while.cond.loopexit_crit_edge.us %indvars.iv.be = phi i64 [ %indvars.iv.next, %for.inc.us ], [ %0, %for.cond.while.cond.loopexit_crit_edge.us ] %flag.152.us.be = phi i32 [ %flag.2.us, %for.inc.us ], [ 0, %for.cond.while.cond.loopexit_crit_edge.us ] br label %for.body.us, !llvm.loop !11 for.cond.while.cond.loopexit_crit_edge.us: ; preds = %for.inc.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond15.preheader, label %for.body.us.backedge for.cond15.preheader: ; preds = %for.cond.while.cond.loopexit_crit_edge.us %sub16 = add i32 %N, -1 br i1 %cmp50, label %for.body18.preheader, label %for.end23 for.body18.preheader: ; preds = %for.cond15.preheader %wide.trip.count = zext i32 %sub16 to i64 br label %for.body18 for.body18: ; preds = %for.body18.preheader, %for.body18 %indvars.iv60 = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next61, %for.body18 ] %arrayidx20 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv60 %3 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count br i1 %exitcond.not, label %for.end23, label %for.body18, !llvm.loop !12 for.end23: ; preds = %for.body18, %for.cond15.preheader.thread, %for.cond15.preheader %sub1667 = phi i32 [ %sub1665, %for.cond15.preheader.thread ], [ %sub16, %for.cond15.preheader ], [ %sub16, %for.body18 ] %.us-phi66 = phi i32 [ 0, %for.cond15.preheader.thread ], [ %cnt.2.us, %for.cond15.preheader ], [ %cnt.2.us, %for.body18 ] %idxprom25 = sext i32 %sub1667 to i64 %arrayidx26 = getelementptr inbounds i32, ptr %A, i64 %idxprom25 %4 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %call27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4) %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi66) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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> int main(){ int n, a[100], i, count=0, flag=1, b; scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d", &a[i]); } while(flag==1){ flag=0; for(i=n-1; i>0; i--){ if(a[i]<a[i-1]){ b=a[i]; a[i]=a[i-1]; a[i-1]=b; count++; flag=1; } } } for(i=0; i<n-1; i++){ printf("%d ", a[i]); } printf("%d",a[n-1]); printf("\n%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282496/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282496/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp55 = icmp sgt i32 %0, 0 br i1 %cmp55, label %for.body, label %for.cond25.preheader.for.end34_crit_edge while.cond.preheader: ; preds = %for.body %cmp458 = icmp sgt i32 %4, 1 br i1 %cmp458, label %for.cond3.preheader.us.preheader, label %for.cond25.preheader.for.end34_crit_edge for.cond3.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body5.us for.body5.us: ; preds = %for.body5.us.backedge, %for.cond3.preheader.us.preheader %indvars.iv73 = phi i64 [ %1, %for.cond3.preheader.us.preheader ], [ %indvars.iv73.be, %for.body5.us.backedge ] %flag.160.us = phi i32 [ 0, %for.cond3.preheader.us.preheader ], [ %flag.160.us.be, %for.body5.us.backedge ] %count.159.us = phi i32 [ 0, %for.cond3.preheader.us.preheader ], [ %count.2.us, %for.body5.us.backedge ] %indvars.iv.next74 = add nsw i64 %indvars.iv73, -1 %idxprom6.us = and i64 %indvars.iv.next74, 4294967295 %arrayidx7.us = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom6.us %2 = load i32, ptr %arrayidx7.us, align 4, !tbaa !5 %sub8.us = add i64 %indvars.iv73, 4294967294 %idxprom9.us = and i64 %sub8.us, 4294967295 %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom9.us %3 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp slt i32 %2, %3 br i1 %cmp11.us, label %if.then.us, label %for.inc23.us if.then.us: ; preds = %for.body5.us store i32 %3, ptr %arrayidx7.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx10.us, align 4, !tbaa !5 %inc22.us = add nsw i32 %count.159.us, 1 br label %for.inc23.us for.inc23.us: ; preds = %if.then.us, %for.body5.us %count.2.us = phi i32 [ %inc22.us, %if.then.us ], [ %count.159.us, %for.body5.us ] %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.160.us, %for.body5.us ] %cmp4.us = icmp sgt i64 %indvars.iv73, 2 br i1 %cmp4.us, label %for.body5.us.backedge, label %for.cond3.while.cond.loopexit_crit_edge.us for.body5.us.backedge: ; preds = %for.inc23.us, %for.cond3.while.cond.loopexit_crit_edge.us %indvars.iv73.be = phi i64 [ %indvars.iv.next74, %for.inc23.us ], [ %1, %for.cond3.while.cond.loopexit_crit_edge.us ] %flag.160.us.be = phi i32 [ %flag.2.us, %for.inc23.us ], [ 0, %for.cond3.while.cond.loopexit_crit_edge.us ] br label %for.body5.us, !llvm.loop !9 for.cond3.while.cond.loopexit_crit_edge.us: ; preds = %for.inc23.us %cmp2.us = icmp eq i32 %flag.2.us, 1 br i1 %cmp2.us, label %for.body5.us.backedge, label %for.cond25.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond25.preheader: ; preds = %for.cond3.while.cond.loopexit_crit_edge.us br i1 %cmp458, label %for.body28, label %for.cond25.preheader.for.end34_crit_edge for.cond25.preheader.for.end34_crit_edge: ; preds = %entry, %while.cond.preheader, %for.cond25.preheader %.us-phi85 = phi i32 [ %count.2.us, %for.cond25.preheader ], [ 0, %while.cond.preheader ], [ 0, %entry ] %6 = phi i32 [ %4, %for.cond25.preheader ], [ %4, %while.cond.preheader ], [ %0, %entry ] %sub2666 = add nsw i32 %6, -1 %.pre = sext i32 %sub2666 to i64 br label %for.end34 for.body28: ; preds = %for.cond25.preheader, %for.body28 %indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body28 ], [ 0, %for.cond25.preheader ] %arrayidx30 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv76 %7 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %sub26 = add nsw i32 %8, -1 %9 = sext i32 %sub26 to i64 %cmp27 = icmp slt i64 %indvars.iv.next77, %9 br i1 %cmp27, label %for.body28, label %for.end34, !llvm.loop !12 for.end34: ; preds = %for.body28, %for.cond25.preheader.for.end34_crit_edge %.us-phi84 = phi i32 [ %.us-phi85, %for.cond25.preheader.for.end34_crit_edge ], [ %count.2.us, %for.body28 ] %idxprom36.pre-phi = phi i64 [ %.pre, %for.cond25.preheader.for.end34_crit_edge ], [ %9, %for.body28 ] %arrayidx37 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom36.pre-phi %10 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi84) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #include<stdlib.h> #define N 100 int main(){ int A[N],a,i,j,flag=1,cnt=0,v; scanf("%d",&a); if(a<1 || a>100)exit(0); for(i=0;i<a;i++){ scanf("%d",&A[i]); if(A[i]<0 || A[i]>100)exit(1); } while(flag==1){ flag=0; for(j=a-1;j>0;j--){ if(A[j]<A[j-1]){ v=A[j-1]; A[j-1]=A[j]; A[j]=v; flag=1; cnt++; } } } for(i=0;i<a;i++){ printf("%d",A[i]); if(i==a-1)printf("\n"); else printf(" "); } printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282539/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282539/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca [100 x i32], align 16 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4 %1 = add i32 %0, -101 %or.cond = icmp ult i32 %1, -100 br i1 %or.cond, label %if.then, label %for.body if.then: ; preds = %entry call void @exit(i32 noundef 0) #6 unreachable for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.cond.preheader: ; preds = %for.cond %cmp1578 = icmp sgt i32 %2, 1 br i1 %cmp1578, label %for.cond14.preheader.us.preheader, label %for.cond38.preheader for.cond14.preheader.us.preheader: ; preds = %while.cond.preheader %4 = zext i32 %2 to i64 br label %for.body16.us for.body16.us: ; preds = %for.body16.us.backedge, %for.cond14.preheader.us.preheader %indvars.iv90 = phi i64 [ %4, %for.cond14.preheader.us.preheader ], [ %indvars.iv90.be, %for.body16.us.backedge ] %cnt.181.us = phi i32 [ 0, %for.cond14.preheader.us.preheader ], [ %cnt.2.us, %for.body16.us.backedge ] %flag.180.us = phi i32 [ 0, %for.cond14.preheader.us.preheader ], [ %flag.180.us.be, %for.body16.us.backedge ] %indvars.iv.next91 = add nsw i64 %indvars.iv90, -1 %idxprom17.us = and i64 %indvars.iv.next91, 4294967295 %arrayidx18.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom17.us %5 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %sub19.us = add i64 %indvars.iv90, 4294967294 %idxprom20.us = and i64 %sub19.us, 4294967295 %arrayidx21.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom20.us %6 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5 %cmp22.us = icmp slt i32 %5, %6 br i1 %cmp22.us, label %if.then23.us, label %for.inc36.us if.then23.us: ; preds = %for.body16.us store i32 %5, ptr %arrayidx21.us, align 4, !tbaa !5 store i32 %6, ptr %arrayidx18.us, align 4, !tbaa !5 %inc34.us = add nsw i32 %cnt.181.us, 1 br label %for.inc36.us for.inc36.us: ; preds = %if.then23.us, %for.body16.us %flag.2.us = phi i32 [ 1, %if.then23.us ], [ %flag.180.us, %for.body16.us ] %cnt.2.us = phi i32 [ %inc34.us, %if.then23.us ], [ %cnt.181.us, %for.body16.us ] %cmp15.us = icmp sgt i64 %indvars.iv90, 2 br i1 %cmp15.us, label %for.body16.us.backedge, label %for.cond14.while.cond.loopexit_crit_edge.us for.body16.us.backedge: ; preds = %for.inc36.us, %for.cond14.while.cond.loopexit_crit_edge.us %indvars.iv90.be = phi i64 [ %indvars.iv.next91, %for.inc36.us ], [ %4, %for.cond14.while.cond.loopexit_crit_edge.us ] %flag.180.us.be = phi i32 [ %flag.2.us, %for.inc36.us ], [ 0, %for.cond14.while.cond.loopexit_crit_edge.us ] br label %for.body16.us, !llvm.loop !11 for.cond14.while.cond.loopexit_crit_edge.us: ; preds = %for.inc36.us %cmp13.us = icmp eq i32 %flag.2.us, 1 br i1 %cmp13.us, label %for.body16.us.backedge, label %for.cond38.preheader for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %7 = load i32, ptr %arrayidx, align 4, !tbaa !5 %or.cond73 = icmp ugt i32 %7, 100 br i1 %or.cond73, label %if.then11, label %for.cond if.then11: ; preds = %for.body call void @exit(i32 noundef 1) #6 unreachable for.cond38.preheader: ; preds = %for.cond14.while.cond.loopexit_crit_edge.us, %while.cond.preheader %.us-phi = phi i32 [ 0, %while.cond.preheader ], [ %cnt.2.us, %for.cond14.while.cond.loopexit_crit_edge.us ] %cmp3986 = icmp sgt i32 %2, 0 br i1 %cmp3986, label %for.body40, label %for.end52 for.body40: ; preds = %for.cond38.preheader, %for.body40 %indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body40 ], [ 0, %for.cond38.preheader ] %arrayidx42 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv93 %8 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %9 = load i32, ptr %a, align 4, !tbaa !5 %sub44 = add nsw i32 %9, -1 %10 = zext i32 %sub44 to i64 %cmp45 = icmp eq i64 %indvars.iv93, %10 %. = select i1 %cmp45, i32 10, i32 32 %putchar72 = call i32 @putchar(i32 %.) %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %11 = load i32, ptr %a, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp39 = icmp slt i64 %indvars.iv.next94, %12 br i1 %cmp39, label %for.body40, label %for.end52, !llvm.loop !12 for.end52: ; preds = %for.body40, %for.cond38.preheader %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.us-phi) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 400, 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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #include<stdlib.h> int main() { int i,j,n,hold,count=0; int Array[100]; scanf("%d",&n); if( n < 1 || n > 100 ) exit(1); for( i = 0; i < n; i++ ) { scanf("%d",&Array[i]); if( Array[i] < 0 || Array[i] > 100 ) exit(1); } for( i = 0; i < n-1; i++ ) { for( j = n-1; j > i; j-- ) { if(Array[j] < Array[j-1]) { hold = Array[j]; Array[j] = Array[j-1]; Array[j-1] = hold; count++; } } } for( i = 0; i <= n-2; i++ ) printf("%d ",Array[i]); printf("%d\n",Array[n-1]); printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282582/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282582/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %Array = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %Array) #4 %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, -101 %or.cond = icmp ult i32 %1, -100 br i1 %or.cond, label %if.then, label %for.body if.then: ; preds = %entry call void @exit(i32 noundef 1) #5 unreachable for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body, label %for.cond13.preheader, !llvm.loop !9 for.cond13.preheader: ; preds = %for.cond %sub = add i32 %2, -1 %cmp1486 = icmp sgt i32 %2, 1 br i1 %cmp1486, label %for.cond17.preheader.preheader, label %for.end53 for.cond17.preheader.preheader: ; preds = %for.cond13.preheader %4 = zext i32 %2 to i64 %5 = add nsw i64 %4, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx21.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %Array, i64 0, i64 %5 br label %for.cond17.preheader for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %Array, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %or.cond79 = icmp ugt i32 %6, 100 br i1 %or.cond79, label %if.then11, label %for.cond if.then11: ; preds = %for.body call void @exit(i32 noundef 1) #5 unreachable for.cond17.preheader: ; preds = %for.cond17.preheader.preheader, %for.inc41 %indvars.iv100 = phi i64 [ 0, %for.cond17.preheader.preheader ], [ %indvars.iv.next101, %for.inc41 ] %count.088 = phi i32 [ 0, %for.cond17.preheader.preheader ], [ %count.2, %for.inc41 ] %.pre = load i32, ptr %arrayidx21.phi.trans.insert, align 4, !tbaa !5 br label %for.body19 for.cond44.preheader: ; preds = %for.inc41 %cmp46.not91 = icmp slt i32 %2, 2 br i1 %cmp46.not91, label %for.end53, label %for.body47 for.body19: ; preds = %for.cond17.preheader, %for.inc39 %7 = phi i32 [ %.pre, %for.cond17.preheader ], [ %9, %for.inc39 ] %indvars.iv97 = phi i64 [ %5, %for.cond17.preheader ], [ %indvars.iv.next98, %for.inc39 ] %count.185 = phi i32 [ %count.088, %for.cond17.preheader ], [ %count.2, %for.inc39 ] %indvars.iv.next98 = add nsw i64 %indvars.iv97, -1 %arrayidx24 = getelementptr inbounds [100 x i32], ptr %Array, i64 0, i64 %indvars.iv.next98 %8 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %cmp25 = icmp slt i32 %7, %8 br i1 %cmp25, label %if.then26, label %for.inc39 if.then26: ; preds = %for.body19 %arrayidx21 = getelementptr inbounds [100 x i32], ptr %Array, i64 0, i64 %indvars.iv97 store i32 %8, ptr %arrayidx21, align 4, !tbaa !5 store i32 %7, ptr %arrayidx24, align 4, !tbaa !5 %inc37 = add nsw i32 %count.185, 1 br label %for.inc39 for.inc39: ; preds = %for.body19, %if.then26 %9 = phi i32 [ %7, %if.then26 ], [ %8, %for.body19 ] %count.2 = phi i32 [ %inc37, %if.then26 ], [ %count.185, %for.body19 ] %cmp18 = icmp sgt i64 %indvars.iv.next98, %indvars.iv100 br i1 %cmp18, label %for.body19, label %for.inc41, !llvm.loop !11 for.inc41: ; preds = %for.inc39 %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %exitcond.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count br i1 %exitcond.not, label %for.cond44.preheader, label %for.cond17.preheader, !llvm.loop !12 for.body47: ; preds = %for.cond44.preheader, %for.body47 %indvars.iv103 = phi i64 [ %indvars.iv.next104, %for.body47 ], [ 0, %for.cond44.preheader ] %arrayidx49 = getelementptr inbounds [100 x i32], ptr %Array, i64 0, i64 %indvars.iv103 %10 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %sub45 = add nsw i32 %11, -2 %12 = sext i32 %sub45 to i64 %cmp46.not.not = icmp slt i64 %indvars.iv103, %12 br i1 %cmp46.not.not, label %for.body47, label %for.end53.loopexit, !llvm.loop !13 for.end53.loopexit: ; preds = %for.body47 %.pre106 = add nsw i32 %11, -1 br label %for.end53 for.end53: ; preds = %for.cond13.preheader, %for.end53.loopexit, %for.cond44.preheader %count.0.lcssa109 = phi i32 [ %count.2, %for.end53.loopexit ], [ %count.2, %for.cond44.preheader ], [ 0, %for.cond13.preheader ] %sub54.pre-phi = phi i32 [ %.pre106, %for.end53.loopexit ], [ %sub, %for.cond44.preheader ], [ %sub, %for.cond13.preheader ] %idxprom55 = sext i32 %sub54.pre-phi to i64 %arrayidx56 = getelementptr inbounds [100 x i32], ptr %Array, i64 0, i64 %idxprom55 %13 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa109) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %Array) #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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(){ int i,j,N,flag,A[100],count=0,tmp; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } flag=1; while(flag){ flag=0; for(j=N-1;j>=1;j--){ if(A[j] < A[j-1]){ tmp=A[j]; A[j]=A[j-1]; A[j-1]=tmp; flag=1; count++; } } } for(j=0;j<N;j++){ if(j>0) printf(" "); printf("%d",A[j]); } printf("\n"); printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282625/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282625/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp55 = icmp sgt i32 %0, 0 br i1 %cmp55, label %for.body, label %for.end36 while.cond.preheader: ; preds = %for.body %cmp358 = icmp sgt i32 %4, 1 br i1 %cmp358, label %for.cond2.preheader.us.preheader, label %for.cond24.preheader for.cond2.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader %indvars.iv70 = phi i64 [ %1, %for.cond2.preheader.us.preheader ], [ %indvars.iv70.be, %for.body4.us.backedge ] %count.161.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %count.2.us, %for.body4.us.backedge ] %flag.160.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %flag.160.us.be, %for.body4.us.backedge ] %indvars.iv.next71 = add nsw i64 %indvars.iv70, -1 %idxprom5.us = and i64 %indvars.iv.next71, 4294967295 %arrayidx6.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom5.us %2 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %sub7.us = add i64 %indvars.iv70, 4294967294 %idxprom8.us = and i64 %sub7.us, 4294967295 %arrayidx9.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom8.us %3 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp slt i32 %2, %3 br i1 %cmp10.us, label %if.then.us, label %for.inc22.us if.then.us: ; preds = %for.body4.us store i32 %3, ptr %arrayidx6.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5 %inc21.us = add nsw i32 %count.161.us, 1 br label %for.inc22.us for.inc22.us: ; preds = %if.then.us, %for.body4.us %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.160.us, %for.body4.us ] %count.2.us = phi i32 [ %inc21.us, %if.then.us ], [ %count.161.us, %for.body4.us ] %cmp3.us = icmp sgt i64 %indvars.iv70, 2 br i1 %cmp3.us, label %for.body4.us.backedge, label %for.cond2.while.cond.loopexit_crit_edge.us for.body4.us.backedge: ; preds = %for.inc22.us, %for.cond2.while.cond.loopexit_crit_edge.us %indvars.iv70.be = phi i64 [ %indvars.iv.next71, %for.inc22.us ], [ %1, %for.cond2.while.cond.loopexit_crit_edge.us ] %flag.160.us.be = phi i32 [ %flag.2.us, %for.inc22.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ] br label %for.body4.us, !llvm.loop !9 for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc22.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond24.preheader, label %for.body4.us.backedge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us, %while.cond.preheader %.us-phi = phi i32 [ 0, %while.cond.preheader ], [ %count.2.us, %for.cond2.while.cond.loopexit_crit_edge.us ] %cmp2566 = icmp sgt i32 %4, 0 br i1 %cmp2566, label %if.end30.peel, label %for.end36 if.end30.peel: ; preds = %for.cond24.preheader %.pre = load i32, ptr %A, align 16, !tbaa !5 %call33.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %6 = load i32, ptr %N, align 4, !tbaa !5 %cmp25.peel = icmp sgt i32 %6, 1 br i1 %cmp25.peel, label %if.end30, label %for.end36 if.end30: ; preds = %if.end30.peel, %if.end30 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %if.end30 ], [ 1, %if.end30.peel ] %putchar54 = call i32 @putchar(i32 32) %arrayidx32 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv73 %7 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp25 = icmp slt i64 %indvars.iv.next74, %9 br i1 %cmp25, label %if.end30, label %for.end36, !llvm.loop !12 for.end36: ; preds = %if.end30, %entry, %if.end30.peel, %for.cond24.preheader %.us-phi81 = phi i32 [ %.us-phi, %for.cond24.preheader ], [ %.us-phi, %if.end30.peel ], [ 0, %entry ], [ %.us-phi, %if.end30 ] %putchar = call i32 @putchar(i32 10) %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.us-phi81) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> int main(void){ int N,i,j,key,count=0; int length[100]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&length[i]); } for(i=0;i<=N-1;i++){ for(j=N-1;j>i;j--){ if(length[j]<length[j-1]){ key=length[j]; length[j]=length[j-1]; length[j-1]=key; count++; } } } for(i=0;i<N;i++){ printf("%d",length[i]); if(i<N-1) printf(" "); } printf("\n%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282669/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282669/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%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 %length = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %length) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp64 = icmp sgt i32 %0, 0 br i1 %cmp64, label %for.body, label %for.end44 for.cond2.preheader: ; preds = %for.body %cmp3.not.not72 = icmp sgt i32 %4, 0 br i1 %cmp3.not.not72, label %for.cond6.preheader.lr.ph, label %for.end44 for.cond6.preheader.lr.ph: ; preds = %for.cond2.preheader %j.066 = add nsw i32 %4, -1 %1 = zext i32 %4 to i64 %2 = add nsw i64 %1, -1 %3 = zext i32 %j.066 to i64 %wide.trip.count = zext i32 %4 to i64 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %length, 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 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.lr.ph, %for.inc28 %indvars.iv88 = phi i64 [ 0, %for.cond6.preheader.lr.ph ], [ %indvars.iv.next89, %for.inc28 ] %count.074 = phi i32 [ 0, %for.cond6.preheader.lr.ph ], [ %count.1.lcssa, %for.inc28 ] %cmp767 = icmp ult i64 %indvars.iv88, %3 br i1 %cmp767, label %for.body8, label %for.inc28 for.cond31.preheader: ; preds = %for.inc28 br i1 %cmp3.not.not72, label %for.body33, label %for.end44 for.body8: ; preds = %for.cond6.preheader, %for.inc26 %indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.inc26 ], [ %1, %for.cond6.preheader ] %indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.inc26 ], [ %2, %for.cond6.preheader ] %count.169 = phi i32 [ %count.2, %for.inc26 ], [ %count.074, %for.cond6.preheader ] %indvars.iv.next83 = add nsw i64 %indvars.iv82, -1 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %length, i64 0, i64 %indvars.iv80 %6 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %7 = add nsw i64 %indvars.iv82, -2 %arrayidx13 = getelementptr inbounds [100 x i32], ptr %length, i64 0, i64 %7 %8 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp slt i32 %6, %8 br i1 %cmp14, label %if.then, label %for.inc26 if.then: ; preds = %for.body8 store i32 %8, ptr %arrayidx10, align 4, !tbaa !5 store i32 %6, ptr %arrayidx13, align 4, !tbaa !5 %inc25 = add nsw i32 %count.169, 1 br label %for.inc26 for.inc26: ; preds = %for.body8, %if.then %count.2 = phi i32 [ %inc25, %if.then ], [ %count.169, %for.body8 ] %indvars.iv.next81 = add nsw i64 %indvars.iv80, -1 %cmp7 = icmp sgt i64 %indvars.iv.next81, %indvars.iv88 br i1 %cmp7, label %for.body8, label %for.inc28, !llvm.loop !11 for.inc28: ; preds = %for.inc26, %for.cond6.preheader %count.1.lcssa = phi i32 [ %count.074, %for.cond6.preheader ], [ %count.2, %for.inc26 ] %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count br i1 %exitcond.not, label %for.cond31.preheader, label %for.cond6.preheader, !llvm.loop !12 for.body33: ; preds = %for.cond31.preheader, %for.inc42 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.inc42 ], [ 0, %for.cond31.preheader ] %arrayidx35 = getelementptr inbounds [100 x i32], ptr %length, i64 0, i64 %indvars.iv91 %9 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9) %10 = load i32, ptr %N, align 4, !tbaa !5 %sub37 = add nsw i32 %10, -1 %11 = sext i32 %sub37 to i64 %cmp38 = icmp slt i64 %indvars.iv91, %11 br i1 %cmp38, label %if.then39, label %for.inc42 if.then39: ; preds = %for.body33 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.inc42 for.inc42: ; preds = %for.body33, %if.then39 %12 = phi i32 [ %10, %for.body33 ], [ %.pre, %if.then39 ] %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %13 = sext i32 %12 to i64 %cmp32 = icmp slt i64 %indvars.iv.next92, %13 br i1 %cmp32, label %for.body33, label %for.end44, !llvm.loop !13 for.end44: ; preds = %for.inc42, %entry, %for.cond2.preheader, %for.cond31.preheader %count.0.lcssa98 = phi i32 [ %count.1.lcssa, %for.cond31.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1.lcssa, %for.inc42 ] %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa98) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %length) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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> #define N 100 int main(){ int i,j,n,A[N],tmp,count=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } for(i=0;i<n;i++){ for(j=n-1;j>=1+i;j--){ if(A[j]<A[j-1]){ tmp=A[j]; A[j]=A[j-1]; A[j-1]=tmp; count++; } } } for(i=0;i<n;i++){ printf("%d",A[i]); if(i<n-1)printf(" "); } printf("\n%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282711/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282711/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp64 = icmp sgt i32 %0, 0 br i1 %cmp64, label %for.body, label %for.end43 for.cond2.preheader: ; preds = %for.body %cmp373 = icmp sgt i32 %2, 0 br i1 %cmp373, label %for.cond5.preheader.lr.ph, label %for.end43 for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count = zext i32 %2 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2.loopexit: ; preds = %for.inc25, %for.cond5.preheader %count.1.lcssa = phi i32 [ %count.075, %for.cond5.preheader ], [ %count.2, %for.inc25 ] %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond5.preheader, !llvm.loop !11 for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.cond2.loopexit %indvars.iv85 = phi i64 [ 0, %for.cond5.preheader.lr.ph ], [ %indvars.iv.next86, %for.cond2.loopexit ] %count.075 = phi i32 [ 0, %for.cond5.preheader.lr.ph ], [ %count.1.lcssa, %for.cond2.loopexit ] %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1 %cmp6.not.not67 = icmp ult i64 %indvars.iv.next86, %1 br i1 %cmp6.not.not67, label %for.body7, label %for.cond2.loopexit for.cond30.preheader: ; preds = %for.cond2.loopexit br i1 %cmp373, label %for.body32, label %for.end43 for.body7: ; preds = %for.cond5.preheader, %for.inc25 %indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.inc25 ], [ %1, %for.cond5.preheader ] %count.169 = phi i32 [ %count.2, %for.inc25 ], [ %count.075, %for.cond5.preheader ] %indvars.iv.next82 = add nsw i64 %indvars.iv81, -1 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next82 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %5 = add nsw i64 %indvars.iv81, -2 %arrayidx12 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %5 %6 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp slt i32 %4, %6 br i1 %cmp13, label %if.then, label %for.inc25 if.then: ; preds = %for.body7 store i32 %6, ptr %arrayidx9, align 4, !tbaa !5 store i32 %4, ptr %arrayidx12, align 4, !tbaa !5 %inc24 = add nsw i32 %count.169, 1 br label %for.inc25 for.inc25: ; preds = %for.body7, %if.then %count.2 = phi i32 [ %inc24, %if.then ], [ %count.169, %for.body7 ] %cmp6.not.not = icmp sgt i64 %indvars.iv.next82, %indvars.iv.next86 br i1 %cmp6.not.not, label %for.body7, label %for.cond2.loopexit, !llvm.loop !12 for.body32: ; preds = %for.cond30.preheader, %for.inc41 %indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.inc41 ], [ 0, %for.cond30.preheader ] %arrayidx34 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv88 %7 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %8 = load i32, ptr %n, align 4, !tbaa !5 %sub36 = add nsw i32 %8, -1 %9 = sext i32 %sub36 to i64 %cmp37 = icmp slt i64 %indvars.iv88, %9 br i1 %cmp37, label %if.then38, label %for.inc41 if.then38: ; preds = %for.body32 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc41 for.inc41: ; preds = %for.body32, %if.then38 %10 = phi i32 [ %8, %for.body32 ], [ %.pre, %if.then38 ] %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %11 = sext i32 %10 to i64 %cmp31 = icmp slt i64 %indvars.iv.next89, %11 br i1 %cmp31, label %for.body32, label %for.end43, !llvm.loop !13 for.end43: ; preds = %for.inc41, %entry, %for.cond2.preheader, %for.cond30.preheader %count.0.lcssa95 = phi i32 [ %count.1.lcssa, %for.cond30.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1.lcssa, %for.inc41 ] %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa95) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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> void swap(int *a,int *b){ int temp; temp = *a; *a = *b; *b = temp; return; } int sort(int A[],int N){ int i,j,sw; sw = 0; unsigned short flag = 1; for(i = 0; flag;i++){ flag = 0; for(j = N-1; j >= i+1;j--){ if(A[j] < A[j-1]){ swap(&A[j],&A[j-1]); flag = 1; sw++; } } } return sw; } int main(void){ int R[100],r,i,sw; scanf("%d",&r); for(i = 0; i < r; i++) scanf("%d",&R[i]); sw = sort(R,r); for(i = 0; i < r; i++){ if(i) printf(" "); printf("%d",R[i]); } printf("\n%d\n",sw); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282777/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282777/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress 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(argmem: readwrite) uwtable define dso_local i32 @sort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #2 { entry: %0 = sext i32 %N to i64 %invariant.gep = getelementptr i32, ptr %A, i64 -2 br label %for.cond1.preheader for.cond.loopexit: ; preds = %for.inc %tobool.not = icmp eq i16 %flag.2, 0 br i1 %tobool.not, label %for.end14, label %for.cond1.preheader, !llvm.loop !9 for.cond1.preheader: ; preds = %entry, %for.cond.loopexit %indvars.iv36 = phi i64 [ 0, %entry ], [ %indvars.iv.next37, %for.cond.loopexit ] %sw.034 = phi i32 [ 0, %entry ], [ %sw.2, %for.cond.loopexit ] %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1 %cmp.not.not26 = icmp slt i64 %indvars.iv.next37, %0 br i1 %cmp.not.not26, label %for.body2, label %for.end14 for.body2: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %0, %for.cond1.preheader ] %flag.129 = phi i16 [ %flag.2, %for.inc ], [ 0, %for.cond1.preheader ] %sw.128 = phi i32 [ %sw.2, %for.inc ], [ %sw.034, %for.cond1.preheader ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %2 = load i32, ptr %gep, align 4, !tbaa !5 %cmp6 = icmp slt i32 %1, %2 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body2 store i32 %2, ptr %arrayidx, align 4, !tbaa !5 store i32 %1, ptr %gep, align 4, !tbaa !5 %inc = add nsw i32 %sw.128, 1 br label %for.inc for.inc: ; preds = %for.body2, %if.then %sw.2 = phi i32 [ %inc, %if.then ], [ %sw.128, %for.body2 ] %flag.2 = phi i16 [ 1, %if.then ], [ %flag.129, %for.body2 ] %cmp.not.not = icmp sgt i64 %indvars.iv.next, %indvars.iv.next37 br i1 %cmp.not.not, label %for.body2, label %for.cond.loopexit, !llvm.loop !11 for.end14: ; preds = %for.cond1.preheader, %for.cond.loopexit %sw.1.lcssa42 = phi i32 [ %sw.2, %for.cond.loopexit ], [ %sw.034, %for.cond1.preheader ] ret i32 %sw.1.lcssa42 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %R = alloca [100 x i32], align 16 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %R) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load i32, ptr %r, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %0, 0 br i1 %cmp20, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre30 = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %R, 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 %r, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !12 for.end.loopexit: ; preds = %for.body %3 = icmp sgt i32 %1, 0 br label %for.end for.end: ; preds = %entry.for.end_crit_edge, %for.end.loopexit %.pre-phi = phi i64 [ %.pre30, %entry.for.end_crit_edge ], [ %2, %for.end.loopexit ] %cmp422 = phi i1 [ false, %entry.for.end_crit_edge ], [ %3, %for.end.loopexit ] %invariant.gep.i = getelementptr i32, ptr %R, i64 -2 %smax = call i64 @llvm.smax.i64(i64 %.pre-phi, i64 1) %4 = add nsw i64 %smax, -1 br label %for.cond1.preheader.i for.cond.loopexit.i: ; preds = %for.inc.i %tobool.not.i = icmp eq i16 %flag.2.i, 0 br i1 %tobool.not.i, label %sort.exit, label %for.cond1.preheader.i, !llvm.loop !9 for.cond1.preheader.i: ; preds = %for.cond.loopexit.i, %for.end %indvars.iv36.i = phi i64 [ 0, %for.end ], [ %indvars.iv.next37.i, %for.cond.loopexit.i ] %sw.034.i = phi i32 [ 0, %for.end ], [ %sw.2.i, %for.cond.loopexit.i ] %indvars.iv.next37.i = add nuw nsw i64 %indvars.iv36.i, 1 %exitcond.not = icmp eq i64 %indvars.iv36.i, %4 br i1 %exitcond.not, label %sort.exit, label %for.body2.i for.body2.i: ; preds = %for.cond1.preheader.i, %for.inc.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %.pre-phi, %for.cond1.preheader.i ] %flag.129.i = phi i16 [ %flag.2.i, %for.inc.i ], [ 0, %for.cond1.preheader.i ] %sw.128.i = phi i32 [ %sw.2.i, %for.inc.i ], [ %sw.034.i, %for.cond1.preheader.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %R, i64 %indvars.iv.next.i %5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i %6 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp6.i = icmp slt i32 %5, %6 br i1 %cmp6.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body2.i store i32 %6, ptr %arrayidx.i, align 4, !tbaa !5 store i32 %5, ptr %gep.i, align 4, !tbaa !5 %inc.i = add nsw i32 %sw.128.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body2.i %sw.2.i = phi i32 [ %inc.i, %if.then.i ], [ %sw.128.i, %for.body2.i ] %flag.2.i = phi i16 [ 1, %if.then.i ], [ %flag.129.i, %for.body2.i ] %cmp.not.not.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv.next37.i br i1 %cmp.not.not.i, label %for.body2.i, label %for.cond.loopexit.i, !llvm.loop !11 sort.exit: ; preds = %for.cond.loopexit.i, %for.cond1.preheader.i %sw.1.lcssa42.i = phi i32 [ %sw.2.i, %for.cond.loopexit.i ], [ %sw.034.i, %for.cond1.preheader.i ] br i1 %cmp422, label %if.end.peel, label %for.end12 if.end.peel: ; preds = %sort.exit %.pre = load i32, ptr %R, align 16, !tbaa !5 %call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %7 = load i32, ptr %r, align 4, !tbaa !5 %cmp4.peel = icmp sgt i32 %7, 1 br i1 %cmp4.peel, label %if.end, label %for.end12 if.end: ; preds = %if.end.peel, %if.end %indvars.iv26 = phi i64 [ %indvars.iv.next27, %if.end ], [ 1, %if.end.peel ] %putchar = call i32 @putchar(i32 32) %arrayidx8 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv26 %8 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1 %9 = load i32, ptr %r, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next27, %10 br i1 %cmp4, label %if.end, label %for.end12, !llvm.loop !13 for.end12: ; preds = %if.end, %if.end.peel, %sort.exit %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sw.1.lcssa42.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %R) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ int n; scanf("%d",&n); char **array; array = (char**)malloc(sizeof(char*)*100); int i = 0, m = 50; for (i = 0; i < n; ++i) array[i] = (char*)malloc(sizeof(char)*100); for(i = 0; i < n; ++i){ scanf("%s",array[i]); //printf("%s\n",array[i]); } for (int j = 0; j < n; ++j) { char *string2; int flag = 0; string2 = (char*)malloc(sizeof(char)*100); strcpy(string2,array[j]); //printf("%s\n",string2); int k = j-1; while(k>=0){ if(!strcmp(string2,array[k])){ flag = 1; break; } else{ k--; } } if(flag) printf("YES\n"); else printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28282/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28282/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call noalias dereferenceable_or_null(800) ptr @malloc(i64 noundef 800) #8 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp47 = icmp sgt i32 %0, 0 br i1 %cmp47, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.cond3.preheader: ; preds = %for.body br i1 %cmp47, label %for.body5, label %for.cond.cleanup for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %call2 = call noalias dereferenceable_or_null(100) ptr @malloc(i64 noundef 100) #8 %arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv store ptr %call2, ptr %arrayidx, align 8, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond3.preheader, label %for.body, !llvm.loop !11 for.cond12.preheader: ; preds = %for.body5 %1 = icmp sgt i32 %3, 0 br i1 %1, label %for.body14, label %for.cond.cleanup for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv54 = phi i64 [ %indvars.iv.next55, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv54 %2 = load ptr, ptr %arrayidx7, align 8, !tbaa !9 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %2) %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp4 = icmp slt i64 %indvars.iv.next55, %4 br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13 for.cond.cleanup: ; preds = %if.end28, %entry, %for.cond3.preheader, %for.cond12.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 for.body14: ; preds = %for.cond12.preheader, %if.end28 %indvars.iv57 = phi i64 [ %indvars.iv.next58, %if.end28 ], [ 0, %for.cond12.preheader ] %call15 = call noalias dereferenceable_or_null(100) ptr @malloc(i64 noundef 100) #8 %arrayidx17 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv57 %5 = load ptr, ptr %arrayidx17, align 8, !tbaa !9 %call18 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call15, ptr noundef nonnull dereferenceable(1) %5) #7 br label %while.cond while.cond: ; preds = %while.body, %for.body14 %indvars.iv59 = phi i64 [ %7, %while.body ], [ %indvars.iv57, %for.body14 ] %6 = icmp slt i64 %indvars.iv59, 1 br i1 %6, label %if.end28, label %while.body while.body: ; preds = %while.cond %7 = add nsw i64 %indvars.iv59, -1 %arrayidx21 = getelementptr inbounds ptr, ptr %call1, i64 %7 %8 = load ptr, ptr %arrayidx21, align 8, !tbaa !9 %call22 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %call15, ptr noundef nonnull dereferenceable(1) %8) #9 %tobool.not = icmp eq i32 %call22, 0 br i1 %tobool.not, label %if.end28, label %while.cond, !llvm.loop !14 if.end28: ; preds = %while.cond, %while.body %str.sink = phi ptr [ @str.4, %while.body ], [ @str, %while.cond ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp13 = icmp slt i64 %indvars.iv.next58, %10 br i1 %cmp13, label %for.body14, label %for.cond.cleanup, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress 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 #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = { nounwind } attributes #8 = { nounwind allocsize(0) } attributes #9 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include <stdio.h> #define N 100 int bubble(int *, int); int main(){ int i, n, A[N], count; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } count=bubble(A, n); for(i=0;i<n;i++){ printf("%d",A[i]); if(i<n-1) printf(" "); } printf("\n%d\n",count); return 0; } int bubble(int *A, int n){ int i, j, sub, count=0; for(i=0;i<n;i++){ for(j=n-1;j>=i+1;j--){ if(A[j]<A[j-1]){ sub=A[j]; A[j]=A[j-1]; A[j-1]=sub; count++; } } } return count; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282863/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282863/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %0, 0 br i1 %cmp21, label %for.body, label %for.end13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp45.i = icmp sgt i32 %1, 0 br i1 %cmp45.i, label %for.cond2.preheader.lr.ph.i, label %for.end13 for.cond2.preheader.lr.ph.i: ; preds = %for.end %3 = zext i32 %1 to i64 %invariant.gep.i = getelementptr i32, ptr %A, i64 -2 br label %for.cond2.preheader.i for.cond.loopexit.i: ; preds = %for.inc.i, %for.cond2.preheader.i %count.1.lcssa.i = phi i32 [ %count.047.i, %for.cond2.preheader.i ], [ %count.2.i, %for.inc.i ] %exitcond.not.i = icmp eq i64 %indvars.iv.next52.i, %3 br i1 %exitcond.not.i, label %bubble.exit, label %for.cond2.preheader.i, !llvm.loop !11 for.cond2.preheader.i: ; preds = %for.cond.loopexit.i, %for.cond2.preheader.lr.ph.i %indvars.iv51.i = phi i64 [ 0, %for.cond2.preheader.lr.ph.i ], [ %indvars.iv.next52.i, %for.cond.loopexit.i ] %count.047.i = phi i32 [ 0, %for.cond2.preheader.lr.ph.i ], [ %count.1.lcssa.i, %for.cond.loopexit.i ] %indvars.iv.next52.i = add nuw nsw i64 %indvars.iv51.i, 1 %cmp3.not.not40.i = icmp ult i64 %indvars.iv.next52.i, %3 br i1 %cmp3.not.not40.i, label %for.body4.i, label %for.cond.loopexit.i for.body4.i: ; preds = %for.cond2.preheader.i, %for.inc.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %3, %for.cond2.preheader.i ] %count.142.i = phi i32 [ %count.2.i, %for.inc.i ], [ %count.047.i, %for.cond2.preheader.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i %4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i %5 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp8.i = icmp slt i32 %4, %5 br i1 %cmp8.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body4.i store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5 store i32 %4, ptr %gep.i, align 4, !tbaa !5 %inc.i = add nsw i32 %count.142.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body4.i %count.2.i = phi i32 [ %inc.i, %if.then.i ], [ %count.142.i, %for.body4.i ] %cmp3.not.not.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv.next52.i br i1 %cmp3.not.not.i, label %for.body4.i, label %for.cond.loopexit.i, !llvm.loop !12 bubble.exit: ; preds = %for.cond.loopexit.i br i1 %cmp45.i, label %for.body5, label %for.end13 for.body5: ; preds = %bubble.exit, %for.inc11 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.inc11 ], [ 0, %bubble.exit ] %arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv27 %6 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %7 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %7, -1 %8 = sext i32 %sub to i64 %cmp9 = icmp slt i64 %indvars.iv27, %8 br i1 %cmp9, label %if.then, label %for.inc11 if.then: ; preds = %for.body5 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc11 for.inc11: ; preds = %for.body5, %if.then %9 = phi i32 [ %7, %for.body5 ], [ %.pre, %if.then ] %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next28, %10 br i1 %cmp4, label %for.body5, label %for.end13, !llvm.loop !13 for.end13: ; preds = %for.inc11, %entry, %for.end, %bubble.exit %count.0.lcssa.i34 = phi i32 [ %count.1.lcssa.i, %bubble.exit ], [ 0, %for.end ], [ 0, %entry ], [ %count.1.lcssa.i, %for.inc11 ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa.i34) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @bubble(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #3 { entry: %cmp45 = icmp sgt i32 %n, 0 br i1 %cmp45, label %for.cond2.preheader.lr.ph, label %for.end21 for.cond2.preheader.lr.ph: ; preds = %entry %0 = zext i32 %n to i64 %wide.trip.count = zext i32 %n to i64 %invariant.gep = getelementptr i32, ptr %A, i64 -2 br label %for.cond2.preheader for.cond.loopexit: ; preds = %for.inc, %for.cond2.preheader %count.1.lcssa = phi i32 [ %count.047, %for.cond2.preheader ], [ %count.2, %for.inc ] %exitcond.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count br i1 %exitcond.not, label %for.end21, label %for.cond2.preheader, !llvm.loop !11 for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.cond.loopexit %indvars.iv51 = phi i64 [ 0, %for.cond2.preheader.lr.ph ], [ %indvars.iv.next52, %for.cond.loopexit ] %count.047 = phi i32 [ 0, %for.cond2.preheader.lr.ph ], [ %count.1.lcssa, %for.cond.loopexit ] %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 %cmp3.not.not40 = icmp ult i64 %indvars.iv.next52, %0 br i1 %cmp3.not.not40, label %for.body4, label %for.cond.loopexit for.body4: ; preds = %for.cond2.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %0, %for.cond2.preheader ] %count.142 = phi i32 [ %count.2, %for.inc ], [ %count.047, %for.cond2.preheader ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %2 = load i32, ptr %gep, align 4, !tbaa !5 %cmp8 = icmp slt i32 %1, %2 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body4 store i32 %2, ptr %arrayidx, align 4, !tbaa !5 store i32 %1, ptr %gep, align 4, !tbaa !5 %inc = add nsw i32 %count.142, 1 br label %for.inc for.inc: ; preds = %for.body4, %if.then %count.2 = phi i32 [ %inc, %if.then ], [ %count.142, %for.body4 ] %cmp3.not.not = icmp sgt i64 %indvars.iv.next, %indvars.iv.next52 br i1 %cmp3.not.not, label %for.body4, label %for.cond.loopexit, !llvm.loop !12 for.end21: ; preds = %for.cond.loopexit, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa, %for.cond.loopexit ] ret i32 %count.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #define MAX 100 int main(){ int num[MAX],a,i,j,k,m,n=0; scanf("%d",&a); for(i=0;i<a;i++){ scanf("%d",&num[i]); } for(j=1;j<a;j++){ i=j; for(k=j-1;k>=0;k--){ if(num[k]>num[i]){ m=num[k]; num[k]=num[i]; num[i]=m; i--; n++; } } } for(i=0;i<a;i++){ printf("%d",num[i]); if(i !=a-1){ printf(" "); } } printf("\n%d\n",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282906/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282906/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [100 x i32], align 16 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %num) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp62 = icmp sgt i32 %0, 0 br i1 %cmp62, label %for.body, label %for.end41 for.cond2.preheader: ; preds = %for.body %cmp368 = icmp sgt i32 %1, 1 br i1 %cmp368, label %for.cond5.preheader.preheader, label %for.cond28.preheader for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %num, 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 %a, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.inc25 %indvars.iv76 = phi i64 [ 1, %for.cond5.preheader.preheader ], [ %indvars.iv.next77, %for.inc25 ] %n.070 = phi i32 [ 0, %for.cond5.preheader.preheader ], [ %n.2, %for.inc25 ] %indvars82 = trunc i64 %indvars.iv76 to i32 br label %for.body7 for.cond28.preheader: ; preds = %for.inc25, %for.cond2.preheader %n.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %n.2, %for.inc25 ] %cmp2972 = icmp sgt i32 %1, 0 br i1 %cmp2972, label %for.body30, label %for.end41 for.body7: ; preds = %for.cond5.preheader, %for.inc22 %indvars.iv78 = phi i64 [ %indvars.iv76, %for.cond5.preheader ], [ %indvars.iv.next79, %for.inc22 ] %n.166 = phi i32 [ %n.070, %for.cond5.preheader ], [ %n.2, %for.inc22 ] %i.165 = phi i32 [ %indvars82, %for.cond5.preheader ], [ %i.2, %for.inc22 ] %indvars.iv.next79 = add nsw i64 %indvars.iv78, -1 %idxprom8 = and i64 %indvars.iv.next79, 4294967295 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %idxprom8 %3 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %idxprom10 = sext i32 %i.165 to i64 %arrayidx11 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %idxprom10 %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %3, %4 br i1 %cmp12, label %if.then, label %for.inc22 if.then: ; preds = %for.body7 store i32 %4, ptr %arrayidx9, align 4, !tbaa !5 store i32 %3, ptr %arrayidx11, align 4, !tbaa !5 %dec = add nsw i32 %i.165, -1 %inc21 = add nsw i32 %n.166, 1 br label %for.inc22 for.inc22: ; preds = %for.body7, %if.then %i.2 = phi i32 [ %dec, %if.then ], [ %i.165, %for.body7 ] %n.2 = phi i32 [ %inc21, %if.then ], [ %n.166, %for.body7 ] %5 = icmp sgt i64 %indvars.iv78, 1 br i1 %5, label %for.body7, label %for.inc25, !llvm.loop !11 for.inc25: ; preds = %for.inc22 %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %exitcond.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count br i1 %exitcond.not, label %for.cond28.preheader, label %for.cond5.preheader, !llvm.loop !12 for.body30: ; preds = %for.cond28.preheader, %for.inc39 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.inc39 ], [ 0, %for.cond28.preheader ] %arrayidx32 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %indvars.iv83 %6 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %7 = load i32, ptr %a, align 4, !tbaa !5 %sub34 = add nsw i32 %7, -1 %8 = zext i32 %sub34 to i64 %cmp35.not = icmp eq i64 %indvars.iv83, %8 br i1 %cmp35.not, label %for.inc39, label %if.then36 if.then36: ; preds = %for.body30 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %a, align 4, !tbaa !5 br label %for.inc39 for.inc39: ; preds = %for.body30, %if.then36 %9 = phi i32 [ %7, %for.body30 ], [ %.pre, %if.then36 ] %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %10 = sext i32 %9 to i64 %cmp29 = icmp slt i64 %indvars.iv.next84, %10 br i1 %cmp29, label %for.body30, label %for.end41, !llvm.loop !13 for.end41: ; preds = %for.inc39, %entry, %for.cond28.preheader %n.0.lcssa90 = phi i32 [ %n.0.lcssa, %for.cond28.preheader ], [ 0, %entry ], [ %n.0.lcssa, %for.inc39 ] %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %n.0.lcssa90) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 400, 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 @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 re[10010][2]; int a[200010],ch[200010]; int main() { int T,t,n,k; int i,cnt; scanf("%d",&T); for(t=0;t<T;t++) { scanf("%d %d",&n,&k); for(i=0;i<n;i++) { scanf("%d",&a[i]); ch[i]=0; } for(i=1;i<n-1;i++) if(a[i-1]<a[i]&&a[i]>a[i+1]) ch[i]=1; cnt=0; for(i=1;i<k-1;i++) if(ch[i]==1) cnt++; re[t][0]=cnt; re[t][1]=1; for(i=k-1;i<n-1;i++) { cnt=cnt+ch[i]-ch[i-k+2]; if(re[t][0]<cnt) { re[t][0]=cnt; re[t][1]=i-k+3; } } } for(t=0;t<T;t++) printf("%d %d\n",re[t][0]+1,re[t][1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_28295/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_28295/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @a = dso_local global [200010 x i32] zeroinitializer, align 16 @ch = dso_local local_unnamed_addr global [200010 x i32] zeroinitializer, align 16 @re = dso_local local_unnamed_addr global [10010 x [2 x i32]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca i32, align 4 %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %cmp142 = icmp sgt i32 %0, 0 br i1 %cmp142, label %for.body, label %for.end92 for.cond79.preheader: ; preds = %for.inc76 %1 = icmp sgt i32 %38, 0 br i1 %1, label %for.body81, label %for.end92 for.body: ; preds = %entry, %for.inc76 %indvars.iv165 = phi i64 [ %indvars.iv.next166, %for.inc76 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k) %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp3126 = icmp sgt i32 %2, 0 br i1 %cmp3126, label %for.body4, label %for.cond8.preheader.thread for.cond8.preheader.thread: ; preds = %for.body %sub174 = add i32 %2, -1 br label %for.cond27.preheader for.cond8.preheader: ; preds = %for.body4 %sub = add i32 %5, -1 %cmp9128 = icmp sgt i32 %5, 2 br i1 %cmp9128, label %for.body10.preheader, label %for.cond27.preheader for.body10.preheader: ; preds = %for.cond8.preheader %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr @a, align 16, !tbaa !5 %3 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %3, 1 %4 = icmp eq i32 %sub, 2 br i1 %4, label %for.cond27.preheader.loopexit.unr-lcssa, label %for.body10.preheader.new for.body10.preheader.new: ; preds = %for.body10.preheader %unroll_iter = and i64 %3, -2 br label %for.body10 for.body4: ; preds = %for.body, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %arrayidx7 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %indvars.iv store i32 0, ptr %arrayidx7, 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 %cmp3 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp3, label %for.body4, label %for.cond8.preheader, !llvm.loop !9 for.cond27.preheader.loopexit.unr-lcssa: ; preds = %for.inc24.1, %for.body10.preheader %.unr = phi i32 [ %.pre, %for.body10.preheader ], [ %26, %for.inc24.1 ] %indvars.iv148.unr = phi i64 [ 1, %for.body10.preheader ], [ %27, %for.inc24.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond27.preheader, label %for.body10.epil for.body10.epil: ; preds = %for.cond27.preheader.loopexit.unr-lcssa %arrayidx15.epil = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv148.unr %7 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5 %cmp16.epil = icmp slt i32 %.unr, %7 br i1 %cmp16.epil, label %land.lhs.true.epil, label %for.cond27.preheader land.lhs.true.epil: ; preds = %for.body10.epil %8 = add nuw nsw i64 %indvars.iv148.unr, 1 %arrayidx20.epil = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %8 %9 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5 %cmp21.epil = icmp sgt i32 %7, %9 br i1 %cmp21.epil, label %if.then.epil, label %for.cond27.preheader if.then.epil: ; preds = %land.lhs.true.epil %arrayidx23.epil = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %indvars.iv148.unr store i32 1, ptr %arrayidx23.epil, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit.unr-lcssa, %if.then.epil, %land.lhs.true.epil, %for.body10.epil, %for.cond8.preheader.thread, %for.cond8.preheader %sub177 = phi i32 [ %sub174, %for.cond8.preheader.thread ], [ %sub, %for.cond8.preheader ], [ %sub, %for.body10.epil ], [ %sub, %land.lhs.true.epil ], [ %sub, %if.then.epil ], [ %sub, %for.cond27.preheader.loopexit.unr-lcssa ] %.lcssa176 = phi i32 [ %2, %for.cond8.preheader.thread ], [ %5, %for.cond8.preheader ], [ %5, %for.body10.epil ], [ %5, %land.lhs.true.epil ], [ %5, %if.then.epil ], [ %5, %for.cond27.preheader.loopexit.unr-lcssa ] %10 = load i32, ptr %k, align 4, !tbaa !5 %sub28 = add i32 %10, -1 %cmp29131 = icmp sgt i32 %10, 2 br i1 %cmp29131, label %for.body30.preheader, label %for.end39 for.body30.preheader: ; preds = %for.cond27.preheader %wide.trip.count156 = zext i32 %sub28 to i64 %11 = add nsw i64 %wide.trip.count156, -1 %min.iters.check = icmp ult i64 %11, 8 br i1 %min.iters.check, label %for.body30.preheader182, label %vector.ph vector.ph: ; preds = %for.body30.preheader %n.vec = and i64 %11, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ] %vec.phi180 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ] %offset.idx = or i64 %index, 1 %12 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %12, align 4, !tbaa !5 %13 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load181 = load <4 x i32>, ptr %13, align 4, !tbaa !5 %14 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %15 = icmp eq <4 x i32> %wide.load181, <i32 1, i32 1, i32 1, i32 1> %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> %vec.phi, %16 %19 = add <4 x i32> %vec.phi180, %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 !11 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 %11, %n.vec br i1 %cmp.n, label %for.end39, label %for.body30.preheader182 for.body30.preheader182: ; preds = %for.body30.preheader, %middle.block %indvars.iv153.ph = phi i64 [ 1, %for.body30.preheader ], [ %ind.end, %middle.block ] %cnt.0133.ph = phi i32 [ 0, %for.body30.preheader ], [ %21, %middle.block ] br label %for.body30 for.body10: ; preds = %for.inc24.1, %for.body10.preheader.new %22 = phi i32 [ %.pre, %for.body10.preheader.new ], [ %26, %for.inc24.1 ] %indvars.iv148 = phi i64 [ 1, %for.body10.preheader.new ], [ %27, %for.inc24.1 ] %niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.1, %for.inc24.1 ] %arrayidx15 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv148 %23 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp slt i32 %22, %23 %24 = add nuw nsw i64 %indvars.iv148, 1 br i1 %cmp16, label %land.lhs.true, label %for.inc24 land.lhs.true: ; preds = %for.body10 %arrayidx20 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %24 %25 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %23, %25 br i1 %cmp21, label %if.then, label %for.inc24 if.then: ; preds = %land.lhs.true %arrayidx23 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %indvars.iv148 store i32 1, ptr %arrayidx23, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.body10, %land.lhs.true, %if.then %arrayidx15.1 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %24 %26 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5 %cmp16.1 = icmp slt i32 %23, %26 %27 = add nuw nsw i64 %indvars.iv148, 2 br i1 %cmp16.1, label %land.lhs.true.1, label %for.inc24.1 land.lhs.true.1: ; preds = %for.inc24 %arrayidx20.1 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %27 %28 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %cmp21.1 = icmp sgt i32 %26, %28 br i1 %cmp21.1, label %if.then.1, label %for.inc24.1 if.then.1: ; preds = %land.lhs.true.1 %arrayidx23.1 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %24 store i32 1, ptr %arrayidx23.1, align 4, !tbaa !5 br label %for.inc24.1 for.inc24.1: ; preds = %if.then.1, %land.lhs.true.1, %for.inc24 %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.cond27.preheader.loopexit.unr-lcssa, label %for.body10, !llvm.loop !14 for.body30: ; preds = %for.body30.preheader182, %for.body30 %indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.body30 ], [ %indvars.iv153.ph, %for.body30.preheader182 ] %cnt.0133 = phi i32 [ %spec.select, %for.body30 ], [ %cnt.0133.ph, %for.body30.preheader182 ] %arrayidx32 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %indvars.iv153 %29 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %cmp33 = icmp eq i32 %29, 1 %inc35 = zext i1 %cmp33 to i32 %spec.select = add nuw nsw i32 %cnt.0133, %inc35 %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156 br i1 %exitcond157.not, label %for.end39, label %for.body30, !llvm.loop !15 for.end39: ; preds = %for.body30, %middle.block, %for.cond27.preheader %arrayidx41.promoted = phi i32 [ 0, %for.cond27.preheader ], [ %21, %middle.block ], [ %spec.select, %for.body30 ] %arrayidx41 = getelementptr inbounds [10010 x [2 x i32]], ptr @re, i64 0, i64 %indvars.iv165 store i32 %arrayidx41.promoted, ptr %arrayidx41, align 8, !tbaa !5 %arrayidx45 = getelementptr inbounds [10010 x [2 x i32]], ptr @re, i64 0, i64 %indvars.iv165, i64 1 store i32 1, ptr %arrayidx45, align 4, !tbaa !5 %cmp49137 = icmp slt i32 %10, %.lcssa176 br i1 %cmp49137, label %for.body50.lr.ph, label %for.inc76 for.body50.lr.ph: ; preds = %for.end39 %30 = sext i32 %sub28 to i64 %31 = sext i32 %10 to i64 %smax = call i32 @llvm.smax.i32(i32 %10, i32 %sub177) br label %for.body50 for.body50: ; preds = %for.body50.lr.ph, %for.inc73 %indvars.iv158 = phi i64 [ %30, %for.body50.lr.ph ], [ %indvars.iv.next159, %for.inc73 ] %sub58141 = phi i32 [ %arrayidx41.promoted, %for.body50.lr.ph ], [ %sub58140, %for.inc73 ] %cnt.2139 = phi i32 [ %arrayidx41.promoted, %for.body50.lr.ph ], [ %sub58, %for.inc73 ] %arrayidx52 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %indvars.iv158 %32 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %add53 = add nsw i32 %32, %cnt.2139 %33 = sub nsw i64 %indvars.iv158, %31 %34 = add nsw i64 %33, 2 %arrayidx57 = getelementptr inbounds [200010 x i32], ptr @ch, i64 0, i64 %34 %35 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %sub58 = sub i32 %add53, %35 %cmp62 = icmp slt i32 %sub58141, %sub58 br i1 %cmp62, label %if.then63, label %for.inc73 if.then63: ; preds = %for.body50 store i32 %sub58, ptr %arrayidx41, align 8, !tbaa !5 %36 = trunc i64 %33 to i32 %37 = add i32 %36, 3 store i32 %37, ptr %arrayidx45, align 4, !tbaa !5 br label %for.inc73 for.inc73: ; preds = %for.body50, %if.then63 %sub58140 = phi i32 [ %sub58141, %for.body50 ], [ %sub58, %if.then63 ] %indvars.iv.next159 = add nsw i64 %indvars.iv158, 1 %lftr.wideiv = trunc i64 %indvars.iv.next159 to i32 %exitcond164.not = icmp eq i32 %smax, %lftr.wideiv br i1 %exitcond164.not, label %for.inc76, label %for.body50, !llvm.loop !16 for.inc76: ; preds = %for.inc73, %for.end39 %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1 %38 = load i32, ptr %T, align 4, !tbaa !5 %39 = sext i32 %38 to i64 %cmp = icmp slt i64 %indvars.iv.next166, %39 br i1 %cmp, label %for.body, label %for.cond79.preheader, !llvm.loop !17 for.body81: ; preds = %for.cond79.preheader, %for.body81 %indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.body81 ], [ 0, %for.cond79.preheader ] %arrayidx83 = getelementptr inbounds [10010 x [2 x i32]], ptr @re, i64 0, i64 %indvars.iv168 %40 = load i32, ptr %arrayidx83, align 8, !tbaa !5 %add85 = add nsw i32 %40, 1 %arrayidx88 = getelementptr inbounds [10010 x [2 x i32]], ptr @re, i64 0, i64 %indvars.iv168, i64 1 %41 = load i32, ptr %arrayidx88, align 4, !tbaa !5 %call89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add85, i32 noundef %41) %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %42 = load i32, ptr %T, align 4, !tbaa !5 %43 = sext i32 %42 to i64 %cmp80 = icmp slt i64 %indvars.iv.next169, %43 br i1 %cmp80, label %for.body81, label %for.end92, !llvm.loop !18 for.end92: ; preds = %for.body81, %entry, %for.cond79.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include <stdio.h> #define N 100 int main(){ int a,b,flag,i,j,c,v; int A[N]; scanf("%d",&b); for(i=0;i<b;i++){ scanf("%d",&A[i]); v=A[i]; } c = 0; for (i = 0; i < b-1; i++){ for ( j = 0; j < b-1; j++){ if (A[j] > A[j+1]){ v = A[j]; A[j] = A[j+1]; A[j+1] = v; c++; } } } for(j=0;j<b;j++){ printf("%d",A[j]); if(j<b-1) printf(" "); } printf("\n"); printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_282993/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_282993/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp68 = icmp sgt i32 %0, 0 br i1 %cmp68, label %for.body, label %for.end46 for.cond4.preheader: ; preds = %for.body %sub = add i32 %8, -1 %cmp574 = icmp sgt i32 %8, 1 br i1 %cmp574, label %for.cond7.preheader.us.preheader, label %for.cond33.preheader for.cond7.preheader.us.preheader: ; preds = %for.cond4.preheader %wide.trip.count = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %sub, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.inc30_crit_edge.us %c.076.us = phi i32 [ %c.2.us.lcssa, %for.cond7.for.inc30_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ] %i.175.us = phi i32 [ %inc31.us, %for.cond7.for.inc30_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ] %.pre = load i32, ptr %A, align 16, !tbaa !5 br i1 %1, label %for.cond7.for.inc30_crit_edge.us.unr-lcssa, label %for.body10.us for.body10.us: ; preds = %for.cond7.preheader.us, %for.inc27.us.1 %2 = phi i32 [ %6, %for.inc27.us.1 ], [ %.pre, %for.cond7.preheader.us ] %indvars.iv82 = phi i64 [ %indvars.iv.next83.1, %for.inc27.us.1 ], [ 0, %for.cond7.preheader.us ] %c.172.us = phi i32 [ %c.2.us.1, %for.inc27.us.1 ], [ %c.076.us, %for.cond7.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc27.us.1 ], [ 0, %for.cond7.preheader.us ] %indvars.iv.next83 = or i64 %indvars.iv82, 1 %arrayidx14.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next83 %3 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.us = icmp sgt i32 %2, %3 br i1 %cmp15.us, label %if.then.us, label %for.inc27.us if.then.us: ; preds = %for.body10.us %arrayidx12.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv82 store i32 %3, ptr %arrayidx12.us, align 8, !tbaa !5 store i32 %2, ptr %arrayidx14.us, align 4, !tbaa !5 %inc26.us = add nsw i32 %c.172.us, 1 br label %for.inc27.us for.inc27.us: ; preds = %if.then.us, %for.body10.us %4 = phi i32 [ %2, %if.then.us ], [ %3, %for.body10.us ] %c.2.us = phi i32 [ %inc26.us, %if.then.us ], [ %c.172.us, %for.body10.us ] %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2 %arrayidx14.us.1 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next83.1 %5 = load i32, ptr %arrayidx14.us.1, align 8, !tbaa !5 %cmp15.us.1 = icmp sgt i32 %4, %5 br i1 %cmp15.us.1, label %if.then.us.1, label %for.inc27.us.1 if.then.us.1: ; preds = %for.inc27.us %arrayidx12.us.1 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next83 store i32 %5, ptr %arrayidx12.us.1, align 4, !tbaa !5 store i32 %4, ptr %arrayidx14.us.1, align 8, !tbaa !5 %inc26.us.1 = add nsw i32 %c.2.us, 1 br label %for.inc27.us.1 for.inc27.us.1: ; preds = %if.then.us.1, %for.inc27.us %6 = phi i32 [ %4, %if.then.us.1 ], [ %5, %for.inc27.us ] %c.2.us.1 = phi i32 [ %inc26.us.1, %if.then.us.1 ], [ %c.2.us, %for.inc27.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.cond7.for.inc30_crit_edge.us.unr-lcssa, label %for.body10.us, !llvm.loop !9 for.cond7.for.inc30_crit_edge.us.unr-lcssa: ; preds = %for.inc27.us.1, %for.cond7.preheader.us %c.2.us.lcssa.ph = phi i32 [ undef, %for.cond7.preheader.us ], [ %c.2.us.1, %for.inc27.us.1 ] %.unr = phi i32 [ %.pre, %for.cond7.preheader.us ], [ %6, %for.inc27.us.1 ] %indvars.iv82.unr = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next83.1, %for.inc27.us.1 ] %c.172.us.unr = phi i32 [ %c.076.us, %for.cond7.preheader.us ], [ %c.2.us.1, %for.inc27.us.1 ] br i1 %lcmp.mod.not, label %for.cond7.for.inc30_crit_edge.us, label %for.body10.us.epil for.body10.us.epil: ; preds = %for.cond7.for.inc30_crit_edge.us.unr-lcssa %indvars.iv.next83.epil = add nuw nsw i64 %indvars.iv82.unr, 1 %arrayidx14.us.epil = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next83.epil %7 = load i32, ptr %arrayidx14.us.epil, align 4, !tbaa !5 %cmp15.us.epil = icmp sgt i32 %.unr, %7 br i1 %cmp15.us.epil, label %if.then.us.epil, label %for.cond7.for.inc30_crit_edge.us if.then.us.epil: ; preds = %for.body10.us.epil %arrayidx12.us.epil = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv82.unr store i32 %7, ptr %arrayidx12.us.epil, align 4, !tbaa !5 store i32 %.unr, ptr %arrayidx14.us.epil, align 4, !tbaa !5 %inc26.us.epil = add nsw i32 %c.172.us.unr, 1 br label %for.cond7.for.inc30_crit_edge.us for.cond7.for.inc30_crit_edge.us: ; preds = %for.body10.us.epil, %if.then.us.epil, %for.cond7.for.inc30_crit_edge.us.unr-lcssa %c.2.us.lcssa = phi i32 [ %c.2.us.lcssa.ph, %for.cond7.for.inc30_crit_edge.us.unr-lcssa ], [ %inc26.us.epil, %if.then.us.epil ], [ %c.172.us.unr, %for.body10.us.epil ] %inc31.us = add nuw nsw i32 %i.175.us, 1 %exitcond85.not = icmp eq i32 %inc31.us, %sub br i1 %exitcond85.not, label %for.cond33.preheader, label %for.cond7.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %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 %8 = load i32, ptr %b, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !12 for.cond33.preheader: ; preds = %for.cond7.for.inc30_crit_edge.us, %for.cond4.preheader %c.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ %c.2.us.lcssa, %for.cond7.for.inc30_crit_edge.us ] %cmp3478 = icmp sgt i32 %8, 0 br i1 %cmp3478, label %for.body35, label %for.end46 for.body35: ; preds = %for.cond33.preheader, %for.inc44 %indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.inc44 ], [ 0, %for.cond33.preheader ] %arrayidx37 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv86 %10 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) %11 = load i32, ptr %b, align 4, !tbaa !5 %sub39 = add nsw i32 %11, -1 %12 = sext i32 %sub39 to i64 %cmp40 = icmp slt i64 %indvars.iv86, %12 br i1 %cmp40, label %if.then41, label %for.inc44 if.then41: ; preds = %for.body35 %putchar67 = call i32 @putchar(i32 32) %.pre89 = load i32, ptr %b, align 4, !tbaa !5 br label %for.inc44 for.inc44: ; preds = %for.body35, %if.then41 %13 = phi i32 [ %11, %for.body35 ], [ %.pre89, %if.then41 ] %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %14 = sext i32 %13 to i64 %cmp34 = icmp slt i64 %indvars.iv.next87, %14 br i1 %cmp34, label %for.body35, label %for.end46, !llvm.loop !13 for.end46: ; preds = %for.inc44, %entry, %for.cond33.preheader %c.0.lcssa94 = phi i32 [ %c.0.lcssa, %for.cond33.preheader ], [ 0, %entry ], [ %c.0.lcssa, %for.inc44 ] %putchar = call i32 @putchar(i32 10) %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %c.0.lcssa94) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, 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: 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> #define N 100 int bubble(int, int); int main(){ int array[N], i, j, temp, num, cnt = 0, k; scanf("%d",&num); for(i = 0 ; i < num; i++)scanf("%d",&array[i]); for(i = 0; i < num; i++) { for(j = 0; j < num - i - 1; j++) { if(bubble(array[j],array[j + 1]) == 1) { temp = array[j + 1]; array[j + 1] = array[j]; array[j] = temp; cnt++; } /*for(k = 0; k < num; k++) { printf("%d",array[k]); printf(" "); if(k == num - 1)printf("\n"); } */ } } for(i = 0; i < num; i++) { printf("%d",array[i]); if(i == num - 1){ printf("\n"); break; } printf(" "); } printf("%d\n",cnt); return 0; } int bubble(int a, int b) { if(a > b)return 1; else return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283035/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283035/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %array = alloca [100 x i32], align 16 %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %array) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %0, 0 br i1 %cmp66, label %for.body, label %for.end46 for.cond2.preheader: ; preds = %for.body %cmp372 = icmp sgt i32 %1, 0 br i1 %cmp372, label %for.cond5.preheader, label %for.end46 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %array, 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 %num, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc29 %i.174 = phi i32 [ %inc30, %for.inc29 ], [ 0, %for.cond2.preheader ] %cnt.073 = phi i32 [ %cnt.1.lcssa, %for.inc29 ], [ 0, %for.cond2.preheader ] %3 = xor i32 %i.174, -1 %4 = add i32 %1, %3 %5 = zext i32 %4 to i64 %6 = xor i32 %i.174, -1 %sub6 = add i32 %1, %6 %cmp768 = icmp sgt i32 %sub6, 0 br i1 %cmp768, label %for.body8.preheader, label %for.inc29 for.body8.preheader: ; preds = %for.cond5.preheader %.pre = load i32, ptr %array, align 16, !tbaa !5 %xtraiter = and i64 %5, 1 %7 = icmp eq i32 %4, 1 br i1 %7, label %for.inc29.loopexit.unr-lcssa, label %for.body8.preheader.new for.body8.preheader.new: ; preds = %for.body8.preheader %unroll_iter = and i64 %5, 4294967294 br label %for.body8 for.cond32.preheader: ; preds = %for.inc29 br i1 %cmp372, label %for.body34, label %for.end46 for.body8: ; preds = %for.inc26.1, %for.body8.preheader.new %8 = phi i32 [ %.pre, %for.body8.preheader.new ], [ %12, %for.inc26.1 ] %indvars.iv80 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next81.1, %for.inc26.1 ] %cnt.170 = phi i32 [ %cnt.073, %for.body8.preheader.new ], [ %cnt.2.1, %for.inc26.1 ] %niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.inc26.1 ] %indvars.iv.next81 = or i64 %indvars.iv80, 1 %arrayidx12 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv.next81 %9 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp.i.not = icmp sgt i32 %8, %9 br i1 %cmp.i.not, label %if.then, label %for.inc26 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv80 store i32 %8, ptr %arrayidx12, align 4, !tbaa !5 store i32 %9, ptr %arrayidx10, align 8, !tbaa !5 %inc25 = add nsw i32 %cnt.170, 1 br label %for.inc26 for.inc26: ; preds = %for.body8, %if.then %10 = phi i32 [ %8, %if.then ], [ %9, %for.body8 ] %cnt.2 = phi i32 [ %inc25, %if.then ], [ %cnt.170, %for.body8 ] %indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2 %arrayidx12.1 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv.next81.1 %11 = load i32, ptr %arrayidx12.1, align 8, !tbaa !5 %cmp.i.not.1 = icmp sgt i32 %10, %11 br i1 %cmp.i.not.1, label %if.then.1, label %for.inc26.1 if.then.1: ; preds = %for.inc26 %arrayidx10.1 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv.next81 store i32 %10, ptr %arrayidx12.1, align 8, !tbaa !5 store i32 %11, ptr %arrayidx10.1, align 4, !tbaa !5 %inc25.1 = add nsw i32 %cnt.2, 1 br label %for.inc26.1 for.inc26.1: ; preds = %if.then.1, %for.inc26 %12 = phi i32 [ %10, %if.then.1 ], [ %11, %for.inc26 ] %cnt.2.1 = phi i32 [ %inc25.1, %if.then.1 ], [ %cnt.2, %for.inc26 ] %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.inc29.loopexit.unr-lcssa, label %for.body8, !llvm.loop !11 for.inc29.loopexit.unr-lcssa: ; preds = %for.inc26.1, %for.body8.preheader %cnt.2.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %cnt.2.1, %for.inc26.1 ] %.unr = phi i32 [ %.pre, %for.body8.preheader ], [ %12, %for.inc26.1 ] %indvars.iv80.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next81.1, %for.inc26.1 ] %cnt.170.unr = phi i32 [ %cnt.073, %for.body8.preheader ], [ %cnt.2.1, %for.inc26.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc29, label %for.body8.epil for.body8.epil: ; preds = %for.inc29.loopexit.unr-lcssa %indvars.iv.next81.epil = add nuw nsw i64 %indvars.iv80.unr, 1 %arrayidx12.epil = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv.next81.epil %13 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5 %cmp.i.not.epil = icmp sgt i32 %.unr, %13 br i1 %cmp.i.not.epil, label %if.then.epil, label %for.inc29 if.then.epil: ; preds = %for.body8.epil %arrayidx10.epil = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv80.unr store i32 %.unr, ptr %arrayidx12.epil, align 4, !tbaa !5 store i32 %13, ptr %arrayidx10.epil, align 4, !tbaa !5 %inc25.epil = add nsw i32 %cnt.170.unr, 1 br label %for.inc29 for.inc29: ; preds = %for.inc29.loopexit.unr-lcssa, %if.then.epil, %for.body8.epil, %for.cond5.preheader %cnt.1.lcssa = phi i32 [ %cnt.073, %for.cond5.preheader ], [ %cnt.2.lcssa.ph, %for.inc29.loopexit.unr-lcssa ], [ %inc25.epil, %if.then.epil ], [ %cnt.170.unr, %for.body8.epil ] %inc30 = add nuw nsw i32 %i.174, 1 %exitcond85.not = icmp eq i32 %inc30, %1 br i1 %exitcond85.not, label %for.cond32.preheader, label %for.cond5.preheader, !llvm.loop !12 for.body34: ; preds = %for.cond32.preheader, %if.end42 %indvars.iv86 = phi i64 [ %indvars.iv.next87, %if.end42 ], [ 0, %for.cond32.preheader ] %arrayidx36 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv86 %14 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14) %15 = load i32, ptr %num, align 4, !tbaa !5 %sub38 = add nsw i32 %15, -1 %16 = zext i32 %sub38 to i64 %cmp39 = icmp eq i64 %indvars.iv86, %16 br i1 %cmp39, label %if.then40, label %if.end42 if.then40: ; preds = %for.body34 %putchar65 = call i32 @putchar(i32 10) br label %for.end46 if.end42: ; preds = %for.body34 %putchar = call i32 @putchar(i32 32) %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %17 = load i32, ptr %num, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp33 = icmp slt i64 %indvars.iv.next87, %18 br i1 %cmp33, label %for.body34, label %for.end46, !llvm.loop !13 for.end46: ; preds = %if.end42, %entry, %for.cond2.preheader, %for.cond32.preheader, %if.then40 %cnt.0.lcssa93 = phi i32 [ %cnt.1.lcssa, %for.cond32.preheader ], [ %cnt.1.lcssa, %if.then40 ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %cnt.1.lcssa, %if.end42 ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cnt.0.lcssa93) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %array) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @bubble(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %cmp = icmp sgt i32 %a, %b %. = zext i1 %cmp to i32 ret i32 %. } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int bubbleSort(int *, int); int main(){ int n, number[100], a, count; scanf("%d",&n); for(a = 0; a < n; a++){ scanf("%d",&number[a]); } count = bubbleSort(number, n); for(a = 0; a < n-1; a++){ printf("%d ",number[a]); } printf("%d\n",number[a]); printf("%d\n",count); return 0; } int bubbleSort(int *p, int n){ int flag=1, a=0, b, temp, count=0; while(flag == 1){ flag = 0; for(b = n-1; b > a; b--){ if(*(p+b) < *(p+(b-1))){ temp = *(p+b); *(p+b) = *(p+(b-1)); *(p+(b-1)) = temp; flag = 1; count++; } } a++; } return count; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283079/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283079/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %number = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %number) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %0, 0 br i1 %cmp22, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %number, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %3 = icmp sgt i32 %1, 1 br label %for.end for.end: ; preds = %entry.for.end_crit_edge, %for.end.loopexit %.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.end.loopexit ] %cmp425 = phi i1 [ false, %entry.for.end_crit_edge ], [ %3, %for.end.loopexit ] %4 = add nsw i64 %.pre-phi, -1 %invariant.gep.i = getelementptr i32, ptr %number, i64 -2 %smax = call i64 @llvm.smax.i64(i64 %4, i64 0) br label %for.cond.preheader.i for.cond.preheader.i: ; preds = %for.end.i, %for.end %indvars.iv47.i = phi i64 [ 0, %for.end ], [ %indvars.iv.next48.i, %for.end.i ] %count.040.i = phi i32 [ 0, %for.end ], [ %count.2.i, %for.end.i ] %exitcond.not = icmp eq i64 %indvars.iv47.i, %smax br i1 %exitcond.not, label %bubbleSort.exit, label %for.body.i for.body.i: ; preds = %for.cond.preheader.i, %for.inc.i %indvars.iv41.i = phi i64 [ %indvars.iv.next42.i, %for.inc.i ], [ %.pre-phi, %for.cond.preheader.i ] %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %4, %for.cond.preheader.i ] %count.136.i = phi i32 [ %count.2.i, %for.inc.i ], [ %count.040.i, %for.cond.preheader.i ] %flag.135.i = phi i32 [ %flag.2.i, %for.inc.i ], [ 0, %for.cond.preheader.i ] %indvars.iv.next42.i = add nsw i64 %indvars.iv41.i, -1 %add.ptr.i = getelementptr inbounds i32, ptr %number, i64 %indvars.iv.i %5 = load i32, ptr %add.ptr.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv41.i %6 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp5.i = icmp slt i32 %5, %6 br i1 %cmp5.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i store i32 %6, ptr %add.ptr.i, align 4, !tbaa !5 store i32 %5, ptr %gep.i, align 4, !tbaa !5 %inc.i = add nsw i32 %count.136.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %flag.2.i = phi i32 [ 1, %if.then.i ], [ %flag.135.i, %for.body.i ] %count.2.i = phi i32 [ %inc.i, %if.then.i ], [ %count.136.i, %for.body.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %cmp1.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv47.i br i1 %cmp1.i, label %for.body.i, label %for.end.i, !llvm.loop !11 for.end.i: ; preds = %for.inc.i %indvars.iv.next48.i = add nuw nsw i64 %indvars.iv47.i, 1 %cmp.i = icmp eq i32 %flag.2.i, 1 br i1 %cmp.i, label %for.cond.preheader.i, label %bubbleSort.exit, !llvm.loop !12 bubbleSort.exit: ; preds = %for.cond.preheader.i, %for.end.i %count.1.lcssa54.i = phi i32 [ %count.2.i, %for.end.i ], [ %count.040.i, %for.cond.preheader.i ] br i1 %cmp425, label %for.body5, label %for.end11 for.body5: ; preds = %bubbleSort.exit, %for.body5 %indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.body5 ], [ 0, %bubbleSort.exit ] %arrayidx7 = getelementptr inbounds [100 x i32], ptr %number, i64 0, i64 %indvars.iv30 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %9 = sext i32 %sub to i64 %cmp4 = icmp slt i64 %indvars.iv.next31, %9 br i1 %cmp4, label %for.body5, label %for.end11.loopexit, !llvm.loop !13 for.end11.loopexit: ; preds = %for.body5 %10 = and i64 %indvars.iv.next31, 4294967295 br label %for.end11 for.end11: ; preds = %for.end11.loopexit, %bubbleSort.exit %a.1.lcssa = phi i64 [ 0, %bubbleSort.exit ], [ %10, %for.end11.loopexit ] %arrayidx13 = getelementptr inbounds [100 x i32], ptr %number, i64 0, i64 %a.1.lcssa %11 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.1.lcssa54.i) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %number) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @bubbleSort(ptr nocapture noundef %p, i32 noundef %n) local_unnamed_addr #3 { entry: %b.032 = add nsw i32 %n, -1 %0 = sext i32 %n to i64 %1 = add nsw i64 %0, -1 %2 = sext i32 %b.032 to i64 %invariant.gep = getelementptr i32, ptr %p, i64 -2 br label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %indvars.iv47 = phi i64 [ 0, %entry ], [ %indvars.iv.next48, %for.end ] %count.040 = phi i32 [ 0, %entry ], [ %count.2, %for.end ] %cmp133 = icmp slt i64 %indvars.iv47, %2 br i1 %cmp133, label %for.body, label %while.end for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.inc ], [ %0, %for.cond.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %1, %for.cond.preheader ] %count.136 = phi i32 [ %count.2, %for.inc ], [ %count.040, %for.cond.preheader ] %flag.135 = phi i32 [ %flag.2, %for.inc ], [ 0, %for.cond.preheader ] %indvars.iv.next42 = add nsw i64 %indvars.iv41, -1 %add.ptr = getelementptr inbounds i32, ptr %p, i64 %indvars.iv %3 = load i32, ptr %add.ptr, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv41 %4 = load i32, ptr %gep, align 4, !tbaa !5 %cmp5 = icmp slt i32 %3, %4 br i1 %cmp5, label %if.then, label %for.inc if.then: ; preds = %for.body store i32 %4, ptr %add.ptr, align 4, !tbaa !5 store i32 %3, ptr %gep, align 4, !tbaa !5 %inc = add nsw i32 %count.136, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %flag.2 = phi i32 [ 1, %if.then ], [ %flag.135, %for.body ] %count.2 = phi i32 [ %inc, %if.then ], [ %count.136, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp1 = icmp sgt i64 %indvars.iv.next, %indvars.iv47 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1 %cmp = icmp eq i32 %flag.2, 1 br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !12 while.end: ; preds = %for.cond.preheader, %for.end %count.1.lcssa54 = phi i32 [ %count.2, %for.end ], [ %count.040, %for.cond.preheader ] ret i32 %count.1.lcssa54 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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) #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 norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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> int main(void) { int n; scanf("%d",&n); int a[n]; for(int i=0;i<n;i++) { scanf("%d",&a[i]); } int temp; int count=0; for(int i=0;i<n-1;i++) { for(int j=0;j<n-1;j++) { if(a[j]>a[j+1]) { temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; count++; } } } for(int i=0;i<n-1;i++) { printf("%d ",a[i]); } printf("%d",a[n-1]); printf("\n"); printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283121/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283121/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %3, 0 br i1 %cmp66, label %for.body, label %for.cond3.preheader.thread for.cond3.preheader.thread: ; preds = %entry %sub91 = add i32 %3, -1 br label %for.cond35.preheader.for.cond.cleanup38_crit_edge for.cond3.preheader: ; preds = %for.body %sub = add i32 %11, -1 %cmp472 = icmp sgt i32 %11, 1 br i1 %cmp472, label %for.cond7.preheader.us.preheader, label %for.cond35.preheader.for.cond.cleanup38_crit_edge for.cond7.preheader.us.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %sub to i64 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %sub, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %invariant.gep = getelementptr i32, ptr %vla, i64 1 br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.cond.cleanup10_crit_edge.us %i2.074.us = phi i32 [ %inc32.us, %for.cond7.for.cond.cleanup10_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ] %count.073.us = phi i32 [ %count.2.us.lcssa, %for.cond7.for.cond.cleanup10_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ] %.pre = load i32, ptr %vla, align 16, !tbaa !5 br i1 %4, label %for.cond7.for.cond.cleanup10_crit_edge.us.unr-lcssa, label %for.body11.us for.body11.us: ; preds = %for.cond7.preheader.us, %for.inc28.us.1 %5 = phi i32 [ %9, %for.inc28.us.1 ], [ %.pre, %for.cond7.preheader.us ] %indvars.iv83 = phi i64 [ %indvars.iv.next84.1, %for.inc28.us.1 ], [ 0, %for.cond7.preheader.us ] %count.169.us = phi i32 [ %count.2.us.1, %for.inc28.us.1 ], [ %count.073.us, %for.cond7.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc28.us.1 ], [ 0, %for.cond7.preheader.us ] %indvars.iv.next84 = or i64 %indvars.iv83, 1 %arrayidx15.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next84 %6 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5 %cmp16.us = icmp sgt i32 %5, %6 br i1 %cmp16.us, label %if.then.us, label %for.inc28.us if.then.us: ; preds = %for.body11.us %arrayidx13.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83 store i32 %6, ptr %arrayidx13.us, align 8, !tbaa !5 store i32 %5, ptr %arrayidx15.us, align 4, !tbaa !5 %inc27.us = add nsw i32 %count.169.us, 1 br label %for.inc28.us for.inc28.us: ; preds = %if.then.us, %for.body11.us %7 = phi i32 [ %5, %if.then.us ], [ %6, %for.body11.us ] %count.2.us = phi i32 [ %inc27.us, %if.then.us ], [ %count.169.us, %for.body11.us ] %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2 %arrayidx15.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next84.1 %8 = load i32, ptr %arrayidx15.us.1, align 8, !tbaa !5 %cmp16.us.1 = icmp sgt i32 %7, %8 br i1 %cmp16.us.1, label %if.then.us.1, label %for.inc28.us.1 if.then.us.1: ; preds = %for.inc28.us %arrayidx13.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next84 store i32 %8, ptr %arrayidx13.us.1, align 4, !tbaa !5 store i32 %7, ptr %arrayidx15.us.1, align 8, !tbaa !5 %inc27.us.1 = add nsw i32 %count.2.us, 1 br label %for.inc28.us.1 for.inc28.us.1: ; preds = %if.then.us.1, %for.inc28.us %9 = phi i32 [ %7, %if.then.us.1 ], [ %8, %for.inc28.us ] %count.2.us.1 = phi i32 [ %inc27.us.1, %if.then.us.1 ], [ %count.2.us, %for.inc28.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.cond7.for.cond.cleanup10_crit_edge.us.unr-lcssa, label %for.body11.us, !llvm.loop !9 for.cond7.for.cond.cleanup10_crit_edge.us.unr-lcssa: ; preds = %for.inc28.us.1, %for.cond7.preheader.us %count.2.us.lcssa.ph = phi i32 [ undef, %for.cond7.preheader.us ], [ %count.2.us.1, %for.inc28.us.1 ] %.unr = phi i32 [ %.pre, %for.cond7.preheader.us ], [ %9, %for.inc28.us.1 ] %indvars.iv83.unr = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next84.1, %for.inc28.us.1 ] %count.169.us.unr = phi i32 [ %count.073.us, %for.cond7.preheader.us ], [ %count.2.us.1, %for.inc28.us.1 ] br i1 %lcmp.mod.not, label %for.cond7.for.cond.cleanup10_crit_edge.us, label %for.body11.us.epil for.body11.us.epil: ; preds = %for.cond7.for.cond.cleanup10_crit_edge.us.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv83.unr %10 = load i32, ptr %gep, align 4, !tbaa !5 %cmp16.us.epil = icmp sgt i32 %.unr, %10 br i1 %cmp16.us.epil, label %if.then.us.epil, label %for.cond7.for.cond.cleanup10_crit_edge.us if.then.us.epil: ; preds = %for.body11.us.epil %arrayidx13.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83.unr store i32 %10, ptr %arrayidx13.us.epil, align 4, !tbaa !5 store i32 %.unr, ptr %gep, align 4, !tbaa !5 %inc27.us.epil = add nsw i32 %count.169.us.unr, 1 br label %for.cond7.for.cond.cleanup10_crit_edge.us for.cond7.for.cond.cleanup10_crit_edge.us: ; preds = %for.body11.us.epil, %if.then.us.epil, %for.cond7.for.cond.cleanup10_crit_edge.us.unr-lcssa %count.2.us.lcssa = phi i32 [ %count.2.us.lcssa.ph, %for.cond7.for.cond.cleanup10_crit_edge.us.unr-lcssa ], [ %inc27.us.epil, %if.then.us.epil ], [ %count.169.us.unr, %for.body11.us.epil ] %inc32.us = add nuw nsw i32 %i2.074.us, 1 %exitcond86.not = icmp eq i32 %inc32.us, %sub br i1 %exitcond86.not, label %for.cond35.preheader, label %for.cond7.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, 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 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !12 for.cond35.preheader: ; preds = %for.cond7.for.cond.cleanup10_crit_edge.us br i1 %cmp472, label %for.body39, label %for.cond35.preheader.for.cond.cleanup38_crit_edge for.cond35.preheader.for.cond.cleanup38_crit_edge: ; preds = %for.cond3.preheader.thread, %for.cond3.preheader, %for.cond35.preheader %count.0.lcssa100 = phi i32 [ %count.2.us.lcssa, %for.cond35.preheader ], [ 0, %for.cond3.preheader ], [ 0, %for.cond3.preheader.thread ] %sub9398 = phi i32 [ %sub, %for.cond35.preheader ], [ %sub, %for.cond3.preheader ], [ %sub91, %for.cond3.preheader.thread ] %.pre90 = sext i32 %sub9398 to i64 br label %for.cond.cleanup38 for.cond.cleanup38: ; preds = %for.body39, %for.cond35.preheader.for.cond.cleanup38_crit_edge %count.0.lcssa99 = phi i32 [ %count.0.lcssa100, %for.cond35.preheader.for.cond.cleanup38_crit_edge ], [ %count.2.us.lcssa, %for.body39 ] %idxprom47.pre-phi = phi i64 [ %.pre90, %for.cond35.preheader.for.cond.cleanup38_crit_edge ], [ %16, %for.body39 ] %arrayidx48 = getelementptr inbounds i32, ptr %vla, i64 %idxprom47.pre-phi %13 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13) %putchar = call i32 @putchar(i32 10) %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %count.0.lcssa99) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body39: ; preds = %for.cond35.preheader, %for.body39 %indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.body39 ], [ 0, %for.cond35.preheader ] %arrayidx41 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87 %14 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %sub36 = add nsw i32 %15, -1 %16 = sext i32 %sub36 to i64 %cmp37 = icmp slt i64 %indvars.iv.next88, %16 br i1 %cmp37, label %for.body39, label %for.cond.cleanup38, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: 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 nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main() { int n,c; int a[101] = {0}; int d,i,j; int flag; scanf("%d",&n); c = 0; for(i = 0;i<n;i++) { scanf("%d" ,&a[i]); } flag = 1; while(flag) { flag = 0; for(j=n-1;j>=1;j--) { if(a[j] < a[j-1]) { d = a[j]; a[j] = a[j-1]; a[j-1] = d; c++; flag = 1; } } } for(i=0;i<n;i++) { printf("%d",a[i]); if(i != n-1) printf(" "); } printf("\n%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283165/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283165/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%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 [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(404) %a, i8 0, i64 404, 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 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.end37 while.cond.preheader: ; preds = %for.body %cmp357 = icmp sgt i32 %4, 1 br i1 %cmp357, label %for.cond2.preheader.us.preheader, label %for.cond24.preheader for.cond2.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader %indvars.iv69 = phi i64 [ %1, %for.cond2.preheader.us.preheader ], [ %indvars.iv69.be, %for.body4.us.backedge ] %flag.160.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %flag.160.us.be, %for.body4.us.backedge ] %c.158.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %c.2.us, %for.body4.us.backedge ] %indvars.iv.next70 = add nsw i64 %indvars.iv69, -1 %idxprom5.us = and i64 %indvars.iv.next70, 4294967295 %arrayidx6.us = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %idxprom5.us %2 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %sub7.us = add i64 %indvars.iv69, 4294967294 %idxprom8.us = and i64 %sub7.us, 4294967295 %arrayidx9.us = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %idxprom8.us %3 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp slt i32 %2, %3 br i1 %cmp10.us, label %if.then.us, label %for.inc22.us if.then.us: ; preds = %for.body4.us store i32 %3, ptr %arrayidx6.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5 %inc21.us = add nsw i32 %c.158.us, 1 br label %for.inc22.us for.inc22.us: ; preds = %if.then.us, %for.body4.us %c.2.us = phi i32 [ %inc21.us, %if.then.us ], [ %c.158.us, %for.body4.us ] %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.160.us, %for.body4.us ] %cmp3.us = icmp sgt i64 %indvars.iv69, 2 br i1 %cmp3.us, label %for.body4.us.backedge, label %for.cond2.while.cond.loopexit_crit_edge.us for.body4.us.backedge: ; preds = %for.inc22.us, %for.cond2.while.cond.loopexit_crit_edge.us %indvars.iv69.be = phi i64 [ %indvars.iv.next70, %for.inc22.us ], [ %1, %for.cond2.while.cond.loopexit_crit_edge.us ] %flag.160.us.be = phi i32 [ %flag.2.us, %for.inc22.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ] br label %for.body4.us, !llvm.loop !9 for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc22.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond24.preheader, label %for.body4.us.backedge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 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 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us, %while.cond.preheader %.us-phi = phi i32 [ 0, %while.cond.preheader ], [ %c.2.us, %for.cond2.while.cond.loopexit_crit_edge.us ] %cmp2565 = icmp sgt i32 %4, 0 br i1 %cmp2565, label %for.body26, label %for.end37 for.body26: ; preds = %for.cond24.preheader, %for.inc35 %indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.inc35 ], [ 0, %for.cond24.preheader ] %arrayidx28 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv72 %6 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %7 = load i32, ptr %n, align 4, !tbaa !5 %sub30 = add nsw i32 %7, -1 %8 = zext i32 %sub30 to i64 %cmp31.not = icmp eq i64 %indvars.iv72, %8 br i1 %cmp31.not, label %for.inc35, label %if.then32 if.then32: ; preds = %for.body26 %putchar = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc35 for.inc35: ; preds = %for.body26, %if.then32 %9 = phi i32 [ %7, %for.body26 ], [ %.pre, %if.then32 ] %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %10 = sext i32 %9 to i64 %cmp25 = icmp slt i64 %indvars.iv.next73, %10 br i1 %cmp25, label %for.body26, label %for.end37, !llvm.loop !12 for.end37: ; preds = %for.inc35, %entry, %for.cond24.preheader %.us-phi79 = phi i32 [ %.us-phi, %for.cond24.preheader ], [ 0, %entry ], [ %.us-phi, %for.inc35 ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi79) call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #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: 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 = !{!"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> void bubbleSort(int A[],int N){ int i,flg=1; int count=0; int tmp; while(flg){ flg=0; for(i=N-1;i>=1;i--){ if(A[i]<A[i-1]){ tmp=A[i-1]; A[i-1]=A[i]; A[i]=tmp; flg=1; count++; } } } for(i=0;i<N;i++){ printf("%d",A[i]); if(i!=N-1) printf(" "); } printf("\n%d\n",count); } int main(void){ int i,n; scanf("%d",&n); int a[n]; for(i=0;i<n;i++) scanf("%d",&a[i]); bubbleSort(a,n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283208/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283208/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @bubbleSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp51 = icmp sgt i32 %N, 1 br i1 %cmp51, label %for.cond.preheader.us.preheader, label %for.cond15.preheader for.cond.preheader.us.preheader: ; preds = %entry %0 = zext i32 %N to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.backedge, %for.cond.preheader.us.preheader %indvars.iv = phi i64 [ %0, %for.cond.preheader.us.preheader ], [ %indvars.iv.be, %for.body.us.backedge ] %count.153.us = phi i32 [ 0, %for.cond.preheader.us.preheader ], [ %count.2.us, %for.body.us.backedge ] %flg.152.us = phi i32 [ 0, %for.cond.preheader.us.preheader ], [ %flg.152.us.be, %for.body.us.backedge ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %idxprom.us = and i64 %indvars.iv.next, 4294967295 %arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %idxprom.us %1 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %sub1.us = add i64 %indvars.iv, 4294967294 %idxprom2.us = and i64 %sub1.us, 4294967295 %arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us %2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %1, %2 br i1 %cmp4.us, label %if.then.us, label %for.inc.us if.then.us: ; preds = %for.body.us store i32 %1, ptr %arrayidx3.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx.us, align 4, !tbaa !5 %inc.us = add nsw i32 %count.153.us, 1 br label %for.inc.us for.inc.us: ; preds = %if.then.us, %for.body.us %flg.2.us = phi i32 [ 1, %if.then.us ], [ %flg.152.us, %for.body.us ] %count.2.us = phi i32 [ %inc.us, %if.then.us ], [ %count.153.us, %for.body.us ] %cmp.us = icmp sgt i64 %indvars.iv, 2 br i1 %cmp.us, label %for.body.us.backedge, label %for.cond.while.cond.loopexit_crit_edge.us for.body.us.backedge: ; preds = %for.inc.us, %for.cond.while.cond.loopexit_crit_edge.us %indvars.iv.be = phi i64 [ %indvars.iv.next, %for.inc.us ], [ %0, %for.cond.while.cond.loopexit_crit_edge.us ] %flg.152.us.be = phi i32 [ %flg.2.us, %for.inc.us ], [ 0, %for.cond.while.cond.loopexit_crit_edge.us ] br label %for.body.us, !llvm.loop !9 for.cond.while.cond.loopexit_crit_edge.us: ; preds = %for.inc.us %tobool.not.us = icmp eq i32 %flg.2.us, 0 br i1 %tobool.not.us, label %for.cond15.preheader, label %for.body.us.backedge for.cond15.preheader: ; preds = %for.cond.while.cond.loopexit_crit_edge.us, %entry %.us-phi = phi i32 [ 0, %entry ], [ %count.2.us, %for.cond.while.cond.loopexit_crit_edge.us ] %cmp1658 = icmp sgt i32 %N, 0 br i1 %cmp1658, label %for.body17.lr.ph, label %for.end27 for.body17.lr.ph: ; preds = %for.cond15.preheader %sub20 = add nsw i32 %N, -1 %3 = zext i32 %sub20 to i64 %wide.trip.count = zext i32 %N to i64 br label %for.body17 for.body17: ; preds = %for.body17.lr.ph, %for.inc25 %indvars.iv61 = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next62, %for.inc25 ] %arrayidx19 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv61 %4 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4) %cmp21.not = icmp eq i64 %indvars.iv61, %3 br i1 %cmp21.not, label %for.inc25, label %if.then22 if.then22: ; preds = %for.body17 %putchar = tail call i32 @putchar(i32 32) br label %for.inc25 for.inc25: ; preds = %for.body17, %if.then22 %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count br i1 %exitcond.not, label %for.end27, label %for.body17, !llvm.loop !11 for.end27: ; preds = %for.inc25, %for.cond15.preheader %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi) ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %3, 0 br i1 %cmp4, label %for.body, label %bubbleSort.exit 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 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body %cmp51.i = icmp sgt i32 %4, 1 br i1 %cmp51.i, label %for.cond.preheader.us.preheader.i, label %for.cond15.preheader.i for.cond.preheader.us.preheader.i: ; preds = %for.end %6 = zext i32 %4 to i64 br label %for.body.us.i for.body.us.i: ; preds = %for.body.us.i.backedge, %for.cond.preheader.us.preheader.i %indvars.iv.i = phi i64 [ %6, %for.cond.preheader.us.preheader.i ], [ %indvars.iv.i.be, %for.body.us.i.backedge ] %count.153.us.i = phi i32 [ 0, %for.cond.preheader.us.preheader.i ], [ %count.2.us.i, %for.body.us.i.backedge ] %flg.152.us.i = phi i32 [ 0, %for.cond.preheader.us.preheader.i ], [ %flg.152.us.i.be, %for.body.us.i.backedge ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %idxprom.us.i = and i64 %indvars.iv.next.i, 4294967295 %arrayidx.us.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom.us.i %7 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5 %sub1.us.i = add nuw nsw i64 %indvars.iv.i, 4294967294 %idxprom2.us.i = and i64 %sub1.us.i, 4294967295 %arrayidx3.us.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom2.us.i %8 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5 %cmp4.us.i = icmp slt i32 %7, %8 br i1 %cmp4.us.i, label %if.then.us.i, label %for.inc.us.i if.then.us.i: ; preds = %for.body.us.i store i32 %7, ptr %arrayidx3.us.i, align 4, !tbaa !5 store i32 %8, ptr %arrayidx.us.i, align 4, !tbaa !5 %inc.us.i = add nsw i32 %count.153.us.i, 1 br label %for.inc.us.i for.inc.us.i: ; preds = %if.then.us.i, %for.body.us.i %flg.2.us.i = phi i32 [ 1, %if.then.us.i ], [ %flg.152.us.i, %for.body.us.i ] %count.2.us.i = phi i32 [ %inc.us.i, %if.then.us.i ], [ %count.153.us.i, %for.body.us.i ] %cmp.us.i = icmp sgt i64 %indvars.iv.i, 2 br i1 %cmp.us.i, label %for.body.us.i.backedge, label %for.cond.while.cond.loopexit_crit_edge.us.i for.body.us.i.backedge: ; preds = %for.inc.us.i, %for.cond.while.cond.loopexit_crit_edge.us.i %indvars.iv.i.be = phi i64 [ %indvars.iv.next.i, %for.inc.us.i ], [ %6, %for.cond.while.cond.loopexit_crit_edge.us.i ] %flg.152.us.i.be = phi i32 [ %flg.2.us.i, %for.inc.us.i ], [ 0, %for.cond.while.cond.loopexit_crit_edge.us.i ] br label %for.body.us.i, !llvm.loop !9 for.cond.while.cond.loopexit_crit_edge.us.i: ; preds = %for.inc.us.i %tobool.not.us.i = icmp eq i32 %flg.2.us.i, 0 br i1 %tobool.not.us.i, label %for.cond15.preheader.i, label %for.body.us.i.backedge for.cond15.preheader.i: ; preds = %for.cond.while.cond.loopexit_crit_edge.us.i, %for.end %.us-phi.i = phi i32 [ 0, %for.end ], [ %count.2.us.i, %for.cond.while.cond.loopexit_crit_edge.us.i ] %cmp1658.i = icmp sgt i32 %4, 0 br i1 %cmp1658.i, label %for.body17.lr.ph.i, label %bubbleSort.exit for.body17.lr.ph.i: ; preds = %for.cond15.preheader.i %sub20.i = add nsw i32 %4, -1 %9 = zext i32 %sub20.i to i64 %wide.trip.count.i = zext i32 %4 to i64 br label %for.body17.i for.body17.i: ; preds = %for.inc25.i, %for.body17.lr.ph.i %indvars.iv61.i = phi i64 [ 0, %for.body17.lr.ph.i ], [ %indvars.iv.next62.i, %for.inc25.i ] %arrayidx19.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv61.i %10 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10) %cmp21.not.i = icmp eq i64 %indvars.iv61.i, %9 br i1 %cmp21.not.i, label %for.inc25.i, label %if.then22.i if.then22.i: ; preds = %for.body17.i %putchar.i = call i32 @putchar(i32 32) br label %for.inc25.i for.inc25.i: ; preds = %if.then22.i, %for.body17.i %indvars.iv.next62.i = add nuw nsw i64 %indvars.iv61.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next62.i, %wide.trip.count.i br i1 %exitcond.not.i, label %bubbleSort.exit, label %for.body17.i, !llvm.loop !11 bubbleSort.exit: ; preds = %for.inc25.i, %entry, %for.cond15.preheader.i %.us-phi.i14 = phi i32 [ %.us-phi.i, %for.cond15.preheader.i ], [ 0, %entry ], [ %.us-phi.i, %for.inc25.i ] %call28.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi.i14) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: 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 nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(){ int i,j; int A[100],N,num=0,v; scanf("%d",&N); for(i=0;i<N;i++) scanf("%d",&A[i]); for(i=0;i<N-1;i++){ for(j=N-1;j>i;j--){ if(A[j] < A[j-1]){ v = A[j]; A[j] = A[j-1]; A[j-1] = v; num++; } } } printf("%d",A[0]); for(i=1;i<N;i++) printf(" %d",A[i]); printf("\n"); printf("%d\n",num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283251/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283251/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca [100 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 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 %cmp61 = icmp sgt i32 %0, 0 br i1 %cmp61, label %for.body, label %for.end30 for.cond2.preheader: ; preds = %for.body %cmp365 = icmp sgt i32 %3, 1 br i1 %cmp365, label %for.cond6.preheader.preheader, label %for.end30 for.cond6.preheader.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %3, -1 %1 = zext i32 %3 to i64 %2 = add nsw i64 %1, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx10.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %2 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc28 %indvars.iv76 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next77, %for.inc28 ] %num.066 = phi i32 [ 0, %for.cond6.preheader.preheader ], [ %num.2, %for.inc28 ] %.pre = load i32, ptr %arrayidx10.phi.trans.insert, align 4, !tbaa !5 br label %for.body8 for.body8: ; preds = %for.cond6.preheader, %for.inc26 %5 = phi i32 [ %.pre, %for.cond6.preheader ], [ %7, %for.inc26 ] %indvars.iv73 = phi i64 [ %2, %for.cond6.preheader ], [ %indvars.iv.next74, %for.inc26 ] %num.164 = phi i32 [ %num.066, %for.cond6.preheader ], [ %num.2, %for.inc26 ] %indvars.iv.next74 = add nsw i64 %indvars.iv73, -1 %arrayidx13 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv.next74 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp slt i32 %5, %6 br i1 %cmp14, label %if.then, label %for.inc26 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv73 store i32 %6, ptr %arrayidx10, align 4, !tbaa !5 store i32 %5, ptr %arrayidx13, align 4, !tbaa !5 %inc25 = add nsw i32 %num.164, 1 br label %for.inc26 for.inc26: ; preds = %for.body8, %if.then %7 = phi i32 [ %5, %if.then ], [ %6, %for.body8 ] %num.2 = phi i32 [ %inc25, %if.then ], [ %num.164, %for.body8 ] %cmp7 = icmp sgt i64 %indvars.iv.next74, %indvars.iv76 br i1 %cmp7, label %for.body8, label %for.inc28, !llvm.loop !11 for.inc28: ; preds = %for.inc26 %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %exitcond.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count br i1 %exitcond.not, label %for.end30, label %for.cond6.preheader, !llvm.loop !12 for.end30: ; preds = %for.inc28, %entry, %for.cond2.preheader %num.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %num.2, %for.inc28 ] %8 = load i32, ptr %A, align 16, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %9 = load i32, ptr %N, align 4, !tbaa !5 %cmp3469 = icmp sgt i32 %9, 1 br i1 %cmp3469, label %for.body35, label %for.end41 for.body35: ; preds = %for.end30, %for.body35 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body35 ], [ 1, %for.end30 ] %arrayidx37 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv79 %10 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %11 = load i32, ptr %N, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp34 = icmp slt i64 %indvars.iv.next80, %12 br i1 %cmp34, label %for.body35, label %for.end41, !llvm.loop !13 for.end41: ; preds = %for.body35, %for.end30 %putchar = call i32 @putchar(i32 10) %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %num.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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> #define N 100 int main(){ int a[N],n,i,j,temp,count=0; scanf("%d",&n); for(i=0; i<n; i++) scanf("%d",&a[i]); for(i=0; i<n-1; i++){ for(j=n-1; j>i; j--){ if(a[j]<a[j-1]){ temp=a[j]; a[j]=a[j-1]; a[j-1]=temp; count++; } } } for(i=0; i<n-1; i++){ printf("%d ",a[i]); } printf("%d\n",a[i]); printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283295/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283295/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca [100 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp63 = icmp sgt i32 %0, 0 br i1 %cmp63, label %for.body, label %for.end40 for.cond2.preheader: ; preds = %for.body %cmp367 = icmp sgt i32 %3, 1 br i1 %cmp367, label %for.cond6.preheader.preheader, label %for.end40 for.cond6.preheader.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %3, -1 %1 = zext i32 %3 to i64 %2 = add nsw i64 %1, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx10.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %2 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc28 %indvars.iv80 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next81, %for.inc28 ] %count.069 = phi i32 [ 0, %for.cond6.preheader.preheader ], [ %count.2, %for.inc28 ] %.pre = load i32, ptr %arrayidx10.phi.trans.insert, align 4, !tbaa !5 br label %for.body8 for.cond31.preheader: ; preds = %for.inc28 br i1 %cmp367, label %for.body34, label %for.end40 for.body8: ; preds = %for.cond6.preheader, %for.inc26 %5 = phi i32 [ %.pre, %for.cond6.preheader ], [ %7, %for.inc26 ] %indvars.iv77 = phi i64 [ %2, %for.cond6.preheader ], [ %indvars.iv.next78, %for.inc26 ] %count.166 = phi i32 [ %count.069, %for.cond6.preheader ], [ %count.2, %for.inc26 ] %indvars.iv.next78 = add nsw i64 %indvars.iv77, -1 %arrayidx13 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next78 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp slt i32 %5, %6 br i1 %cmp14, label %if.then, label %for.inc26 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv77 store i32 %6, ptr %arrayidx10, align 4, !tbaa !5 store i32 %5, ptr %arrayidx13, align 4, !tbaa !5 %inc25 = add nsw i32 %count.166, 1 br label %for.inc26 for.inc26: ; preds = %for.body8, %if.then %7 = phi i32 [ %5, %if.then ], [ %6, %for.body8 ] %count.2 = phi i32 [ %inc25, %if.then ], [ %count.166, %for.body8 ] %cmp7 = icmp sgt i64 %indvars.iv.next78, %indvars.iv80 br i1 %cmp7, label %for.body8, label %for.inc28, !llvm.loop !11 for.inc28: ; preds = %for.inc26 %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %exitcond.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count br i1 %exitcond.not, label %for.cond31.preheader, label %for.cond6.preheader, !llvm.loop !12 for.body34: ; preds = %for.cond31.preheader, %for.body34 %indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body34 ], [ 0, %for.cond31.preheader ] %arrayidx36 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv83 %8 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8) %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %sub32 = add nsw i32 %9, -1 %10 = sext i32 %sub32 to i64 %cmp33 = icmp slt i64 %indvars.iv.next84, %10 br i1 %cmp33, label %for.body34, label %for.end40.loopexit, !llvm.loop !13 for.end40.loopexit: ; preds = %for.body34 %11 = and i64 %indvars.iv.next84, 4294967295 br label %for.end40 for.end40: ; preds = %entry, %for.cond2.preheader, %for.end40.loopexit, %for.cond31.preheader %count.0.lcssa90 = phi i32 [ %count.2, %for.cond31.preheader ], [ %count.2, %for.end40.loopexit ], [ 0, %for.cond2.preheader ], [ 0, %entry ] %i.2.lcssa = phi i64 [ 0, %for.cond31.preheader ], [ %11, %for.end40.loopexit ], [ 0, %for.cond2.preheader ], [ 0, %entry ] %arrayidx42 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %i.2.lcssa %12 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12) %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa90) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int bubbleSort(int a[],int n){ int i,j,tmp,cnt=0; for(i=0;i<n-1;i++){ for(j=n-1;j>i;j--){ if(a[j-1] > a[j]){ tmp = a[j]; a[j] = a[j-1]; a[j-1] = tmp; cnt++; } } } return cnt; } int main(){ int cnt; int a[110]; int i,n; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } cnt = bubbleSort(a,n); for(i=0;i<n;i++) { printf("%d",a[i]); if(i<n-1) printf(" "); } printf("\n"); printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283338/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283338/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = 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 i32 @bubbleSort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp41 = icmp sgt i32 %n, 1 br i1 %cmp41, label %for.cond2.preheader.preheader, label %for.end21 for.cond2.preheader.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 %0 = zext i32 %n to i64 %1 = add nsw i64 %0, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx7.phi.trans.insert = getelementptr inbounds i32, ptr %a, i64 %1 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.inc19 %indvars.iv45 = phi i64 [ 0, %for.cond2.preheader.preheader ], [ %indvars.iv.next46, %for.inc19 ] %cnt.043 = phi i32 [ 0, %for.cond2.preheader.preheader ], [ %cnt.2, %for.inc19 ] %.pre = load i32, ptr %arrayidx7.phi.trans.insert, align 4, !tbaa !5 br label %for.body4 for.body4: ; preds = %for.cond2.preheader, %for.inc %2 = phi i32 [ %.pre, %for.cond2.preheader ], [ %4, %for.inc ] %indvars.iv = phi i64 [ %1, %for.cond2.preheader ], [ %indvars.iv.next, %for.inc ] %cnt.140 = phi i32 [ %cnt.043, %for.cond2.preheader ], [ %cnt.2, %for.inc ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %3, %2 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body4 %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv store i32 %3, ptr %arrayidx7, align 4, !tbaa !5 store i32 %2, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %cnt.140, 1 br label %for.inc for.inc: ; preds = %for.body4, %if.then %4 = phi i32 [ %2, %if.then ], [ %3, %for.body4 ] %cnt.2 = phi i32 [ %inc, %if.then ], [ %cnt.140, %for.body4 ] %cmp3 = icmp sgt i64 %indvars.iv.next, %indvars.iv45 br i1 %cmp3, label %for.body4, label %for.inc19, !llvm.loop !9 for.inc19: ; preds = %for.inc %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1 %exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count br i1 %exitcond.not, label %for.end21, label %for.cond2.preheader, !llvm.loop !11 for.end21: ; preds = %for.inc19, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.2, %for.inc19 ] ret i32 %cnt.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca [110 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body %cmp41.i = icmp sgt i32 %1, 1 br i1 %cmp41.i, label %for.cond2.preheader.preheader.i, label %bubbleSort.exit for.cond2.preheader.preheader.i: ; preds = %for.end %sub.i = add nsw i32 %1, -1 %3 = zext i32 %1 to i64 %4 = add nsw i64 %3, -1 %wide.trip.count.i = zext i32 %sub.i to i64 %arrayidx7.phi.trans.insert.i = getelementptr inbounds i32, ptr %a, i64 %4 br label %for.cond2.preheader.i for.cond2.preheader.i: ; preds = %for.inc19.i, %for.cond2.preheader.preheader.i %indvars.iv45.i = phi i64 [ 0, %for.cond2.preheader.preheader.i ], [ %indvars.iv.next46.i, %for.inc19.i ] %cnt.043.i = phi i32 [ 0, %for.cond2.preheader.preheader.i ], [ %cnt.2.i, %for.inc19.i ] %.pre.i = load i32, ptr %arrayidx7.phi.trans.insert.i, align 4, !tbaa !5 br label %for.body4.i for.body4.i: ; preds = %for.inc.i, %for.cond2.preheader.i %5 = phi i32 [ %.pre.i, %for.cond2.preheader.i ], [ %7, %for.inc.i ] %indvars.iv.i = phi i64 [ %4, %for.cond2.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %cnt.140.i = phi i32 [ %cnt.043.i, %for.cond2.preheader.i ], [ %cnt.2.i, %for.inc.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i %6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp8.i = icmp sgt i32 %6, %5 br i1 %cmp8.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body4.i %arrayidx7.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i store i32 %6, ptr %arrayidx7.i, align 4, !tbaa !5 store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5 %inc.i = add nsw i32 %cnt.140.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body4.i %7 = phi i32 [ %5, %if.then.i ], [ %6, %for.body4.i ] %cnt.2.i = phi i32 [ %inc.i, %if.then.i ], [ %cnt.140.i, %for.body4.i ] %cmp3.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv45.i br i1 %cmp3.i, label %for.body4.i, label %for.inc19.i, !llvm.loop !9 for.inc19.i: ; preds = %for.inc.i %indvars.iv.next46.i = add nuw nsw i64 %indvars.iv45.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next46.i, %wide.trip.count.i br i1 %exitcond.not.i, label %bubbleSort.exit, label %for.cond2.preheader.i, !llvm.loop !11 bubbleSort.exit: ; preds = %for.inc19.i, %for.end %cnt.0.lcssa.i = phi i32 [ 0, %for.end ], [ %cnt.2.i, %for.inc19.i ] %cmp425 = icmp sgt i32 %1, 0 br i1 %cmp425, label %for.body5, label %for.end13 for.body5: ; preds = %bubbleSort.exit, %for.inc11 %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.inc11 ], [ 0, %bubbleSort.exit ] %arrayidx7 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv29 %8 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8) %9 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %9, -1 %10 = sext i32 %sub to i64 %cmp9 = icmp slt i64 %indvars.iv29, %10 br i1 %cmp9, label %if.then, label %for.inc11 if.then: ; preds = %for.body5 %putchar22 = call i32 @putchar(i32 32) %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc11 for.inc11: ; preds = %for.body5, %if.then %11 = phi i32 [ %9, %for.body5 ], [ %.pre, %if.then ] %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %12 = sext i32 %11 to i64 %cmp4 = icmp slt i64 %indvars.iv.next30, %12 br i1 %cmp4, label %for.body5, label %for.end13, !llvm.loop !13 for.end13: ; preds = %for.inc11, %entry, %bubbleSort.exit %cnt.0.lcssa.i35 = phi i32 [ %cnt.0.lcssa.i, %bubbleSort.exit ], [ 0, %entry ], [ %cnt.0.lcssa.i, %for.inc11 ] %putchar = call i32 @putchar(i32 10) %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cnt.0.lcssa.i35) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 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 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main(){ int n,i,j,c; int flag=1,a=0; int A[100]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&A[i]); } while(flag){ flag = 0; for(j=n-1;j>0;j--){ if(A[j]<A[j-1]){ c = A[j]; A[j] = A[j-1]; A[j-1] = c; flag = 1; a++; } } } for(i=0;i<n;i++){ if(i!=0)printf(" "); printf("%d",A[i]); } printf("\n%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283389/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283389/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %A = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #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.end36 while.cond.preheader: ; preds = %for.body %cmp356 = icmp sgt i32 %4, 1 br i1 %cmp356, label %for.cond2.preheader.us.preheader, label %for.cond24.preheader for.cond2.preheader.us.preheader: ; preds = %while.cond.preheader %1 = zext i32 %4 to i64 br label %for.body4.us for.body4.us: ; preds = %for.body4.us.backedge, %for.cond2.preheader.us.preheader %indvars.iv68 = phi i64 [ %1, %for.cond2.preheader.us.preheader ], [ %indvars.iv68.be, %for.body4.us.backedge ] %a.159.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %a.2.us, %for.body4.us.backedge ] %flag.158.us = phi i32 [ 0, %for.cond2.preheader.us.preheader ], [ %flag.158.us.be, %for.body4.us.backedge ] %indvars.iv.next69 = add nsw i64 %indvars.iv68, -1 %idxprom5.us = and i64 %indvars.iv.next69, 4294967295 %arrayidx6.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom5.us %2 = load i32, ptr %arrayidx6.us, align 4, !tbaa !5 %sub7.us = add i64 %indvars.iv68, 4294967294 %idxprom8.us = and i64 %sub7.us, 4294967295 %arrayidx9.us = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom8.us %3 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp slt i32 %2, %3 br i1 %cmp10.us, label %if.then.us, label %for.inc22.us if.then.us: ; preds = %for.body4.us store i32 %3, ptr %arrayidx6.us, align 4, !tbaa !5 store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5 %inc21.us = add nsw i32 %a.159.us, 1 br label %for.inc22.us for.inc22.us: ; preds = %if.then.us, %for.body4.us %flag.2.us = phi i32 [ 1, %if.then.us ], [ %flag.158.us, %for.body4.us ] %a.2.us = phi i32 [ %inc21.us, %if.then.us ], [ %a.159.us, %for.body4.us ] %cmp3.us = icmp sgt i64 %indvars.iv68, 2 br i1 %cmp3.us, label %for.body4.us.backedge, label %for.cond2.while.cond.loopexit_crit_edge.us for.body4.us.backedge: ; preds = %for.inc22.us, %for.cond2.while.cond.loopexit_crit_edge.us %indvars.iv68.be = phi i64 [ %indvars.iv.next69, %for.inc22.us ], [ %1, %for.cond2.while.cond.loopexit_crit_edge.us ] %flag.158.us.be = phi i32 [ %flag.2.us, %for.inc22.us ], [ 0, %for.cond2.while.cond.loopexit_crit_edge.us ] br label %for.body4.us, !llvm.loop !9 for.cond2.while.cond.loopexit_crit_edge.us: ; preds = %for.inc22.us %tobool.not.us = icmp eq i32 %flag.2.us, 0 br i1 %tobool.not.us, label %for.cond24.preheader, label %for.body4.us.backedge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 for.cond24.preheader: ; preds = %for.cond2.while.cond.loopexit_crit_edge.us, %while.cond.preheader %.us-phi = phi i32 [ 0, %while.cond.preheader ], [ %a.2.us, %for.cond2.while.cond.loopexit_crit_edge.us ] %cmp2564 = icmp sgt i32 %4, 0 br i1 %cmp2564, label %if.end30.peel, label %for.end36 if.end30.peel: ; preds = %for.cond24.preheader %.pre = load i32, ptr %A, align 16, !tbaa !5 %call33.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp25.peel = icmp sgt i32 %6, 1 br i1 %cmp25.peel, label %if.end30, label %for.end36 if.end30: ; preds = %if.end30.peel, %if.end30 %indvars.iv71 = phi i64 [ %indvars.iv.next72, %if.end30 ], [ 1, %if.end30.peel ] %putchar = call i32 @putchar(i32 32) %arrayidx32 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv71 %7 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp25 = icmp slt i64 %indvars.iv.next72, %9 br i1 %cmp25, label %if.end30, label %for.end36, !llvm.loop !12 for.end36: ; preds = %if.end30, %entry, %if.end30.peel, %for.cond24.preheader %.us-phi79 = phi i32 [ %.us-phi, %for.cond24.preheader ], [ %.us-phi, %if.end30.peel ], [ 0, %entry ], [ %.us-phi, %if.end30 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.us-phi79) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> int main(){ int N; int *inputs; int cnt = 0; scanf("%d", &N); inputs = (int*)malloc(sizeof(int) * N); if(inputs == NULL){ printf("Memory Error\n"); exit(1); } for(int i = 0;i < N;i++){ scanf("%d", &inputs[i]); } int temp; for(int i = N - 1; 0 < i; i--){ for(int j = 0; j < i; j++){ if(inputs[j + 1] < inputs[j]){ temp = inputs[j + 1]; inputs[j + 1] = inputs[j]; inputs[j] = temp; cnt++; } } } for(int i = 0;i < N - 1;i++){ printf("%d ", inputs[i]); } printf("%d", inputs[N - 1]); printf("\n%d\n", cnt); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283431/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283431/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1 @str = private unnamed_addr constant [13 x i8] c"Memory Error\00", align 1 ; Function Attrs: 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) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp = icmp eq ptr %call1, null br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp485 = icmp sgt i32 %0, 0 br i1 %cmp485, label %for.body, label %for.cond43.preheader.thread if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) call void @exit(i32 noundef 1) #8 unreachable for.cond8.preheader: ; preds = %for.body %cmp992 = icmp sgt i32 %5, 1 br i1 %cmp992, label %for.cond13.preheader.preheader, label %for.cond43.preheader.thread for.cond43.preheader.thread: ; preds = %for.cond8.preheader, %for.cond.preheader %1 = phi i32 [ %5, %for.cond8.preheader ], [ %0, %for.cond.preheader ] %.pre114 = add nsw i32 %1, -1 br label %for.cond43.preheader.for.cond.cleanup47_crit_edge for.cond13.preheader.preheader: ; preds = %for.cond8.preheader %2 = add i32 %5, -1 %3 = zext i32 %2 to i64 %4 = sub nsw i64 0, %3 %invariant.gep = getelementptr i32, ptr %call1, i64 1 br label %for.body17.preheader for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call6 = 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 %cmp4 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp4, label %for.body, label %for.cond8.preheader, !llvm.loop !9 for.cond8.loopexit.unr-lcssa: ; preds = %for.inc37.1, %for.body17.preheader %cnt.2.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %cnt.2.1, %for.inc37.1 ] %.unr = phi i32 [ %.pre, %for.body17.preheader ], [ %14, %for.inc37.1 ] %indvars.iv103.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next104.1, %for.inc37.1 ] %cnt.188.unr = phi i32 [ %cnt.093, %for.body17.preheader ], [ %cnt.2.1, %for.inc37.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond8.loopexit, label %for.body17.epil for.body17.epil: ; preds = %for.cond8.loopexit.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv103.unr %7 = load i32, ptr %gep, align 4, !tbaa !5 %cmp22.epil = icmp slt i32 %7, %.unr br i1 %cmp22.epil, label %if.then24.epil, label %for.cond8.loopexit if.then24.epil: ; preds = %for.body17.epil %arrayidx21.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv103.unr store i32 %.unr, ptr %gep, align 4, !tbaa !5 store i32 %7, ptr %arrayidx21.epil, align 4, !tbaa !5 %inc35.epil = add nsw i32 %cnt.188.unr, 1 br label %for.cond8.loopexit for.cond8.loopexit: ; preds = %for.body17.epil, %if.then24.epil, %for.cond8.loopexit.unr-lcssa %cnt.2.lcssa = phi i32 [ %cnt.2.lcssa.ph, %for.cond8.loopexit.unr-lcssa ], [ %inc35.epil, %if.then24.epil ], [ %cnt.188.unr, %for.body17.epil ] %cmp9 = icmp sgt i32 %i7.094.in, 2 %indvars.iv.next109 = add i64 %indvars.iv108, -1 %indvar.next = add i64 %indvar, 1 br i1 %cmp9, label %for.body17.preheader, label %for.cond43.preheader, !llvm.loop !11 for.body17.preheader: ; preds = %for.cond8.loopexit, %for.cond13.preheader.preheader %indvar = phi i64 [ %indvar.next, %for.cond8.loopexit ], [ 0, %for.cond13.preheader.preheader ] %indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.cond8.loopexit ], [ %3, %for.cond13.preheader.preheader ] %i7.094.in = phi i32 [ %i7.094, %for.cond8.loopexit ], [ %5, %for.cond13.preheader.preheader ] %cnt.093 = phi i32 [ %cnt.2.lcssa, %for.cond8.loopexit ], [ 0, %for.cond13.preheader.preheader ] %i7.094 = add nsw i32 %i7.094.in, -1 %.pre = load i32, ptr %call1, align 4, !tbaa !5 %xtraiter = and i64 %indvars.iv108, 1 %8 = xor i64 %indvar, %4 %9 = icmp eq i64 %8, -1 br i1 %9, label %for.cond8.loopexit.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %indvars.iv108, -2 br label %for.body17 for.cond43.preheader: ; preds = %for.cond8.loopexit br i1 %cmp992, label %for.body48, label %for.cond43.preheader.for.cond.cleanup47_crit_edge for.cond43.preheader.for.cond.cleanup47_crit_edge: ; preds = %for.cond43.preheader.thread, %for.cond43.preheader %cnt.0.lcssa124 = phi i32 [ 0, %for.cond43.preheader.thread ], [ %cnt.2.lcssa, %for.cond43.preheader ] %sub4496.pre-phi122 = phi i32 [ %.pre114, %for.cond43.preheader.thread ], [ %2, %for.cond43.preheader ] %.pre115 = sext i32 %sub4496.pre-phi122 to i64 br label %for.cond.cleanup47 for.body17: ; preds = %for.inc37.1, %for.body17.preheader.new %10 = phi i32 [ %.pre, %for.body17.preheader.new ], [ %14, %for.inc37.1 ] %indvars.iv103 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next104.1, %for.inc37.1 ] %cnt.188 = phi i32 [ %cnt.093, %for.body17.preheader.new ], [ %cnt.2.1, %for.inc37.1 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.inc37.1 ] %indvars.iv.next104 = or i64 %indvars.iv103, 1 %arrayidx19 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next104 %11 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp22 = icmp slt i32 %11, %10 br i1 %cmp22, label %if.then24, label %for.inc37 if.then24: ; preds = %for.body17 %arrayidx21 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv103 store i32 %10, ptr %arrayidx19, align 4, !tbaa !5 store i32 %11, ptr %arrayidx21, align 4, !tbaa !5 %inc35 = add nsw i32 %cnt.188, 1 br label %for.inc37 for.inc37: ; preds = %for.body17, %if.then24 %12 = phi i32 [ %10, %if.then24 ], [ %11, %for.body17 ] %cnt.2 = phi i32 [ %inc35, %if.then24 ], [ %cnt.188, %for.body17 ] %indvars.iv.next104.1 = add nuw nsw i64 %indvars.iv103, 2 %arrayidx19.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next104.1 %13 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5 %cmp22.1 = icmp slt i32 %13, %12 br i1 %cmp22.1, label %if.then24.1, label %for.inc37.1 if.then24.1: ; preds = %for.inc37 %arrayidx21.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next104 store i32 %12, ptr %arrayidx19.1, align 4, !tbaa !5 store i32 %13, ptr %arrayidx21.1, align 4, !tbaa !5 %inc35.1 = add nsw i32 %cnt.2, 1 br label %for.inc37.1 for.inc37.1: ; preds = %if.then24.1, %for.inc37 %14 = phi i32 [ %12, %if.then24.1 ], [ %13, %for.inc37 ] %cnt.2.1 = phi i32 [ %inc35.1, %if.then24.1 ], [ %cnt.2, %for.inc37 ] %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.cond8.loopexit.unr-lcssa, label %for.body17, !llvm.loop !12 for.cond.cleanup47: ; preds = %for.body48, %for.cond43.preheader.for.cond.cleanup47_crit_edge %cnt.0.lcssa123 = phi i32 [ %cnt.0.lcssa124, %for.cond43.preheader.for.cond.cleanup47_crit_edge ], [ %cnt.2.lcssa, %for.body48 ] %idxprom56.pre-phi = phi i64 [ %.pre115, %for.cond43.preheader.for.cond.cleanup47_crit_edge ], [ %18, %for.body48 ] %arrayidx57 = getelementptr inbounds i32, ptr %call1, i64 %idxprom56.pre-phi %15 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15) %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cnt.0.lcssa123) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 for.body48: ; preds = %for.cond43.preheader, %for.body48 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body48 ], [ 0, %for.cond43.preheader ] %arrayidx50 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv111 %16 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %17 = load i32, ptr %N, align 4, !tbaa !5 %sub44 = add nsw i32 %17, -1 %18 = sext i32 %sub44 to i64 %cmp45 = icmp slt i64 %indvars.iv.next112, %18 br i1 %cmp45, label %for.body48, label %for.cond.cleanup47, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: noreturn nounwind declare void @exit(i32 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 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } attributes #8 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> #define MAX 100 void Bsort(int a[], int n); int main(void) { int A[MAX]; int N; scanf("%d", &N); for(int i=0; i<N; ++i) { scanf("%d", &A[i]); } Bsort(A, N); return 0; } void Bsort(int a[], int n) { int tmp, j; int c = 0; int flag = 1; int i = 0; while(flag) { flag = 0; for(j=n-1; j>=i+1; --j) { if(a[j] < a[j-1]) { tmp = a[j]; a[j] = a[j-1]; a[j-1] = tmp; c++; flag = 1; } } ++i; } for(j=0; j<n; ++j) { if(j != n-1) { printf("%d ", a[j]); } else printf("%d\n", a[j]); } printf("%d\n", c); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283475/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283475/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %A = alloca [100 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 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 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, 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 %.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %7, %for.body ] %.lcssa = phi i32 [ %0, %entry.for.cond.cleanup_crit_edge ], [ %6, %for.body ] %invariant.gep.i = getelementptr i32, ptr %A, i64 -2 %smax = call i64 @llvm.smax.i64(i64 %.pre-phi, i64 1) %1 = add nsw i64 %smax, -1 br label %for.cond.preheader.i while.cond.loopexit.i: ; preds = %for.inc.i %tobool.not.i = icmp eq i32 %flag.2.i, 0 br i1 %tobool.not.i, label %for.cond16.preheader.i, label %for.cond.preheader.i, !llvm.loop !9 for.cond.preheader.i: ; preds = %while.cond.loopexit.i, %for.cond.cleanup %indvars.iv70.i = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next71.i, %while.cond.loopexit.i ] %c.064.i = phi i32 [ 0, %for.cond.cleanup ], [ %c.2.i, %while.cond.loopexit.i ] %indvars.iv.next71.i = add nuw nsw i64 %indvars.iv70.i, 1 %exitcond.not = icmp eq i64 %indvars.iv70.i, %1 br i1 %exitcond.not, label %for.cond16.preheader.i, label %for.body.i for.cond16.preheader.i: ; preds = %for.cond.preheader.i, %while.cond.loopexit.i %c.1.lcssa79.i = phi i32 [ %c.2.i, %while.cond.loopexit.i ], [ %c.064.i, %for.cond.preheader.i ] %cmp1766.i = icmp sgt i32 %.lcssa, 0 br i1 %cmp1766.i, label %for.body18.lr.ph.i, label %Bsort.exit for.body18.lr.ph.i: ; preds = %for.cond16.preheader.i %sub19.i = add nsw i32 %.lcssa, -1 %2 = zext i32 %sub19.i to i64 %wide.trip.count.i = zext i32 %.lcssa to i64 br label %for.body18.i for.body.i: ; preds = %for.cond.preheader.i, %for.inc.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ %.pre-phi, %for.cond.preheader.i ] %flag.160.i = phi i32 [ %flag.2.i, %for.inc.i ], [ 0, %for.cond.preheader.i ] %c.159.i = phi i32 [ %c.2.i, %for.inc.i ], [ %c.064.i, %for.cond.preheader.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i %4 = load i32, ptr %gep.i, align 4, !tbaa !5 %cmp4.i = icmp slt i32 %3, %4 br i1 %cmp4.i, label %if.then.i, label %for.inc.i if.then.i: ; preds = %for.body.i store i32 %4, ptr %arrayidx.i, align 4, !tbaa !5 store i32 %3, ptr %gep.i, align 4, !tbaa !5 %inc.i = add nsw i32 %c.159.i, 1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %c.2.i = phi i32 [ %inc.i, %if.then.i ], [ %c.159.i, %for.body.i ] %flag.2.i = phi i32 [ 1, %if.then.i ], [ %flag.160.i, %for.body.i ] %cmp.not.not.i = icmp sgt i64 %indvars.iv.next.i, %indvars.iv.next71.i br i1 %cmp.not.not.i, label %for.body.i, label %while.cond.loopexit.i, !llvm.loop !11 for.body18.i: ; preds = %for.body18.i, %for.body18.lr.ph.i %indvars.iv73.i = phi i64 [ 0, %for.body18.lr.ph.i ], [ %indvars.iv.next74.i, %for.body18.i ] %cmp20.not.i = icmp eq i64 %indvars.iv73.i, %2 %arrayidx23.sink.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv73.i %.str.1.sink.i = select i1 %cmp20.not.i, ptr @.str.2, ptr @.str.1 %5 = load i32, ptr %arrayidx23.sink.i, align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink.i, i32 noundef %5) %indvars.iv.next74.i = add nuw nsw i64 %indvars.iv73.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next74.i, %wide.trip.count.i br i1 %exitcond.not.i, label %Bsort.exit, label %for.body18.i, !llvm.loop !12 Bsort.exit: ; preds = %for.body18.i, %for.cond16.preheader.i %call31.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.1.lcssa79.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @Bsort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 { entry: %0 = sext i32 %n to i64 %invariant.gep = getelementptr i32, ptr %a, i64 -2 br label %for.cond.preheader while.cond.loopexit: ; preds = %for.inc %tobool.not = icmp eq i32 %flag.2, 0 br i1 %tobool.not, label %for.cond16.preheader, label %for.cond.preheader, !llvm.loop !9 for.cond.preheader: ; preds = %entry, %while.cond.loopexit %indvars.iv70 = phi i64 [ 0, %entry ], [ %indvars.iv.next71, %while.cond.loopexit ] %c.064 = phi i32 [ 0, %entry ], [ %c.2, %while.cond.loopexit ] %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %cmp.not.not57 = icmp slt i64 %indvars.iv.next71, %0 br i1 %cmp.not.not57, label %for.body, label %for.cond16.preheader for.cond16.preheader: ; preds = %for.cond.preheader, %while.cond.loopexit %c.1.lcssa79 = phi i32 [ %c.2, %while.cond.loopexit ], [ %c.064, %for.cond.preheader ] %cmp1766 = icmp sgt i32 %n, 0 br i1 %cmp1766, label %for.body18.lr.ph, label %for.end30 for.body18.lr.ph: ; preds = %for.cond16.preheader %sub19 = add nsw i32 %n, -1 %1 = zext i32 %sub19 to i64 %wide.trip.count = zext i32 %n to i64 br label %for.body18 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %0, %for.cond.preheader ] %flag.160 = phi i32 [ %flag.2, %for.inc ], [ 0, %for.cond.preheader ] %c.159 = phi i32 [ %c.2, %for.inc ], [ %c.064, %for.cond.preheader ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %3 = load i32, ptr %gep, align 4, !tbaa !5 %cmp4 = icmp slt i32 %2, %3 br i1 %cmp4, label %if.then, label %for.inc if.then: ; preds = %for.body store i32 %3, ptr %arrayidx, align 4, !tbaa !5 store i32 %2, ptr %gep, align 4, !tbaa !5 %inc = add nsw i32 %c.159, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %c.2 = phi i32 [ %inc, %if.then ], [ %c.159, %for.body ] %flag.2 = phi i32 [ 1, %if.then ], [ %flag.160, %for.body ] %cmp.not.not = icmp sgt i64 %indvars.iv.next, %indvars.iv.next71 br i1 %cmp.not.not, label %for.body, label %while.cond.loopexit, !llvm.loop !11 for.body18: ; preds = %for.body18.lr.ph, %for.body18 %indvars.iv73 = phi i64 [ 0, %for.body18.lr.ph ], [ %indvars.iv.next74, %for.body18 ] %cmp20.not = icmp eq i64 %indvars.iv73, %1 %arrayidx23.sink = getelementptr inbounds i32, ptr %a, i64 %indvars.iv73 %.str.1.sink = select i1 %cmp20.not, ptr @.str.2, ptr @.str.1 %4 = load i32, ptr %arrayidx23.sink, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %4) %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %exitcond.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count br i1 %exitcond.not, label %for.end30, label %for.body18, !llvm.loop !12 for.end30: ; preds = %for.body18, %for.cond16.preheader %call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.1.lcssa79) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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(void){ int time, D, L; scanf("%d", &D); scanf("%d", &L); time = (D / L) + (D % L); printf("%d\n", time); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_283532/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_283532/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %D = alloca i32, align 4 %L = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L) %0 = load i32, ptr %D, align 4, !tbaa !5 %1 = load i32, ptr %L, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %add = add nsw i32 %rem, %div %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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"}