Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> int search(int A[], int n, int key) { int i = 0; A[n] = key; while(A[i] != key) i++; return i != n; } int main(void) { int i, n, A[10000+1], q, key, sum = 0; scanf("%d",&n); for(i=0; i<n; i++) scanf("%d", &A[i]); scanf("%d",&q); for(i=0; i<q; i++) { scanf("%d", &key); if(search(A, n, key))sum++; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141850/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141850/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 { entry: %idxprom = sext i32 %n to i64 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom store i32 %key, ptr %arrayidx, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, %key %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %1 = trunc i64 %indvars.iv to i32 %cmp3 = icmp ne i32 %1, %n %conv = zext i1 %cmp3 to i32 ret i32 %conv } ; 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 %A = alloca [10001 x i32], align 16 %q = alloca i32, align 4 %key = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #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 %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10001 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 !11 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %3 = load i32, ptr %q, align 4, !tbaa !5 %cmp420 = icmp sgt i32 %3, 0 br i1 %cmp420, label %for.body5, label %for.end11 for.body5: ; preds = %for.end, %search.exit %sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ] %i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key) %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = load i32, ptr %key, align 4, !tbaa !5 %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %for.body5 %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ] %arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp.not.i = icmp eq i32 %6, %5 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9 search.exit: ; preds = %while.cond.i %7 = trunc i64 %indvars.iv.i to i32 %cmp3.i.not = icmp ne i32 %4, %7 %inc8 = zext i1 %cmp3.i.not to i32 %spec.select = add nuw nsw i32 %sum.022, %inc8 %inc10 = add nuw nsw i32 %i.121, 1 %8 = load i32, ptr %q, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc10, %8 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12 for.end11: ; preds = %search.exit, %for.end %sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #define MAXS 10000 #define MAXT 500 int search(int *A, int n, int key); int main(){ int i,j,k,n,q; int cnt=0; scanf("%d",&n); int S[n]; for(i=0;i<n;i++){ scanf("%d", &S[i]); } scanf("%d", &q); int T[q]; for(i=0;i<q;i++){ scanf("%d", &T[i]); } /* printf("%d\n", n); for(i=0;i<n;i++){ printf("%d", S[i]); } printf("\n", n); printf("%d\n", q); for(i=0;i<q;i++){ printf("%d",T[i]); } printf("\n", n); */ for(i=0; i<q; i++){ if(search(S, n, T[i])){ cnt++; } } printf("%d\n",cnt); return 0; } int search(int *A, int n, int key){ int i=0; A[n]=key; while(A[i]!=key){ i++; } return i!=n; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141894/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141894/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %q = 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 %q) #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 %for.end 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 !9 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %6 = load i32, ptr %q, align 4, !tbaa !5 %7 = zext i32 %6 to i64 %vla3 = alloca i32, i64 %7, align 16 %cmp535 = icmp sgt i32 %6, 0 br i1 %cmp535, label %for.body6, label %for.end22 for.cond13.preheader: ; preds = %for.body6 %cmp1437 = icmp sgt i32 %10, 0 br i1 %cmp1437, label %for.body15.lr.ph, label %for.end22 for.body15.lr.ph: ; preds = %for.cond13.preheader %8 = load i32, ptr %n, align 4, !tbaa !5 %idxprom.i = sext i32 %8 to i64 %arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom.i %wide.trip.count = zext i32 %10 to i64 %xtraiter = and i64 %wide.trip.count, 1 %9 = icmp eq i32 %10, 1 br i1 %9, label %for.end22.loopexit.unr-lcssa, label %for.body15.lr.ph.new for.body15.lr.ph.new: ; preds = %for.body15.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body15 for.body6: ; preds = %for.end, %for.body6 %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body6 ], [ 0, %for.end ] %arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv43 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8) %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %10 = load i32, ptr %q, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp5 = icmp slt i64 %indvars.iv.next44, %11 br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !11 for.body15: ; preds = %search.exit.1, %for.body15.lr.ph.new %indvars.iv46 = phi i64 [ 0, %for.body15.lr.ph.new ], [ %indvars.iv.next47.1, %search.exit.1 ] %cnt.038 = phi i32 [ 0, %for.body15.lr.ph.new ], [ %spec.select.1, %search.exit.1 ] %niter = phi i64 [ 0, %for.body15.lr.ph.new ], [ %niter.next.1, %search.exit.1 ] %arrayidx17 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv46 %12 = load i32, ptr %arrayidx17, align 8, !tbaa !5 store i32 %12, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %for.body15 %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body15 ] %arrayidx2.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i %13 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp.not.i = icmp eq i32 %13, %12 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !12 search.exit: ; preds = %while.cond.i %14 = trunc i64 %indvars.iv.i to i32 %cmp3.i.not = icmp ne i32 %8, %14 %inc19 = zext i1 %cmp3.i.not to i32 %spec.select = add nuw nsw i32 %cnt.038, %inc19 %indvars.iv.next47 = or i64 %indvars.iv46, 1 %arrayidx17.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next47 %15 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.cond.i.1 while.cond.i.1: ; preds = %while.cond.i.1, %search.exit %indvars.iv.i.1 = phi i64 [ %indvars.iv.next.i.1, %while.cond.i.1 ], [ 0, %search.exit ] %arrayidx2.i.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i.1 %16 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5 %cmp.not.i.1 = icmp eq i32 %16, %15 %indvars.iv.next.i.1 = add nuw i64 %indvars.iv.i.1, 1 br i1 %cmp.not.i.1, label %search.exit.1, label %while.cond.i.1, !llvm.loop !12 search.exit.1: ; preds = %while.cond.i.1 %17 = trunc i64 %indvars.iv.i.1 to i32 %cmp3.i.not.1 = icmp ne i32 %8, %17 %inc19.1 = zext i1 %cmp3.i.not.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %inc19.1 %indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46, 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.end22.loopexit.unr-lcssa, label %for.body15, !llvm.loop !13 for.end22.loopexit.unr-lcssa: ; preds = %search.exit.1, %for.body15.lr.ph %spec.select.lcssa.ph = phi i32 [ undef, %for.body15.lr.ph ], [ %spec.select.1, %search.exit.1 ] %indvars.iv46.unr = phi i64 [ 0, %for.body15.lr.ph ], [ %indvars.iv.next47.1, %search.exit.1 ] %cnt.038.unr = phi i32 [ 0, %for.body15.lr.ph ], [ %spec.select.1, %search.exit.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end22, label %for.body15.epil for.body15.epil: ; preds = %for.end22.loopexit.unr-lcssa %arrayidx17.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv46.unr %18 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5 store i32 %18, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.cond.i.epil while.cond.i.epil: ; preds = %while.cond.i.epil, %for.body15.epil %indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %while.cond.i.epil ], [ 0, %for.body15.epil ] %arrayidx2.i.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i.epil %19 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5 %cmp.not.i.epil = icmp eq i32 %19, %18 %indvars.iv.next.i.epil = add nuw i64 %indvars.iv.i.epil, 1 br i1 %cmp.not.i.epil, label %search.exit.epil, label %while.cond.i.epil, !llvm.loop !12 search.exit.epil: ; preds = %while.cond.i.epil %20 = trunc i64 %indvars.iv.i.epil to i32 %cmp3.i.not.epil = icmp ne i32 %8, %20 %inc19.epil = zext i1 %cmp3.i.not.epil to i32 %spec.select.epil = add nuw nsw i32 %cnt.038.unr, %inc19.epil br label %for.end22 for.end22: ; preds = %search.exit.epil, %for.end22.loopexit.unr-lcssa, %for.end, %for.cond13.preheader %cnt.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.end ], [ %spec.select.lcssa.ph, %for.end22.loopexit.unr-lcssa ], [ %spec.select.epil, %search.exit.epil ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #4 { entry: %idxprom = sext i32 %n to i64 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom store i32 %key, ptr %arrayidx, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, %key %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12 while.end: ; preds = %while.cond %1 = trunc i64 %indvars.iv to i32 %cmp3 = icmp ne i32 %1, %n %conv = zext i1 %cmp3 to i32 ret i32 %conv } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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,q,i,j,c=0,t,start; scanf("%d",&n); int s[n]; for(i=0;i<n;i++) scanf("%d",&s[i]); scanf("%d",&q); for(i=0;i<q;i++){ scanf("%d",&t); start=0; for(j=start;j<n;j++){ if(s[j]==t){c++;start=j;break;} } } printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141937/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141937/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %q = alloca i32, align 4 %t = 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 %q) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %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 %cmp29 = icmp sgt i32 %3, 0 br i1 %cmp29, 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 %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 !9 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %6 = load i32, ptr %q, align 4, !tbaa !5 %cmp433 = icmp sgt i32 %6, 0 br i1 %cmp433, label %for.body5, label %for.end19 for.body5: ; preds = %for.end, %for.inc17 %i.135 = phi i32 [ %inc18, %for.inc17 ], [ 0, %for.end ] %c.034 = phi i32 [ %c.1, %for.inc17 ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp831 = icmp sgt i32 %7, 0 br i1 %cmp831, label %for.body9.lr.ph, label %for.inc17 for.body9.lr.ph: ; preds = %for.body5 %8 = load i32, ptr %t, align 4, !tbaa !5 %wide.trip.count = zext i32 %7 to i64 br label %for.body9 for.cond7: ; preds = %for.body9 %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1 %exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count br i1 %exitcond.not, label %for.inc17, label %for.body9, !llvm.loop !11 for.body9: ; preds = %for.body9.lr.ph, %for.cond7 %indvars.iv37 = phi i64 [ 0, %for.body9.lr.ph ], [ %indvars.iv.next38, %for.cond7 ] %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv37 %9 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp eq i32 %9, %8 br i1 %cmp12, label %if.then, label %for.cond7 if.then: ; preds = %for.body9 %inc13 = add nsw i32 %c.034, 1 br label %for.inc17 for.inc17: ; preds = %for.cond7, %for.body5, %if.then %c.1 = phi i32 [ %inc13, %if.then ], [ %c.034, %for.body5 ], [ %c.034, %for.cond7 ] %inc18 = add nuw nsw i32 %i.135, 1 %10 = load i32, ptr %q, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc18, %10 br i1 %cmp4, label %for.body5, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.inc17, %for.end %c.0.lcssa = phi i32 [ 0, %for.end ], [ %c.1, %for.inc17 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int search(int A[],int key, int n){ int i=0; A[n] = key; while(A[i]!=key) i++; return i !=n; } int main(){ int n,q; int S[10000],T[500],i,j,count=0,key; scanf("%d",&n); for(i=0;i<n;i++)scanf("%d",&S[i]); scanf("%d",&q); for(i=0;i<q;i++){ scanf("%d",&key); count += search(S,key,n); } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141980/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141980/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %key, i32 noundef %n) local_unnamed_addr #0 { entry: %idxprom = sext i32 %n to i64 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom store i32 %key, ptr %arrayidx, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, %key %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %1 = trunc i64 %indvars.iv to i32 %cmp3 = icmp ne i32 %1, %n %conv = zext i1 %cmp3 to i32 ret i32 %conv } ; 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 %q = alloca i32, align 4 %S = alloca [10000 x i32], align 16 %key = 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 %q) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #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 %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i32], ptr %S, 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 !11 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %3 = load i32, ptr %q, align 4, !tbaa !5 %cmp419 = icmp sgt i32 %3, 0 br i1 %cmp419, label %for.body5, label %for.end10 for.body5: ; preds = %for.end, %search.exit %count.021 = phi i32 [ %add, %search.exit ], [ 0, %for.end ] %i.120 = phi i32 [ %inc9, %search.exit ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key) %4 = load i32, ptr %key, align 4, !tbaa !5 %5 = load i32, ptr %n, align 4, !tbaa !5 %idxprom.i = sext i32 %5 to i64 %arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i store i32 %4, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %for.body5 %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ] %arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp.not.i = icmp eq i32 %6, %4 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9 search.exit: ; preds = %while.cond.i %7 = trunc i64 %indvars.iv.i to i32 %cmp3.i = icmp ne i32 %5, %7 %conv.i = zext i1 %cmp3.i to i32 %add = add nuw nsw i32 %count.021, %conv.i %inc9 = add nuw nsw i32 %i.120, 1 %8 = load i32, ptr %q, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc9, %8 br i1 %cmp4, label %for.body5, label %for.end10, !llvm.loop !12 for.end10: ; preds = %search.exit, %for.end %count.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %search.exit ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> int main() { int i,length,n,a=0,d=0; scanf("%d",&n); char ara[n+2]; scanf("%s",ara); length=strlen(ara); for(i=0;i<length;i++) { if(ara[i]=='A') a=a+1; else d=d+1; } if(a>d) printf("Anton"); else if(a==d) printf("Friendship"); else printf("Danik"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14203/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14203/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"Anton\00", align 1 @.str.3 = private unnamed_addr constant [11 x i8] c"Friendship\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"Danik\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) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 2 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %1, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %vla) #7 %conv = trunc i64 %call2 to i32 %cmp28 = icmp sgt i32 %conv, 0 br i1 %cmp28, label %for.body.preheader, label %if.end21 for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader48, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call2, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %vec.phi43 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %vec.phi44 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %3 = getelementptr inbounds i8, ptr %vla, i64 %index %wide.load = load <4 x i8>, ptr %3, align 8, !tbaa !9 %4 = getelementptr inbounds i8, ptr %3, i64 4 %wide.load45 = load <4 x i8>, ptr %4, align 4, !tbaa !9 %5 = icmp eq <4 x i8> %wide.load, <i8 65, i8 65, i8 65, i8 65> %6 = icmp eq <4 x i8> %wide.load45, <i8 65, i8 65, i8 65, i8 65> %7 = zext <4 x i1> %5 to <4 x i32> %8 = zext <4 x i1> %6 to <4 x i32> %9 = add <4 x i32> %vec.phi43, %7 %10 = add <4 x i32> %vec.phi44, %8 %11 = xor <4 x i1> %5, <i1 true, i1 true, i1 true, i1 true> %12 = xor <4 x i1> %6, <i1 true, i1 true, i1 true, i1 true> %13 = zext <4 x i1> %11 to <4 x i32> %14 = zext <4 x i1> %12 to <4 x i32> %15 = add <4 x i32> %vec.phi, %13 %16 = add <4 x i32> %vec.phi42, %14 %index.next = add nuw i64 %index, 8 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %bin.rdx46 = add <4 x i32> %10, %9 %18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx46) %bin.rdx = add <4 x i32> %16, %15 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end, label %for.body.preheader48 for.body.preheader48: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %d.030.ph = phi i32 [ 0, %for.body.preheader ], [ %19, %middle.block ] %a.029.ph = phi i32 [ 0, %for.body.preheader ], [ %18, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader48, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader48 ] %d.030 = phi i32 [ %d.1, %for.body ], [ %d.030.ph, %for.body.preheader48 ] %a.029 = phi i32 [ %a.1, %for.body ], [ %a.029.ph, %for.body.preheader48 ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %20 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp5 = icmp eq i8 %20, 65 %add7 = zext i1 %cmp5 to i32 %a.1 = add nuw nsw i32 %a.029, %add7 %not.cmp5 = xor i1 %cmp5, true %add8 = zext i1 %not.cmp5 to i32 %d.1 = add nuw nsw i32 %d.030, %add8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block %a.1.lcssa = phi i32 [ %18, %middle.block ], [ %a.1, %for.body ] %d.1.lcssa = phi i32 [ %19, %middle.block ], [ %d.1, %for.body ] %cmp9 = icmp ugt i32 %a.1.lcssa, %d.1.lcssa br i1 %cmp9, label %if.end21, label %if.else13 if.else13: ; preds = %for.end %cmp14 = icmp eq i32 %a.1.lcssa, %d.1.lcssa %spec.select = select i1 %cmp14, ptr @.str.3, ptr @.str.4 br label %if.end21 if.end21: ; preds = %if.else13, %entry, %for.end %.str.3.sink = phi ptr [ @.str.2, %for.end ], [ @.str.3, %entry ], [ %spec.select, %if.else13 ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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>) #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 nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12}
#include <stdio.h> int search(int A[], int n, int key) { int i = 0; A[n] = key; while(A[i] != key) i++; return i != n; } int main() { int i, n, A[10000+1], q, key, sum = 0; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%d", &A[i]); scanf("%d", &q); for(i = 0; i < q; i++) { scanf("%d", &key); if(search(A, n, key)) sum++; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142073/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142073/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 { entry: %idxprom = sext i32 %n to i64 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom store i32 %key, ptr %arrayidx, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, %key %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %1 = trunc i64 %indvars.iv to i32 %cmp3 = icmp ne i32 %1, %n %conv = zext i1 %cmp3 to i32 ret i32 %conv } ; 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 %A = alloca [10001 x i32], align 16 %q = alloca i32, align 4 %key = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #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 %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10001 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 !11 for.end: ; preds = %for.body, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %3 = load i32, ptr %q, align 4, !tbaa !5 %cmp420 = icmp sgt i32 %3, 0 br i1 %cmp420, label %for.body5, label %for.end11 for.body5: ; preds = %for.end, %search.exit %sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ] %i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key) %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = load i32, ptr %key, align 4, !tbaa !5 %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %for.body5 %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ] %arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp.not.i = icmp eq i32 %6, %5 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9 search.exit: ; preds = %while.cond.i %7 = trunc i64 %indvars.iv.i to i32 %cmp3.i.not = icmp ne i32 %4, %7 %inc8 = zext i1 %cmp3.i.not to i32 %spec.select = add nuw nsw i32 %sum.022, %inc8 %inc10 = add nuw nsw i32 %i.121, 1 %8 = load i32, ptr %q, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc10, %8 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12 for.end11: ; preds = %search.exit, %for.end %sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main() { int n = 0, k = 0, x = 1; scanf("%d\n%d", &n, &k); for (int i = 0; i < n; i++) { if (2 * x <= x + k) { x *= 2; } else { x += k; } } printf("%d\n", x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142116/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142116/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A%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 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 store i32 0, ptr %n, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 store i32 0, ptr %k, align 4, !tbaa !5 %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 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %k, align 4, !tbaa !5 %xtraiter = and i32 %0, 3 %2 = icmp ult i32 %0, 4 br i1 %2, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %0, -4 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %add.mul.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %add.mul.3, %for.body ] %x.011.unr = phi i32 [ 1, %for.body.lr.ph ], [ %add.mul.3, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %x.011.epil = phi i32 [ %add.mul.epil, %for.body.epil ], [ %x.011.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = shl nsw i32 %x.011.epil, 1 %add.epil = add nsw i32 %1, %x.011.epil %add.mul.epil = call i32 @llvm.smin.i32(i32 %mul.epil, i32 %add.epil) %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !9 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %x.0.lcssa = phi i32 [ 1, %entry ], [ %add.mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %add.mul.epil, %for.body.epil ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0.lcssa) 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 i32 0 for.body: ; preds = %for.body, %for.body.lr.ph.new %x.011 = phi i32 [ 1, %for.body.lr.ph.new ], [ %add.mul.3, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %mul = shl nsw i32 %x.011, 1 %add = add nsw i32 %1, %x.011 %add.mul = call i32 @llvm.smin.i32(i32 %mul, i32 %add) %mul.1 = shl nsw i32 %add.mul, 1 %add.1 = add nsw i32 %1, %add.mul %add.mul.1 = call i32 @llvm.smin.i32(i32 %mul.1, i32 %add.1) %mul.2 = shl nsw i32 %add.mul.1, 1 %add.2 = add nsw i32 %1, %add.mul.1 %add.mul.2 = call i32 @llvm.smin.i32(i32 %mul.2, i32 %add.2) %mul.3 = shl nsw i32 %add.mul.2, 1 %add.3 = add nsw i32 %1, %add.mul.2 %add.mul.3 = call i32 @llvm.smin.i32(i32 %mul.3, i32 %add.3) %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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.unroll.disable"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main() { long int m,x=0,i; scanf("%ld",&m); char a[m]; scanf("%s",a); for(i=0;i<m;i++){ if(a[i]=='A') x++; } if(x>m-x) printf("Anton"); else if(x==m-x) printf("Friendship"); else printf("Danik"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14216/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14216/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"Anton\00", align 1 @.str.3 = private unnamed_addr constant [11 x i8] c"Friendship\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"Danik\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %0 = load i64, ptr %m, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %0, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %2 = load i64, ptr %m, align 8, !tbaa !5 %cmp24 = icmp sgt i64 %2, 0 br i1 %cmp24, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %2, 4 br i1 %min.iters.check, label %for.body.preheader30, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %2, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ] %vec.phi28 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %3 = getelementptr inbounds i8, ptr %vla, i64 %index %wide.load = load <2 x i8>, ptr %3, align 4, !tbaa !9 %4 = getelementptr inbounds i8, ptr %3, i64 2 %wide.load29 = load <2 x i8>, ptr %4, align 2, !tbaa !9 %5 = icmp eq <2 x i8> %wide.load, <i8 65, i8 65> %6 = icmp eq <2 x i8> %wide.load29, <i8 65, i8 65> %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.phi28, %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 !10 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %10, %9 %12 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %2, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader30 for.body.preheader30: ; preds = %for.body.preheader, %middle.block %x.026.ph = phi i64 [ 0, %for.body.preheader ], [ %12, %middle.block ] %i.025.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader30, %for.body %x.026 = phi i64 [ %spec.select, %for.body ], [ %x.026.ph, %for.body.preheader30 ] %i.025 = phi i64 [ %inc4, %for.body ], [ %i.025.ph, %for.body.preheader30 ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %i.025 %13 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp2 = icmp eq i8 %13, 65 %inc = zext i1 %cmp2 to i64 %spec.select = add nuw nsw i64 %x.026, %inc %inc4 = add nuw nsw i64 %i.025, 1 %exitcond.not = icmp eq i64 %inc4, %2 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block, %entry %x.0.lcssa = phi i64 [ 0, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ] %sub = sub nsw i64 %2, %x.0.lcssa %cmp5 = icmp sgt i64 %x.0.lcssa, %sub %cmp10 = icmp eq i64 %x.0.lcssa, %sub %.str.3..str.4 = select i1 %cmp10, ptr @.str.3, ptr @.str.4 %.str.3.sink = select i1 %cmp5, ptr @.str.2, ptr %.str.3..str.4 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #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 i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12}
#include <stdio.h> int main() { int number_n, current_score = 1, add_number, i, temp_number; scanf("%d", &number_n); scanf("%d", &add_number); for(i = 0; i < number_n; i++) { if(current_score * 2 < current_score + add_number) { current_score *= 2; } else { current_score += add_number; } } printf("%d\n", current_score); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142202/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142202/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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: %number_n = alloca i32, align 4 %add_number = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number_n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %add_number) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number_n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add_number) %0 = load i32, ptr %number_n, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %add_number, align 4, !tbaa !5 %xtraiter = and i32 %0, 3 %2 = icmp ult i32 %0, 4 br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %0, -4 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %current_score.013 = phi i32 [ 1, %for.body.lr.ph.new ], [ %mul.add.3, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %mul = shl nsw i32 %current_score.013, 1 %add = add nsw i32 %1, %current_score.013 %mul.add = call i32 @llvm.smin.i32(i32 %mul, i32 %add) %mul.1 = shl nsw i32 %mul.add, 1 %add.1 = add nsw i32 %1, %mul.add %mul.add.1 = call i32 @llvm.smin.i32(i32 %mul.1, i32 %add.1) %mul.2 = shl nsw i32 %mul.add.1, 1 %add.2 = add nsw i32 %1, %mul.add.1 %mul.add.2 = call i32 @llvm.smin.i32(i32 %mul.2, i32 %add.2) %mul.3 = shl nsw i32 %mul.add.2, 1 %add.3 = add nsw i32 %1, %mul.add.2 %mul.add.3 = call i32 @llvm.smin.i32(i32 %mul.3, i32 %add.3) %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %mul.add.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %mul.add.3, %for.body ] %current_score.013.unr = phi i32 [ 1, %for.body.lr.ph ], [ %mul.add.3, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %current_score.013.epil = phi i32 [ %mul.add.epil, %for.body.epil ], [ %current_score.013.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = shl nsw i32 %current_score.013.epil, 1 %add.epil = add nsw i32 %1, %current_score.013.epil %mul.add.epil = call i32 @llvm.smin.i32(i32 %mul.epil, i32 %add.epil) %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %current_score.0.lcssa = phi i32 [ 1, %entry ], [ %mul.add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.add.epil, %for.body.epil ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %current_score.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %add_number) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number_n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> int main(void) { int n, k, i, ans=1; scanf("%d", &n); scanf("%d", &k); for(i=1; i<=n; i++) { if(ans<=k) ans *= 2; else ans += k; } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142253/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142253/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %k = 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 %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not8 = icmp slt i32 %0, 1 br i1 %cmp.not8, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %k, align 4, !tbaa !5 %xtraiter = and i32 %0, 3 %2 = icmp ult i32 %0, 4 br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %0, -4 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %ans.010 = phi i32 [ 1, %for.body.lr.ph.new ], [ %ans.1.3, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %cmp2.not = icmp sgt i32 %ans.010, %1 %mul = shl nsw i32 %ans.010, 1 %add = add nsw i32 %1, %ans.010 %ans.1 = select i1 %cmp2.not, i32 %add, i32 %mul %cmp2.not.1 = icmp sgt i32 %ans.1, %1 %mul.1 = shl nsw i32 %ans.1, 1 %add.1 = add nsw i32 %1, %ans.1 %ans.1.1 = select i1 %cmp2.not.1, i32 %add.1, i32 %mul.1 %cmp2.not.2 = icmp sgt i32 %ans.1.1, %1 %mul.2 = shl nsw i32 %ans.1.1, 1 %add.2 = add nsw i32 %1, %ans.1.1 %ans.1.2 = select i1 %cmp2.not.2, i32 %add.2, i32 %mul.2 %cmp2.not.3 = icmp sgt i32 %ans.1.2, %1 %mul.3 = shl nsw i32 %ans.1.2, 1 %add.3 = add nsw i32 %1, %ans.1.2 %ans.1.3 = select i1 %cmp2.not.3, i32 %add.3, i32 %mul.3 %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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %ans.1.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %ans.1.3, %for.body ] %ans.010.unr = phi i32 [ 1, %for.body.lr.ph ], [ %ans.1.3, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %ans.010.epil = phi i32 [ %ans.1.epil, %for.body.epil ], [ %ans.010.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %cmp2.not.epil = icmp sgt i32 %ans.010.epil, %1 %mul.epil = shl nsw i32 %ans.010.epil, 1 %add.epil = add nsw i32 %1, %ans.010.epil %ans.1.epil = select i1 %cmp2.not.epil, i32 %add.epil, i32 %mul.epil %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body.epil ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 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, !12} !12 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <stdlib.h> int main() { int n, k; scanf("%d %d", &n, &k); int ans = 1; while(n--){ if(ans > k){ ans += k; } else { ans *= 2; } } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142303/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142303/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %n.promoted = load i32, ptr %n, align 4, !tbaa !5 %tobool.not7 = icmp eq i32 %n.promoted, 0 br i1 %tobool.not7, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %0 = load i32, ptr %k, align 4, !tbaa !5 %xtraiter = and i32 %n.promoted, 3 %1 = icmp ult i32 %n.promoted, 4 br i1 %1, label %while.end.loopexit.unr-lcssa, label %while.body.lr.ph.new while.body.lr.ph.new: ; preds = %while.body.lr.ph %unroll_iter = and i32 %n.promoted, -4 br label %while.body while.body: ; preds = %while.body, %while.body.lr.ph.new %ans.08 = phi i32 [ 1, %while.body.lr.ph.new ], [ %ans.1.3, %while.body ] %niter = phi i32 [ 0, %while.body.lr.ph.new ], [ %niter.next.3, %while.body ] %cmp = icmp sgt i32 %ans.08, %0 %add = add nsw i32 %0, %ans.08 %mul = shl nsw i32 %ans.08, 1 %ans.1 = select i1 %cmp, i32 %add, i32 %mul %cmp.1 = icmp sgt i32 %ans.1, %0 %add.1 = add nsw i32 %0, %ans.1 %mul.1 = shl nsw i32 %ans.1, 1 %ans.1.1 = select i1 %cmp.1, i32 %add.1, i32 %mul.1 %cmp.2 = icmp sgt i32 %ans.1.1, %0 %add.2 = add nsw i32 %0, %ans.1.1 %mul.2 = shl nsw i32 %ans.1.1, 1 %ans.1.2 = select i1 %cmp.2, i32 %add.2, i32 %mul.2 %cmp.3 = icmp sgt i32 %ans.1.2, %0 %add.3 = add nsw i32 %0, %ans.1.2 %mul.3 = shl nsw i32 %ans.1.2, 1 %ans.1.3 = select i1 %cmp.3, i32 %add.3, i32 %mul.3 %niter.next.3 = add i32 %niter, 4 %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %while.end.loopexit.unr-lcssa, label %while.body, !llvm.loop !9 while.end.loopexit.unr-lcssa: ; preds = %while.body, %while.body.lr.ph %ans.1.lcssa.ph = phi i32 [ undef, %while.body.lr.ph ], [ %ans.1.3, %while.body ] %ans.08.unr = phi i32 [ 1, %while.body.lr.ph ], [ %ans.1.3, %while.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.end, label %while.body.epil while.body.epil: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil %ans.08.epil = phi i32 [ %ans.1.epil, %while.body.epil ], [ %ans.08.unr, %while.end.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %while.body.epil ], [ 0, %while.end.loopexit.unr-lcssa ] %cmp.epil = icmp sgt i32 %ans.08.epil, %0 %add.epil = add nsw i32 %0, %ans.08.epil %mul.epil = shl nsw i32 %ans.08.epil, 1 %ans.1.epil = select i1 %cmp.epil, i32 %add.epil, i32 %mul.epil %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %while.end, label %while.body.epil, !llvm.loop !11 while.end: ; preds = %while.end.loopexit.unr-lcssa, %while.body.epil, %entry %ans.0.lcssa = phi i32 [ 1, %entry ], [ %ans.1.lcssa.ph, %while.end.loopexit.unr-lcssa ], [ %ans.1.epil, %while.body.epil ] store i32 -1, ptr %n, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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, !12} !12 = !{!"llvm.loop.unroll.disable"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.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 MAX_N (1 << 17) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;} ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll ABS(ll a){return a>=0?a:(-a);} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod(ll n){return n%=MOD1;} 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;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} typedef struct{ ll aa; ll bb; }frequent; int main(void){ // char ; ll n; scanf("%lld",&n); ll a[n],x[n-1],y[n-1],r=0; rep(i,0,n){ scanf("%lld",&a[i]); if(a[i]>=0) r++; } if(n==2){ printf("%lld\n",ABS(a[0]-a[1])); printf("%lld %lld\n",max2(a[0],a[1]),min2(a[0],a[1])); return 0; } sortup(a,n); // rep(i,0,n){ // printf("%lld ",a[i]); // } PN; if(r<2){ x[0]=a[n-1]; y[0]=a[0]; rep(i,1,n-1){ x[i]=x[i-1]-y[i-1]; y[i]=a[i]; } }else if(r==n || r==n-1){ x[0]=a[0]; y[0]=a[1]; rep(i,1,n-2){ x[i]=x[i-1]-y[i-1]; y[i]=a[i+1]; } x[n-2]=a[n-1]; y[n-2]=x[n-3]-y[n-3]; }else if(r!=2){ x[0]=a[0]; y[0]=a[n-r]; rep(i,0,r-2){ x[i+1]=x[i]-y[i]; y[i+1]=a[n-r+1+i]; } rep(i,0,n-r){ x[r-1+i]= i? x[r-2+i]-y[r-2+i] : a[n-1]; y[r-1+i]= i? a[i] : x[r-2+i]-y[r-2+i]; } } printf("%lld\n",x[n-2]-y[n-2]); rep(i,0,n-1){ printf("%lld %lld\n",x[i],y[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142347/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142347/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.2 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { 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 #2 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; 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 #3 { entry: %cmp5 = icmp sgt i64 %n, 0 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ] %b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6) %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 { entry: %cmp5 = icmp sgt i64 %n, 0 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ] %b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6) %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { 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 #4 { 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(i64 noundef %n) local_unnamed_addr #5 { entry: %rem = srem i64 %n, 1000000007 ret i64 %rem } ; 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) #6 { 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) #6 { 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: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #13 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #13 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #13 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %sub = add nsw i64 %2, -1 %vla1 = alloca i64, i64 %sub, align 16 %vla3 = alloca i64, i64 %sub, align 16 %cmp240 = icmp sgt i64 %2, 0 br i1 %cmp240, label %for.body, label %if.end22 for.cond.cleanup: ; preds = %for.body %cmp8 = icmp eq i64 %.pr, 2 br i1 %cmp8, label %if.then9, label %if.end22 for.body: ; preds = %entry, %for.body %i.0242 = phi i64 [ %inc7, %for.body ], [ 0, %entry ] %r.0241 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.0242 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %3 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp6238 = icmp sgt i64 %3, -1 %inc = zext i1 %cmp6238 to i64 %spec.select = add nuw nsw i64 %r.0241, %inc %inc7 = add nuw nsw i64 %i.0242, 1 %.pr = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc7, %.pr br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 if.then9: ; preds = %for.cond.cleanup %4 = load i64, ptr %vla, align 16, !tbaa !5 %arrayidx11 = getelementptr inbounds i64, ptr %vla, i64 1 %5 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %sub12 = sub nsw i64 %4, %5 %cond.i = call i64 @llvm.abs.i64(i64 %sub12, i1 true) %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cond.i) %6 = load i64, ptr %vla, align 16, !tbaa !5 %7 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %cond.i230 = call i64 @llvm.smax.i64(i64 %6, i64 %7) %cond.i231 = call i64 @llvm.smin.i64(i64 %6, i64 %7) %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cond.i230, i64 noundef %cond.i231) br label %cleanup if.end22: ; preds = %entry, %for.cond.cleanup %r.0.lcssa266 = phi i64 [ %spec.select, %for.cond.cleanup ], [ 0, %entry ] %.lcssa265 = phi i64 [ %.pr, %for.cond.cleanup ], [ %2, %entry ] %sext = shl i64 %.lcssa265, 32 %conv.i = ashr exact i64 %sext, 32 call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.i, i64 noundef 8, ptr noundef nonnull @upll) #13 %putchar = call i32 @putchar(i32 10) %cmp24 = icmp slt i64 %r.0.lcssa266, 2 %8 = load i64, ptr %n, align 8, !tbaa !5 br i1 %cmp24, label %if.then26, label %if.else if.then26: ; preds = %if.end22 %9 = getelementptr i64, ptr %vla, i64 %8 %arrayidx28 = getelementptr i64, ptr %9, i64 -1 %10 = load i64, ptr %arrayidx28, align 8, !tbaa !5 store i64 %10, ptr %vla1, align 16, !tbaa !5 %11 = load i64, ptr %vla, align 16, !tbaa !5 store i64 %11, ptr %vla3, align 16, !tbaa !5 %cmp35252 = icmp sgt i64 %8, 2 br i1 %cmp35252, label %for.body38.preheader, label %if.end159 for.body38.preheader: ; preds = %if.then26 %xtraiter284 = and i64 %8, 1 %12 = icmp eq i64 %8, 3 br i1 %12, label %if.end159.loopexit.unr-lcssa, label %for.body38.preheader.new for.body38.preheader.new: ; preds = %for.body38.preheader %13 = and i64 %8, -2 %14 = add i64 %13, -4 br label %for.body38 for.body38: ; preds = %for.body38, %for.body38.preheader.new %15 = phi i64 [ %11, %for.body38.preheader.new ], [ %18, %for.body38 ] %16 = phi i64 [ %10, %for.body38.preheader.new ], [ %sub43.1, %for.body38 ] %i32.0253 = phi i64 [ 1, %for.body38.preheader.new ], [ %inc48.1, %for.body38 ] %niter289 = phi i64 [ 0, %for.body38.preheader.new ], [ %niter289.next.1, %for.body38 ] %sub43 = sub nsw i64 %16, %15 %arrayidx44 = getelementptr inbounds i64, ptr %vla1, i64 %i32.0253 store i64 %sub43, ptr %arrayidx44, align 8, !tbaa !5 %arrayidx45 = getelementptr inbounds i64, ptr %vla, i64 %i32.0253 %17 = load i64, ptr %arrayidx45, align 8, !tbaa !5 %arrayidx46 = getelementptr inbounds i64, ptr %vla3, i64 %i32.0253 store i64 %17, ptr %arrayidx46, align 8, !tbaa !5 %inc48 = add nuw nsw i64 %i32.0253, 1 %sub43.1 = sub nsw i64 %sub43, %17 %arrayidx44.1 = getelementptr inbounds i64, ptr %vla1, i64 %inc48 store i64 %sub43.1, ptr %arrayidx44.1, align 8, !tbaa !5 %arrayidx45.1 = getelementptr inbounds i64, ptr %vla, i64 %inc48 %18 = load i64, ptr %arrayidx45.1, align 8, !tbaa !5 %arrayidx46.1 = getelementptr inbounds i64, ptr %vla3, i64 %inc48 store i64 %18, ptr %arrayidx46.1, align 8, !tbaa !5 %inc48.1 = add nuw nsw i64 %i32.0253, 2 %niter289.next.1 = add i64 %niter289, 2 %niter289.ncmp.1 = icmp eq i64 %niter289, %14 br i1 %niter289.ncmp.1, label %if.end159.loopexit.unr-lcssa, label %for.body38, !llvm.loop !20 if.else: ; preds = %if.end22 %cmp50 = icmp eq i64 %r.0.lcssa266, %8 %sub52 = add nsw i64 %8, -1 %cmp53 = icmp eq i64 %r.0.lcssa266, %sub52 %or.cond = select i1 %cmp50, i1 true, i1 %cmp53 br i1 %or.cond, label %if.then55, label %if.else89 if.then55: ; preds = %if.else %19 = load i64, ptr %vla, align 16, !tbaa !5 store i64 %19, ptr %vla1, align 16, !tbaa !5 %arrayidx58 = getelementptr inbounds i64, ptr %vla, i64 1 %20 = load i64, ptr %arrayidx58, align 8, !tbaa !5 store i64 %20, ptr %vla3, align 16, !tbaa !5 %cmp63249 = icmp sgt i64 %8, 3 br i1 %cmp63249, label %for.body66.preheader, label %for.cond.cleanup65 for.body66.preheader: ; preds = %if.then55 %21 = add i64 %8, -3 %xtraiter278 = and i64 %21, 1 %22 = icmp eq i64 %8, 4 br i1 %22, label %for.cond.cleanup65.loopexit.unr-lcssa, label %for.body66.preheader.new for.body66.preheader.new: ; preds = %for.body66.preheader %unroll_iter282 = and i64 %21, -2 br label %for.body66 for.cond.cleanup65.loopexit.unr-lcssa: ; preds = %for.body66, %for.body66.preheader %.unr279 = phi i64 [ %20, %for.body66.preheader ], [ %34, %for.body66 ] %.unr280 = phi i64 [ %19, %for.body66.preheader ], [ %sub71.1, %for.body66 ] %i60.0250.unr = phi i64 [ 1, %for.body66.preheader ], [ %add.1, %for.body66 ] %lcmp.mod281.not = icmp eq i64 %xtraiter278, 0 br i1 %lcmp.mod281.not, label %for.cond.cleanup65, label %for.body66.epil for.body66.epil: ; preds = %for.cond.cleanup65.loopexit.unr-lcssa %sub71.epil = sub nsw i64 %.unr280, %.unr279 %arrayidx72.epil = getelementptr inbounds i64, ptr %vla1, i64 %i60.0250.unr store i64 %sub71.epil, ptr %arrayidx72.epil, align 8, !tbaa !5 %23 = getelementptr i64, ptr %vla, i64 %i60.0250.unr %arrayidx73.epil = getelementptr i64, ptr %23, i64 1 %24 = load i64, ptr %arrayidx73.epil, align 8, !tbaa !5 %arrayidx74.epil = getelementptr inbounds i64, ptr %vla3, i64 %i60.0250.unr store i64 %24, ptr %arrayidx74.epil, align 8, !tbaa !5 br label %for.cond.cleanup65 for.cond.cleanup65: ; preds = %for.body66.epil, %for.cond.cleanup65.loopexit.unr-lcssa, %if.then55 %25 = getelementptr i64, ptr %vla, i64 %8 %arrayidx79 = getelementptr i64, ptr %25, i64 -1 %26 = load i64, ptr %arrayidx79, align 8, !tbaa !5 %27 = getelementptr i64, ptr %vla1, i64 %8 %arrayidx81 = getelementptr i64, ptr %27, i64 -2 store i64 %26, ptr %arrayidx81, align 8, !tbaa !5 %sub82 = add nsw i64 %8, -3 %arrayidx83 = getelementptr inbounds i64, ptr %vla1, i64 %sub82 %28 = load i64, ptr %arrayidx83, align 8, !tbaa !5 %arrayidx85 = getelementptr inbounds i64, ptr %vla3, i64 %sub82 %29 = load i64, ptr %arrayidx85, align 8, !tbaa !5 %sub86 = sub nsw i64 %28, %29 %30 = getelementptr i64, ptr %vla3, i64 %8 %arrayidx88 = getelementptr i64, ptr %30, i64 -2 store i64 %sub86, ptr %arrayidx88, align 8, !tbaa !5 br label %if.end159 for.body66: ; preds = %for.body66, %for.body66.preheader.new %31 = phi i64 [ %20, %for.body66.preheader.new ], [ %34, %for.body66 ] %32 = phi i64 [ %19, %for.body66.preheader.new ], [ %sub71.1, %for.body66 ] %i60.0250 = phi i64 [ 1, %for.body66.preheader.new ], [ %add.1, %for.body66 ] %niter283 = phi i64 [ 0, %for.body66.preheader.new ], [ %niter283.next.1, %for.body66 ] %sub71 = sub nsw i64 %32, %31 %arrayidx72 = getelementptr inbounds i64, ptr %vla1, i64 %i60.0250 store i64 %sub71, ptr %arrayidx72, align 8, !tbaa !5 %add = add nuw nsw i64 %i60.0250, 1 %arrayidx73 = getelementptr inbounds i64, ptr %vla, i64 %add %33 = load i64, ptr %arrayidx73, align 8, !tbaa !5 %arrayidx74 = getelementptr inbounds i64, ptr %vla3, i64 %i60.0250 store i64 %33, ptr %arrayidx74, align 8, !tbaa !5 %sub71.1 = sub nsw i64 %sub71, %33 %arrayidx72.1 = getelementptr inbounds i64, ptr %vla1, i64 %add store i64 %sub71.1, ptr %arrayidx72.1, align 8, !tbaa !5 %add.1 = add nuw nsw i64 %i60.0250, 2 %arrayidx73.1 = getelementptr inbounds i64, ptr %vla, i64 %add.1 %34 = load i64, ptr %arrayidx73.1, align 8, !tbaa !5 %arrayidx74.1 = getelementptr inbounds i64, ptr %vla3, i64 %add store i64 %34, ptr %arrayidx74.1, align 8, !tbaa !5 %niter283.next.1 = add i64 %niter283, 2 %niter283.ncmp.1 = icmp eq i64 %niter283.next.1, %unroll_iter282 br i1 %niter283.ncmp.1, label %for.cond.cleanup65.loopexit.unr-lcssa, label %for.body66, !llvm.loop !21 if.else89: ; preds = %if.else %cmp90.not = icmp eq i64 %r.0.lcssa266, 2 br i1 %cmp90.not, label %if.end159, label %for.body104.lr.ph for.body104.lr.ph: ; preds = %if.else89 %35 = load i64, ptr %vla, align 16, !tbaa !5 store i64 %35, ptr %vla1, align 16, !tbaa !5 %sub95 = sub nsw i64 %8, %r.0.lcssa266 %arrayidx96 = getelementptr inbounds i64, ptr %vla, i64 %sub95 %36 = load i64, ptr %arrayidx96, align 8, !tbaa !5 store i64 %36, ptr %vla3, align 16, !tbaa !5 %sub100 = add nsw i64 %r.0.lcssa266, -2 %37 = getelementptr i64, ptr %arrayidx96, i64 1 %xtraiter = and i64 %r.0.lcssa266, 1 %38 = icmp eq i64 %r.0.lcssa266, 3 br i1 %38, label %for.cond120.preheader.unr-lcssa, label %for.body104.lr.ph.new for.body104.lr.ph.new: ; preds = %for.body104.lr.ph %unroll_iter = and i64 %sub100, -2 br label %for.body104 for.cond120.preheader.unr-lcssa: ; preds = %for.body104, %for.body104.lr.ph %.unr = phi i64 [ %36, %for.body104.lr.ph ], [ %53, %for.body104 ] %.unr273 = phi i64 [ %35, %for.body104.lr.ph ], [ %sub107.1, %for.body104 ] %i98.0245.unr = phi i64 [ 0, %for.body104.lr.ph ], [ %add108.1, %for.body104 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond120.preheader, label %for.body104.epil for.body104.epil: ; preds = %for.cond120.preheader.unr-lcssa %sub107.epil = sub nsw i64 %.unr273, %.unr %add108.epil = add nuw nsw i64 %i98.0245.unr, 1 %arrayidx109.epil = getelementptr inbounds i64, ptr %vla1, i64 %add108.epil store i64 %sub107.epil, ptr %arrayidx109.epil, align 8, !tbaa !5 %arrayidx113.epil = getelementptr i64, ptr %37, i64 %i98.0245.unr %39 = load i64, ptr %arrayidx113.epil, align 8, !tbaa !5 %arrayidx115.epil = getelementptr inbounds i64, ptr %vla3, i64 %add108.epil store i64 %39, ptr %arrayidx115.epil, align 8, !tbaa !5 br label %for.cond120.preheader for.cond120.preheader: ; preds = %for.cond120.preheader.unr-lcssa, %for.body104.epil %cmp122247 = icmp sgt i64 %sub95, 0 br i1 %cmp122247, label %cond.end149.peel, label %if.end159 cond.end149.peel: ; preds = %for.cond120.preheader %sub135 = add nsw i64 %r.0.lcssa266, -1 %40 = getelementptr i64, ptr %vla, i64 %8 %arrayidx134 = getelementptr i64, ptr %40, i64 -1 %41 = load i64, ptr %arrayidx134, align 8, !tbaa !5 %arrayidx137235.peel = getelementptr inbounds i64, ptr %vla1, i64 %sub135 store i64 %41, ptr %arrayidx137235.peel, align 8, !tbaa !5 %arrayidx144 = getelementptr inbounds i64, ptr %vla1, i64 %sub100 %42 = load i64, ptr %arrayidx144, align 8, !tbaa !5 %arrayidx147 = getelementptr inbounds i64, ptr %vla3, i64 %sub100 %43 = load i64, ptr %arrayidx147, align 8, !tbaa !5 %sub148.peel = sub nsw i64 %42, %43 %arrayidx153.peel = getelementptr inbounds i64, ptr %vla3, i64 %sub135 store i64 %sub148.peel, ptr %arrayidx153.peel, align 8, !tbaa !5 %exitcond258.peel.not = icmp eq i64 %sub95, 1 br i1 %exitcond258.peel.not, label %if.end159, label %cond.end149.preheader cond.end149.preheader: ; preds = %cond.end149.peel %44 = shl i64 %r.0.lcssa266, 3 %45 = add i64 %44, -8 %scevgep = getelementptr i8, ptr %vla3, i64 %45 %load_initial = load i64, ptr %scevgep, align 8 %scevgep269 = getelementptr i8, ptr %vla1, i64 %45 %load_initial270 = load i64, ptr %scevgep269, align 8 %46 = xor i64 %r.0.lcssa266, -1 %47 = add i64 %8, %46 %48 = add i64 %8, -2 %xtraiter274 = and i64 %47, 1 %49 = icmp eq i64 %48, %r.0.lcssa266 br i1 %49, label %if.end159.loopexit272.unr-lcssa, label %cond.end149.preheader.new cond.end149.preheader.new: ; preds = %cond.end149.preheader %unroll_iter276 = and i64 %47, -2 %invariant.gep = getelementptr i64, ptr %vla, i64 1 br label %cond.end149 for.body104: ; preds = %for.body104, %for.body104.lr.ph.new %50 = phi i64 [ %36, %for.body104.lr.ph.new ], [ %53, %for.body104 ] %51 = phi i64 [ %35, %for.body104.lr.ph.new ], [ %sub107.1, %for.body104 ] %i98.0245 = phi i64 [ 0, %for.body104.lr.ph.new ], [ %add108.1, %for.body104 ] %niter = phi i64 [ 0, %for.body104.lr.ph.new ], [ %niter.next.1, %for.body104 ] %sub107 = sub nsw i64 %51, %50 %add108 = or i64 %i98.0245, 1 %arrayidx109 = getelementptr inbounds i64, ptr %vla1, i64 %add108 store i64 %sub107, ptr %arrayidx109, align 8, !tbaa !5 %arrayidx113 = getelementptr i64, ptr %37, i64 %i98.0245 %52 = load i64, ptr %arrayidx113, align 8, !tbaa !5 %arrayidx115 = getelementptr inbounds i64, ptr %vla3, i64 %add108 store i64 %52, ptr %arrayidx115, align 8, !tbaa !5 %sub107.1 = sub nsw i64 %sub107, %52 %add108.1 = add nuw nsw i64 %i98.0245, 2 %arrayidx109.1 = getelementptr inbounds i64, ptr %vla1, i64 %add108.1 store i64 %sub107.1, ptr %arrayidx109.1, align 16, !tbaa !5 %arrayidx113.1 = getelementptr i64, ptr %37, i64 %add108 %53 = load i64, ptr %arrayidx113.1, align 8, !tbaa !5 %arrayidx115.1 = getelementptr inbounds i64, ptr %vla3, i64 %add108.1 store i64 %53, ptr %arrayidx115.1, align 16, !tbaa !5 %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.cond120.preheader.unr-lcssa, label %for.body104, !llvm.loop !22 cond.end149: ; preds = %cond.end149, %cond.end149.preheader.new %store_forwarded271 = phi i64 [ %load_initial270, %cond.end149.preheader.new ], [ %sub132.1, %cond.end149 ] %store_forwarded = phi i64 [ %load_initial, %cond.end149.preheader.new ], [ %55, %cond.end149 ] %i119.0248 = phi i64 [ 1, %cond.end149.preheader.new ], [ %inc155.1, %cond.end149 ] %niter277 = phi i64 [ 0, %cond.end149.preheader.new ], [ %niter277.next.1, %cond.end149 ] %sub132 = sub nsw i64 %store_forwarded271, %store_forwarded %add136 = add nsw i64 %sub135, %i119.0248 %arrayidx137 = getelementptr inbounds i64, ptr %vla1, i64 %add136 store i64 %sub132, ptr %arrayidx137, align 8, !tbaa !5 %arrayidx140 = getelementptr inbounds i64, ptr %vla, i64 %i119.0248 %54 = load i64, ptr %arrayidx140, align 8, !tbaa !5 %arrayidx153 = getelementptr inbounds i64, ptr %vla3, i64 %add136 store i64 %54, ptr %arrayidx153, align 8, !tbaa !5 %sub132.1 = sub nsw i64 %sub132, %54 %add136.1 = add i64 %r.0.lcssa266, %i119.0248 %arrayidx137.1 = getelementptr inbounds i64, ptr %vla1, i64 %add136.1 store i64 %sub132.1, ptr %arrayidx137.1, align 8, !tbaa !5 %gep = getelementptr i64, ptr %invariant.gep, i64 %i119.0248 %55 = load i64, ptr %gep, align 8, !tbaa !5 %arrayidx153.1 = getelementptr inbounds i64, ptr %vla3, i64 %add136.1 store i64 %55, ptr %arrayidx153.1, align 8, !tbaa !5 %inc155.1 = add nuw nsw i64 %i119.0248, 2 %niter277.next.1 = add nuw i64 %niter277, 2 %niter277.ncmp.1 = icmp eq i64 %niter277.next.1, %unroll_iter276 br i1 %niter277.ncmp.1, label %if.end159.loopexit272.unr-lcssa, label %cond.end149, !llvm.loop !23 if.end159.loopexit.unr-lcssa: ; preds = %for.body38, %for.body38.preheader %.unr285 = phi i64 [ %11, %for.body38.preheader ], [ %18, %for.body38 ] %.unr286 = phi i64 [ %10, %for.body38.preheader ], [ %sub43.1, %for.body38 ] %i32.0253.unr = phi i64 [ 1, %for.body38.preheader ], [ %inc48.1, %for.body38 ] %lcmp.mod287.not = icmp eq i64 %xtraiter284, 0 br i1 %lcmp.mod287.not, label %if.end159, label %for.body38.epil for.body38.epil: ; preds = %if.end159.loopexit.unr-lcssa %sub43.epil = sub nsw i64 %.unr286, %.unr285 %arrayidx44.epil = getelementptr inbounds i64, ptr %vla1, i64 %i32.0253.unr store i64 %sub43.epil, ptr %arrayidx44.epil, align 8, !tbaa !5 %arrayidx45.epil = getelementptr inbounds i64, ptr %vla, i64 %i32.0253.unr %56 = load i64, ptr %arrayidx45.epil, align 8, !tbaa !5 %arrayidx46.epil = getelementptr inbounds i64, ptr %vla3, i64 %i32.0253.unr store i64 %56, ptr %arrayidx46.epil, align 8, !tbaa !5 br label %if.end159 if.end159.loopexit272.unr-lcssa: ; preds = %cond.end149, %cond.end149.preheader %store_forwarded271.unr = phi i64 [ %load_initial270, %cond.end149.preheader ], [ %sub132.1, %cond.end149 ] %store_forwarded.unr = phi i64 [ %load_initial, %cond.end149.preheader ], [ %55, %cond.end149 ] %i119.0248.unr = phi i64 [ 1, %cond.end149.preheader ], [ %inc155.1, %cond.end149 ] %lcmp.mod275.not = icmp eq i64 %xtraiter274, 0 br i1 %lcmp.mod275.not, label %if.end159, label %cond.end149.epil cond.end149.epil: ; preds = %if.end159.loopexit272.unr-lcssa %sub132.epil = sub nsw i64 %store_forwarded271.unr, %store_forwarded.unr %add136.epil = add nsw i64 %sub135, %i119.0248.unr %arrayidx137.epil = getelementptr inbounds i64, ptr %vla1, i64 %add136.epil store i64 %sub132.epil, ptr %arrayidx137.epil, align 8, !tbaa !5 %arrayidx140.epil = getelementptr inbounds i64, ptr %vla, i64 %i119.0248.unr %57 = load i64, ptr %arrayidx140.epil, align 8, !tbaa !5 %arrayidx153.epil = getelementptr inbounds i64, ptr %vla3, i64 %add136.epil store i64 %57, ptr %arrayidx153.epil, align 8, !tbaa !5 br label %if.end159 if.end159: ; preds = %cond.end149.epil, %if.end159.loopexit272.unr-lcssa, %for.body38.epil, %if.end159.loopexit.unr-lcssa, %cond.end149.peel, %for.cond120.preheader, %if.then26, %for.cond.cleanup65, %if.else89 %sub160 = add nsw i64 %8, -2 %arrayidx161 = getelementptr inbounds i64, ptr %vla1, i64 %sub160 %58 = load i64, ptr %arrayidx161, align 8, !tbaa !5 %arrayidx163 = getelementptr inbounds i64, ptr %vla3, i64 %sub160 %59 = load i64, ptr %arrayidx163, align 8, !tbaa !5 %sub164 = sub nsw i64 %58, %59 %call165 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub164) %60 = load i64, ptr %n, align 8, !tbaa !5 %cmp169255 = icmp sgt i64 %60, 1 br i1 %cmp169255, label %for.body172, label %cleanup for.body172: ; preds = %if.end159, %for.body172 %i166.0256 = phi i64 [ %inc177, %for.body172 ], [ 0, %if.end159 ] %arrayidx173 = getelementptr inbounds i64, ptr %vla1, i64 %i166.0256 %61 = load i64, ptr %arrayidx173, align 8, !tbaa !5 %arrayidx174 = getelementptr inbounds i64, ptr %vla3, i64 %i166.0256 %62 = load i64, ptr %arrayidx174, align 8, !tbaa !5 %call175 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %61, i64 noundef %62) %inc177 = add nuw nsw i64 %i166.0256, 1 %63 = load i64, ptr %n, align 8, !tbaa !5 %sub168 = add nsw i64 %63, -1 %cmp169 = icmp slt i64 %inc177, %sub168 br i1 %cmp169, label %for.body172, label %cleanup, !llvm.loop !25 cleanup: ; preds = %for.body172, %if.end159, %if.then9 call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #13 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #10 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #11 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #11 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 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree 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 #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree "no-trapping-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 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #12 = { nofree nounwind } attributes #13 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10, !24} !24 = !{!"llvm.loop.peeled.count", i32 1} !25 = distinct !{!25, !10}
/* exit */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #define BIG 2000000007 #define MOD 1000000007 typedef unsigned long long ull; typedef signed long long sll; #define N_MAX 100000 #define M_MAX 10000 typedef struct { int a; int b; } hw; typedef struct { sll a; sll b; } hwll; const hw vector8[8] = { {-1, -1}, {-1, 0}, {-1, +1}, { 0, -1}, { 0, +1}, {+1, -1}, {+1, 0}, {+1, +1} }; ull n, m; ull h, w; ull k; ull va, vb, vc, vd, ve, vf; ull a[N_MAX]; // sll a[N_MAX]; ull b[N_MAX]; ull dp[N_MAX]; // ull dp[N_MAX][M_MAX + 1]; // char s[N_MAX + 1]; // char t[N_MAX + 1]; // char s[N_MAX][M_MAX + 1]; // hw arr[N_MAX]; // hwll arr[N_MAX]; // hw brr[M_MAX]; // ull digitdp[102][ 2][ 2]; // pos less carry void swap_adj(ull *a, ull *b){ ull tmp = *b; *b = *a; *a = tmp; return; } ull divide(ull a, ull b){ ull x = MOD - 2; ull ans = 1; while (x) { if (x & 1) ans = (ans * b) % MOD; b = (b * b) % MOD; x /= 2; } return (a * ans) % MOD; } int digits(ull x){ int i = 1; while (x >= 10) { x /= 10; i++; } return i; } ull min(ull x, ull y){ return (x < y) ? x : y; } ull gcd(ull x, ull y){ if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow(ull a, ull x){ ull result = 1; while (x) { if (x & 1) { result *= a; result %= MOD; } x /= 2; a = (a * a) % MOD; } return result; } // int nextroute(int arr[]){ // int i = n - 1; // int j, x; // while (arr[i - 1] > arr[i]) i--; // x = n; // for (j = i; j < n; j++) { // if (arr[j] < arr[i - 1]) continue; // if (x == n || arr[x] > arr[j]) x = j; // } // arr[i - 1] ^= arr[x]; // arr[x] ^= arr[i - 1]; // arr[i - 1] ^= arr[x]; // qsort(&arr[i], n - i, sizeof(int), comp); // return 0; // } int nibutan_target(ull target){ ull maxdist = (target * (target + 1) / 2); // 時刻targetまでに到着できる距離は[-maxdist, maxdist] return (n <= maxdist); } int targetdig(ull x, int index /* 1-indexed */){ // static...? int posmax = digits(x); if (posmax < index) return -1; while (posmax > index) { posmax--; x /= 10; } return x % 10; } int intcomp(const void *left, const void *right){ if ((*(int*)left) < (*(int*)right)) { return -1; } else if ((*(int*)left) > (*(int*)right)) { return +1; } else { return 0; } } int ullcomp(const void *left, const void *right){ if ((*(ull*)left) < (*(ull*)right)) { return -1; } else if ((*(ull*)left) > (*(ull*)right)) { return +1; } else { return 0; } } int sllcomp(const void *left, const void *right){ if ((*(sll*)left) < (*(sll*)right)) { return -1; } else if ((*(sll*)left) > (*(sll*)right)) { return +1; } else { return 0; } } int hwAcomp(const void *left, const void *right){ return intcomp(&(((hw*)left)->a), &(((hw*)right)->a)); } int hwBcomp(const void *left, const void *right){ return intcomp(&(((hw*)left)->b), &(((hw*)right)->b)); } int hwABcomp(const void *left, const void *right){ int x = hwAcomp(left, right); if (x) return x; return hwBcomp(left, right); } int hwllAcomp(const void *left, const void *right){ return sllcomp(&(((hw*)left)->a), &(((hw*)right)->a)); } int hwllBcomp(const void *left, const void *right){ return sllcomp(&(((hw*)left)->b), &(((hw*)right)->b)); } int hwllABcomp(const void *left, const void *right){ int x = hwllAcomp(left, right); if (x) return x; return hwllBcomp(left, right); } int ispalin(int x){ return (x == 0) || ((x & -x) == x); } int bitlet(char c){ return (1 << (c - 'a')); } ull solve(){ int i, j, ki; bool isactual[N_MAX]; for (i = 0; i < n; i++) { if (i == 0 || a[i - 1] < a[i]) { dp[i] = a[i]; isactual[i] = true; } else { dp[i] = a[i]; isactual[i] = false; } } for (i = n - 1; i >= 0; i--) { bool isact = (i == n - 1 || b[i] > b[i + 1]); if (isactual[i]) { if (isact) { if (dp[i] != b[i]) goto fail; } else { if (dp[i] > b[i]) goto fail; } } else { if (isact) { if (dp[i] < b[i]) goto fail; dp[i] = b[i]; isactual[i] = true; } else { if (dp[i] > b[i]) { dp[i] = b[i]; } } } } ull result = 1; for (i = 0; i < n; i++) { if (isactual[i] == false) { result *= dp[i]; result %= MOD; } } printf("%llu\n", result); return 0; fail: puts("0"); return 1; } int main(void){ int i, j; int x, y; scanf("%llu", &n); for (i = 0; i < n; i++) { scanf("%llu", &a[i]); } for (i = 0; i < n; i++) { scanf("%llu", &b[i]); } solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142390/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142390/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.hw = type { i32, i32 } @vector8 = dso_local local_unnamed_addr constant [8 x %struct.hw] [%struct.hw { i32 -1, i32 -1 }, %struct.hw { i32 -1, i32 0 }, %struct.hw { i32 -1, i32 1 }, %struct.hw { i32 0, i32 -1 }, %struct.hw { i32 0, i32 1 }, %struct.hw { i32 1, i32 -1 }, %struct.hw { i32 1, i32 0 }, %struct.hw { i32 1, i32 1 }], align 16 @n = dso_local global i64 0, align 8 @a = dso_local global [100000 x i64] zeroinitializer, align 16 @dp = dso_local local_unnamed_addr global [100000 x i64] zeroinitializer, align 16 @b = dso_local global [100000 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"0\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @m = dso_local local_unnamed_addr global i64 0, align 8 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @va = dso_local local_unnamed_addr global i64 0, align 8 @vb = dso_local local_unnamed_addr global i64 0, align 8 @vc = dso_local local_unnamed_addr global i64 0, align 8 @vd = dso_local local_unnamed_addr global i64 0, align 8 @ve = dso_local local_unnamed_addr global i64 0, align 8 @vf = dso_local local_unnamed_addr global i64 0, align 8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_adj(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: br label %while.body while.body: ; preds = %entry, %if.end %ans.014 = phi i64 [ 1, %entry ], [ %ans.1, %if.end ] %x.013 = phi i64 [ 1000000005, %entry ], [ %div11, %if.end ] %b.addr.012 = phi i64 [ %b, %entry ], [ %rem3, %if.end ] %and = and i64 %x.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %ans.014, %b.addr.012 %rem = urem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i64 [ %rem, %if.then ], [ %ans.014, %while.body ] %mul2 = mul i64 %b.addr.012, %b.addr.012 %rem3 = urem i64 %mul2, 1000000007 %div11 = lshr i64 %x.013, 1 %tobool.not = icmp ult i64 %x.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end %mul4 = mul i64 %ans.1, %a %rem5 = urem i64 %mul4, 1000000007 ret i64 %rem5 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @digits(i64 noundef %x) local_unnamed_addr #2 { entry: %cmp3 = icmp ugt i64 %x, 9 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 1, %entry ] %x.addr.04 = phi i64 [ %div, %while.body ], [ %x, %entry ] %div = udiv i64 %x.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %cmp = icmp ugt i64 %x.addr.04, 99 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 1, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x) local_unnamed_addr #2 { entry: %tobool.not11 = icmp eq i64 %x, 0 br i1 %tobool.not11, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.014 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %x.addr.013 = phi i64 [ %div10, %if.end ], [ %x, %entry ] %a.addr.012 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.014, %a.addr.012 %rem = urem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.014, %while.body ] %div10 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.012, %a.addr.012 %rem3 = urem i64 %mul2, 1000000007 %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @nibutan_target(i64 noundef %target) local_unnamed_addr #4 { entry: %add = add i64 %target, 1 %mul = mul i64 %add, %target %div2 = lshr i64 %mul, 1 %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp = icmp ule i64 %0, %div2 %conv = zext i1 %cmp to i32 ret i32 %conv } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @targetdig(i64 noundef %x, i32 noundef %index) local_unnamed_addr #2 { entry: %cmp3.i = icmp ugt i64 %x, 9 br i1 %cmp3.i, label %while.body.i, label %digits.exit while.body.i: ; preds = %entry, %while.body.i %i.05.i = phi i32 [ %inc.i, %while.body.i ], [ 1, %entry ] %x.addr.04.i = phi i64 [ %div.i, %while.body.i ], [ %x, %entry ] %div.i = udiv i64 %x.addr.04.i, 10 %inc.i = add nuw nsw i32 %i.05.i, 1 %cmp.i = icmp ugt i64 %x.addr.04.i, 99 br i1 %cmp.i, label %while.body.i, label %digits.exit, !llvm.loop !11 digits.exit: ; preds = %while.body.i, %entry %i.0.lcssa.i = phi i32 [ 1, %entry ], [ %inc.i, %while.body.i ] %cmp = icmp slt i32 %i.0.lcssa.i, %index br i1 %cmp, label %cleanup, label %while.cond.preheader while.cond.preheader: ; preds = %digits.exit %cmp17 = icmp sgt i32 %i.0.lcssa.i, %index br i1 %cmp17, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %while.cond.preheader %0 = sub i32 %i.0.lcssa.i, %index %1 = xor i32 %index, -1 %2 = add i32 %i.0.lcssa.i, %1 %xtraiter = and i32 %0, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body.prol.loopexit, label %while.body.prol while.body.prol: ; preds = %while.body.preheader, %while.body.prol %posmax.09.prol = phi i32 [ %dec.prol, %while.body.prol ], [ %i.0.lcssa.i, %while.body.preheader ] %x.addr.08.prol = phi i64 [ %div.prol, %while.body.prol ], [ %x, %while.body.preheader ] %prol.iter = phi i32 [ %prol.iter.next, %while.body.prol ], [ 0, %while.body.preheader ] %dec.prol = add nsw i32 %posmax.09.prol, -1 %div.prol = udiv i64 %x.addr.08.prol, 10 %prol.iter.next = add i32 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %while.body.prol.loopexit, label %while.body.prol, !llvm.loop !13 while.body.prol.loopexit: ; preds = %while.body.prol, %while.body.preheader %posmax.09.unr = phi i32 [ %i.0.lcssa.i, %while.body.preheader ], [ %dec.prol, %while.body.prol ] %x.addr.08.unr = phi i64 [ %x, %while.body.preheader ], [ %div.prol, %while.body.prol ] %div.lcssa.unr = phi i64 [ undef, %while.body.preheader ], [ %div.prol, %while.body.prol ] %3 = icmp ult i32 %2, 3 br i1 %3, label %while.end, label %while.body while.body: ; preds = %while.body.prol.loopexit, %while.body %posmax.09 = phi i32 [ %dec.3, %while.body ], [ %posmax.09.unr, %while.body.prol.loopexit ] %x.addr.08 = phi i64 [ %div.3, %while.body ], [ %x.addr.08.unr, %while.body.prol.loopexit ] %dec.3 = add nsw i32 %posmax.09, -4 %div.3 = udiv i64 %x.addr.08, 10000 %cmp1.3 = icmp sgt i32 %dec.3, %index br i1 %cmp1.3, label %while.body, label %while.end, !llvm.loop !15 while.end: ; preds = %while.body.prol.loopexit, %while.body, %while.cond.preheader %x.addr.0.lcssa = phi i64 [ %x, %while.cond.preheader ], [ %div.lcssa.unr, %while.body.prol.loopexit ], [ %div.3, %while.body ] %rem = urem i64 %x.addr.0.lcssa, 10 %conv = trunc i64 %rem to i32 br label %cleanup cleanup: ; preds = %digits.exit, %while.end %retval.0 = phi i32 [ %conv, %while.end ], [ -1, %digits.exit ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @intcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i32, ptr %left, align 4, !tbaa !16 %1 = load i32, ptr %right, align 4, !tbaa !16 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp sgt i32 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !5 %1 = load i64, ptr %right, align 8, !tbaa !5 %cmp = icmp ult i64 %0, %1 %cmp1 = icmp ugt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !5 %1 = load i64, ptr %right, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @hwAcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i32, ptr %left, align 4, !tbaa !16 %1 = load i32, ptr %right, align 4, !tbaa !16 %cmp.i = icmp slt i32 %0, %1 %cmp1.i = icmp sgt i32 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @hwBcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %b = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1 %b1 = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1 %0 = load i32, ptr %b, align 4, !tbaa !16 %1 = load i32, ptr %b1, align 4, !tbaa !16 %cmp.i = icmp slt i32 %0, %1 %cmp1.i = icmp sgt i32 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @hwABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i32, ptr %left, align 4, !tbaa !16 %1 = load i32, ptr %right, align 4, !tbaa !16 %cmp.i.i = icmp slt i32 %0, %1 %cmp1.i.i = icmp sgt i32 %0, %1 %..i.i = zext i1 %cmp1.i.i to i32 %retval.0.i.i = select i1 %cmp.i.i, i32 -1, i32 %..i.i %tobool.not = icmp eq i32 %retval.0.i.i, 0 br i1 %tobool.not, label %if.end, label %cleanup if.end: ; preds = %entry %b.i = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1 %b1.i = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1 %2 = load i32, ptr %b.i, align 4, !tbaa !16 %3 = load i32, ptr %b1.i, align 4, !tbaa !16 %cmp.i.i5 = icmp slt i32 %2, %3 %cmp1.i.i6 = icmp sgt i32 %2, %3 %..i.i7 = zext i1 %cmp1.i.i6 to i32 %retval.0.i.i8 = select i1 %cmp.i.i5, i32 -1, i32 %..i.i7 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ %retval.0.i.i8, %if.end ], [ %retval.0.i.i, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @hwllAcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !5 %1 = load i64, ptr %right, align 8, !tbaa !5 %cmp.i = icmp slt i64 %0, %1 %cmp1.i = icmp sgt i64 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @hwllBcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %b = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1 %b1 = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1 %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %b1, align 8, !tbaa !5 %cmp.i = icmp slt i64 %0, %1 %cmp1.i = icmp sgt i64 %0, %1 %..i = zext i1 %cmp1.i to i32 %retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i ret i32 %retval.0.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @hwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 { entry: %0 = load i64, ptr %left, align 8, !tbaa !5 %1 = load i64, ptr %right, align 8, !tbaa !5 %cmp.i.i = icmp slt i64 %0, %1 %cmp1.i.i = icmp sgt i64 %0, %1 %..i.i = zext i1 %cmp1.i.i to i32 %retval.0.i.i = select i1 %cmp.i.i, i32 -1, i32 %..i.i %tobool.not = icmp eq i32 %retval.0.i.i, 0 br i1 %tobool.not, label %if.end, label %cleanup if.end: ; preds = %entry %b.i = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1 %b1.i = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1 %2 = load i64, ptr %b.i, align 8, !tbaa !5 %3 = load i64, ptr %b1.i, align 8, !tbaa !5 %cmp.i.i5 = icmp slt i64 %2, %3 %cmp1.i.i6 = icmp sgt i64 %2, %3 %..i.i7 = zext i1 %cmp1.i.i6 to i32 %retval.0.i.i8 = select i1 %cmp.i.i5, i32 -1, i32 %..i.i7 br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ %retval.0.i.i8, %if.end ], [ %retval.0.i.i, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ispalin(i32 noundef %x) local_unnamed_addr #3 { entry: %cmp = icmp eq i32 %x, 0 br i1 %cmp, label %lor.end, label %lor.rhs lor.rhs: ; preds = %entry %0 = tail call i32 @llvm.ctpop.i32(i32 %x), !range !18 %cmp1 = icmp ult i32 %0, 2 %1 = zext i1 %cmp1 to i32 br label %lor.end lor.end: ; preds = %lor.rhs, %entry %lor.ext = phi i32 [ 1, %entry ], [ %1, %lor.rhs ] ret i32 %lor.ext } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @bitlet(i8 noundef signext %c) local_unnamed_addr #6 { entry: %conv = sext i8 %c to i32 %sub = add nsw i32 %conv, -97 %shl = shl nuw nsw i32 1, %sub ret i32 %shl } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #7 { entry: %isactual = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %isactual) #10 %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp163.not = icmp eq i64 %0, 0 br i1 %cmp163.not, label %for.end110, label %for.inc.peel for.inc.peel: ; preds = %entry %.pre = load i64, ptr @a, align 16, !tbaa !5 store i64 %.pre, ptr @dp, align 16, !tbaa !5 store i8 1, ptr %isactual, align 16, !tbaa !19 %exitcond.peel.not = icmp eq i64 %0, 1 br i1 %exitcond.peel.not, label %for.body25.lr.ph, label %lor.lhs.false.preheader lor.lhs.false.preheader: ; preds = %for.inc.peel %1 = add i64 %0, -1 %min.iters.check = icmp ult i64 %0, 3 br i1 %min.iters.check, label %lor.lhs.false.preheader196, label %vector.ph vector.ph: ; preds = %lor.lhs.false.preheader %n.vec = and i64 %1, -2 %ind.end = or i64 %1, 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 %2 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %index %wide.load = load <2 x i64>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %offset.idx %wide.load195 = load <2 x i64>, ptr %3, align 8, !tbaa !5 %4 = icmp ult <2 x i64> %wide.load, %wide.load195 %5 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %offset.idx store <2 x i64> %wide.load195, ptr %5, align 8, !tbaa !5 %6 = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %offset.idx %7 = zext <2 x i1> %4 to <2 x i8> store <2 x i8> %7, ptr %6, align 1, !tbaa !19 %index.next = add nuw i64 %index, 2 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %lor.lhs.false.preheader196 lor.lhs.false.preheader196: ; preds = %lor.lhs.false.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %lor.lhs.false.preheader ], [ %ind.end, %middle.block ] br label %lor.lhs.false lor.lhs.false: ; preds = %lor.lhs.false.preheader196, %lor.lhs.false %indvars.iv = phi i64 [ %indvars.iv.next, %lor.lhs.false ], [ %indvars.iv.ph, %lor.lhs.false.preheader196 ] %9 = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %9 %10 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx5 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv %11 = load i64, ptr %arrayidx5, align 8, !tbaa !5 %cmp6 = icmp ult i64 %10, %11 %arrayidx11 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv store i64 %11, ptr %arrayidx11, align 8, !tbaa !5 %arrayidx13 = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %indvars.iv %. = zext i1 %cmp6 to i8 store i8 %., ptr %arrayidx13, align 1, !tbaa !19 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %0 br i1 %exitcond.not, label %for.end, label %lor.lhs.false, !llvm.loop !25 for.end: ; preds = %lor.lhs.false, %middle.block %12 = trunc i64 %0 to i32 %i.1167 = add i32 %12, -1 %cmp23168 = icmp sgt i32 %i.1167, -1 br i1 %cmp23168, label %for.body25.lr.ph, label %for.cond93.preheader for.body25.lr.ph: ; preds = %for.inc.peel, %for.end %i.1167191 = phi i32 [ %i.1167, %for.end ], [ 0, %for.inc.peel ] %sub27 = add i64 %0, -1 %13 = zext i32 %i.1167191 to i64 %arrayidx37156 = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %sub27 %arrayidx44.phi.trans.insert = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %sub27 %arrayidx65.phi.trans.insert = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %sub27 br label %for.body25 for.cond93.preheader: ; preds = %cleanup, %for.end br i1 %cmp163.not, label %for.end110, label %for.body97.preheader for.body97.preheader: ; preds = %for.cond93.preheader %xtraiter = and i64 %0, 1 %14 = icmp eq i64 %0, 1 br i1 %14, label %for.end110.loopexit.unr-lcssa, label %for.body97.preheader.new for.body97.preheader.new: ; preds = %for.body97.preheader %unroll_iter = and i64 %0, -2 br label %for.body97 for.body25: ; preds = %for.body25.lr.ph, %cleanup %indvars.iv179 = phi i64 [ %13, %for.body25.lr.ph ], [ %indvars.iv.next180, %cleanup ] %i.1.in169 = phi i64 [ %0, %for.body25.lr.ph ], [ %indvars.iv179, %cleanup ] %cmp28 = icmp eq i64 %sub27, %indvars.iv179 br i1 %cmp28, label %lor.end.thread, label %lor.end lor.end: ; preds = %for.body25 %arrayidx31 = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %indvars.iv179 %15 = load i64, ptr %arrayidx31, align 8, !tbaa !5 %sext = shl i64 %i.1.in169, 32 %idxprom32 = ashr exact i64 %sext, 32 %arrayidx33 = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %idxprom32 %16 = load i64, ptr %arrayidx33, align 8, !tbaa !5 %cmp34 = icmp ugt i64 %15, %16 %arrayidx37 = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %indvars.iv179 %17 = load i8, ptr %arrayidx37, align 1, !tbaa !19, !range !26, !noundef !27 %tobool.not = icmp eq i8 %17, 0 br i1 %tobool.not, label %if.else59, label %if.then38 lor.end.thread: ; preds = %for.body25 %18 = load i8, ptr %arrayidx37156, align 1, !tbaa !19, !range !26, !noundef !27 %tobool.not157 = icmp eq i8 %18, 0 br i1 %tobool.not157, label %lor.end.thread.if.then61_crit_edge, label %lor.end.thread.if.then40_crit_edge lor.end.thread.if.then61_crit_edge: ; preds = %lor.end.thread %.pre188 = load i64, ptr %arrayidx65.phi.trans.insert, align 8, !tbaa !5 br label %if.then61 lor.end.thread.if.then40_crit_edge: ; preds = %lor.end.thread %.pre187 = load i64, ptr %arrayidx44.phi.trans.insert, align 8, !tbaa !5 br label %if.then40 if.then38: ; preds = %lor.end br i1 %cmp34, label %if.then40, label %if.else49 if.then40: ; preds = %lor.end.thread.if.then40_crit_edge, %if.then38 %19 = phi i64 [ %.pre187, %lor.end.thread.if.then40_crit_edge ], [ %15, %if.then38 ] %arrayidx42 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv179 %20 = load i64, ptr %arrayidx42, align 8, !tbaa !5 %cmp45.not = icmp eq i64 %20, %19 br i1 %cmp45.not, label %cleanup, label %fail if.else49: ; preds = %if.then38 %arrayidx51 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv179 %21 = load i64, ptr %arrayidx51, align 8, !tbaa !5 %cmp54 = icmp ugt i64 %21, %15 br i1 %cmp54, label %fail, label %cleanup if.else59: ; preds = %lor.end br i1 %cmp34, label %if.then61, label %if.else76 if.then61: ; preds = %lor.end.thread.if.then61_crit_edge, %if.else59 %22 = phi i64 [ %15, %if.else59 ], [ %.pre188, %lor.end.thread.if.then61_crit_edge ] %arrayidx37158160 = phi ptr [ %arrayidx37, %if.else59 ], [ %arrayidx37156, %lor.end.thread.if.then61_crit_edge ] %arrayidx63 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv179 %23 = load i64, ptr %arrayidx63, align 8, !tbaa !5 %cmp66 = icmp ult i64 %23, %22 br i1 %cmp66, label %fail, label %if.end69 if.end69: ; preds = %if.then61 store i64 %22, ptr %arrayidx63, align 8, !tbaa !5 store i8 1, ptr %arrayidx37158160, align 1, !tbaa !19 br label %cleanup if.else76: ; preds = %if.else59 %arrayidx78 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv179 %24 = load i64, ptr %arrayidx78, align 8, !tbaa !5 %cmp81 = icmp ugt i64 %24, %15 br i1 %cmp81, label %if.then83, label %cleanup if.then83: ; preds = %if.else76 store i64 %15, ptr %arrayidx78, align 8, !tbaa !5 br label %cleanup cleanup: ; preds = %if.else49, %if.then40, %if.else76, %if.then83, %if.end69 %indvars.iv.next180 = add nsw i64 %indvars.iv179, -1 %cmp23 = icmp sgt i64 %indvars.iv179, 0 br i1 %cmp23, label %for.body25, label %for.cond93.preheader, !llvm.loop !28 for.body97: ; preds = %for.inc108.1, %for.body97.preheader.new %indvars.iv182 = phi i64 [ 0, %for.body97.preheader.new ], [ %indvars.iv.next183.1, %for.inc108.1 ] %result.0173 = phi i64 [ 1, %for.body97.preheader.new ], [ %result.1.1, %for.inc108.1 ] %niter = phi i64 [ 0, %for.body97.preheader.new ], [ %niter.next.1, %for.inc108.1 ] %arrayidx99 = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %indvars.iv182 %25 = load i8, ptr %arrayidx99, align 2, !tbaa !19, !range !26, !noundef !27 %cmp102 = icmp eq i8 %25, 0 br i1 %cmp102, label %if.then104, label %for.inc108 if.then104: ; preds = %for.body97 %arrayidx106 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv182 %26 = load i64, ptr %arrayidx106, align 16, !tbaa !5 %mul = mul i64 %26, %result.0173 %rem = urem i64 %mul, 1000000007 br label %for.inc108 for.inc108: ; preds = %for.body97, %if.then104 %result.1 = phi i64 [ %rem, %if.then104 ], [ %result.0173, %for.body97 ] %indvars.iv.next183 = or i64 %indvars.iv182, 1 %arrayidx99.1 = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %indvars.iv.next183 %27 = load i8, ptr %arrayidx99.1, align 1, !tbaa !19, !range !26, !noundef !27 %cmp102.1 = icmp eq i8 %27, 0 br i1 %cmp102.1, label %if.then104.1, label %for.inc108.1 if.then104.1: ; preds = %for.inc108 %arrayidx106.1 = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv.next183 %28 = load i64, ptr %arrayidx106.1, align 8, !tbaa !5 %mul.1 = mul i64 %28, %result.1 %rem.1 = urem i64 %mul.1, 1000000007 br label %for.inc108.1 for.inc108.1: ; preds = %if.then104.1, %for.inc108 %result.1.1 = phi i64 [ %rem.1, %if.then104.1 ], [ %result.1, %for.inc108 ] %indvars.iv.next183.1 = add nuw nsw i64 %indvars.iv182, 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.end110.loopexit.unr-lcssa, label %for.body97, !llvm.loop !29 for.end110.loopexit.unr-lcssa: ; preds = %for.inc108.1, %for.body97.preheader %result.1.lcssa.ph = phi i64 [ undef, %for.body97.preheader ], [ %result.1.1, %for.inc108.1 ] %indvars.iv182.unr = phi i64 [ 0, %for.body97.preheader ], [ %indvars.iv.next183.1, %for.inc108.1 ] %result.0173.unr = phi i64 [ 1, %for.body97.preheader ], [ %result.1.1, %for.inc108.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end110, label %for.body97.epil for.body97.epil: ; preds = %for.end110.loopexit.unr-lcssa %arrayidx99.epil = getelementptr inbounds [100000 x i8], ptr %isactual, i64 0, i64 %indvars.iv182.unr %29 = load i8, ptr %arrayidx99.epil, align 1, !tbaa !19, !range !26, !noundef !27 %cmp102.epil = icmp eq i8 %29, 0 br i1 %cmp102.epil, label %if.then104.epil, label %for.end110 if.then104.epil: ; preds = %for.body97.epil %arrayidx106.epil = getelementptr inbounds [100000 x i64], ptr @dp, i64 0, i64 %indvars.iv182.unr %30 = load i64, ptr %arrayidx106.epil, align 8, !tbaa !5 %mul.epil = mul i64 %30, %result.0173.unr %rem.epil = urem i64 %mul.epil, 1000000007 br label %for.end110 for.end110: ; preds = %for.end110.loopexit.unr-lcssa, %if.then104.epil, %for.body97.epil, %entry, %for.cond93.preheader %result.0.lcssa = phi i64 [ 1, %for.cond93.preheader ], [ 1, %entry ], [ %result.1.lcssa.ph, %for.end110.loopexit.unr-lcssa ], [ %rem.epil, %if.then104.epil ], [ %result.0173.unr, %for.body97.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %result.0.lcssa) br label %cleanup112 fail: ; preds = %if.then40, %if.else49, %if.then61 %call111 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %cleanup112 cleanup112: ; preds = %fail, %for.end110 %retval.0 = phi i64 [ 1, %fail ], [ 0, %for.end110 ] call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %isactual) #10 ret i64 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n) %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp20.not = icmp eq i64 %0, 0 br i1 %cmp20.not, label %for.end13, label %for.body for.cond3.preheader: ; preds = %for.body %1 = icmp eq i64 %2, 0 br i1 %1, label %for.end13, label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %2 = load i64, ptr @n, align 8, !tbaa !5 %cmp = icmp ugt i64 %2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !30 for.body7: ; preds = %for.cond3.preheader, %for.body7 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ 0, %for.cond3.preheader ] %arrayidx9 = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %indvars.iv27 %call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx9) %indvars.iv.next28 = add nuw i64 %indvars.iv27, 1 %3 = load i64, ptr @n, align 8, !tbaa !5 %cmp5 = icmp ugt i64 %3, %indvars.iv.next28 br i1 %cmp5, label %for.body7, label %for.end13, !llvm.loop !31 for.end13: ; preds = %for.body7, %entry, %for.cond3.preheader %call14 = tail call i64 @solve() ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.ctpop.i32(i32) #9 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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 #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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree 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 #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !10} !16 = !{!17, !17, i64 0} !17 = !{!"int", !7, i64 0} !18 = !{i32 0, i32 33} !19 = !{!20, !20, i64 0} !20 = !{!"_Bool", !7, i64 0} !21 = distinct !{!21, !10, !22, !23, !24} !22 = !{!"llvm.loop.peeled.count", i32 1} !23 = !{!"llvm.loop.isvectorized", i32 1} !24 = !{!"llvm.loop.unroll.runtime.disable"} !25 = distinct !{!25, !10, !22, !24, !23} !26 = !{i8 0, i8 2} !27 = !{} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = distinct !{!31, !10}
#include <stdlib.h> #include <stdio.h> int cmp(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main(void) { int N, K; scanf("%d %d", &N, &K); int XY[N][2]; int Xs[N], Ys[N]; for (int i = 0; i < N; ++i) { scanf("%d %d", &XY[i][0], &XY[i][1]); Xs[i] = XY[i][0]; Ys[i] = XY[i][1]; } qsort(Xs, N, sizeof(int), cmp); qsort(Ys, N, sizeof(int), cmp); unsigned long long ans = -1; for (int l = 0; l < N-1; ++l) { for (int r = l + 1; r < N; ++r) { for (int d = 0; d < N-1; ++d) { for (int u = d + 1; u < N; ++u) { int ll = Xs[l], rr = Xs[r]; int dd = Ys[d], uu = Ys[u]; unsigned long long area = (unsigned long long)(rr - ll) * (uu - dd); // printf("ll:%d, rr:%d, dd:%d, uu:%d, area:%llu\n", ll, rr, dd, uu, area); if (area >= ans) continue; int sum = 0; for (int i = 0; i < N; ++i) { int x = XY[i][0]; int y = XY[i][1]; if (ll <= x && x <= rr && dd <= y && y <= uu) ++sum; if (sum >= K) { ans = area; break; } } } } } } printf("%llu\n", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142433/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142433/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%llu\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %K = 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 %K) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca [2 x i32], i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %vla2 = alloca i32, i64 %4, align 16 %cmp146 = icmp sgt i32 %3, 0 br i1 %cmp146, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %3 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %18, %for.body ] call void @qsort(ptr noundef nonnull %vla1, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #6 %5 = load i32, ptr %N, align 4, !tbaa !5 %conv18 = sext i32 %5 to i64 call void @qsort(ptr noundef nonnull %vla2, i64 noundef %conv18, i64 noundef 4, ptr noundef nonnull @cmp) #6 %6 = load i32, ptr %N, align 4, !tbaa !5 %cmp20180 = icmp sgt i32 %6, 1 br i1 %cmp20180, label %for.body23.us.us.preheader, label %for.cond.cleanup22 for.body23.us.us.preheader: ; preds = %for.cond.cleanup %sub = add i32 %6, -1 %7 = load i32, ptr %K, align 4 %8 = zext i32 %6 to i64 %wide.trip.count222 = zext i32 %sub to i64 %wide.trip.count217 = zext i32 %6 to i64 br label %for.body23.us.us for.body23.us.us: ; preds = %for.body23.us.us.preheader, %for.cond19.loopexit.us.us %indvars.iv219 = phi i64 [ 0, %for.body23.us.us.preheader ], [ %indvars.iv.next220, %for.cond19.loopexit.us.us ] %indvars.iv212 = phi i64 [ 1, %for.body23.us.us.preheader ], [ %indvars.iv.next213, %for.cond19.loopexit.us.us ] %ans.0182.us.us = phi i64 [ -1, %for.body23.us.us.preheader ], [ %ans.1.lcssa.us.us, %for.cond19.loopexit.us.us ] %indvars.iv.next220 = add nuw nsw i64 %indvars.iv219, 1 %cmp25162.us.us = icmp ult i64 %indvars.iv.next220, %8 br i1 %cmp25162.us.us, label %for.cond29.preheader.lr.ph.us.us, label %for.cond19.loopexit.us.us for.cond19.loopexit.us.us: ; preds = %for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us, %for.body23.us.us %ans.1.lcssa.us.us = phi i64 [ %ans.0182.us.us, %for.body23.us.us ], [ %ans.3.lcssa.us.us.us.us.us, %for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us ] %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1 %exitcond223.not = icmp eq i64 %indvars.iv.next220, %wide.trip.count222 br i1 %exitcond223.not, label %for.cond.cleanup22, label %for.body23.us.us, !llvm.loop !9 for.cond29.preheader.lr.ph.us.us: ; preds = %for.body23.us.us %arrayidx42.us.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv219 br label %for.cond29.preheader.us.us.us.us for.cond29.preheader.us.us.us.us: ; preds = %for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us, %for.cond29.preheader.lr.ph.us.us %indvars.iv214 = phi i64 [ %indvars.iv.next215, %for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us ], [ %indvars.iv212, %for.cond29.preheader.lr.ph.us.us ] %ans.1164.us.us.us.us = phi i64 [ %ans.3.lcssa.us.us.us.us.us, %for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us ], [ %ans.0182.us.us, %for.cond29.preheader.lr.ph.us.us ] %arrayidx44.us.us.us.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv214 br label %for.body34.us.us.us.us.us for.body34.us.us.us.us.us: ; preds = %for.cond29.loopexit.us.us.us.us.us, %for.cond29.preheader.us.us.us.us %indvars.iv207 = phi i64 [ %indvars.iv.next208, %for.cond29.loopexit.us.us.us.us.us ], [ 0, %for.cond29.preheader.us.us.us.us ] %indvars.iv200 = phi i64 [ %indvars.iv.next201, %for.cond29.loopexit.us.us.us.us.us ], [ 1, %for.cond29.preheader.us.us.us.us ] %ans.2159.us.us.us.us.us = phi i64 [ %ans.3.lcssa.us.us.us.us.us, %for.cond29.loopexit.us.us.us.us.us ], [ %ans.1164.us.us.us.us, %for.cond29.preheader.us.us.us.us ] %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1 %cmp37153.us.us.us.us.us = icmp ult i64 %indvars.iv.next208, %8 br i1 %cmp37153.us.us.us.us.us, label %for.body40.lr.ph.us.us.us.us.us, label %for.cond29.loopexit.us.us.us.us.us for.cond29.loopexit.us.us.us.us.us: ; preds = %cleanup89.us.us.us.us.us.us, %for.body34.us.us.us.us.us %ans.3.lcssa.us.us.us.us.us = phi i64 [ %ans.2159.us.us.us.us.us, %for.body34.us.us.us.us.us ], [ %ans.7.us.us.us.us.us.us, %cleanup89.us.us.us.us.us.us ] %indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1 %exitcond211.not = icmp eq i64 %indvars.iv.next208, %wide.trip.count222 br i1 %exitcond211.not, label %for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us, label %for.body34.us.us.us.us.us, !llvm.loop !11 for.body40.lr.ph.us.us.us.us.us: ; preds = %for.body34.us.us.us.us.us %9 = load i32, ptr %arrayidx42.us.us, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx44.us.us.us.us, align 4, !tbaa !5 %arrayidx46.us.us.us.us.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv207 %11 = load i32, ptr %arrayidx46.us.us.us.us.us, align 4, !tbaa !5 %sub49.us.us.us.us.us = sub nsw i32 %10, %9 %conv50.us.us.us.us.us = sext i32 %sub49.us.us.us.us.us to i64 br label %for.body40.us.us.us.us.us.us for.body40.us.us.us.us.us.us: ; preds = %cleanup89.us.us.us.us.us.us, %for.body40.lr.ph.us.us.us.us.us %indvars.iv202 = phi i64 [ %indvars.iv.next203, %cleanup89.us.us.us.us.us.us ], [ %indvars.iv200, %for.body40.lr.ph.us.us.us.us.us ] %ans.3155.us.us.us.us.us.us = phi i64 [ %ans.7.us.us.us.us.us.us, %cleanup89.us.us.us.us.us.us ], [ %ans.2159.us.us.us.us.us, %for.body40.lr.ph.us.us.us.us.us ] %arrayidx48.us.us.us.us.us.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv202 %12 = load i32, ptr %arrayidx48.us.us.us.us.us.us, align 4, !tbaa !5 %sub51.us.us.us.us.us.us = sub nsw i32 %12, %11 %conv52.us.us.us.us.us.us = sext i32 %sub51.us.us.us.us.us.us to i64 %mul.us.us.us.us.us.us = mul nsw i64 %conv52.us.us.us.us.us.us, %conv50.us.us.us.us.us %cmp53.not.us.us.us.us.us.us = icmp ult i64 %mul.us.us.us.us.us.us, %ans.3155.us.us.us.us.us.us br i1 %cmp53.not.us.us.us.us.us.us, label %for.body60.us.us.us.us.us.us, label %cleanup89.us.us.us.us.us.us for.cond56.us.us.us.us.us.us: ; preds = %for.body60.us.us.us.us.us.us %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1 %exitcond.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count217 br i1 %exitcond.not, label %cleanup89.us.us.us.us.us.us, label %for.body60.us.us.us.us.us.us, !llvm.loop !12 for.body60.us.us.us.us.us.us: ; preds = %for.body40.us.us.us.us.us.us, %for.cond56.us.us.us.us.us.us %indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.cond56.us.us.us.us.us.us ], [ 0, %for.body40.us.us.us.us.us.us ] %sum.0149.us.us.us.us.us.us = phi i32 [ %sum.1.us.us.us.us.us.us, %for.cond56.us.us.us.us.us.us ], [ 0, %for.body40.us.us.us.us.us.us ] %arrayidx62.us.us.us.us.us.us = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv197 %13 = load i32, ptr %arrayidx62.us.us.us.us.us.us, align 8, !tbaa !5 %arrayidx66.us.us.us.us.us.us = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv197, i64 1 %14 = load i32, ptr %arrayidx66.us.us.us.us.us.us, align 4, !tbaa !5 %cmp67.not.us.us.us.us.us.us = icmp sle i32 %9, %13 %cmp69.not.us.us.us.us.us.us = icmp sle i32 %13, %10 %or.cond.not.us.us.us.us.us.us = and i1 %cmp67.not.us.us.us.us.us.us, %cmp69.not.us.us.us.us.us.us %cmp72.not.us.us.us.us.us.us = icmp sle i32 %11, %14 %or.cond144.us.us.us.us.us.us = select i1 %or.cond.not.us.us.us.us.us.us, i1 %cmp72.not.us.us.us.us.us.us, i1 false %cmp75.not.us.us.us.us.us.us = icmp sle i32 %14, %12 %or.cond145.us.us.us.us.us.us = select i1 %or.cond144.us.us.us.us.us.us, i1 %cmp75.not.us.us.us.us.us.us, i1 false %inc78.us.us.us.us.us.us = zext i1 %or.cond145.us.us.us.us.us.us to i32 %sum.1.us.us.us.us.us.us = add nuw nsw i32 %sum.0149.us.us.us.us.us.us, %inc78.us.us.us.us.us.us %cmp80.not.us.us.us.us.us.us = icmp slt i32 %sum.1.us.us.us.us.us.us, %7 br i1 %cmp80.not.us.us.us.us.us.us, label %for.cond56.us.us.us.us.us.us, label %cleanup89.us.us.us.us.us.us cleanup89.us.us.us.us.us.us: ; preds = %for.body60.us.us.us.us.us.us, %for.cond56.us.us.us.us.us.us, %for.body40.us.us.us.us.us.us %ans.7.us.us.us.us.us.us = phi i64 [ %ans.3155.us.us.us.us.us.us, %for.body40.us.us.us.us.us.us ], [ %ans.3155.us.us.us.us.us.us, %for.cond56.us.us.us.us.us.us ], [ %mul.us.us.us.us.us.us, %for.body60.us.us.us.us.us.us ] %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1 %exitcond206.not = icmp eq i64 %indvars.iv.next203, %wide.trip.count217 br i1 %exitcond206.not, label %for.cond29.loopexit.us.us.us.us.us, label %for.body40.us.us.us.us.us.us, !llvm.loop !13 for.cond29.for.cond.cleanup33_crit_edge.split.us.us.us.us.us: ; preds = %for.cond29.loopexit.us.us.us.us.us %indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1 %exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count217 br i1 %exitcond218.not, label %for.cond19.loopexit.us.us, label %for.cond29.preheader.us.us.us.us, !llvm.loop !14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv %arrayidx6 = getelementptr inbounds [2 x i32], ptr %vla, i64 %indvars.iv, i64 1 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx6) %15 = load i32, ptr %arrayidx, align 8, !tbaa !5 %arrayidx12 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv store i32 %15, ptr %arrayidx12, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %arrayidx17 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv store i32 %16, ptr %arrayidx17, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %17 = load i32, ptr %N, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp = icmp slt i64 %indvars.iv.next, %18 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15 for.cond.cleanup22: ; preds = %for.cond19.loopexit.us.us, %for.cond.cleanup %ans.0.lcssa = phi i64 [ -1, %for.cond.cleanup ], [ %ans.1.lcssa.us.us, %for.cond19.loopexit.us.us ] %call112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> int main(){ int n,m,i,a,b,c,d=1,s; char w; scanf("%d",&n); while(n--){ scanf("%d\n",&m); s=3*m+2; d=1; for(i=0;i<4*m;i++){ scanf("%c",&w); if(w=='N')a=1; else a=0; if (i==0)b=a; else if(i==2*m-1)c=a; else if(i==2*m){//printf("\n"); if(a){ s--; if(b)s--; } } else if(i==4*m-1){ if(a){ s--; if(c)s--; } } else{ d*=a; if(i%2==0){ if(d)s--; d=1; } }//printf("%c",w); } printf("%d\n",s); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142505/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142505/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @.str.2 = private unnamed_addr constant [3 x i8] c"%c\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 %w = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %w) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %dec85 = add nsw i32 %0, -1 store i32 %dec85, ptr %n, align 4, !tbaa !5 %tobool.not86 = icmp eq i32 %0, 0 br i1 %tobool.not86, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %c.088 = phi i32 [ %c.1.lcssa, %for.end ], [ undef, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m) %1 = load i32, ptr %m, align 4, !tbaa !5 %mul = mul nsw i32 %1, 3 %add = add nsw i32 %mul, 2 %cmp77 = icmp sgt i32 %1, 0 br i1 %cmp77, label %for.inc.peel, label %for.end for.inc.peel: ; preds = %while.body %call3.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %w) %.pre = load i32, ptr %m, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %.pre, 0 br i1 %cmp.peel, label %if.else9.preheader, label %for.end if.else9.preheader: ; preds = %for.inc.peel %2 = load i8, ptr %w, align 1, !tbaa !9 %cmp4.not.not.peel = icmp eq i8 %2, 78 %..peel = zext i1 %cmp4.not.not.peel to i32 br label %if.else9 if.else9: ; preds = %if.else9.preheader, %for.inc %s.082 = phi i32 [ %s.2, %for.inc ], [ %add, %if.else9.preheader ] %d.081 = phi i32 [ %d.1, %for.inc ], [ 1, %if.else9.preheader ] %c.180 = phi i32 [ %c.2, %for.inc ], [ %c.088, %if.else9.preheader ] %b.179 = phi i32 [ %b.2, %for.inc ], [ %..peel, %if.else9.preheader ] %i.078 = phi i32 [ %inc, %for.inc ], [ 1, %if.else9.preheader ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %w) %3 = load i8, ptr %w, align 1, !tbaa !9 %cmp4.not.not = icmp eq i8 %3, 78 %. = zext i1 %cmp4.not.not to i32 %4 = load i32, ptr %m, align 4, !tbaa !5 %mul10 = shl nsw i32 %4, 1 %sub = add nsw i32 %mul10, -1 %cmp11 = icmp eq i32 %i.078, %sub br i1 %cmp11, label %for.inc, label %if.else14 if.else14: ; preds = %if.else9 %cmp16 = icmp eq i32 %i.078, %mul10 br i1 %cmp16, label %if.then18, label %if.else27 if.then18: ; preds = %if.else14 br i1 %cmp4.not.not, label %if.then20, label %for.inc if.then20: ; preds = %if.then18 %tobool22.not = icmp ne i32 %b.179, 0 %spec.select = zext i1 %tobool22.not to i32 %spec.select72.v = select i1 %tobool22.not, i32 -2, i32 -1 %spec.select72 = add nsw i32 %s.082, %spec.select72.v br label %for.inc if.else27: ; preds = %if.else14 %mul28 = shl nsw i32 %4, 2 %sub29 = add nsw i32 %mul28, -1 %cmp30 = icmp eq i32 %i.078, %sub29 br i1 %cmp30, label %if.then32, label %if.else41 if.then32: ; preds = %if.else27 br i1 %cmp4.not.not, label %if.then34, label %for.inc if.then34: ; preds = %if.then32 %tobool36.not = icmp eq i32 %c.180, 0 %spec.select74.v = select i1 %tobool36.not, i32 -1, i32 -2 %spec.select74 = add nsw i32 %s.082, %spec.select74.v br label %for.inc if.else41: ; preds = %if.else27 %mul42 = select i1 %cmp4.not.not, i32 %d.081, i32 0 %rem = and i32 %i.078, 1 %cmp43 = icmp eq i32 %rem, 0 br i1 %cmp43, label %if.then45, label %for.inc if.then45: ; preds = %if.else41 %tobool46.not = icmp ne i32 %mul42, 0 %dec48 = sext i1 %tobool46.not to i32 %spec.select75 = add nsw i32 %s.082, %dec48 br label %for.inc for.inc: ; preds = %if.then34, %if.then20, %if.else9, %if.then18, %if.else41, %if.then45, %if.then32 %b.2 = phi i32 [ %b.179, %if.then18 ], [ %b.179, %if.then32 ], [ %b.179, %if.then45 ], [ %b.179, %if.else41 ], [ %b.179, %if.else9 ], [ %spec.select, %if.then20 ], [ %b.179, %if.then34 ] %c.2 = phi i32 [ %c.180, %if.then18 ], [ %c.180, %if.then32 ], [ %c.180, %if.then45 ], [ %c.180, %if.else41 ], [ %., %if.else9 ], [ %c.180, %if.then20 ], [ %c.180, %if.then34 ] %d.1 = phi i32 [ %d.081, %if.then18 ], [ %d.081, %if.then32 ], [ 1, %if.then45 ], [ %mul42, %if.else41 ], [ %d.081, %if.else9 ], [ %d.081, %if.then20 ], [ %d.081, %if.then34 ] %s.2 = phi i32 [ %s.082, %if.then18 ], [ %s.082, %if.then32 ], [ %spec.select75, %if.then45 ], [ %s.082, %if.else41 ], [ %s.082, %if.else9 ], [ %spec.select72, %if.then20 ], [ %spec.select74, %if.then34 ] %inc = add nuw nsw i32 %i.078, 1 %mul2 = shl nsw i32 %4, 2 %cmp = icmp slt i32 %inc, %mul2 br i1 %cmp, label %if.else9, label %for.end, !llvm.loop !10 for.end: ; preds = %for.inc, %for.inc.peel, %while.body %c.1.lcssa = phi i32 [ %c.088, %while.body ], [ %c.088, %for.inc.peel ], [ %c.2, %for.inc ] %s.0.lcssa = phi i32 [ %add, %while.body ], [ %add, %for.inc.peel ], [ %s.2, %for.inc ] %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa) %5 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.peeled.count", i32 1} !13 = distinct !{!13, !11}
#include <stdio.h> int main() { int A1, A2, A3; scanf("%d %d %d", &A1,&A2,&A3); if (A1+A2+A3 >= 22) { printf("bust\n"); } else { printf("win\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142563/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"win\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A1 = alloca i32, align 4 %A2 = alloca i32, align 4 %A3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3) %0 = load i32, ptr %A1, align 4, !tbaa !5 %1 = load i32, ptr %A2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %A3, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a_1,a_2,a_3; int sum; scanf("%d %d %d",&a_1,&a_2,&a_3); sum = a_1+a_2+a_3; if(sum>21){ printf("bust"); } else{ printf("win"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142606/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142606/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a_1 = alloca i32, align 4 %a_2 = alloca i32, align 4 %a_3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a_1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a_2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a_3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a_1, ptr noundef nonnull %a_2, ptr noundef nonnull %a_3) %0 = load i32, ptr %a_1, align 4, !tbaa !5 %1 = load i32, ptr %a_2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %a_3, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a_3) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a_2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a_1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a[3]; int sum; int i; sum=0; scanf("%d %d %d",&a[0],&a[1],&a[2]); for(i=0;i<3;++i){ sum+=a[i]; } if(sum<=21){ printf("win\n"); }else{ printf("bust\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142657/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142657/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"bust\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %add.1 = add nsw i32 %1, %0 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %add.2 = add nsw i32 %2, %add.1 %cmp4 = icmp slt i32 %add.2, 22 %str.3.str = select i1 %cmp4, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int n,ca = 0,cb = 0; scanf("%d",&n); while(n--){ char ch; scanf(" %c",&ch); if(ch == 'A') ca++; else cb++; } if( ca > cb) printf("Anton\n"); else if ( cb > ca) printf("Danik\n"); else printf("Friendship\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14270/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14270/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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" %c\00", align 1 @str = private unnamed_addr constant [11 x i8] c"Friendship\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"Danik\00", align 1 @str.6 = private unnamed_addr constant [6 x i8] c"Anton\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %ch = alloca i8, align 1 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 %dec23 = add nsw i32 %0, -1 store i32 %dec23, ptr %n, align 4, !tbaa !5 %tobool.not24 = icmp eq i32 %0, 0 br i1 %tobool.not24, label %if.else13, label %while.body while.body: ; preds = %entry, %while.body %cb.026 = phi i32 [ %cb.1, %while.body ], [ 0, %entry ] %ca.025 = phi i32 [ %ca.1, %while.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ch) %1 = load i8, ptr %ch, align 1, !tbaa !9 %cmp = icmp eq i8 %1, 65 %inc = zext i1 %cmp to i32 %ca.1 = add nuw nsw i32 %ca.025, %inc %not.cmp = xor i1 %cmp, true %inc3 = zext i1 %not.cmp to i32 %cb.1 = add nuw nsw i32 %cb.026, %inc3 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 %2 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %while.body %cmp4 = icmp ugt i32 %ca.1, %cb.1 br i1 %cmp4, label %if.end16, label %if.else8 if.else8: ; preds = %while.end %cmp9 = icmp ugt i32 %cb.1, %ca.1 br i1 %cmp9, label %if.end16, label %if.else13 if.else13: ; preds = %entry, %if.else8 br label %if.end16 if.end16: ; preds = %if.else8, %while.end, %if.else13 %str.5.sink = phi ptr [ @str, %if.else13 ], [ @str.6, %while.end ], [ @str.5, %if.else8 ] %puts21 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int A1,A2,A3,sum; scanf("%d %d %d",&A1,&A2,&A3); sum=A1+A2+A3; if(sum >= 22) { printf("bust\n") ; } else { printf("win\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142750/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142750/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"win\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A1 = alloca i32, align 4 %A2 = alloca i32, align 4 %A3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3) %0 = load i32, ptr %A1, align 4, !tbaa !5 %1 = load i32, ptr %A2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %A3, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main (void) { int a[3]; scanf("%d%d%d", &a[0], &a[1], &a[2]); if ( a[0]+a[1]+a[2] >= 22 ) printf("bust\n"); else printf("win\n"); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142815/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142815/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"win\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4 %arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %add6 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add6, 21 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a1, a2, a3; scanf("%d %d %d", &a1, &a2, &a3); if (a1 + a2 + a3 >= 22) { printf("bust"); } else { printf("win"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142859/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142859/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a1 = alloca i32, align 4 %a2 = alloca i32, align 4 %a3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a1, ptr noundef nonnull %a2, ptr noundef nonnull %a3) %0 = load i32, ptr %a1, align 4, !tbaa !5 %1 = load i32, ptr %a2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %a3, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a3) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a, b, c, ans; scanf("%d %d %d", &a, &b, &c); ans = a+b+c; if(ans>=22) printf("bust"); else printf("win"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142901/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142901/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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(){ char line[15]; int A1,A2,A3; fgets(line,sizeof(line),stdin); sscanf(line,"%d %d %d",&A1,&A2,&A3); if(A1+A2+A3>=22)printf("bust"); else printf("win"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142945/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142945/source.c" target datalayout = "e-m:e-p270: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 [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %line = alloca [15 x i8], align 1 %A1 = alloca i32, align 4 %A2 = alloca i32, align 4 %A3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %line) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #3 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 15, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3) #3 %1 = load i32, ptr %A1, align 4, !tbaa !9 %2 = load i32, ptr %A2, align 4, !tbaa !9 %add = add nsw i32 %2, %1 %3 = load i32, ptr %A3, align 4, !tbaa !9 %add3 = add nsw i32 %add, %3 %cmp = icmp sgt i32 %add3, 21 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #3 call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %line) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, 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 = !{!"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}
#include<stdio.h> int main(void){ int an=0; int sum=0; for(int i=0;i<3;i++){ scanf("%d",&an); sum+=an; } if(sum>=22) printf("bust"); else printf("win"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142989/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142989/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"bust\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %an = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %an) #3 store i32 0, ptr %an, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %an) %0 = load i32, ptr %an, align 4, !tbaa !5 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %an) %1 = load i32, ptr %an, align 4, !tbaa !5 %add.1 = add nsw i32 %1, %0 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %an) %2 = load i32, ptr %an, align 4, !tbaa !5 %add.2 = add nsw i32 %2, %add.1 %cmp1 = icmp sgt i32 %add.2, 21 %.str.1..str.2 = select i1 %cmp1, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %an) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b,c; scanf("%d %d %d", &a, &b, &c); int soma = a+b+c; if(soma < 22){ printf("win\n"); } else{ printf("bust\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143030/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143030/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"bust\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"win\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp slt i32 %add1, 22 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b,c; scanf("%d %d %d", &a, &b, &c); if(a+b+c >= 22){ printf("bust\n"); } else{ printf("win\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143074/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143074/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"win\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* * main.c * * Created on: 2019/07/21 * Author: family */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { int A1 = 0, A2 = 0, A3 = 0; scanf("%d %d %d", &A1, &A2, &A3); if (22 <= (A1+A2+A3)) { printf("bust\n"); } else { printf("win\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143117/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143117/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"win\00", align 1 @str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A1 = alloca i32, align 4 %A2 = alloca i32, align 4 %A3 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #4 store i32 0, ptr %A1, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #4 store i32 0, ptr %A2, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #4 store i32 0, ptr %A3, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3) %0 = load i32, ptr %A1, align 4, !tbaa !5 %1 = load i32, ptr %A2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %A3, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %cmp = icmp sgt i32 %add1, 21 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> inline static int read_int() { int x = 0, k; while ((k = getchar_unlocked() - '0') >= 0) { x = x * 10 + k; } return x; } inline static void put_int(int x) { int s = 0; char f[4]; while (x) { f[s++] = x % 10; x /= 10; } while (s--) putchar_unlocked(f[s] + '0'); putchar_unlocked('\n'); } int highest[2000], streak[2000]; #pragma GCC optimize ("O3") int main() { int h = read_int(), w = read_int(), max = 0, height, width, lastWall, i, res; short len; for (height = 0; height < h; height++) { lastWall = -1; for (width = 0; width < w; width++) { if (getchar_unlocked() != '.') { if (lastWall != width - 1) { len = width - lastWall - 1; for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len; } res = highest[width] + streak[width]; if (res > max) max = res; highest[width] = streak[width] = 0; lastWall = width; } else streak[width]++; } getchar_unlocked(); if (lastWall != width - 1) { len = width - lastWall - 1; for (i = lastWall + 1; i < width; i++) if (len > highest[i]) highest[i] = len; } } for (width = 0; width < w; width++) { if (streak[width] != 0) { res = highest[width] + streak[width]; if (res > max) max = res; } } put_int(max - 1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143160/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143160/source.c" target datalayout = "e-m:e-p270: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._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } @highest = dso_local local_unnamed_addr global [2000 x i32] zeroinitializer, align 16 @streak = dso_local local_unnamed_addr global [2000 x i32] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %f.i = alloca [4 x i8], align 1 %.pre2.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.body.i, %entry %0 = phi ptr [ %.pre2.i, %entry ], [ %.pre2.i138, %while.body.i ] %x.0.i = phi i32 [ 0, %entry ], [ %add.i, %while.body.i ] %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14 %cmp.not.i.i = icmp ult ptr %1, %2 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %while.cond.i %call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #4 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i cond.false.i.i: ; preds = %while.cond.i %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %getchar_unlocked.exit.i getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i %.pre2.i138 = phi ptr [ %.pre.i, %cond.true.i.i ], [ %0, %cond.false.i.i ] %cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ] %cmp.i = icmp sgt i32 %cond.i.i, 47 br i1 %cmp.i, label %while.body.i, label %while.cond.i139 while.body.i: ; preds = %getchar_unlocked.exit.i %mul.i = mul nsw i32 %x.0.i, 10 %sub.i = add i32 %mul.i, -48 %add.i = add i32 %sub.i, %cond.i.i br label %while.cond.i, !llvm.loop !17 while.cond.i139: ; preds = %getchar_unlocked.exit.i, %while.body.i150 %4 = phi ptr [ %.pre214.pre215, %while.body.i150 ], [ %.pre2.i138, %getchar_unlocked.exit.i ] %x.0.i140 = phi i32 [ %add.i153, %while.body.i150 ], [ 0, %getchar_unlocked.exit.i ] %_IO_read_ptr.i.i141 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i.i141, align 8, !tbaa !9 %_IO_read_end.i.i142 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i.i142, align 8, !tbaa !14 %cmp.not.i.i143 = icmp ult ptr %5, %6 br i1 %cmp.not.i.i143, label %cond.false.i.i154, label %cond.true.i.i144, !prof !15 cond.true.i.i144: ; preds = %while.cond.i139 %call.i.i145 = tail call i32 @__uflow(ptr noundef nonnull %4) #4 %.pre.i146 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i147 cond.false.i.i154: ; preds = %while.cond.i139 %incdec.ptr.i.i155 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i.i155, ptr %_IO_read_ptr.i.i141, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i.i156 = zext i8 %7 to i32 br label %getchar_unlocked.exit.i147 getchar_unlocked.exit.i147: ; preds = %cond.false.i.i154, %cond.true.i.i144 %.pre214.pre215 = phi ptr [ %.pre.i146, %cond.true.i.i144 ], [ %4, %cond.false.i.i154 ] %cond.i.i148 = phi i32 [ %call.i.i145, %cond.true.i.i144 ], [ %conv3.i.i156, %cond.false.i.i154 ] %cmp.i149 = icmp sgt i32 %cond.i.i148, 47 br i1 %cmp.i149, label %while.body.i150, label %for.cond.preheader for.cond.preheader: ; preds = %getchar_unlocked.exit.i147 %cmp188 = icmp sgt i32 %x.0.i, 0 br i1 %cmp188, label %for.cond2.preheader.lr.ph, label %for.cond73.preheader for.cond2.preheader.lr.ph: ; preds = %for.cond.preheader %cmp3179 = icmp sgt i32 %x.0.i140, 0 %wide.trip.count = zext i32 %x.0.i140 to i64 %smax = tail call i32 @llvm.smax.i32(i32 %x.0.i140, i32 0) %8 = add nsw i32 %smax, -2 br label %for.cond2.preheader while.body.i150: ; preds = %getchar_unlocked.exit.i147 %mul.i151 = mul nsw i32 %x.0.i140, 10 %sub.i152 = add i32 %mul.i151, -48 %add.i153 = add i32 %sub.i152, %cond.i.i148 br label %while.cond.i139, !llvm.loop !17 for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.inc70 %.pre214 = phi ptr [ %.pre214.pre215, %for.cond2.preheader.lr.ph ], [ %.pre214216, %for.inc70 ] %height.0190 = phi i32 [ 0, %for.cond2.preheader.lr.ph ], [ %inc71, %for.inc70 ] %max.0189 = phi i32 [ 0, %for.cond2.preheader.lr.ph ], [ %max.1.lcssa, %for.inc70 ] br i1 %cmp3179, label %for.body4, label %for.end42 for.cond73.preheader: ; preds = %for.inc70, %for.cond.preheader %max.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %max.1.lcssa, %for.inc70 ] %cmp74192 = icmp sgt i32 %x.0.i140, 0 br i1 %cmp74192, label %for.body76.preheader, label %for.end94 for.body76.preheader: ; preds = %for.cond73.preheader %wide.trip.count211 = zext i32 %x.0.i140 to i64 %xtraiter = and i64 %wide.trip.count211, 1 %9 = icmp eq i32 %x.0.i140, 1 br i1 %9, label %for.end94.loopexit.unr-lcssa, label %for.body76.preheader.new for.body76.preheader.new: ; preds = %for.body76.preheader %unroll_iter = and i64 %wide.trip.count211, 4294967294 br label %for.body76 for.body4: ; preds = %for.cond2.preheader, %for.inc40 %.pre214219 = phi ptr [ %.pre214218, %for.inc40 ], [ %.pre214, %for.cond2.preheader ] %10 = phi ptr [ %15, %for.inc40 ], [ %.pre214, %for.cond2.preheader ] %indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.inc40 ], [ 0, %for.cond2.preheader ] %lastWall.0182 = phi i32 [ %lastWall.1, %for.inc40 ], [ -1, %for.cond2.preheader ] %max.1180 = phi i32 [ %max.3, %for.inc40 ], [ %max.0189, %for.cond2.preheader ] %11 = add nuw i64 %indvars.iv197, 1 %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 1 %12 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 2 %13 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %12, %13 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %for.body4 %call.i = tail call i32 @__uflow(ptr noundef nonnull %10) #4 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit cond.false.i: ; preds = %for.body4 %incdec.ptr.i = getelementptr inbounds i8, ptr %12, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9 %14 = load i8, ptr %12, align 1, !tbaa !16 %conv3.i = zext i8 %14 to i32 br label %getchar_unlocked.exit getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %.pre214218 = phi ptr [ %.pre, %cond.true.i ], [ %.pre214219, %cond.false.i ] %15 = phi ptr [ %.pre, %cond.true.i ], [ %10, %cond.false.i ] %cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ] %cmp6.not = icmp eq i32 %cond.i, 46 br i1 %cmp6.not, label %if.else, label %if.then if.then: ; preds = %getchar_unlocked.exit %16 = trunc i64 %indvars.iv197 to i32 %17 = add i32 %16, -1 %cmp7.not = icmp eq i32 %lastWall.0182, %17 br i1 %cmp7.not, label %if.end22, label %if.then8 if.then8: ; preds = %if.then %i.0176 = add nsw i32 %lastWall.0182, 1 %18 = sext i32 %i.0176 to i64 %cmp12177 = icmp sgt i64 %indvars.iv197, %18 br i1 %cmp12177, label %for.body14.lr.ph, label %if.end22 for.body14.lr.ph: ; preds = %if.then8 %19 = xor i32 %lastWall.0182, -1 %20 = trunc i64 %indvars.iv197 to i32 %sub10 = add i32 %20, %19 %sext136 = shl i32 %sub10, 16 %conv15 = ashr exact i32 %sext136, 16 %21 = add i32 %lastWall.0182, 2 %22 = zext i32 %21 to i64 %23 = sub i64 %11, %22 %min.iters.check238 = icmp ult i64 %23, 12 br i1 %min.iters.check238, label %for.body14.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %for.body14.lr.ph %24 = add i32 %lastWall.0182, 2 %25 = zext i32 %24 to i64 %26 = sub nsw i64 %indvars.iv197, %25 %27 = trunc i64 %26 to i32 %28 = sub i32 -3, %lastWall.0182 %29 = icmp ult i32 %28, %27 %30 = icmp ugt i64 %26, 4294967295 %31 = or i1 %29, %30 br i1 %31, label %for.body14.preheader, label %vector.ph239 vector.ph239: ; preds = %vector.scevcheck %n.vec241 = and i64 %23, -8 %ind.end242 = add i64 %n.vec241, %18 %broadcast.splatinsert250 = insertelement <4 x i32> poison, i32 %conv15, i64 0 %broadcast.splat251 = shufflevector <4 x i32> %broadcast.splatinsert250, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body245 vector.body245: ; preds = %pred.store.continue267, %vector.ph239 %index246 = phi i64 [ 0, %vector.ph239 ], [ %index.next268, %pred.store.continue267 ] %offset.idx247 = add i64 %index246, %18 %32 = add i64 %offset.idx247, 4 %33 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %offset.idx247 %wide.load248 = load <4 x i32>, ptr %33, align 4, !tbaa !19 %34 = getelementptr inbounds i32, ptr %33, i64 4 %wide.load249 = load <4 x i32>, ptr %34, align 4, !tbaa !19 %35 = icmp sgt <4 x i32> %broadcast.splat251, %wide.load248 %36 = icmp sgt <4 x i32> %broadcast.splat251, %wide.load249 %37 = extractelement <4 x i1> %35, i64 0 br i1 %37, label %pred.store.if252, label %pred.store.continue253 pred.store.if252: ; preds = %vector.body245 %38 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %offset.idx247 store i32 %conv15, ptr %38, align 4, !tbaa !19 br label %pred.store.continue253 pred.store.continue253: ; preds = %pred.store.if252, %vector.body245 %39 = extractelement <4 x i1> %35, i64 1 br i1 %39, label %pred.store.if254, label %pred.store.continue255 pred.store.if254: ; preds = %pred.store.continue253 %40 = add i64 %offset.idx247, 1 %41 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %40 store i32 %conv15, ptr %41, align 4, !tbaa !19 br label %pred.store.continue255 pred.store.continue255: ; preds = %pred.store.if254, %pred.store.continue253 %42 = extractelement <4 x i1> %35, i64 2 br i1 %42, label %pred.store.if256, label %pred.store.continue257 pred.store.if256: ; preds = %pred.store.continue255 %43 = add i64 %offset.idx247, 2 %44 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %43 store i32 %conv15, ptr %44, align 4, !tbaa !19 br label %pred.store.continue257 pred.store.continue257: ; preds = %pred.store.if256, %pred.store.continue255 %45 = extractelement <4 x i1> %35, i64 3 br i1 %45, label %pred.store.if258, label %pred.store.continue259 pred.store.if258: ; preds = %pred.store.continue257 %46 = add i64 %offset.idx247, 3 %47 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %46 store i32 %conv15, ptr %47, align 4, !tbaa !19 br label %pred.store.continue259 pred.store.continue259: ; preds = %pred.store.if258, %pred.store.continue257 %48 = extractelement <4 x i1> %36, i64 0 br i1 %48, label %pred.store.if260, label %pred.store.continue261 pred.store.if260: ; preds = %pred.store.continue259 %49 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %32 store i32 %conv15, ptr %49, align 4, !tbaa !19 br label %pred.store.continue261 pred.store.continue261: ; preds = %pred.store.if260, %pred.store.continue259 %50 = extractelement <4 x i1> %36, i64 1 br i1 %50, label %pred.store.if262, label %pred.store.continue263 pred.store.if262: ; preds = %pred.store.continue261 %51 = add i64 %offset.idx247, 5 %52 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %51 store i32 %conv15, ptr %52, align 4, !tbaa !19 br label %pred.store.continue263 pred.store.continue263: ; preds = %pred.store.if262, %pred.store.continue261 %53 = extractelement <4 x i1> %36, i64 2 br i1 %53, label %pred.store.if264, label %pred.store.continue265 pred.store.if264: ; preds = %pred.store.continue263 %54 = add i64 %offset.idx247, 6 %55 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %54 store i32 %conv15, ptr %55, align 4, !tbaa !19 br label %pred.store.continue265 pred.store.continue265: ; preds = %pred.store.if264, %pred.store.continue263 %56 = extractelement <4 x i1> %36, i64 3 br i1 %56, label %pred.store.if266, label %pred.store.continue267 pred.store.if266: ; preds = %pred.store.continue265 %57 = add i64 %offset.idx247, 7 %58 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %57 store i32 %conv15, ptr %58, align 4, !tbaa !19 br label %pred.store.continue267 pred.store.continue267: ; preds = %pred.store.if266, %pred.store.continue265 %index.next268 = add nuw i64 %index246, 8 %59 = icmp eq i64 %index.next268, %n.vec241 br i1 %59, label %middle.block236, label %vector.body245, !llvm.loop !20 middle.block236: ; preds = %pred.store.continue267 %cmp.n244 = icmp eq i64 %23, %n.vec241 br i1 %cmp.n244, label %if.end22, label %for.body14.preheader for.body14.preheader: ; preds = %vector.scevcheck, %for.body14.lr.ph, %middle.block236 %indvars.iv.ph = phi i64 [ %18, %vector.scevcheck ], [ %18, %for.body14.lr.ph ], [ %ind.end242, %middle.block236 ] br label %for.body14 for.body14: ; preds = %for.body14.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body14.preheader ] %arrayidx = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %indvars.iv %60 = load i32, ptr %arrayidx, align 4, !tbaa !19 %cmp16 = icmp sgt i32 %conv15, %60 br i1 %cmp16, label %if.then18, label %for.inc if.then18: ; preds = %for.body14 store i32 %conv15, ptr %arrayidx, align 4, !tbaa !19 br label %for.inc for.inc: ; preds = %for.body14, %if.then18 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %61 = and i64 %indvars.iv.next, 4294967295 %exitcond.not = icmp eq i64 %61, %indvars.iv197 br i1 %exitcond.not, label %if.end22, label %for.body14, !llvm.loop !23 if.end22: ; preds = %for.inc, %middle.block236, %if.then8, %if.then %arrayidx24 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %indvars.iv197 %62 = load i32, ptr %arrayidx24, align 4, !tbaa !19 %arrayidx26 = getelementptr inbounds [2000 x i32], ptr @streak, i64 0, i64 %indvars.iv197 %63 = load i32, ptr %arrayidx26, align 4, !tbaa !19 %add27 = add nsw i32 %63, %62 %spec.select = tail call i32 @llvm.smax.i32(i32 %add27, i32 %max.1180) store i32 0, ptr %arrayidx26, align 4, !tbaa !19 store i32 0, ptr %arrayidx24, align 4, !tbaa !19 %64 = trunc i64 %indvars.iv197 to i32 br label %for.inc40 if.else: ; preds = %getchar_unlocked.exit %arrayidx37 = getelementptr inbounds [2000 x i32], ptr @streak, i64 0, i64 %indvars.iv197 %65 = load i32, ptr %arrayidx37, align 4, !tbaa !19 %inc38 = add nsw i32 %65, 1 store i32 %inc38, ptr %arrayidx37, align 4, !tbaa !19 br label %for.inc40 for.inc40: ; preds = %if.end22, %if.else %max.3 = phi i32 [ %spec.select, %if.end22 ], [ %max.1180, %if.else ] %lastWall.1 = phi i32 [ %64, %if.end22 ], [ %lastWall.0182, %if.else ] %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1 %exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count br i1 %exitcond201.not, label %for.end42, label %for.body4, !llvm.loop !24 for.end42: ; preds = %for.inc40, %for.cond2.preheader %.pre214217 = phi ptr [ %.pre214, %for.cond2.preheader ], [ %.pre214218, %for.inc40 ] %66 = phi ptr [ %.pre214, %for.cond2.preheader ], [ %15, %for.inc40 ] %max.1.lcssa = phi i32 [ %max.0189, %for.cond2.preheader ], [ %max.3, %for.inc40 ] %width.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %x.0.i140, %for.inc40 ] %lastWall.0.lcssa = phi i32 [ -1, %for.cond2.preheader ], [ %lastWall.1, %for.inc40 ] %_IO_read_ptr.i158 = getelementptr inbounds %struct._IO_FILE, ptr %66, i64 0, i32 1 %67 = load ptr, ptr %_IO_read_ptr.i158, align 8, !tbaa !9 %_IO_read_end.i159 = getelementptr inbounds %struct._IO_FILE, ptr %66, i64 0, i32 2 %68 = load ptr, ptr %_IO_read_end.i159, align 8, !tbaa !14 %cmp.not.i160 = icmp ult ptr %67, %68 br i1 %cmp.not.i160, label %cond.false.i164, label %cond.true.i161, !prof !15 cond.true.i161: ; preds = %for.end42 %call.i162 = tail call i32 @__uflow(ptr noundef nonnull %66) #4 %.pre214.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit167 cond.false.i164: ; preds = %for.end42 %incdec.ptr.i165 = getelementptr inbounds i8, ptr %67, i64 1 store ptr %incdec.ptr.i165, ptr %_IO_read_ptr.i158, align 8, !tbaa !9 br label %getchar_unlocked.exit167 getchar_unlocked.exit167: ; preds = %cond.true.i161, %cond.false.i164 %.pre214216 = phi ptr [ %.pre214.pre, %cond.true.i161 ], [ %.pre214217, %cond.false.i164 ] %sub44 = add nsw i32 %width.0.lcssa, -1 %cmp45.not = icmp eq i32 %lastWall.0.lcssa, %sub44 br i1 %cmp45.not, label %for.inc70, label %if.then47 if.then47: ; preds = %getchar_unlocked.exit167 %i.1185 = add nsw i32 %lastWall.0.lcssa, 1 %cmp53186 = icmp slt i32 %i.1185, %width.0.lcssa br i1 %cmp53186, label %for.body55.lr.ph, label %for.inc70 for.body55.lr.ph: ; preds = %if.then47 %69 = xor i32 %lastWall.0.lcssa, -1 %sub49 = add i32 %width.0.lcssa, %69 %sext = shl i32 %sub49, 16 %conv56 = ashr exact i32 %sext, 16 %70 = sext i32 %i.1185 to i64 %71 = sub i32 %8, %lastWall.0.lcssa %72 = zext i32 %71 to i64 %73 = add nuw nsw i64 %72, 1 %min.iters.check = icmp ult i32 %71, 7 br i1 %min.iters.check, label %for.body55.preheader, label %vector.ph vector.ph: ; preds = %for.body55.lr.ph %n.vec = and i64 %73, 8589934584 %ind.end = add nsw i64 %n.vec, %70 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %conv56, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %pred.store.continue235, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue235 ] %offset.idx = add i64 %index, %70 %74 = add i64 %offset.idx, 4 %75 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %75, align 4, !tbaa !19 %76 = getelementptr inbounds i32, ptr %75, i64 4 %wide.load221 = load <4 x i32>, ptr %76, align 4, !tbaa !19 %77 = icmp sgt <4 x i32> %broadcast.splat, %wide.load %78 = icmp sgt <4 x i32> %broadcast.splat, %wide.load221 %79 = extractelement <4 x i1> %77, i64 0 br i1 %79, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %80 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %offset.idx store i32 %conv56, ptr %80, align 4, !tbaa !19 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %81 = extractelement <4 x i1> %77, i64 1 br i1 %81, label %pred.store.if222, label %pred.store.continue223 pred.store.if222: ; preds = %pred.store.continue %82 = add i64 %offset.idx, 1 %83 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %82 store i32 %conv56, ptr %83, align 4, !tbaa !19 br label %pred.store.continue223 pred.store.continue223: ; preds = %pred.store.if222, %pred.store.continue %84 = extractelement <4 x i1> %77, i64 2 br i1 %84, label %pred.store.if224, label %pred.store.continue225 pred.store.if224: ; preds = %pred.store.continue223 %85 = add i64 %offset.idx, 2 %86 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %85 store i32 %conv56, ptr %86, align 4, !tbaa !19 br label %pred.store.continue225 pred.store.continue225: ; preds = %pred.store.if224, %pred.store.continue223 %87 = extractelement <4 x i1> %77, i64 3 br i1 %87, label %pred.store.if226, label %pred.store.continue227 pred.store.if226: ; preds = %pred.store.continue225 %88 = add i64 %offset.idx, 3 %89 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %88 store i32 %conv56, ptr %89, align 4, !tbaa !19 br label %pred.store.continue227 pred.store.continue227: ; preds = %pred.store.if226, %pred.store.continue225 %90 = extractelement <4 x i1> %78, i64 0 br i1 %90, label %pred.store.if228, label %pred.store.continue229 pred.store.if228: ; preds = %pred.store.continue227 %91 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %74 store i32 %conv56, ptr %91, align 4, !tbaa !19 br label %pred.store.continue229 pred.store.continue229: ; preds = %pred.store.if228, %pred.store.continue227 %92 = extractelement <4 x i1> %78, i64 1 br i1 %92, label %pred.store.if230, label %pred.store.continue231 pred.store.if230: ; preds = %pred.store.continue229 %93 = add i64 %offset.idx, 5 %94 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %93 store i32 %conv56, ptr %94, align 4, !tbaa !19 br label %pred.store.continue231 pred.store.continue231: ; preds = %pred.store.if230, %pred.store.continue229 %95 = extractelement <4 x i1> %78, i64 2 br i1 %95, label %pred.store.if232, label %pred.store.continue233 pred.store.if232: ; preds = %pred.store.continue231 %96 = add i64 %offset.idx, 6 %97 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %96 store i32 %conv56, ptr %97, align 4, !tbaa !19 br label %pred.store.continue233 pred.store.continue233: ; preds = %pred.store.if232, %pred.store.continue231 %98 = extractelement <4 x i1> %78, i64 3 br i1 %98, label %pred.store.if234, label %pred.store.continue235 pred.store.if234: ; preds = %pred.store.continue233 %99 = add i64 %offset.idx, 7 %100 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %99 store i32 %conv56, ptr %100, align 4, !tbaa !19 br label %pred.store.continue235 pred.store.continue235: ; preds = %pred.store.if234, %pred.store.continue233 %index.next = add nuw i64 %index, 8 %101 = icmp eq i64 %index.next, %n.vec br i1 %101, label %middle.block, label %vector.body, !llvm.loop !25 middle.block: ; preds = %pred.store.continue235 %cmp.n = icmp eq i64 %73, %n.vec br i1 %cmp.n, label %for.inc70, label %for.body55.preheader for.body55.preheader: ; preds = %for.body55.lr.ph, %middle.block %indvars.iv202.ph = phi i64 [ %70, %for.body55.lr.ph ], [ %ind.end, %middle.block ] br label %for.body55 for.body55: ; preds = %for.body55.preheader, %for.inc66 %indvars.iv202 = phi i64 [ %indvars.iv.next203, %for.inc66 ], [ %indvars.iv202.ph, %for.body55.preheader ] %arrayidx58 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %indvars.iv202 %102 = load i32, ptr %arrayidx58, align 4, !tbaa !19 %cmp59 = icmp sgt i32 %conv56, %102 br i1 %cmp59, label %if.then61, label %for.inc66 if.then61: ; preds = %for.body55 store i32 %conv56, ptr %arrayidx58, align 4, !tbaa !19 br label %for.inc66 for.inc66: ; preds = %for.body55, %if.then61 %indvars.iv.next203 = add nsw i64 %indvars.iv202, 1 %lftr.wideiv205 = trunc i64 %indvars.iv.next203 to i32 %exitcond206.not = icmp eq i32 %width.0.lcssa, %lftr.wideiv205 br i1 %exitcond206.not, label %for.inc70, label %for.body55, !llvm.loop !26 for.inc70: ; preds = %for.inc66, %middle.block, %if.then47, %getchar_unlocked.exit167 %inc71 = add nuw nsw i32 %height.0190, 1 %exitcond207.not = icmp eq i32 %inc71, %x.0.i br i1 %exitcond207.not, label %for.cond73.preheader, label %for.cond2.preheader, !llvm.loop !27 for.body76: ; preds = %for.inc92.1, %for.body76.preheader.new %indvars.iv208 = phi i64 [ 0, %for.body76.preheader.new ], [ %indvars.iv.next209.1, %for.inc92.1 ] %max.4193 = phi i32 [ %max.0.lcssa, %for.body76.preheader.new ], [ %max.5.1, %for.inc92.1 ] %niter = phi i64 [ 0, %for.body76.preheader.new ], [ %niter.next.1, %for.inc92.1 ] %arrayidx78 = getelementptr inbounds [2000 x i32], ptr @streak, i64 0, i64 %indvars.iv208 %103 = load i32, ptr %arrayidx78, align 8, !tbaa !19 %cmp79.not = icmp eq i32 %103, 0 br i1 %cmp79.not, label %for.inc92, label %if.then81 if.then81: ; preds = %for.body76 %arrayidx83 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %indvars.iv208 %104 = load i32, ptr %arrayidx83, align 8, !tbaa !19 %add86 = add nsw i32 %104, %103 %spec.select137 = tail call i32 @llvm.smax.i32(i32 %add86, i32 %max.4193) br label %for.inc92 for.inc92: ; preds = %if.then81, %for.body76 %max.5 = phi i32 [ %max.4193, %for.body76 ], [ %spec.select137, %if.then81 ] %indvars.iv.next209 = or i64 %indvars.iv208, 1 %arrayidx78.1 = getelementptr inbounds [2000 x i32], ptr @streak, i64 0, i64 %indvars.iv.next209 %105 = load i32, ptr %arrayidx78.1, align 4, !tbaa !19 %cmp79.not.1 = icmp eq i32 %105, 0 br i1 %cmp79.not.1, label %for.inc92.1, label %if.then81.1 if.then81.1: ; preds = %for.inc92 %arrayidx83.1 = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %indvars.iv.next209 %106 = load i32, ptr %arrayidx83.1, align 4, !tbaa !19 %add86.1 = add nsw i32 %106, %105 %spec.select137.1 = tail call i32 @llvm.smax.i32(i32 %add86.1, i32 %max.5) br label %for.inc92.1 for.inc92.1: ; preds = %if.then81.1, %for.inc92 %max.5.1 = phi i32 [ %max.5, %for.inc92 ], [ %spec.select137.1, %if.then81.1 ] %indvars.iv.next209.1 = add nuw nsw i64 %indvars.iv208, 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.end94.loopexit.unr-lcssa, label %for.body76, !llvm.loop !28 for.end94.loopexit.unr-lcssa: ; preds = %for.inc92.1, %for.body76.preheader %max.5.lcssa.ph = phi i32 [ undef, %for.body76.preheader ], [ %max.5.1, %for.inc92.1 ] %indvars.iv208.unr = phi i64 [ 0, %for.body76.preheader ], [ %indvars.iv.next209.1, %for.inc92.1 ] %max.4193.unr = phi i32 [ %max.0.lcssa, %for.body76.preheader ], [ %max.5.1, %for.inc92.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end94, label %for.body76.epil for.body76.epil: ; preds = %for.end94.loopexit.unr-lcssa %arrayidx78.epil = getelementptr inbounds [2000 x i32], ptr @streak, i64 0, i64 %indvars.iv208.unr %107 = load i32, ptr %arrayidx78.epil, align 4, !tbaa !19 %cmp79.not.epil = icmp eq i32 %107, 0 br i1 %cmp79.not.epil, label %for.end94, label %if.then81.epil if.then81.epil: ; preds = %for.body76.epil %arrayidx83.epil = getelementptr inbounds [2000 x i32], ptr @highest, i64 0, i64 %indvars.iv208.unr %108 = load i32, ptr %arrayidx83.epil, align 4, !tbaa !19 %add86.epil = add nsw i32 %108, %107 %spec.select137.epil = tail call i32 @llvm.smax.i32(i32 %add86.epil, i32 %max.4193.unr) br label %for.end94 for.end94: ; preds = %for.end94.loopexit.unr-lcssa, %if.then81.epil, %for.body76.epil, %for.cond73.preheader %max.4.lcssa = phi i32 [ %max.0.lcssa, %for.cond73.preheader ], [ %max.5.lcssa.ph, %for.end94.loopexit.unr-lcssa ], [ %max.4193.unr, %for.body76.epil ], [ %spec.select137.epil, %if.then81.epil ] %sub95 = add nsw i32 %max.4.lcssa, -1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f.i) #4 %tobool.not22.i = icmp eq i32 %sub95, 0 br i1 %tobool.not22.i, label %while.end7.i, label %while.body.i168 while.cond1.preheader.i: ; preds = %while.body.i168 %109 = and i64 %indvars.iv.next.i, 4294967295 %tobool2.not25.i = icmp eq i64 %109, 0 br i1 %tobool2.not25.i, label %while.end7.i, label %while.body3.preheader.i while.body3.preheader.i: ; preds = %while.cond1.preheader.i %sext.i = shl i64 %indvars.iv.next.i, 32 %110 = ashr exact i64 %sext.i, 32 br label %while.body3.i while.body.i168: ; preds = %for.end94, %while.body.i168 %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i168 ], [ 0, %for.end94 ] %x.addr.023.i = phi i32 [ %div.i, %while.body.i168 ], [ %sub95, %for.end94 ] %rem.i = srem i32 %x.addr.023.i, 10 %conv.i = trunc i32 %rem.i to i8 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds [4 x i8], ptr %f.i, i64 0, i64 %indvars.iv.i store i8 %conv.i, ptr %arrayidx.i, align 1, !tbaa !16 %div.i = sdiv i32 %x.addr.023.i, 10 %x.addr.023.off.i = add i32 %x.addr.023.i, 9 %tobool.not.i = icmp ult i32 %x.addr.023.off.i, 19 br i1 %tobool.not.i, label %while.cond1.preheader.i, label %while.body.i168, !llvm.loop !29 while.body3.i: ; preds = %putchar_unlocked.exit.i, %while.body3.preheader.i %indvars.iv28.i = phi i64 [ %110, %while.body3.preheader.i ], [ %indvars.iv.next29.i, %putchar_unlocked.exit.i ] %indvars.iv.next29.i = add nsw i64 %indvars.iv28.i, -1 %arrayidx5.i = getelementptr inbounds [4 x i8], ptr %f.i, i64 0, i64 %indvars.iv.next29.i %111 = load i8, ptr %arrayidx5.i, align 1, !tbaa !16 %conv631.i = zext i8 %111 to i32 %add.i169 = add nuw nsw i32 %conv631.i, 48 %112 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %112, i64 0, i32 5 %113 = load ptr, ptr %_IO_write_ptr.i.i, align 8, !tbaa !30 %_IO_write_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %112, i64 0, i32 6 %114 = load ptr, ptr %_IO_write_end.i.i, align 8, !tbaa !31 %cmp.not.i.i170 = icmp ult ptr %113, %114 br i1 %cmp.not.i.i170, label %cond.false.i.i174, label %cond.true.i.i171, !prof !15 cond.true.i.i171: ; preds = %while.body3.i %conv3.i.i172 = and i32 %add.i169, 255 %call.i.i173 = tail call i32 @__overflow(ptr noundef nonnull %112, i32 noundef %conv3.i.i172) #4 br label %putchar_unlocked.exit.i cond.false.i.i174: ; preds = %while.body3.i %conv4.i.i = trunc i32 %add.i169 to i8 %incdec.ptr.i.i175 = getelementptr inbounds i8, ptr %113, i64 1 store ptr %incdec.ptr.i.i175, ptr %_IO_write_ptr.i.i, align 8, !tbaa !30 store i8 %conv4.i.i, ptr %113, align 1, !tbaa !16 br label %putchar_unlocked.exit.i putchar_unlocked.exit.i: ; preds = %cond.false.i.i174, %cond.true.i.i171 %115 = and i64 %indvars.iv.next29.i, 4294967295 %tobool2.not.i = icmp eq i64 %115, 0 br i1 %tobool2.not.i, label %while.end7.i, label %while.body3.i, !llvm.loop !32 while.end7.i: ; preds = %putchar_unlocked.exit.i, %while.cond1.preheader.i, %for.end94 %116 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i13.i = getelementptr inbounds %struct._IO_FILE, ptr %116, i64 0, i32 5 %117 = load ptr, ptr %_IO_write_ptr.i13.i, align 8, !tbaa !30 %_IO_write_end.i14.i = getelementptr inbounds %struct._IO_FILE, ptr %116, i64 0, i32 6 %118 = load ptr, ptr %_IO_write_end.i14.i, align 8, !tbaa !31 %cmp.not.i15.i = icmp ult ptr %117, %118 br i1 %cmp.not.i15.i, label %cond.false.i19.i, label %cond.true.i16.i, !prof !15 cond.true.i16.i: ; preds = %while.end7.i %call.i17.i = tail call i32 @__overflow(ptr noundef nonnull %116, i32 noundef 10) #4 br label %put_int.exit cond.false.i19.i: ; preds = %while.end7.i %incdec.ptr.i20.i = getelementptr inbounds i8, ptr %117, i64 1 store ptr %incdec.ptr.i20.i, ptr %_IO_write_ptr.i13.i, align 8, !tbaa !30 store i8 10, ptr %117, align 1, !tbaa !16 br label %put_int.exit put_int.exit: ; preds = %cond.true.i16.i, %cond.false.i19.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f.i) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 declare i32 @__uflow(ptr noundef) local_unnamed_addr #2 declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 16} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = !{!11, !11, i64 0} !20 = distinct !{!20, !18, !21, !22} !21 = !{!"llvm.loop.isvectorized", i32 1} !22 = !{!"llvm.loop.unroll.runtime.disable"} !23 = distinct !{!23, !18, !21} !24 = distinct !{!24, !18} !25 = distinct !{!25, !18, !21, !22} !26 = distinct !{!26, !18, !22, !21} !27 = distinct !{!27, !18} !28 = distinct !{!28, !18} !29 = distinct !{!29, !18} !30 = !{!10, !6, i64 40} !31 = !{!10, !6, i64 48} !32 = distinct !{!32, !18}
#include <stdio.h> int h, w; char g[2001][2001]; int mem[4][2001][2001] = {}; int tu(int i, int j){ if(mem[0][i][j] != 0) return mem[0][i][j]; else{ if(i == 0) return 0; else if(g[i - 1][j] == '#') return 0; else return (mem[0][i][j] = tu(i - 1, j) + 1); } } int td(int i, int j){ if(mem[1][i][j] != 0) return mem[1][i][j]; else{ if(i == h - 1) return 0; else if(g[i + 1][j] == '#') return 0; else return (mem[1][i][j] = td(i + 1, j) + 1); } } int yr(int i, int j){ if(mem[2][i][j] != 0) return mem[2][i][j]; else{ if(j == w - 1 || g[i][j + 1] == '#') return 0; else return (mem[2][i][j] = yr(i, j + 1) + 1); } } int yl(int i, int j){ if(mem[3][i][j] != 0) return mem[3][i][j]; else{ if(j == 0 || g[i][j - 1] == '#') return 0; else return (mem[3][i][j] = yl(i, j - 1) + 1); } } int main(int argc, char *argv[]) { scanf("%d %d", &h, &w); for(int i = 0; i < h; i++){ scanf("%s", g[i]); } int max = 0; int q; for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ if(g[i][j] != '#'){ q = yl(i, j) + yr(i, j) + tu(i, j) + td(i, j) + 1; max = max > q ? max : q; } } } printf("%d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143225/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143225/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mem = dso_local local_unnamed_addr global [4 x [2001 x [2001 x i32]]] zeroinitializer, align 16 @g = dso_local global [2001 x [2001 x i8]] zeroinitializer, align 16 @h = dso_local global i32 0, align 4 @w = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @tu(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %idxprom = sext i32 %i to i64 %idxprom1 = sext i32 %j to i64 %arrayidx2 = getelementptr inbounds [2001 x [2001 x i32]], ptr @mem, i64 0, i64 %idxprom, i64 %idxprom1 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, 0 br i1 %cmp.not, label %if.else, label %common.ret32 if.else: ; preds = %entry %cmp7 = icmp eq i32 %i, 0 br i1 %cmp7, label %common.ret32, label %if.else9 if.else9: ; preds = %if.else %sub = add nsw i32 %i, -1 %idxprom10 = sext i32 %sub to i64 %arrayidx13 = getelementptr inbounds [2001 x [2001 x i8]], ptr @g, i64 0, i64 %idxprom10, i64 %idxprom1 %1 = load i8, ptr %arrayidx13, align 1, !tbaa !9 %cmp14 = icmp eq i8 %1, 35 br i1 %cmp14, label %common.ret32, label %if.else17 common.ret32: ; preds = %if.else9, %if.else, %entry, %if.else17 %common.ret32.op = phi i32 [ %add, %if.else17 ], [ %0, %entry ], [ 0, %if.else ], [ 0, %if.else9 ] ret i32 %common.ret32.op if.else17: ; preds = %if.else9 %call = tail call i32 @tu(i32 noundef %sub, i32 noundef %j) %add = add nsw i32 %call, 1 store i32 %add, ptr %arrayidx2, align 4, !tbaa !5 br label %common.ret32 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @td(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %idxprom = sext i32 %i to i64 %idxprom1 = sext i32 %j to i64 %arrayidx2 = getelementptr inbounds [4 x [2001 x [2001 x i32]]], ptr @mem, i64 0, i64 1, i64 %idxprom, i64 %idxprom1 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, 0 br i1 %cmp.not, label %if.else, label %common.ret33 if.else: ; preds = %entry %1 = load i32, ptr @h, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %cmp7 = icmp eq i32 %sub, %i br i1 %cmp7, label %common.ret33, label %if.else9 if.else9: ; preds = %if.else %add = add nsw i32 %i, 1 %idxprom10 = sext i32 %add to i64 %arrayidx13 = getelementptr inbounds [2001 x [2001 x i8]], ptr @g, i64 0, i64 %idxprom10, i64 %idxprom1 %2 = load i8, ptr %arrayidx13, align 1, !tbaa !9 %cmp14 = icmp eq i8 %2, 35 br i1 %cmp14, label %common.ret33, label %if.else17 common.ret33: ; preds = %if.else9, %if.else, %entry, %if.else17 %common.ret33.op = phi i32 [ %add19, %if.else17 ], [ %0, %entry ], [ 0, %if.else ], [ 0, %if.else9 ] ret i32 %common.ret33.op if.else17: ; preds = %if.else9 %call = tail call i32 @td(i32 noundef %add, i32 noundef %j) %add19 = add nsw i32 %call, 1 store i32 %add19, ptr %arrayidx2, align 4, !tbaa !5 br label %common.ret33 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @yr(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %idxprom = sext i32 %i to i64 %idxprom1 = sext i32 %j to i64 %arrayidx2 = getelementptr inbounds [4 x [2001 x [2001 x i32]]], ptr @mem, i64 0, i64 2, i64 %idxprom, i64 %idxprom1 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, 0 br i1 %cmp.not, label %if.else, label %common.ret31 if.else: ; preds = %entry %1 = load i32, ptr @w, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %cmp7 = icmp eq i32 %sub, %j br i1 %cmp7, label %common.ret31, label %lor.lhs.false lor.lhs.false: ; preds = %if.else %add = add nsw i32 %j, 1 %idxprom10 = sext i32 %add to i64 %arrayidx11 = getelementptr inbounds [2001 x [2001 x i8]], ptr @g, i64 0, i64 %idxprom, i64 %idxprom10 %2 = load i8, ptr %arrayidx11, align 1, !tbaa !9 %cmp12 = icmp eq i8 %2, 35 br i1 %cmp12, label %common.ret31, label %if.else15 common.ret31: ; preds = %if.else, %lor.lhs.false, %entry, %if.else15 %common.ret31.op = phi i32 [ %add17, %if.else15 ], [ %0, %entry ], [ 0, %lor.lhs.false ], [ 0, %if.else ] ret i32 %common.ret31.op if.else15: ; preds = %lor.lhs.false %call = tail call i32 @yr(i32 noundef %i, i32 noundef %add) %add17 = add nsw i32 %call, 1 store i32 %add17, ptr %arrayidx2, align 4, !tbaa !5 br label %common.ret31 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @yl(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %idxprom = sext i32 %i to i64 %idxprom1 = sext i32 %j to i64 %arrayidx2 = getelementptr inbounds [4 x [2001 x [2001 x i32]]], ptr @mem, i64 0, i64 3, i64 %idxprom, i64 %idxprom1 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp.not = icmp eq i32 %0, 0 br i1 %cmp.not, label %if.else, label %common.ret30 if.else: ; preds = %entry %cmp7 = icmp eq i32 %j, 0 br i1 %cmp7, label %common.ret30, label %lor.lhs.false lor.lhs.false: ; preds = %if.else %sub = add nsw i32 %j, -1 %idxprom10 = sext i32 %sub to i64 %arrayidx11 = getelementptr inbounds [2001 x [2001 x i8]], ptr @g, i64 0, i64 %idxprom, i64 %idxprom10 %1 = load i8, ptr %arrayidx11, align 1, !tbaa !9 %cmp12 = icmp eq i8 %1, 35 br i1 %cmp12, label %common.ret30, label %if.else15 common.ret30: ; preds = %if.else, %lor.lhs.false, %entry, %if.else15 %common.ret30.op = phi i32 [ %add, %if.else15 ], [ %0, %entry ], [ 0, %lor.lhs.false ], [ 0, %if.else ] ret i32 %common.ret30.op if.else15: ; preds = %lor.lhs.false %call = tail call i32 @yl(i32 noundef %i, i32 noundef %sub) %add = add nsw i32 %call, 1 store i32 %add, ptr %arrayidx2, align 4, !tbaa !5 br label %common.ret30 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) 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 %cmp50 = icmp sgt i32 %0, 0 br i1 %cmp50, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %cmp455 = icmp sgt i32 %3, 0 %1 = load i32, ptr @w, align 4 %2 = icmp sgt i32 %1, 0 %or.cond = select i1 %cmp455, i1 %2, i1 false br i1 %or.cond, label %for.cond7.preheader, label %for.cond.cleanup5 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [2001 x [2001 x i8]], ptr @g, 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 %3 = load i32, ptr @h, 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.cond3.preheader, !llvm.loop !10 for.cond7.preheader: ; preds = %for.cond3.preheader, %for.cond.cleanup9 %5 = phi i32 [ %9, %for.cond.cleanup9 ], [ %3, %for.cond3.preheader ] %6 = phi i32 [ %10, %for.cond.cleanup9 ], [ %1, %for.cond3.preheader ] %7 = phi i32 [ %11, %for.cond.cleanup9 ], [ %1, %for.cond3.preheader ] %indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.cond.cleanup9 ], [ 0, %for.cond3.preheader ] %max.056 = phi i32 [ %max.1.lcssa, %for.cond.cleanup9 ], [ 0, %for.cond3.preheader ] %cmp852 = icmp sgt i32 %7, 0 br i1 %cmp852, label %for.body10.lr.ph, label %for.cond.cleanup9 for.body10.lr.ph: ; preds = %for.cond7.preheader %8 = trunc i64 %indvars.iv64 to i32 br label %for.body10 for.cond.cleanup5: ; preds = %for.cond.cleanup9, %entry, %for.cond3.preheader %max.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %max.1.lcssa, %for.cond.cleanup9 ] %call32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) ret i32 0 for.cond.cleanup9.loopexit: ; preds = %for.inc26 %.pre67 = load i32, ptr @h, align 4, !tbaa !5 br label %for.cond.cleanup9 for.cond.cleanup9: ; preds = %for.cond.cleanup9.loopexit, %for.cond7.preheader %9 = phi i32 [ %5, %for.cond7.preheader ], [ %.pre67, %for.cond.cleanup9.loopexit ] %10 = phi i32 [ %6, %for.cond7.preheader ], [ %16, %for.cond.cleanup9.loopexit ] %11 = phi i32 [ %7, %for.cond7.preheader ], [ %16, %for.cond.cleanup9.loopexit ] %max.1.lcssa = phi i32 [ %max.056, %for.cond7.preheader ], [ %max.2, %for.cond.cleanup9.loopexit ] %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1 %12 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next65, %12 br i1 %cmp4, label %for.cond7.preheader, label %for.cond.cleanup5, !llvm.loop !12 for.body10: ; preds = %for.body10.lr.ph, %for.inc26 %13 = phi i32 [ %6, %for.body10.lr.ph ], [ %16, %for.inc26 ] %indvars.iv61 = phi i64 [ 0, %for.body10.lr.ph ], [ %indvars.iv.next62, %for.inc26 ] %max.153 = phi i32 [ %max.056, %for.body10.lr.ph ], [ %max.2, %for.inc26 ] %arrayidx14 = getelementptr inbounds [2001 x [2001 x i8]], ptr @g, i64 0, i64 %indvars.iv64, i64 %indvars.iv61 %14 = load i8, ptr %arrayidx14, align 1, !tbaa !9 %cmp15.not = icmp eq i8 %14, 35 br i1 %cmp15.not, label %for.inc26, label %if.then if.then: ; preds = %for.body10 %15 = trunc i64 %indvars.iv61 to i32 %call17 = tail call i32 @yl(i32 noundef %8, i32 noundef %15) %call18 = tail call i32 @yr(i32 noundef %8, i32 noundef %15) %call19 = tail call i32 @tu(i32 noundef %8, i32 noundef %15) %call21 = tail call i32 @td(i32 noundef %8, i32 noundef %15) %add = add i32 %call17, 1 %add20 = add i32 %add, %call18 %add22 = add i32 %add20, %call19 %add23 = add i32 %add22, %call21 %cond = tail call i32 @llvm.smax.i32(i32 %max.153, i32 %add23) %.pre = load i32, ptr @w, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.body10, %if.then %16 = phi i32 [ %.pre, %if.then ], [ %13, %for.body10 ] %max.2 = phi i32 [ %cond, %if.then ], [ %max.153, %for.body10 ] %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1 %17 = sext i32 %16 to i64 %cmp8 = icmp slt i64 %indvars.iv.next62, %17 br i1 %cmp8, label %for.body10, label %for.cond.cleanup9.loopexit, !llvm.loop !14 } ; 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.smax.i32(i32, 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) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13} !13 = !{!"llvm.loop.unswitch.partial.disable"} !14 = distinct !{!14, !11}
#include <stdio.h> #include <math.h> int main(void){ long n; int flag=0; while(scanf(" %ld", &n) != EOF){ int i, j, a[5]; char c[5][7]; if(flag==1) printf("\n"); for(i=0; i<5; i++) a[i] = (n/(int)pow(10, 4-i)) % 10; for(i=0; i<5; i++){ for(j=0; j<7; j++){ c[i][j] = '*'; } } for(i=0; i<5; i++){ c[i][(a[i]/5>0)?0:1] = ' '; c[i][2+a[i]%5] = ' '; } for(i=0; i<7; i++){ if(i==2) printf("=====\n"); for(j=0; j<5; j++){ printf("%c", c[j][i]); } printf("\n"); } flag=1; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143276/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143276/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %ld\00", align 1 @str = private unnamed_addr constant [6 x i8] c"=====\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %c = alloca [5 x [7 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not105 = icmp eq i32 %call104, -1 br i1 %cmp.not105, label %while.end, label %while.body while.body: ; preds = %entry call void @llvm.lifetime.start.p0(i64 35, ptr nonnull %c) #5 %arrayidx65.6 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 6 %arrayidx65.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 0 %arrayidx65.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 0 %arrayidx65.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 0 %arrayidx65.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 0 %arrayidx65.1114 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 1 %arrayidx65.1.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 1 %arrayidx65.2.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 1 %arrayidx65.3.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 1 %arrayidx65.4.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 1 %arrayidx65.2117 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 2 %arrayidx65.1.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 2 %arrayidx65.2.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 2 %arrayidx65.3.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 2 %arrayidx65.4.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 2 %arrayidx65.3120 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 3 %arrayidx65.1.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 3 %arrayidx65.2.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 3 %arrayidx65.3.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 3 %arrayidx65.4.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 3 %arrayidx65.4123 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 4 %arrayidx65.1.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 4 %arrayidx65.2.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 4 %arrayidx65.3.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 4 %arrayidx65.4.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 4 %arrayidx65.5 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 5 %arrayidx65.1.5 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 5 %arrayidx65.2.5 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 5 %arrayidx65.3.5 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 5 %arrayidx65.4.5 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 5 %arrayidx65.1.6 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 6 %arrayidx65.2.6 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 6 %arrayidx65.3.6 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 6 %arrayidx65.4.6 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 6 br label %if.end57.6 if.then.critedge: ; preds = %if.end57.6 call void @llvm.lifetime.start.p0(i64 35, ptr nonnull %c) #5 %putchar = call i32 @putchar(i32 10) br label %if.end57.6 if.end57.6: ; preds = %while.body, %if.then.critedge %0 = load i64, ptr %n, align 8, !tbaa !5 %div = sdiv i64 %0, 10000 %rem = srem i64 %div, 10 %conv7 = trunc i64 %rem to i32 %div.1 = sdiv i64 %0, 1000 %rem.1 = srem i64 %div.1, 10 %conv7.1 = trunc i64 %rem.1 to i32 %div.2 = sdiv i64 %0, 100 %rem.2 = srem i64 %div.2, 10 %conv7.2 = trunc i64 %rem.2 to i32 %div.3 = sdiv i64 %0, 10 %rem.3 = srem i64 %div.3, 10 %conv7.3 = trunc i64 %rem.3 to i32 %rem.4 = srem i64 %0, 10 %conv7.4 = trunc i64 %rem.4 to i32 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(35) %c, i8 42, i64 35, i1 false), !tbaa !9 %cmp35 = icmp slt i32 %conv7, 5 %idxprom37 = zext i1 %cmp35 to i64 %arrayidx38 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 %idxprom37 store i8 32, ptr %arrayidx38, align 1, !tbaa !9 %rem43.lhs.trunc = trunc i64 %rem to i8 %rem43126 = srem i8 %rem43.lhs.trunc, 5 %narrow = add nsw i8 %rem43126, 2 %idxprom44 = sext i8 %narrow to i64 %arrayidx45 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 0, i64 %idxprom44 store i8 32, ptr %arrayidx45, align 1, !tbaa !9 %cmp35.1 = icmp slt i32 %conv7.1, 5 %idxprom37.1 = zext i1 %cmp35.1 to i64 %arrayidx38.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 %idxprom37.1 store i8 32, ptr %arrayidx38.1, align 1, !tbaa !9 %rem43.1.lhs.trunc = trunc i64 %rem.1 to i8 %rem43.1127 = srem i8 %rem43.1.lhs.trunc, 5 %narrow131 = add nsw i8 %rem43.1127, 2 %idxprom44.1 = sext i8 %narrow131 to i64 %arrayidx45.1 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 1, i64 %idxprom44.1 store i8 32, ptr %arrayidx45.1, align 1, !tbaa !9 %cmp35.2 = icmp slt i32 %conv7.2, 5 %idxprom37.2 = zext i1 %cmp35.2 to i64 %arrayidx38.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 %idxprom37.2 store i8 32, ptr %arrayidx38.2, align 1, !tbaa !9 %rem43.2.lhs.trunc = trunc i64 %rem.2 to i8 %rem43.2128 = srem i8 %rem43.2.lhs.trunc, 5 %narrow132 = add nsw i8 %rem43.2128, 2 %idxprom44.2 = sext i8 %narrow132 to i64 %arrayidx45.2 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 2, i64 %idxprom44.2 store i8 32, ptr %arrayidx45.2, align 1, !tbaa !9 %cmp35.3 = icmp slt i32 %conv7.3, 5 %idxprom37.3 = zext i1 %cmp35.3 to i64 %arrayidx38.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 %idxprom37.3 store i8 32, ptr %arrayidx38.3, align 1, !tbaa !9 %rem43.3.lhs.trunc = trunc i64 %rem.3 to i8 %rem43.3129 = srem i8 %rem43.3.lhs.trunc, 5 %narrow133 = add nsw i8 %rem43.3129, 2 %idxprom44.3 = sext i8 %narrow133 to i64 %arrayidx45.3 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 3, i64 %idxprom44.3 store i8 32, ptr %arrayidx45.3, align 1, !tbaa !9 %cmp35.4 = icmp slt i32 %conv7.4, 5 %idxprom37.4 = zext i1 %cmp35.4 to i64 %arrayidx38.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 %idxprom37.4 store i8 32, ptr %arrayidx38.4, align 1, !tbaa !9 %rem43.4.lhs.trunc = trunc i64 %rem.4 to i8 %rem43.4130 = srem i8 %rem43.4.lhs.trunc, 5 %narrow134 = add nsw i8 %rem43.4130, 2 %idxprom44.4 = sext i8 %narrow134 to i64 %arrayidx45.4 = getelementptr inbounds [5 x [7 x i8]], ptr %c, i64 0, i64 4, i64 %idxprom44.4 store i8 32, ptr %arrayidx45.4, align 1, !tbaa !9 %1 = load i8, ptr %c, align 16, !tbaa !9 %conv66 = sext i8 %1 to i32 %putchar97 = call i32 @putchar(i32 %conv66) %2 = load i8, ptr %arrayidx65.1, align 1, !tbaa !9 %conv66.1 = sext i8 %2 to i32 %putchar97.1 = call i32 @putchar(i32 %conv66.1) %3 = load i8, ptr %arrayidx65.2, align 2, !tbaa !9 %conv66.2 = sext i8 %3 to i32 %putchar97.2 = call i32 @putchar(i32 %conv66.2) %4 = load i8, ptr %arrayidx65.3, align 1, !tbaa !9 %conv66.3 = sext i8 %4 to i32 %putchar97.3 = call i32 @putchar(i32 %conv66.3) %5 = load i8, ptr %arrayidx65.4, align 4, !tbaa !9 %conv66.4 = sext i8 %5 to i32 %putchar97.4 = call i32 @putchar(i32 %conv66.4) %putchar96 = call i32 @putchar(i32 10) %6 = load i8, ptr %arrayidx65.1114, align 1, !tbaa !9 %conv66.1115 = sext i8 %6 to i32 %putchar97.1116 = call i32 @putchar(i32 %conv66.1115) %7 = load i8, ptr %arrayidx65.1.1, align 8, !tbaa !9 %conv66.1.1 = sext i8 %7 to i32 %putchar97.1.1 = call i32 @putchar(i32 %conv66.1.1) %8 = load i8, ptr %arrayidx65.2.1, align 1, !tbaa !9 %conv66.2.1 = sext i8 %8 to i32 %putchar97.2.1 = call i32 @putchar(i32 %conv66.2.1) %9 = load i8, ptr %arrayidx65.3.1, align 2, !tbaa !9 %conv66.3.1 = sext i8 %9 to i32 %putchar97.3.1 = call i32 @putchar(i32 %conv66.3.1) %10 = load i8, ptr %arrayidx65.4.1, align 1, !tbaa !9 %conv66.4.1 = sext i8 %10 to i32 %putchar97.4.1 = call i32 @putchar(i32 %conv66.4.1) %putchar96.1 = call i32 @putchar(i32 10) %puts.2 = call i32 @puts(ptr nonnull dereferenceable(1) @str) %11 = load i8, ptr %arrayidx65.2117, align 2, !tbaa !9 %conv66.2118 = sext i8 %11 to i32 %putchar97.2119 = call i32 @putchar(i32 %conv66.2118) %12 = load i8, ptr %arrayidx65.1.2, align 1, !tbaa !9 %conv66.1.2 = sext i8 %12 to i32 %putchar97.1.2 = call i32 @putchar(i32 %conv66.1.2) %13 = load i8, ptr %arrayidx65.2.2, align 16, !tbaa !9 %conv66.2.2 = sext i8 %13 to i32 %putchar97.2.2 = call i32 @putchar(i32 %conv66.2.2) %14 = load i8, ptr %arrayidx65.3.2, align 1, !tbaa !9 %conv66.3.2 = sext i8 %14 to i32 %putchar97.3.2 = call i32 @putchar(i32 %conv66.3.2) %15 = load i8, ptr %arrayidx65.4.2, align 2, !tbaa !9 %conv66.4.2 = sext i8 %15 to i32 %putchar97.4.2 = call i32 @putchar(i32 %conv66.4.2) %putchar96.2 = call i32 @putchar(i32 10) %16 = load i8, ptr %arrayidx65.3120, align 1, !tbaa !9 %conv66.3121 = sext i8 %16 to i32 %putchar97.3122 = call i32 @putchar(i32 %conv66.3121) %17 = load i8, ptr %arrayidx65.1.3, align 2, !tbaa !9 %conv66.1.3 = sext i8 %17 to i32 %putchar97.1.3 = call i32 @putchar(i32 %conv66.1.3) %18 = load i8, ptr %arrayidx65.2.3, align 1, !tbaa !9 %conv66.2.3 = sext i8 %18 to i32 %putchar97.2.3 = call i32 @putchar(i32 %conv66.2.3) %19 = load i8, ptr %arrayidx65.3.3, align 8, !tbaa !9 %conv66.3.3 = sext i8 %19 to i32 %putchar97.3.3 = call i32 @putchar(i32 %conv66.3.3) %20 = load i8, ptr %arrayidx65.4.3, align 1, !tbaa !9 %conv66.4.3 = sext i8 %20 to i32 %putchar97.4.3 = call i32 @putchar(i32 %conv66.4.3) %putchar96.3 = call i32 @putchar(i32 10) %21 = load i8, ptr %arrayidx65.4123, align 4, !tbaa !9 %conv66.4124 = sext i8 %21 to i32 %putchar97.4125 = call i32 @putchar(i32 %conv66.4124) %22 = load i8, ptr %arrayidx65.1.4, align 1, !tbaa !9 %conv66.1.4 = sext i8 %22 to i32 %putchar97.1.4 = call i32 @putchar(i32 %conv66.1.4) %23 = load i8, ptr %arrayidx65.2.4, align 2, !tbaa !9 %conv66.2.4 = sext i8 %23 to i32 %putchar97.2.4 = call i32 @putchar(i32 %conv66.2.4) %24 = load i8, ptr %arrayidx65.3.4, align 1, !tbaa !9 %conv66.3.4 = sext i8 %24 to i32 %putchar97.3.4 = call i32 @putchar(i32 %conv66.3.4) %25 = load i8, ptr %arrayidx65.4.4, align 16, !tbaa !9 %conv66.4.4 = sext i8 %25 to i32 %putchar97.4.4 = call i32 @putchar(i32 %conv66.4.4) %putchar96.4 = call i32 @putchar(i32 10) %26 = load i8, ptr %arrayidx65.5, align 1, !tbaa !9 %conv66.5 = sext i8 %26 to i32 %putchar97.5 = call i32 @putchar(i32 %conv66.5) %27 = load i8, ptr %arrayidx65.1.5, align 4, !tbaa !9 %conv66.1.5 = sext i8 %27 to i32 %putchar97.1.5 = call i32 @putchar(i32 %conv66.1.5) %28 = load i8, ptr %arrayidx65.2.5, align 1, !tbaa !9 %conv66.2.5 = sext i8 %28 to i32 %putchar97.2.5 = call i32 @putchar(i32 %conv66.2.5) %29 = load i8, ptr %arrayidx65.3.5, align 2, !tbaa !9 %conv66.3.5 = sext i8 %29 to i32 %putchar97.3.5 = call i32 @putchar(i32 %conv66.3.5) %30 = load i8, ptr %arrayidx65.4.5, align 1, !tbaa !9 %conv66.4.5 = sext i8 %30 to i32 %putchar97.4.5 = call i32 @putchar(i32 %conv66.4.5) %putchar96.5 = call i32 @putchar(i32 10) %31 = load i8, ptr %arrayidx65.6, align 2, !tbaa !9 %conv66.6 = sext i8 %31 to i32 %putchar97.6 = call i32 @putchar(i32 %conv66.6) %32 = load i8, ptr %arrayidx65.1.6, align 1, !tbaa !9 %conv66.1.6 = sext i8 %32 to i32 %putchar97.1.6 = call i32 @putchar(i32 %conv66.1.6) %33 = load i8, ptr %arrayidx65.2.6, align 4, !tbaa !9 %conv66.2.6 = sext i8 %33 to i32 %putchar97.2.6 = call i32 @putchar(i32 %conv66.2.6) %34 = load i8, ptr %arrayidx65.3.6, align 1, !tbaa !9 %conv66.3.6 = sext i8 %34 to i32 %putchar97.3.6 = call i32 @putchar(i32 %conv66.3.6) %35 = load i8, ptr %arrayidx65.4.6, align 2, !tbaa !9 %conv66.4.6 = sext i8 %35 to i32 %putchar97.4.6 = call i32 @putchar(i32 %conv66.4.6) %putchar96.6 = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 35, ptr nonnull %c) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %if.then.critedge, !llvm.loop !10 while.end: ; preds = %if.end57.6, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <stdbool.h> typedef long long ll; #define rep(i,n) for(ll i=0; i<(ll)(n); i++) #define max(l,r) ((l)>(r)?l:r) #define min(l,r) ((l)<(r)?l:r) #define swap(l,r) {ll tp=l;l=r;r=tp;} const ll MOD = 1000000007; ll scr[5050][5050]; int cnt[5050]; int main(){ int n, k; scanf("%d%d", &n, &k); int p[5050]; ll c[5050]; rep(i, n) scanf("%d", &p[i]); rep(i, n) p[i]--; rep(i, n) scanf("%lld", &c[i]); rep(i, n+1) rep(j, n+1) scr[i][j] = -(MOD*MOD); rep(i, n){ int idx = i; cnt[i] = 0; scr[idx][cnt[i]] = c[p[idx]]; while(p[idx] != i) { idx = p[idx]; cnt[i]++; scr[i][cnt[i]] = c[p[idx]]; scr[i][cnt[i]] += scr[i][cnt[i]-1]; } } ll ans = -(MOD*MOD); rep(i, n){ if(cnt[i]+1 >= k){ rep(j, k){ ans = max(ans, scr[i][j]); } }else{ if(scr[i][cnt[i]] <= 0){ rep(j, cnt[i]+1){ ans = max(ans, scr[i][j]); } }else{ ll tmp = scr[i][cnt[i]] * (k/(cnt[i]+1)); ans = max(ans, tmp); int tmpk = k % (cnt[i]+1); rep(j, cnt[i]){ ans = max(ans, tmp - scr[i][cnt[i]] + scr[i][j]); } rep(j, tmpk){ ans = max(ans, tmp + scr[i][j]); } } } } printf("%lld\n", ans); /*rep(i,n){ rep(j, cnt[i]+1){ printf("%d ", scr[i][j]); } puts(""); }*/ }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143326/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143326/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @MOD = dso_local local_unnamed_addr constant i64 1000000007, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @scr = dso_local local_unnamed_addr global [5050 x [5050 x i64]] zeroinitializer, align 16 @cnt = dso_local local_unnamed_addr global [5050 x i32] zeroinitializer, align 16 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %p = alloca [5050 x i32], align 16 %c = alloca [5050 x i64], align 16 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) call void @llvm.lifetime.start.p0(i64 20200, ptr nonnull %p) #4 call void @llvm.lifetime.start.p0(i64 40400, ptr nonnull %c) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %conv306 = sext i32 %0 to i64 %cmp307 = icmp sgt i32 %0, 0 br i1 %cmp307, label %for.body, label %for.cond4.preheader for.cond4.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %7, %for.body ] %conv.lcssa = phi i64 [ %conv306, %entry ], [ %conv, %for.body ] %cmp6309 = icmp sgt i64 %conv.lcssa, 0 br i1 %cmp6309, label %for.body9.preheader, label %for.cond15.preheader for.body9.preheader: ; preds = %for.cond4.preheader %min.iters.check = icmp ult i64 %conv.lcssa, 8 br i1 %min.iters.check, label %for.body9.preheader476, label %vector.ph vector.ph: ; preds = %for.body9.preheader %n.vec = and i64 %conv.lcssa, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds [5050 x i32], ptr %p, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load376 = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = add nsw <4 x i32> %wide.load, <i32 -1, i32 -1, i32 -1, i32 -1> %5 = add nsw <4 x i32> %wide.load376, <i32 -1, i32 -1, i32 -1, i32 -1> store <4 x i32> %4, ptr %2, align 16, !tbaa !5 store <4 x i32> %5, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %conv.lcssa, %n.vec br i1 %cmp.n, label %for.cond15.preheader, label %for.body9.preheader476 for.body9.preheader476: ; preds = %for.body9.preheader, %middle.block %i3.0310.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec, %middle.block ] br label %for.body9 for.body: ; preds = %entry, %for.body %i.0308 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [5050 x i32], ptr %p, i64 0, i64 %i.0308 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.0308, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %7 to i64 %cmp = icmp slt i64 %inc, %conv br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13 for.cond15.preheader: ; preds = %for.body9, %middle.block, %for.cond4.preheader %conv16311 = sext i32 %1 to i64 %cmp17312 = icmp sgt i32 %1, 0 br i1 %cmp17312, label %for.body20, label %for.cond27.preheader for.body9: ; preds = %for.body9.preheader476, %for.body9 %i3.0310 = phi i64 [ %inc12, %for.body9 ], [ %i3.0310.ph, %for.body9.preheader476 ] %arrayidx10 = getelementptr inbounds [5050 x i32], ptr %p, i64 0, i64 %i3.0310 %8 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %dec = add nsw i32 %8, -1 store i32 %dec, ptr %arrayidx10, align 4, !tbaa !5 %inc12 = add nuw nsw i64 %i3.0310, 1 %exitcond.not = icmp eq i64 %inc12, %conv.lcssa br i1 %exitcond.not, label %for.cond15.preheader, label %for.body9, !llvm.loop !14 for.cond27.preheader: ; preds = %for.body20, %for.cond15.preheader %.lcssa = phi i32 [ %1, %for.cond15.preheader ], [ %13, %for.body20 ] %conv16.lcssa = phi i64 [ %conv16311, %for.cond15.preheader ], [ %conv16, %for.body20 ] %cmp29318 = icmp sgt i32 %.lcssa, -1 br i1 %cmp29318, label %for.cond33.preheader.us.preheader, label %for.cond49.preheader for.cond33.preheader.us.preheader: ; preds = %for.cond27.preheader %add = add nuw i32 %.lcssa, 1 %9 = call i32 @llvm.smax.i32(i32 %add, i32 1) %smax = zext i32 %9 to i64 %min.iters.check379 = icmp ult i32 %9, 4 %n.vec382 = and i64 %smax, 2147483644 %cmp.n384 = icmp eq i64 %n.vec382, %smax br label %for.cond33.preheader.us for.cond33.preheader.us: ; preds = %for.cond33.preheader.us.preheader, %for.cond33.for.cond.cleanup38_crit_edge.us %i26.0319.us = phi i64 [ %inc46.us, %for.cond33.for.cond.cleanup38_crit_edge.us ], [ 0, %for.cond33.preheader.us.preheader ] br i1 %min.iters.check379, label %for.body39.us.preheader, label %vector.body385 vector.body385: ; preds = %for.cond33.preheader.us, %vector.body385 %index386 = phi i64 [ %index.next387, %vector.body385 ], [ 0, %for.cond33.preheader.us ] %10 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i26.0319.us, i64 %index386 store <2 x i64> <i64 -1000000014000000049, i64 -1000000014000000049>, ptr %10, align 16, !tbaa !15 %11 = getelementptr inbounds i64, ptr %10, i64 2 store <2 x i64> <i64 -1000000014000000049, i64 -1000000014000000049>, ptr %11, align 16, !tbaa !15 %index.next387 = add nuw i64 %index386, 4 %12 = icmp eq i64 %index.next387, %n.vec382 br i1 %12, label %middle.block377, label %vector.body385, !llvm.loop !17 middle.block377: ; preds = %vector.body385 br i1 %cmp.n384, label %for.cond33.for.cond.cleanup38_crit_edge.us, label %for.body39.us.preheader for.body39.us.preheader: ; preds = %for.cond33.preheader.us, %middle.block377 %j.0317.us.ph = phi i64 [ 0, %for.cond33.preheader.us ], [ %n.vec382, %middle.block377 ] br label %for.body39.us for.body39.us: ; preds = %for.body39.us.preheader, %for.body39.us %j.0317.us = phi i64 [ %inc43.us, %for.body39.us ], [ %j.0317.us.ph, %for.body39.us.preheader ] %arrayidx41.us = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i26.0319.us, i64 %j.0317.us store i64 -1000000014000000049, ptr %arrayidx41.us, align 8, !tbaa !15 %inc43.us = add nuw nsw i64 %j.0317.us, 1 %exitcond354.not = icmp eq i64 %inc43.us, %smax br i1 %exitcond354.not, label %for.cond33.for.cond.cleanup38_crit_edge.us, label %for.body39.us, !llvm.loop !18 for.cond33.for.cond.cleanup38_crit_edge.us: ; preds = %for.body39.us, %middle.block377 %inc46.us = add nuw nsw i64 %i26.0319.us, 1 %exitcond355.not = icmp eq i64 %inc46.us, %smax br i1 %exitcond355.not, label %for.cond49.preheader, label %for.cond33.preheader.us, !llvm.loop !19 for.body20: ; preds = %for.cond15.preheader, %for.body20 %i14.0313 = phi i64 [ %inc24, %for.body20 ], [ 0, %for.cond15.preheader ] %arrayidx21 = getelementptr inbounds [5050 x i64], ptr %c, i64 0, i64 %i14.0313 %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx21) %inc24 = add nuw nsw i64 %i14.0313, 1 %13 = load i32, ptr %n, align 4, !tbaa !5 %conv16 = sext i32 %13 to i64 %cmp17 = icmp slt i64 %inc24, %conv16 br i1 %cmp17, label %for.body20, label %for.cond27.preheader, !llvm.loop !20 for.cond49.preheader: ; preds = %for.cond33.for.cond.cleanup38_crit_edge.us, %for.cond27.preheader %cmp51325 = icmp sgt i64 %conv16.lcssa, 0 br i1 %cmp51325, label %for.body54, label %for.cond.cleanup99 for.cond95.preheader: ; preds = %while.end br i1 %cmp51325, label %for.body100.lr.ph, label %for.cond.cleanup99 for.body100.lr.ph: ; preds = %for.cond95.preheader %14 = load i32, ptr %k, align 4, !tbaa !5 %conv107 = sext i32 %14 to i64 %cmp108327 = icmp sgt i32 %14, 0 %min.iters.check444 = icmp ult i32 %14, 4 %n.vec447 = and i64 %conv107, -4 %cmp.n449 = icmp eq i64 %n.vec447, %conv107 br label %for.body100 for.body54: ; preds = %for.cond49.preheader, %while.end %i48.0326 = phi i64 [ %inc92, %while.end ], [ 0, %for.cond49.preheader ] %arrayidx56 = getelementptr inbounds [5050 x i32], ptr @cnt, i64 0, i64 %i48.0326 store i32 0, ptr %arrayidx56, align 4, !tbaa !5 %sext = shl i64 %i48.0326, 32 %idxprom = ashr exact i64 %sext, 32 %arrayidx57 = getelementptr inbounds [5050 x i32], ptr %p, i64 0, i64 %idxprom %15 = load i32, ptr %arrayidx57, align 4, !tbaa !5 %idxprom58 = sext i32 %15 to i64 %arrayidx59 = getelementptr inbounds [5050 x i64], ptr %c, i64 0, i64 %idxprom58 %16 = load i64, ptr %arrayidx59, align 8, !tbaa !15 %arrayidx61 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %idxprom store i64 %16, ptr %arrayidx61, align 16, !tbaa !15 %cmp68.not323 = icmp eq i64 %i48.0326, %idxprom58 br i1 %cmp68.not323, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.body54 %arrayidx85.phi.trans.insert = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i48.0326, i64 0 %.pre = load i64, ptr %arrayidx85.phi.trans.insert, align 16, !tbaa !15 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %17 = phi i64 [ %.pre, %while.body.lr.ph ], [ %add90, %while.body ] %indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %while.body ] %conv67324 = phi i64 [ %idxprom58, %while.body.lr.ph ], [ %conv67, %while.body ] %18 = phi i32 [ %15, %while.body.lr.ph ], [ %21, %while.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx75 = getelementptr inbounds [5050 x i32], ptr %p, i64 0, i64 %conv67324 %19 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %idxprom76 = sext i32 %19 to i64 %arrayidx77 = getelementptr inbounds [5050 x i64], ptr %c, i64 0, i64 %idxprom76 %20 = load i64, ptr %arrayidx77, align 8, !tbaa !15 %arrayidx81 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i48.0326, i64 %indvars.iv.next %add90 = add nsw i64 %17, %20 store i64 %add90, ptr %arrayidx81, align 8, !tbaa !15 %idxprom65 = sext i32 %18 to i64 %arrayidx66 = getelementptr inbounds [5050 x i32], ptr %p, i64 0, i64 %idxprom65 %21 = load i32, ptr %arrayidx66, align 4, !tbaa !5 %conv67 = sext i32 %21 to i64 %cmp68.not = icmp eq i64 %i48.0326, %conv67 br i1 %cmp68.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !21 while.cond.while.end_crit_edge: ; preds = %while.body %22 = trunc i64 %indvars.iv.next to i32 store i32 %22, ptr %arrayidx56, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %for.body54 %inc92 = add nuw nsw i64 %i48.0326, 1 %exitcond357.not = icmp eq i64 %inc92, %conv16.lcssa br i1 %exitcond357.not, label %for.cond95.preheader, label %for.body54, !llvm.loop !22 for.cond.cleanup99: ; preds = %for.inc222, %for.cond49.preheader, %for.cond95.preheader %ans.0.lcssa = phi i64 [ -1000000014000000049, %for.cond95.preheader ], [ -1000000014000000049, %for.cond49.preheader ], [ %ans.5, %for.inc222 ] %call225 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 40400, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 20200, ptr nonnull %p) #4 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 i32 0 for.body100: ; preds = %for.body100.lr.ph, %for.inc222 %i94.0345 = phi i64 [ 0, %for.body100.lr.ph ], [ %inc223, %for.inc222 ] %ans.0344 = phi i64 [ -1000000014000000049, %for.body100.lr.ph ], [ %ans.5, %for.inc222 ] %arrayidx101 = getelementptr inbounds [5050 x i32], ptr @cnt, i64 0, i64 %i94.0345 %23 = load i32, ptr %arrayidx101, align 4, !tbaa !5 %add102 = add nsw i32 %23, 1 %cmp103.not = icmp slt i32 %add102, %14 br i1 %cmp103.not, label %if.else, label %for.cond106.preheader for.cond106.preheader: ; preds = %for.body100 br i1 %cmp108327, label %for.body111.preheader, label %for.inc222 for.body111.preheader: ; preds = %for.cond106.preheader br i1 %min.iters.check444, label %for.body111.preheader464, label %vector.ph445 vector.ph445: ; preds = %for.body111.preheader %minmax.ident.splatinsert454 = insertelement <2 x i64> poison, i64 %ans.0344, i64 0 %minmax.ident.splat455 = shufflevector <2 x i64> %minmax.ident.splatinsert454, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body450 vector.body450: ; preds = %vector.body450, %vector.ph445 %index451 = phi i64 [ 0, %vector.ph445 ], [ %index.next458, %vector.body450 ] %vec.phi452 = phi <2 x i64> [ %minmax.ident.splat455, %vector.ph445 ], [ %26, %vector.body450 ] %vec.phi453 = phi <2 x i64> [ %minmax.ident.splat455, %vector.ph445 ], [ %27, %vector.body450 ] %24 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %index451 %wide.load456 = load <2 x i64>, ptr %24, align 16, !tbaa !15 %25 = getelementptr inbounds i64, ptr %24, i64 2 %wide.load457 = load <2 x i64>, ptr %25, align 16, !tbaa !15 %26 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi452, <2 x i64> %wide.load456) %27 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi453, <2 x i64> %wide.load457) %index.next458 = add nuw i64 %index451, 4 %28 = icmp eq i64 %index.next458, %n.vec447 br i1 %28, label %middle.block442, label %vector.body450, !llvm.loop !23 middle.block442: ; preds = %vector.body450 %rdx.minmax459 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %26, <2 x i64> %27) %29 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax459) br i1 %cmp.n449, label %for.inc222, label %for.body111.preheader464 for.body111.preheader464: ; preds = %for.body111.preheader, %middle.block442 %j105.0329.ph = phi i64 [ 0, %for.body111.preheader ], [ %n.vec447, %middle.block442 ] %ans.1328.ph = phi i64 [ %ans.0344, %for.body111.preheader ], [ %29, %middle.block442 ] br label %for.body111 for.body111: ; preds = %for.body111.preheader464, %for.body111 %j105.0329 = phi i64 [ %inc119, %for.body111 ], [ %j105.0329.ph, %for.body111.preheader464 ] %ans.1328 = phi i64 [ %ans.1., %for.body111 ], [ %ans.1328.ph, %for.body111.preheader464 ] %arrayidx113 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %j105.0329 %30 = load i64, ptr %arrayidx113, align 8, !tbaa !15 %ans.1. = call i64 @llvm.smax.i64(i64 %ans.1328, i64 %30) %inc119 = add nuw nsw i64 %j105.0329, 1 %exitcond358.not = icmp eq i64 %inc119, %conv107 br i1 %exitcond358.not, label %for.inc222, label %for.body111, !llvm.loop !24 if.else: ; preds = %for.body100 %idxprom123 = sext i32 %23 to i64 %arrayidx124 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %idxprom123 %31 = load i64, ptr %arrayidx124, align 8, !tbaa !15 %cmp125 = icmp slt i64 %31, 1 br i1 %cmp125, label %for.cond129.preheader, label %if.else150 for.cond129.preheader: ; preds = %if.else %conv132 = sext i32 %add102 to i64 %cmp133339 = icmp sgt i32 %23, -1 br i1 %cmp133339, label %for.body136.preheader, label %for.inc222 for.body136.preheader: ; preds = %for.cond129.preheader %min.iters.check390 = icmp ult i32 %add102, 4 br i1 %min.iters.check390, label %for.body136.preheader461, label %vector.ph391 vector.ph391: ; preds = %for.body136.preheader %n.vec393 = and i64 %conv132, -4 %minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %ans.0344, i64 0 %minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body396 vector.body396: ; preds = %vector.body396, %vector.ph391 %index397 = phi i64 [ 0, %vector.ph391 ], [ %index.next401, %vector.body396 ] %vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph391 ], [ %34, %vector.body396 ] %vec.phi398 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph391 ], [ %35, %vector.body396 ] %32 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %index397 %wide.load399 = load <2 x i64>, ptr %32, align 16, !tbaa !15 %33 = getelementptr inbounds i64, ptr %32, i64 2 %wide.load400 = load <2 x i64>, ptr %33, align 16, !tbaa !15 %34 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load399) %35 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi398, <2 x i64> %wide.load400) %index.next401 = add nuw i64 %index397, 4 %36 = icmp eq i64 %index.next401, %n.vec393 br i1 %36, label %middle.block388, label %vector.body396, !llvm.loop !25 middle.block388: ; preds = %vector.body396 %rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %34, <2 x i64> %35) %37 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n395 = icmp eq i64 %n.vec393, %conv132 br i1 %cmp.n395, label %for.inc222, label %for.body136.preheader461 for.body136.preheader461: ; preds = %for.body136.preheader, %middle.block388 %j128.0341.ph = phi i64 [ 0, %for.body136.preheader ], [ %n.vec393, %middle.block388 ] %ans.2340.ph = phi i64 [ %ans.0344, %for.body136.preheader ], [ %37, %middle.block388 ] br label %for.body136 for.body136: ; preds = %for.body136.preheader461, %for.body136 %j128.0341 = phi i64 [ %inc148, %for.body136 ], [ %j128.0341.ph, %for.body136.preheader461 ] %ans.2340 = phi i64 [ %ans.2., %for.body136 ], [ %ans.2340.ph, %for.body136.preheader461 ] %arrayidx138 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %j128.0341 %38 = load i64, ptr %arrayidx138, align 8, !tbaa !15 %ans.2. = call i64 @llvm.smax.i64(i64 %ans.2340, i64 %38) %inc148 = add nuw nsw i64 %j128.0341, 1 %exitcond362.not = icmp eq i64 %inc148, %conv132 br i1 %exitcond362.not, label %for.inc222, label %for.body136, !llvm.loop !26 if.else150: ; preds = %if.else %div = sdiv i32 %14, %add102 %conv157 = sext i32 %div to i64 %mul = mul nsw i64 %31, %conv157 %cond163 = call i64 @llvm.smax.i64(i64 %ans.0344, i64 %mul) %rem = srem i32 %14, %add102 %cmp170331 = icmp sgt i32 %23, 0 br i1 %cmp170331, label %for.body173.lr.ph, label %for.cond200.preheader for.body173.lr.ph: ; preds = %if.else150 %sub178 = sub i64 %mul, %31 %min.iters.check423 = icmp ult i32 %23, 4 br i1 %min.iters.check423, label %for.body173.preheader, label %vector.ph424 vector.ph424: ; preds = %for.body173.lr.ph %n.vec426 = and i64 %idxprom123, -4 %minmax.ident.splatinsert433 = insertelement <2 x i64> poison, i64 %cond163, i64 0 %minmax.ident.splat434 = shufflevector <2 x i64> %minmax.ident.splatinsert433, <2 x i64> poison, <2 x i32> zeroinitializer %broadcast.splatinsert437 = insertelement <2 x i64> poison, i64 %sub178, i64 0 %broadcast.splat438 = shufflevector <2 x i64> %broadcast.splatinsert437, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body429 vector.body429: ; preds = %vector.body429, %vector.ph424 %index430 = phi i64 [ 0, %vector.ph424 ], [ %index.next439, %vector.body429 ] %vec.phi431 = phi <2 x i64> [ %minmax.ident.splat434, %vector.ph424 ], [ %43, %vector.body429 ] %vec.phi432 = phi <2 x i64> [ %minmax.ident.splat434, %vector.ph424 ], [ %44, %vector.body429 ] %39 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %index430 %wide.load435 = load <2 x i64>, ptr %39, align 16, !tbaa !15 %40 = getelementptr inbounds i64, ptr %39, i64 2 %wide.load436 = load <2 x i64>, ptr %40, align 16, !tbaa !15 %41 = add nsw <2 x i64> %broadcast.splat438, %wide.load435 %42 = add nsw <2 x i64> %broadcast.splat438, %wide.load436 %43 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi431, <2 x i64> %41) %44 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi432, <2 x i64> %42) %index.next439 = add nuw i64 %index430, 4 %45 = icmp eq i64 %index.next439, %n.vec426 br i1 %45, label %middle.block421, label %vector.body429, !llvm.loop !27 middle.block421: ; preds = %vector.body429 %rdx.minmax440 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %43, <2 x i64> %44) %46 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax440) %cmp.n428 = icmp eq i64 %n.vec426, %idxprom123 br i1 %cmp.n428, label %for.cond200.preheader, label %for.body173.preheader for.body173.preheader: ; preds = %for.body173.lr.ph, %middle.block421 %j166.0333.ph = phi i64 [ 0, %for.body173.lr.ph ], [ %n.vec426, %middle.block421 ] %ans.3332.ph = phi i64 [ %cond163, %for.body173.lr.ph ], [ %46, %middle.block421 ] br label %for.body173 for.cond200.preheader: ; preds = %for.body173, %middle.block421, %if.else150 %ans.3.lcssa = phi i64 [ %cond163, %if.else150 ], [ %46, %middle.block421 ], [ %ans.3.add181, %for.body173 ] %conv201 = sext i32 %rem to i64 %cmp202335 = icmp sgt i32 %rem, 0 br i1 %cmp202335, label %for.body205.preheader, label %for.inc222 for.body205.preheader: ; preds = %for.cond200.preheader %min.iters.check404 = icmp ult i32 %rem, 4 br i1 %min.iters.check404, label %for.body205.preheader462, label %vector.ph405 vector.ph405: ; preds = %for.body205.preheader %n.vec407 = and i64 %conv201, -4 %minmax.ident.splatinsert414 = insertelement <2 x i64> poison, i64 %ans.3.lcssa, i64 0 %minmax.ident.splat415 = shufflevector <2 x i64> %minmax.ident.splatinsert414, <2 x i64> poison, <2 x i32> zeroinitializer %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %mul, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body410 vector.body410: ; preds = %vector.body410, %vector.ph405 %index411 = phi i64 [ 0, %vector.ph405 ], [ %index.next418, %vector.body410 ] %vec.phi412 = phi <2 x i64> [ %minmax.ident.splat415, %vector.ph405 ], [ %51, %vector.body410 ] %vec.phi413 = phi <2 x i64> [ %minmax.ident.splat415, %vector.ph405 ], [ %52, %vector.body410 ] %47 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %index411 %wide.load416 = load <2 x i64>, ptr %47, align 16, !tbaa !15 %48 = getelementptr inbounds i64, ptr %47, i64 2 %wide.load417 = load <2 x i64>, ptr %48, align 16, !tbaa !15 %49 = add nsw <2 x i64> %wide.load416, %broadcast.splat %50 = add nsw <2 x i64> %wide.load417, %broadcast.splat %51 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi412, <2 x i64> %49) %52 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi413, <2 x i64> %50) %index.next418 = add nuw i64 %index411, 4 %53 = icmp eq i64 %index.next418, %n.vec407 br i1 %53, label %middle.block402, label %vector.body410, !llvm.loop !28 middle.block402: ; preds = %vector.body410 %rdx.minmax419 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %51, <2 x i64> %52) %54 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax419) %cmp.n409 = icmp eq i64 %n.vec407, %conv201 br i1 %cmp.n409, label %for.inc222, label %for.body205.preheader462 for.body205.preheader462: ; preds = %for.body205.preheader, %middle.block402 %j199.0337.ph = phi i64 [ 0, %for.body205.preheader ], [ %n.vec407, %middle.block402 ] %ans.4336.ph = phi i64 [ %ans.3.lcssa, %for.body205.preheader ], [ %54, %middle.block402 ] br label %for.body205 for.body173: ; preds = %for.body173.preheader, %for.body173 %j166.0333 = phi i64 [ %inc197, %for.body173 ], [ %j166.0333.ph, %for.body173.preheader ] %ans.3332 = phi i64 [ %ans.3.add181, %for.body173 ], [ %ans.3332.ph, %for.body173.preheader ] %arrayidx180 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %j166.0333 %55 = load i64, ptr %arrayidx180, align 8, !tbaa !15 %add181 = add nsw i64 %sub178, %55 %ans.3.add181 = call i64 @llvm.smax.i64(i64 %ans.3332, i64 %add181) %inc197 = add nuw nsw i64 %j166.0333, 1 %exitcond359.not = icmp eq i64 %inc197, %idxprom123 br i1 %exitcond359.not, label %for.cond200.preheader, label %for.body173, !llvm.loop !29 for.body205: ; preds = %for.body205.preheader462, %for.body205 %j199.0337 = phi i64 [ %inc219, %for.body205 ], [ %j199.0337.ph, %for.body205.preheader462 ] %ans.4336 = phi i64 [ %ans.4.add208, %for.body205 ], [ %ans.4336.ph, %for.body205.preheader462 ] %arrayidx207 = getelementptr inbounds [5050 x [5050 x i64]], ptr @scr, i64 0, i64 %i94.0345, i64 %j199.0337 %56 = load i64, ptr %arrayidx207, align 8, !tbaa !15 %add208 = add nsw i64 %56, %mul %ans.4.add208 = call i64 @llvm.smax.i64(i64 %ans.4336, i64 %add208) %inc219 = add nuw nsw i64 %j199.0337, 1 %exitcond360.not = icmp eq i64 %inc219, %conv201 br i1 %exitcond360.not, label %for.inc222, label %for.body205, !llvm.loop !30 for.inc222: ; preds = %for.body111, %for.body205, %for.body136, %middle.block442, %middle.block402, %middle.block388, %for.cond106.preheader, %for.cond200.preheader, %for.cond129.preheader %ans.5 = phi i64 [ %ans.0344, %for.cond129.preheader ], [ %ans.3.lcssa, %for.cond200.preheader ], [ %ans.0344, %for.cond106.preheader ], [ %37, %middle.block388 ], [ %54, %middle.block402 ], [ %29, %middle.block442 ], [ %ans.2., %for.body136 ], [ %ans.4.add208, %for.body205 ], [ %ans.1., %for.body111 ] %inc223 = add nuw nsw i64 %i94.0345, 1 %exitcond363.not = icmp eq i64 %inc223, %conv16.lcssa br i1 %exitcond363.not, label %for.cond.cleanup99, label %for.body100, !llvm.loop !31 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 ; 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 <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x 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, !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 = !{!16, !16, i64 0} !16 = !{!"long long", !7, i64 0} !17 = distinct !{!17, !10, !11, !12} !18 = distinct !{!18, !10, !12, !11} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10, !11, !12} !24 = distinct !{!24, !10, !12, !11} !25 = distinct !{!25, !10, !11, !12} !26 = distinct !{!26, !10, !12, !11} !27 = distinct !{!27, !10, !11, !12} !28 = distinct !{!28, !10, !11, !12} !29 = distinct !{!29, !10, !12, !11} !30 = distinct !{!30, !10, !12, !11} !31 = distinct !{!31, !10}
#include <stdio.h> char Ps[2][200000]; int NPs; int check(){ int x=0, y=0, P; char V = 0; while(x != NPs){ P = Ps[y][x]; if(V){ if(P == '1' || P == '2') return 0; else{ V = 0; x++; } } else { if(P == '1' || P == '2') x++; else{ V = 1; y = !y; } } } if(y == 1) return 1; else return 0; } int main(){ int i, j, q; scanf("%d", &q); for(i=0; i<q; i++){ scanf("%d", &NPs); scanf("\n"); for(j=0; j<NPs; j++){ scanf("%c", &Ps[0][j]); } scanf("\n"); for(j=0; j<NPs; j++){ scanf("%c", &Ps[1][j]); } if(check()) printf("YES\n"); else printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14337/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14337/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @NPs = dso_local global i32 0, align 4 @Ps = dso_local global [2 x [200000 x i8]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @check() local_unnamed_addr #0 { entry: %0 = load i32, ptr @NPs, align 4, !tbaa !5 %cmp.not37 = icmp eq i32 %0, 0 br i1 %cmp.not37, label %cleanup, label %while.body while.body: ; preds = %entry, %if.end19 %V.040 = phi i8 [ %V.1, %if.end19 ], [ 0, %entry ] %y.039 = phi i32 [ %y.1, %if.end19 ], [ 0, %entry ] %x.038 = phi i32 [ %x.1, %if.end19 ], [ 0, %entry ] %idxprom = zext i32 %y.039 to i64 %idxprom1 = sext i32 %x.038 to i64 %arrayidx2 = getelementptr inbounds [2 x [200000 x i8]], ptr @Ps, i64 0, i64 %idxprom, i64 %idxprom1 %1 = load i8, ptr %arrayidx2, align 1, !tbaa !9 %tobool.not = icmp eq i8 %V.040, 0 %2 = add i8 %1, -49 %or.cond27 = icmp ult i8 %2, 2 br i1 %tobool.not, label %if.else8, label %if.then if.then: ; preds = %while.body br i1 %or.cond27, label %cleanup, label %if.else if.else: ; preds = %if.then %inc = add nsw i32 %x.038, 1 br label %if.end19 if.else8: ; preds = %while.body br i1 %or.cond27, label %if.then14, label %if.else16 if.then14: ; preds = %if.else8 %inc15 = add nsw i32 %x.038, 1 br label %if.end19 if.else16: ; preds = %if.else8 %tobool17.not = icmp eq i32 %y.039, 0 %lnot.ext = zext i1 %tobool17.not to i32 br label %if.end19 if.end19: ; preds = %if.then14, %if.else16, %if.else %x.1 = phi i32 [ %inc, %if.else ], [ %inc15, %if.then14 ], [ %x.038, %if.else16 ] %y.1 = phi i32 [ %y.039, %if.else ], [ %y.039, %if.then14 ], [ %lnot.ext, %if.else16 ] %V.1 = phi i8 [ 0, %if.else ], [ 0, %if.then14 ], [ 1, %if.else16 ] %cmp.not = icmp eq i32 %x.1, %0 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !10 while.end.loopexit: ; preds = %if.end19 %3 = icmp eq i32 %y.1, 1 %4 = zext i1 %3 to i32 br label %cleanup cleanup: ; preds = %if.then, %entry, %while.end.loopexit %retval.0 = phi i32 [ 0, %entry ], [ %4, %while.end.loopexit ], [ 0, %if.then ] 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: %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %0 = load i32, ptr %q, align 4, !tbaa !5 %cmp36 = icmp sgt i32 %0, 0 br i1 %cmp36, label %for.body, label %for.end22 for.body: ; preds = %entry, %for.inc20 %i.037 = phi i32 [ %inc21, %for.inc20 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @NPs) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1) %1 = load i32, ptr @NPs, align 4, !tbaa !5 %cmp432 = icmp sgt i32 %1, 0 br i1 %cmp432, label %for.body5, label %for.end for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [200000 x i8], ptr @Ps, i64 0, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr @NPs, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body5, %for.body %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1) %4 = load i32, ptr @NPs, align 4, !tbaa !5 %cmp934 = icmp sgt i32 %4, 0 br i1 %cmp934, label %for.body10, label %for.end16 for.body10: ; preds = %for.end, %for.body10 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body10 ], [ 0, %for.end ] %arrayidx12 = getelementptr inbounds [2 x [200000 x i8]], ptr @Ps, i64 0, i64 1, i64 %indvars.iv40 %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx12) %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %5 = load i32, ptr @NPs, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp9 = icmp slt i64 %indvars.iv.next41, %6 br i1 %cmp9, label %for.body10, label %for.end16, !llvm.loop !13 for.end16: ; preds = %for.body10, %for.end %.lcssa = phi i32 [ %4, %for.end ], [ %5, %for.body10 ] %cmp.not37.i = icmp eq i32 %.lcssa, 0 br i1 %cmp.not37.i, label %if.else, label %while.body.i while.body.i: ; preds = %for.end16, %if.end19.i %V.040.i = phi i8 [ %V.1.i, %if.end19.i ], [ 0, %for.end16 ] %y.039.i = phi i32 [ %y.1.i, %if.end19.i ], [ 0, %for.end16 ] %x.038.i = phi i32 [ %x.1.i, %if.end19.i ], [ 0, %for.end16 ] %idxprom.i = zext i32 %y.039.i to i64 %idxprom1.i = sext i32 %x.038.i to i64 %arrayidx2.i = getelementptr inbounds [2 x [200000 x i8]], ptr @Ps, i64 0, i64 %idxprom.i, i64 %idxprom1.i %7 = load i8, ptr %arrayidx2.i, align 1, !tbaa !9 %tobool.not.i = icmp eq i8 %V.040.i, 0 %8 = add i8 %7, -49 %or.cond27.i = icmp ult i8 %8, 2 br i1 %tobool.not.i, label %if.else8.i, label %if.then.i if.then.i: ; preds = %while.body.i br i1 %or.cond27.i, label %if.else, label %if.else.i if.else.i: ; preds = %if.then.i %inc.i = add nsw i32 %x.038.i, 1 br label %if.end19.i if.else8.i: ; preds = %while.body.i br i1 %or.cond27.i, label %if.then14.i, label %if.else16.i if.then14.i: ; preds = %if.else8.i %inc15.i = add nsw i32 %x.038.i, 1 br label %if.end19.i if.else16.i: ; preds = %if.else8.i %tobool17.not.i = icmp eq i32 %y.039.i, 0 %lnot.ext.i = zext i1 %tobool17.not.i to i32 br label %if.end19.i if.end19.i: ; preds = %if.else16.i, %if.then14.i, %if.else.i %x.1.i = phi i32 [ %inc.i, %if.else.i ], [ %inc15.i, %if.then14.i ], [ %x.038.i, %if.else16.i ] %y.1.i = phi i32 [ %y.039.i, %if.else.i ], [ %y.039.i, %if.then14.i ], [ %lnot.ext.i, %if.else16.i ] %V.1.i = phi i8 [ 0, %if.else.i ], [ 0, %if.then14.i ], [ 1, %if.else16.i ] %cmp.not.i = icmp eq i32 %x.1.i, %.lcssa br i1 %cmp.not.i, label %check.exit, label %while.body.i, !llvm.loop !10 check.exit: ; preds = %if.end19.i %.not = icmp eq i32 %y.1.i, 1 br i1 %.not, label %for.inc20, label %if.else if.else: ; preds = %if.then.i, %for.end16, %check.exit br label %for.inc20 for.inc20: ; preds = %check.exit, %if.else %str.5.sink = phi ptr [ @str, %if.else ], [ @str.5, %check.exit ] %puts29 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) %inc21 = add nuw nsw i32 %i.037, 1 %9 = load i32, ptr %q, align 4, !tbaa !5 %cmp = icmp slt i32 %inc21, %9 br i1 %cmp, label %for.body, label %for.end22, !llvm.loop !14 for.end22: ; preds = %for.inc20, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11} !14 = distinct !{!14, !11}
#include "stdio.h" typedef long long LL; int q, n; LL sum, ans, t; int main() { int i; scanf("%d", &q); while(q--) { sum = 0; scanf("%d", &n); for(i=1; i<=n; ++i) { scanf("%I64d", &t); sum += t; } printf("%I64d\n", sum/n+!!(sum%n) ); } return 0; } /* 3 5 1 2 3 4 5 3 1 2 2 4 1 1 1 1 */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14342/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14342/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @q = dso_local global i32 0, align 4 @sum = dso_local local_unnamed_addr global i64 0, align 8 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1 @t = dso_local global i64 0, align 8 @.str.2 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1 @ans = dso_local local_unnamed_addr global i64 0, align 8 ; 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 @q) %0 = load i32, ptr @q, align 4, !tbaa !5 %dec12 = add nsw i32 %0, -1 store i32 %dec12, ptr @q, align 4, !tbaa !5 %tobool.not13 = icmp eq i32 %0, 0 br i1 %tobool.not13, label %while.end, label %while.body while.body: ; preds = %entry, %for.end store i64 0, ptr @sum, align 8, !tbaa !9 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not10 = icmp slt i32 %1, 1 br i1 %cmp.not10, label %while.body.for.end_crit_edge, label %for.body while.body.for.end_crit_edge: ; preds = %while.body %.pre = load i64, ptr @sum, align 8, !tbaa !9 br label %for.end for.body: ; preds = %while.body, %for.body %i.011 = phi i32 [ %inc, %for.body ], [ 1, %while.body ] %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @t) %2 = load i64, ptr @t, align 8, !tbaa !9 %3 = load i64, ptr @sum, align 8, !tbaa !9 %add = add nsw i64 %3, %2 store i64 %add, ptr @sum, align 8, !tbaa !9 %inc = add nuw nsw i32 %i.011, 1 %4 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.011, %4 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %while.body.for.end_crit_edge %5 = phi i64 [ %.pre, %while.body.for.end_crit_edge ], [ %add, %for.body ] %.lcssa = phi i32 [ %1, %while.body.for.end_crit_edge ], [ %4, %for.body ] %conv = sext i32 %.lcssa to i64 %div = sdiv i64 %5, %conv %rem = srem i64 %5, %conv %tobool4 = icmp ne i64 %rem, 0 %conv6 = zext i1 %tobool4 to i64 %add7 = add nsw i64 %div, %conv6 %call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add7) %6 = load i32, ptr @q, align 4, !tbaa !5 %dec = add nsw i32 %6, -1 store i32 %dec, ptr @q, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %for.end, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdio.h> char seat[1000][7]; int main() { int i,n,no=1; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s",seat[i]); if(no) if(seat[i][0]=='O' && seat[i][1]=='O') seat[i][0] = seat[i][1] = '+', no = 0; else if(seat[i][3]=='O' && seat[i][4]=='O') seat[i][3] = seat[i][4] = '+', no = 0; } if(no) puts("NO"); else { puts("YES"); for(i=0;i<n;i++) puts(seat[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1435/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1435/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @seat = dso_local global [1000 x [7 x i8]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 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 %cmp73 = icmp sgt i32 %0, 0 br i1 %cmp73, label %for.body, label %if.then43 for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %no.075 = phi i32 [ %no.1, %for.inc ], [ 1, %entry ] %arrayidx = getelementptr inbounds [1000 x [7 x i8]], ptr @seat, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %tobool.not = icmp eq i32 %no.075, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.body %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp5 = icmp eq i8 %1, 79 br i1 %cmp5, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %if.then %arrayidx9 = getelementptr inbounds [1000 x [7 x i8]], ptr @seat, i64 0, i64 %indvars.iv, i64 1 %2 = load i8, ptr %arrayidx9, align 1, !tbaa !9 %cmp11 = icmp eq i8 %2, 79 br i1 %cmp11, label %for.inc.sink.split, label %if.else if.else: ; preds = %land.lhs.true, %if.then %arrayidx22 = getelementptr inbounds [1000 x [7 x i8]], ptr @seat, i64 0, i64 %indvars.iv, i64 3 %3 = load i8, ptr %arrayidx22, align 1, !tbaa !9 %cmp24 = icmp eq i8 %3, 79 br i1 %cmp24, label %land.lhs.true26, label %for.inc land.lhs.true26: ; preds = %if.else %arrayidx29 = getelementptr inbounds [1000 x [7 x i8]], ptr @seat, i64 0, i64 %indvars.iv, i64 4 %4 = load i8, ptr %arrayidx29, align 1, !tbaa !9 %cmp31 = icmp eq i8 %4, 79 br i1 %cmp31, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %land.lhs.true26, %land.lhs.true %arrayidx29.sink = phi ptr [ %arrayidx9, %land.lhs.true ], [ %arrayidx29, %land.lhs.true26 ] %arrayidx22.sink = phi ptr [ %arrayidx, %land.lhs.true ], [ %arrayidx22, %land.lhs.true26 ] store i8 43, ptr %arrayidx29.sink, align 1, !tbaa !9 store i8 43, ptr %arrayidx22.sink, align 1, !tbaa !9 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %for.body, %if.else, %land.lhs.true26 %5 = phi i1 [ false, %land.lhs.true26 ], [ false, %if.else ], [ true, %for.body ], [ true, %for.inc.sink.split ] %no.1 = phi i32 [ 1, %land.lhs.true26 ], [ 1, %if.else ], [ 0, %for.body ], [ 0, %for.inc.sink.split ] %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.end, !llvm.loop !10 for.end: ; preds = %for.inc br i1 %5, label %if.else45, label %if.then43 if.then43: ; preds = %entry, %for.end %call44 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end58 if.else45: ; preds = %for.end %call46 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp4876 = icmp sgt i32 %8, 0 br i1 %cmp4876, label %for.body50, label %if.end58 for.body50: ; preds = %if.else45, %for.body50 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body50 ], [ 0, %if.else45 ] %arrayidx52 = getelementptr inbounds [1000 x [7 x i8]], ptr @seat, i64 0, i64 %indvars.iv79 %call54 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %arrayidx52) %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp48 = icmp slt i64 %indvars.iv.next80, %10 br i1 %cmp48, label %for.body50, label %if.end58, !llvm.loop !12 if.end58: ; preds = %for.body50, %if.else45, %if.then43 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> int chk(double x1,double y1, double x2,double y2, double x3,double y3, double xp,double yp); int main(){ double x1,y1,x2,y2,x3,y3,xp,yp; while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){ //printf("%.3lf %.3lf %.3lf %.3lf %.3lf %.3lf %.3lf %.3lf\n",x1,y1,x2,y2,x3,y3,xp,yp); printf(chk(x1,y1,x2,y2,x3,y3,xp,yp)?"YES\n":"NO\n"); } return 0; } int chk(double x1,double y1, double x2,double y2, double x3,double y3, double xp,double yp){ // p=sa+tb // a.x * s + b.x * t = p.x; // a.y * s + b.y * t = p.y; // p=(xp-x1,yp-y1); // a=(x2-x1,y2-y1); // b=(x3-x1,y3-y1); double a,b,c,d,e,f; double s,t; a=x2-x1; b=x3-x1; c=xp-x1; d=y2-y1; e=y3-y1; f=yp-y1; s=(-e*c+b*f)/(-a*e+b*d); t=(+d*c-a*f)/(-a*e+b*d); //printf("%.3lf,%.3lf",s,t); if(s>0 && t>0 && s+t<1 )return 1; return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143542/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143542/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"YES\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"NO\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x1 = alloca double, align 8 %y1 = alloca double, align 8 %x2 = alloca double, align 8 %y2 = alloca double, align 8 %x3 = alloca double, align 8 %y3 = alloca double, align 8 %xp = alloca double, align 8 %yp = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x3) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y3) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xp) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yp) #6 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp) %cmp.not4 = icmp eq i32 %call3, -1 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load double, ptr %x1, align 8, !tbaa !5 %1 = load double, ptr %y1, align 8, !tbaa !5 %2 = load double, ptr %x2, align 8, !tbaa !5 %3 = load double, ptr %y2, align 8, !tbaa !5 %4 = load double, ptr %x3, align 8, !tbaa !5 %5 = load double, ptr %y3, align 8, !tbaa !5 %6 = load double, ptr %xp, align 8, !tbaa !5 %7 = load double, ptr %yp, align 8, !tbaa !5 %sub.i = fsub double %2, %0 %sub1.i = fsub double %4, %0 %sub2.i = fsub double %6, %0 %sub3.i = fsub double %3, %1 %sub4.i = fsub double %5, %1 %sub5.i = fsub double %7, %1 %fneg.i = fneg double %sub4.i %fneg7.i = fneg double %sub.i %mul8.i = fmul double %sub3.i, %sub1.i %8 = call double @llvm.fmuladd.f64(double %fneg7.i, double %sub4.i, double %mul8.i) %9 = insertelement <2 x double> poison, double %sub5.i, i64 0 %10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer %11 = insertelement <2 x double> poison, double %sub1.i, i64 0 %12 = insertelement <2 x double> %11, double %fneg7.i, i64 1 %13 = fmul <2 x double> %10, %12 %14 = insertelement <2 x double> poison, double %fneg.i, i64 0 %15 = insertelement <2 x double> %14, double %sub3.i, i64 1 %16 = insertelement <2 x double> poison, double %sub2.i, i64 0 %17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer %18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %15, <2 x double> %17, <2 x double> %13) %19 = insertelement <2 x double> poison, double %8, i64 0 %20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer %21 = fdiv <2 x double> %18, %20 %22 = fcmp ogt <2 x double> %21, zeroinitializer %shift = shufflevector <2 x i1> %22, <2 x i1> poison, <2 x i32> <i32 1, i32 poison> %23 = and <2 x i1> %22, %shift %or.cond.i = extractelement <2 x i1> %23, i64 0 %shift5 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> <i32 1, i32 poison> %24 = fadd <2 x double> %21, %shift5 %add.i = extractelement <2 x double> %24, i64 0 %cmp15.i = fcmp olt double %add.i, 1.000000e+00 %or.cond39.i = and i1 %or.cond.i, %cmp15.i %cond = select i1 %or.cond39.i, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yp) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xp) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y3) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x3) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @chk(double noundef %x1, double noundef %y1, double noundef %x2, double noundef %y2, double noundef %x3, double noundef %y3, double noundef %xp, double noundef %yp) local_unnamed_addr #3 { entry: %sub = fsub double %x2, %x1 %sub1 = fsub double %x3, %x1 %sub2 = fsub double %xp, %x1 %sub3 = fsub double %y2, %y1 %sub4 = fsub double %y3, %y1 %sub5 = fsub double %yp, %y1 %fneg = fneg double %sub4 %fneg7 = fneg double %sub %mul8 = fmul double %sub3, %sub1 %0 = tail call double @llvm.fmuladd.f64(double %fneg7, double %sub4, double %mul8) %1 = insertelement <2 x double> poison, double %sub5, i64 0 %2 = shufflevector <2 x double> %1, <2 x double> poison, <2 x i32> zeroinitializer %3 = insertelement <2 x double> poison, double %sub1, i64 0 %4 = insertelement <2 x double> %3, double %fneg7, i64 1 %5 = fmul <2 x double> %2, %4 %6 = insertelement <2 x double> poison, double %fneg, i64 0 %7 = insertelement <2 x double> %6, double %sub3, i64 1 %8 = insertelement <2 x double> poison, double %sub2, i64 0 %9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> zeroinitializer %10 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %5) %11 = insertelement <2 x double> poison, double %0, i64 0 %12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer %13 = fdiv <2 x double> %10, %12 %14 = fcmp ogt <2 x double> %13, zeroinitializer %shift = shufflevector <2 x i1> %14, <2 x i1> poison, <2 x i32> <i32 1, i32 poison> %15 = and <2 x i1> %14, %shift %or.cond = extractelement <2 x i1> %15, i64 0 %shift40 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> <i32 1, i32 poison> %16 = fadd <2 x double> %13, %shift40 %add = extractelement <2 x double> %16, i64 0 %cmp15 = fcmp olt double %add, 1.000000e+00 %or.cond39 = and i1 %or.cond, %cmp15 %retval.0 = zext i1 %or.cond39 to i32 ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = !{!"double", !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, a, cnt = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a); if (a & 1) { cnt++; } } if (cnt % 2 == 0) { printf("YES\n"); } else { printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143586/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143586/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body, label %if.end7 for.cond.cleanup: ; preds = %for.body %1 = and i32 %spec.select, 1 %2 = icmp eq i32 %1, 0 %spec.select15 = select i1 %2, ptr @str.3, ptr @str br label %if.end7 for.body: ; preds = %entry, %for.body %i.013 = phi i32 [ %inc2, %for.body ], [ 0, %entry ] %cnt.012 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %3 = load i32, ptr %a, align 4, !tbaa !5 %and = and i32 %3, 1 %spec.select = add i32 %and, %cnt.012 %inc2 = add nuw nsw i32 %i.013, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc2, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 if.end7: ; preds = %for.cond.cleanup, %entry %str.sink = phi ptr [ @str.3, %entry ], [ %spec.select15, %for.cond.cleanup ] %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> #include <stdlib.h> #include <string.h> #include <math.h> #define swap(type,a,b) do{type t=a;a=b;b=t;}while(0); #define MAX(a,b) (((a)>(b))?(a):(b)) #define MIN(a,b) (((a)<(b))?(a):(b)) #define ll long long #define INF 100000000 #define FOR(i,a,n) for(i=a;i<n;i++) int comp(const void* a,const void* b){ return *(int*)a-*(int*)b; } void fill(int a[],int b,int c){ int i; FOR(i,0,b) a[i]=c; return; } int main(void) { int n,a,cnt=0,i; scanf("%d",&n); FOR(i,0,n){ scanf("%d",&a); if(a%2) cnt++; } printf("%s\n",cnt%2?"NO":"YES"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143636/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143636/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable define dso_local void @fill(ptr nocapture noundef writeonly %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #1 { entry: %cmp3 = icmp sgt i32 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %b to i64 %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader6, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %c, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %0 = getelementptr inbounds i32, ptr %a, i64 %index store <4 x i32> %broadcast.splat, ptr %0, align 4, !tbaa !5 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %broadcast.splat, ptr %1, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader6 for.body.preheader6: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader6, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader6 ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv store i32 %c, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %a = 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 %a) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %0, 0 br i1 %cmp8, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.010 = phi i32 [ %inc2, %for.body ], [ 0, %entry ] %cnt.09 = phi i32 [ %spec.select, %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 %spec.select = add i32 %2, %cnt.09 %inc2 = add nuw nsw i32 %i.010, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc2, %3 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !14 for.end.loopexit: ; preds = %for.body %4 = and i32 %spec.select, 1 %5 = icmp eq i32 %4, 0 %6 = select i1 %5, ptr @.str.3, ptr @.str.2 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %cnt.0.lcssa = phi ptr [ @.str.3, %entry ], [ %6, %for.end.loopexit ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10}
#include<stdio.h> #include<math.h> int main() { int t,i,y,x,n; double sum; scanf("%d",&t); while(t--) { scanf("%d",&n); sum=0; for(i=0;i<n;i++) { scanf("%d",&x); sum+=x; } sum=sum/n; y=ceil(sum); printf("%d\n",y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14368/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14368/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %x = alloca i32, align 4 %n = 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 %x) #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 %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec13 = add nsw i32 %0, -1 store i32 %dec13, ptr %t, align 4, !tbaa !5 %tobool.not14 = icmp eq i32 %0, 0 br i1 %tobool.not14, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %1, 0 br i1 %cmp9, label %for.body, label %for.end for.body: ; preds = %while.body, %for.body %sum.011 = phi double [ %add, %for.body ], [ 0.000000e+00, %while.body ] %i.010 = phi i32 [ %inc, %for.body ], [ 0, %while.body ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %2 = load i32, ptr %x, align 4, !tbaa !5 %conv = sitofp i32 %2 to double %add = fadd double %sum.011, %conv %inc = add nuw nsw i32 %i.010, 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, %while.body %sum.0.lcssa = phi double [ 0.000000e+00, %while.body ], [ %add, %for.body ] %.lcssa = phi i32 [ %1, %while.body ], [ %3, %for.body ] %conv3 = sitofp i32 %.lcssa to double %div = fdiv double %sum.0.lcssa, %conv3 %4 = call double @llvm.ceil.f64(double %div) %conv4 = fptosi double %4 to i32 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv4) %5 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %5, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.ceil.f64(double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ long a,b; while (scanf("%ld %ld",&a,&b) && a!=0 || b!=0){ long n; if(b>=a){ n=a; a=b; b=n; } long k,count=0; while(b > 0){ k = a%b; a = b; b = k; count++; } printf("%ld %ld\n",a,count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143722/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143722/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\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 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %tobool15 = icmp ne i32 %call14, 0 %0 = load i64, ptr %a, align 8 %cmp16 = icmp ne i64 %0, 0 %or.cond17 = select i1 %tobool15, i1 %cmp16, i1 false %1 = load i64, ptr %b, align 8 %cmp118 = icmp ne i64 %1, 0 %or.cond819 = select i1 %or.cond17, i1 true, i1 %cmp118 br i1 %or.cond819, label %while.body, label %while.end7 while.body: ; preds = %entry, %while.end %2 = phi i64 [ %8, %while.end ], [ %1, %entry ] %3 = phi i64 [ %7, %while.end ], [ %0, %entry ] %cmp2.not = icmp slt i64 %2, %3 br i1 %cmp2.not, label %if.end, label %if.then if.then: ; preds = %while.body store i64 %2, ptr %a, align 8, !tbaa !5 store i64 %3, ptr %b, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %a.promoted = phi i64 [ %2, %if.then ], [ %3, %while.body ] %.pr = phi i64 [ %3, %if.then ], [ %2, %while.body ] %cmp412 = icmp sgt i64 %.pr, 0 br i1 %cmp412, label %while.body5, label %while.end while.body5: ; preds = %if.end, %while.body5 %count.013 = phi i64 [ %inc, %while.body5 ], [ 0, %if.end ] %4 = phi i64 [ %rem, %while.body5 ], [ %.pr, %if.end ] %5 = phi i64 [ %4, %while.body5 ], [ %a.promoted, %if.end ] %rem = srem i64 %5, %4 %inc = add nuw nsw i64 %count.013, 1 %cmp4 = icmp sgt i64 %rem, 0 br i1 %cmp4, label %while.body5, label %while.cond3.while.end_crit_edge, !llvm.loop !9 while.cond3.while.end_crit_edge: ; preds = %while.body5 store i64 %4, ptr %a, align 8, !tbaa !5 store i64 %rem, ptr %b, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond3.while.end_crit_edge, %if.end %6 = phi i64 [ %4, %while.cond3.while.end_crit_edge ], [ %a.promoted, %if.end ] %count.0.lcssa = phi i64 [ %inc, %while.cond3.while.end_crit_edge ], [ 0, %if.end ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %6, i64 noundef %count.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %tobool = icmp ne i32 %call, 0 %7 = load i64, ptr %a, align 8 %cmp = icmp ne i64 %7, 0 %or.cond = select i1 %tobool, i1 %cmp, i1 false %8 = load i64, ptr %b, align 8 %cmp1 = icmp ne i64 %8, 0 %or.cond8 = select i1 %or.cond, i1 true, i1 %cmp1 br i1 %or.cond8, label %while.body, label %while.end7, !llvm.loop !11 while.end7: ; preds = %while.end, %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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !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,b,tmp,mod,step; while(1){ step=0; scanf("%d %d",&a,&b); if(a==0 && b==0){ break; } if(a<b){ tmp=a; a=b; b=tmp; } mod=a%b; step+=1; while(mod!=0){ a=b; b=mod; mod=a%b; step+=1; } printf("%d %d\n",b,step); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143795/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143795/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp22 = icmp eq i32 %0, 0 %1 = load i32, ptr %b, align 4 %cmp123 = icmp eq i32 %1, 0 %or.cond24 = select i1 %cmp22, i1 %cmp123, i1 false br i1 %or.cond24, label %while.end11, label %if.end if.end: ; preds = %entry, %while.end %2 = phi i32 [ %8, %while.end ], [ %1, %entry ] %3 = phi i32 [ %7, %while.end ], [ %0, %entry ] %cmp2 = icmp slt i32 %3, %2 br i1 %cmp2, label %if.then3, label %if.end4 if.then3: ; preds = %if.end store i32 %2, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %b, align 4, !tbaa !5 br label %if.end4 if.end4: ; preds = %if.then3, %if.end %4 = phi i32 [ %3, %if.then3 ], [ %2, %if.end ] %5 = phi i32 [ %2, %if.then3 ], [ %3, %if.end ] %rem = srem i32 %5, %4 %cmp6.not17 = icmp eq i32 %rem, 0 br i1 %cmp6.not17, label %while.end, label %while.body7 while.body7: ; preds = %if.end4, %while.body7 %step.020 = phi i32 [ %add9, %while.body7 ], [ 1, %if.end4 ] %mod.019 = phi i32 [ %rem8, %while.body7 ], [ %rem, %if.end4 ] %mod.01618 = phi i32 [ %mod.019, %while.body7 ], [ %4, %if.end4 ] %rem8 = srem i32 %mod.01618, %mod.019 %add9 = add nuw nsw i32 %step.020, 1 %cmp6.not = icmp eq i32 %rem8, 0 br i1 %cmp6.not, label %while.cond5.while.end_crit_edge, label %while.body7, !llvm.loop !9 while.cond5.while.end_crit_edge: ; preds = %while.body7 store i32 %mod.01618, ptr %a, align 4, !tbaa !5 store i32 %mod.019, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond5.while.end_crit_edge, %if.end4 %6 = phi i32 [ %mod.019, %while.cond5.while.end_crit_edge ], [ %4, %if.end4 ] %step.0.lcssa = phi i32 [ %add9, %while.cond5.while.end_crit_edge ], [ 1, %if.end4 ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %step.0.lcssa) %call = 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 %cmp = icmp eq i32 %7, 0 %8 = load i32, ptr %b, align 4 %cmp1 = icmp eq i32 %8, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end11, label %if.end while.end11: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int a, b, x; scanf("%d%d", &a, &b); x = (a + b) / 2; if ((a + b) % 2 == 1) x++; printf("%d\n", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143838/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %2 = and i32 %add, -2147483647 %cmp = icmp eq i32 %2, 1 %inc = zext i1 %cmp to i32 %spec.select = add nsw i32 %div, %inc %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main() { int i,j; float c; scanf("%d%d",&i,&j); c=(i+j)/2; if(i%2==0&&j%2!=0||i%2!=0&&j%2==0){printf("%.f",round(c)+1);} else if(i%2==0&&j%2==0){ printf("%.f",round(c));} else if(i%2!=0&&j%2!=0){printf("%.f",round(c));} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143881/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143881/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #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 %i, ptr noundef nonnull %j) %0 = load i32, ptr %i, align 4, !tbaa !5 %1 = load i32, ptr %j, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %div = sdiv i32 %add, 2 %conv = sitofp i32 %div to float %2 = and i32 %0, 1 %cmp = icmp ne i32 %2, 0 %3 = and i32 %1, 1 %cmp3.not = icmp eq i32 %3, 0 %or.cond = select i1 %cmp, i1 true, i1 %cmp3.not br i1 %or.cond, label %lor.lhs.false, label %if.then lor.lhs.false: ; preds = %entry %cmp6.not = icmp eq i32 %2, 0 br i1 %cmp6.not, label %land.lhs.true18, label %land.lhs.true8 land.lhs.true8: ; preds = %lor.lhs.false br i1 %cmp3.not, label %if.then, label %if.then33 if.then: ; preds = %entry, %land.lhs.true8 %4 = fpext float %conv to double %add13 = fadd double %4, 1.000000e+00 br label %if.end37.sink.split land.lhs.true18: ; preds = %lor.lhs.false br i1 %cmp3.not, label %if.then22, label %if.end37 if.then22: ; preds = %land.lhs.true18 %5 = fpext float %conv to double br label %if.end37.sink.split if.then33: ; preds = %land.lhs.true8 %6 = fpext float %conv to double br label %if.end37.sink.split if.end37.sink.split: ; preds = %if.then, %if.then33, %if.then22 %.sink = phi double [ %5, %if.then22 ], [ %6, %if.then33 ], [ %add13, %if.then ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %.sink) br label %if.end37 if.end37: ; preds = %if.end37.sink.split, %land.lhs.true18 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int ave(int a, int b ) { int ave; ave = (a + b) / 2; if((a + b) % 2 == 1) { ave++; } return ave; } int main(void) { int A, B; scanf("%d",&A); scanf("%d",&B); printf("%d",ave(A, B)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143924/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143924/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ave(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %add = add nsw i32 %b, %a %div = sdiv i32 %add, 2 %0 = and i32 %add, -2147483647 %cmp = icmp eq i32 %0, 1 %inc = zext i1 %cmp to i32 %spec.select = add nsw i32 %div, %inc ret i32 %spec.select } ; 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 i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %add.i = add nsw i32 %1, %0 %div.i = sdiv i32 %add.i, 2 %2 = and i32 %add.i, -2147483647 %cmp.i = icmp eq i32 %2, 1 %inc.i = zext i1 %cmp.i to i32 %spec.select.i = add nsw i32 %div.i, %inc.i %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: 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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a, b, x; scanf("%d %d", &a, &b); x = ((a+b)+2-1)/2; printf("%d\n", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add i32 %0, 1 %sub = add i32 %add, %1 %div = sdiv i32 %sub, 2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int T, flag; long long l, r, x, y, res; scanf("%d", &T); while(T--){ scanf("%lld %lld", &l, &r); if(l*2<=r){ printf("%lld %lld\n", l, l*2); } else{ printf("-1 -1\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14401/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14401/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.2 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 @str = private unnamed_addr constant [6 x i8] c"-1 -1\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 i64, align 8 %r = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %dec5 = add nsw i32 %0, -1 store i32 %dec5, ptr %T, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r) %1 = load i64, ptr %l, align 8, !tbaa !9 %mul = shl nsw i64 %1, 1 %2 = load i64, ptr %r, align 8, !tbaa !9 %cmp.not = icmp sgt i64 %mul, %2 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %while.body %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %1, i64 noundef %mul) br label %if.end if.else: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then %3 = load i32, ptr %T, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %T, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int a, b; scanf("%d%d", &a, &b); printf("%d", (int)(a+b+1)/2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144060/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144060/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add i32 %0, 1 %add1 = add i32 %add, %1 %div = sdiv i32 %add1, 2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b,s,n; double p,c; scanf("%d%d",&a,&b); s=a+b; p=s*1.0/2; n=s/2; c=p-n; if(c>=0.5) printf("%d\n",n+1); else printf("%d\n",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144110/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144110/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %conv = sitofp i32 %add to double %div = fmul double %conv, 5.000000e-01 %div1 = sdiv i32 %add, 2 %conv2 = sitofp i32 %div1 to double %sub = fsub double %div, %conv2 %cmp = fcmp oge double %sub, 5.000000e-01 %add4 = zext i1 %cmp to i32 %div1.sink = add nsw i32 %div1, %add4 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div1.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int n,i,j,a[50001]={0}; char p[50001]={1,1}; for(i=2;i*i<50001;i++){ if(p[i])continue; for(j=i*i;j<50001;j+=i)p[j]=1; } for(i=0;i<50001;i++){ for(j=1;j*2<=i;j++){ if(p[j]+p[i-j]==0)a[i]++; } } while(scanf("%d",&n),n)printf("%d\n",a[n]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144154/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144154/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [50001 x i32], align 16 %p = alloca [50001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 200004, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200004) %a, i8 0, i64 200004, i1 false) call void @llvm.lifetime.start.p0(i64 50001, ptr nonnull %p) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50001) %p, i8 0, i64 50001, i1 false) store i8 1, ptr %p, align 16 %0 = getelementptr inbounds <{ i8, i8, [49999 x i8] }>, ptr %p, i64 0, i32 1 store i8 1, ptr %0, align 1 br label %for.body for.body: ; preds = %entry, %for.inc7 %indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.inc7 ] %mul60 = phi i32 [ 4, %entry ], [ %mul, %for.inc7 ] %arrayidx = getelementptr inbounds [50001 x i8], ptr %p, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %1, 0 %cmp356 = icmp ult i32 %mul60, 50001 %or.cond = and i1 %tobool.not, %cmp356 br i1 %or.cond, label %for.body4.preheader, label %for.inc7 for.body4.preheader: ; preds = %for.body %2 = zext i32 %mul60 to i64 br label %for.body4 for.body4: ; preds = %for.body4.preheader, %for.body4 %indvars.iv66 = phi i64 [ %2, %for.body4.preheader ], [ %indvars.iv.next67, %for.body4 ] %arrayidx6 = getelementptr inbounds [50001 x i8], ptr %p, i64 0, i64 %indvars.iv66 store i8 1, ptr %arrayidx6, align 1, !tbaa !5 %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, %indvars.iv %cmp3 = icmp ult i64 %indvars.iv.next67, 50001 br i1 %cmp3, label %for.body4, label %for.inc7, !llvm.loop !8 for.inc7: ; preds = %for.body4, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = trunc i64 %indvars.iv.next to i32 %mul = mul nsw i32 %3, %3 %exitcond.not = icmp eq i64 %indvars.iv.next, 224 br i1 %exitcond.not, label %for.cond12.preheader, label %for.body, !llvm.loop !10 for.cond12.preheader: ; preds = %for.inc7, %for.inc32 %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.inc32 ], [ 0, %for.inc7 ] %cmp14.not61 = icmp ult i64 %indvars.iv75, 2 br i1 %cmp14.not61, label %for.inc32, label %for.body15.lr.ph for.body15.lr.ph: ; preds = %for.cond12.preheader %arrayidx26 = getelementptr inbounds [50001 x i32], ptr %a, i64 0, i64 %indvars.iv75 br label %for.body15 while.cond.preheader: ; preds = %for.inc32 %call64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %4 = load i32, ptr %n, align 4, !tbaa !11 %tobool35.not65 = icmp eq i32 %4, 0 br i1 %tobool35.not65, label %while.end, label %while.body for.body15: ; preds = %for.body15.lr.ph, %for.inc29 %indvars.iv70 = phi i64 [ 1, %for.body15.lr.ph ], [ %indvars.iv.next71, %for.inc29 ] %arrayidx17 = getelementptr inbounds [50001 x i8], ptr %p, i64 0, i64 %indvars.iv70 %5 = load i8, ptr %arrayidx17, align 1, !tbaa !5 %conv = sext i8 %5 to i32 %6 = sub nsw i64 %indvars.iv75, %indvars.iv70 %arrayidx19 = getelementptr inbounds [50001 x i8], ptr %p, i64 0, i64 %6 %7 = load i8, ptr %arrayidx19, align 1, !tbaa !5 %conv20 = sext i8 %7 to i32 %add21 = sub nsw i32 0, %conv20 %cmp22 = icmp eq i32 %conv, %add21 br i1 %cmp22, label %if.then24, label %for.inc29 if.then24: ; preds = %for.body15 %8 = load i32, ptr %arrayidx26, align 4, !tbaa !11 %inc27 = add nsw i32 %8, 1 store i32 %inc27, ptr %arrayidx26, align 4, !tbaa !11 br label %for.inc29 for.inc29: ; preds = %for.body15, %if.then24 %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %9 = shl nuw nsw i64 %indvars.iv.next71, 1 %cmp14.not = icmp ugt i64 %9, %indvars.iv75 br i1 %cmp14.not, label %for.inc32, label %for.body15, !llvm.loop !13 for.inc32: ; preds = %for.inc29, %for.cond12.preheader %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %exitcond78.not = icmp eq i64 %indvars.iv.next76, 50001 br i1 %exitcond78.not, label %while.cond.preheader, label %for.cond12.preheader, !llvm.loop !14 while.body: ; preds = %while.cond.preheader, %while.body %10 = phi i32 [ %12, %while.body ], [ %4, %while.cond.preheader ] %idxprom36 = sext i32 %10 to i64 %arrayidx37 = getelementptr inbounds [50001 x i32], ptr %a, i64 0, i64 %idxprom36 %11 = load i32, ptr %arrayidx37, align 4, !tbaa !11 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %12 = load i32, ptr %n, align 4, !tbaa !11 %tobool35.not = icmp eq i32 %12, 0 br i1 %tobool35.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 50001, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 200004, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = !{!12, !12, i64 0} !12 = !{!"int", !6, i64 0} !13 = distinct !{!13, !9} !14 = distinct !{!14, !9} !15 = distinct !{!15, !9}
#include<stdio.h> int main(void){ long long i,j; int n,prime[50001]; prime[0]=1; prime[1]=1; for(i=2;i<50001;i++) prime[i]=0; for(i=2;i*i<50001;i++){ if(prime[i]==0){ for(j=2*i;j<50001;j+=i) prime[j]=1; } } while(1){ int count=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n/2+1;i++) if(prime[i]==0 && prime[n-i]==0)count++; printf("%d\n",count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %prime = alloca [50001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 200004, ptr nonnull %prime) #4 store i32 1, ptr %prime, align 16, !tbaa !5 %arrayidx1 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 1 store i32 1, ptr %arrayidx1, align 4, !tbaa !5 %scevgep = getelementptr inbounds i8, ptr %prime, i64 8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(199996) %scevgep, i8 0, i64 199996, i1 false), !tbaa !5 br label %for.body5 while.cond.preheader: ; preds = %for.inc15.1 %call68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1869 = icmp eq i32 %0, 0 br i1 %cmp1869, label %while.end, label %for.cond21.preheader for.body5: ; preds = %for.inc15.1, %entry %i.164 = phi i64 [ 2, %entry ], [ %inc16.1, %for.inc15.1 ] %arrayidx6 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %i.164 %1 = load i32, ptr %arrayidx6, align 8, !tbaa !5 %cmp7 = icmp eq i32 %1, 0 br i1 %cmp7, label %for.body11.preheader, label %for.inc15 for.body11.preheader: ; preds = %for.body5 %mul8 = shl nuw nsw i64 %i.164, 1 br label %for.body11 for.body11: ; preds = %for.body11.preheader, %for.body11 %j.063 = phi i64 [ %add, %for.body11 ], [ %mul8, %for.body11.preheader ] %arrayidx12 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %j.063 store i32 1, ptr %arrayidx12, align 8, !tbaa !5 %add = add nuw nsw i64 %j.063, %i.164 %cmp10 = icmp ult i64 %add, 50001 br i1 %cmp10, label %for.body11, label %for.inc15, !llvm.loop !9 for.inc15: ; preds = %for.body11, %for.body5 %inc16 = or i64 %i.164, 1 %arrayidx6.1 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %inc16 %2 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %cmp7.1 = icmp eq i32 %2, 0 br i1 %cmp7.1, label %for.body11.preheader.1, label %for.inc15.1 for.body11.preheader.1: ; preds = %for.inc15 %mul8.1 = shl nuw nsw i64 %inc16, 1 br label %for.body11.1 for.body11.1: ; preds = %for.body11.1, %for.body11.preheader.1 %j.063.1 = phi i64 [ %add.1, %for.body11.1 ], [ %mul8.1, %for.body11.preheader.1 ] %arrayidx12.1 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %j.063.1 store i32 1, ptr %arrayidx12.1, align 4, !tbaa !5 %add.1 = add nuw nsw i64 %j.063.1, %inc16 %cmp10.1 = icmp ult i64 %add.1, 50001 br i1 %cmp10.1, label %for.body11.1, label %for.inc15.1, !llvm.loop !9 for.inc15.1: ; preds = %for.body11.1, %for.inc15 %inc16.1 = add nuw nsw i64 %i.164, 2 %exitcond.not.1 = icmp eq i64 %inc16.1, 224 br i1 %exitcond.not.1, label %while.cond.preheader, label %for.body5, !llvm.loop !11 for.cond21.preheader: ; preds = %while.cond.preheader, %cleanup %3 = phi i32 [ %11, %cleanup ], [ %0, %while.cond.preheader ] %div = sdiv i32 %3, 2 %add22 = add nsw i32 %div, 1 %conv = sext i32 %add22 to i64 %cmp2365 = icmp sgt i32 %3, -2 br i1 %cmp2365, label %for.body25.lr.ph, label %cleanup for.body25.lr.ph: ; preds = %for.cond21.preheader %conv29 = sext i32 %3 to i64 %xtraiter = and i64 %conv, 1 %.off = add i32 %3, 1 %4 = icmp ult i32 %.off, 3 br i1 %4, label %cleanup.loopexit.unr-lcssa, label %for.body25.lr.ph.new for.body25.lr.ph.new: ; preds = %for.body25.lr.ph %unroll_iter = and i64 %conv, -2 br label %for.body25 for.body25: ; preds = %for.inc36.1, %for.body25.lr.ph.new %count.067 = phi i32 [ 0, %for.body25.lr.ph.new ], [ %count.1.1, %for.inc36.1 ] %i.266 = phi i64 [ 0, %for.body25.lr.ph.new ], [ %inc37.1, %for.inc36.1 ] %niter = phi i64 [ 0, %for.body25.lr.ph.new ], [ %niter.next.1, %for.inc36.1 ] %arrayidx26 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %i.266 %5 = load i32, ptr %arrayidx26, align 8, !tbaa !5 %cmp27 = icmp eq i32 %5, 0 br i1 %cmp27, label %land.lhs.true, label %for.inc36 land.lhs.true: ; preds = %for.body25 %sub = sub nsw i64 %conv29, %i.266 %arrayidx30 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %sub %6 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp31 = icmp eq i32 %6, 0 %inc34 = zext i1 %cmp31 to i32 %spec.select = add nsw i32 %count.067, %inc34 br label %for.inc36 for.inc36: ; preds = %land.lhs.true, %for.body25 %count.1 = phi i32 [ %count.067, %for.body25 ], [ %spec.select, %land.lhs.true ] %inc37 = or i64 %i.266, 1 %arrayidx26.1 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %inc37 %7 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5 %cmp27.1 = icmp eq i32 %7, 0 br i1 %cmp27.1, label %land.lhs.true.1, label %for.inc36.1 land.lhs.true.1: ; preds = %for.inc36 %sub.1 = sub nsw i64 %conv29, %inc37 %arrayidx30.1 = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %sub.1 %8 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %cmp31.1 = icmp eq i32 %8, 0 %inc34.1 = zext i1 %cmp31.1 to i32 %spec.select.1 = add nsw i32 %count.1, %inc34.1 br label %for.inc36.1 for.inc36.1: ; preds = %land.lhs.true.1, %for.inc36 %count.1.1 = phi i32 [ %count.1, %for.inc36 ], [ %spec.select.1, %land.lhs.true.1 ] %inc37.1 = add nuw nsw i64 %i.266, 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 %cleanup.loopexit.unr-lcssa, label %for.body25, !llvm.loop !12 cleanup.loopexit.unr-lcssa: ; preds = %for.inc36.1, %for.body25.lr.ph %count.1.lcssa.ph = phi i32 [ undef, %for.body25.lr.ph ], [ %count.1.1, %for.inc36.1 ] %count.067.unr = phi i32 [ 0, %for.body25.lr.ph ], [ %count.1.1, %for.inc36.1 ] %i.266.unr = phi i64 [ 0, %for.body25.lr.ph ], [ %inc37.1, %for.inc36.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %cleanup, label %for.body25.epil for.body25.epil: ; preds = %cleanup.loopexit.unr-lcssa %arrayidx26.epil = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %i.266.unr %9 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !5 %cmp27.epil = icmp eq i32 %9, 0 br i1 %cmp27.epil, label %land.lhs.true.epil, label %cleanup land.lhs.true.epil: ; preds = %for.body25.epil %sub.epil = sub nsw i64 %conv29, %i.266.unr %arrayidx30.epil = getelementptr inbounds [50001 x i32], ptr %prime, i64 0, i64 %sub.epil %10 = load i32, ptr %arrayidx30.epil, align 4, !tbaa !5 %cmp31.epil = icmp eq i32 %10, 0 %inc34.epil = zext i1 %cmp31.epil to i32 %spec.select.epil = add nsw i32 %count.067.unr, %inc34.epil br label %cleanup cleanup: ; preds = %cleanup.loopexit.unr-lcssa, %land.lhs.true.epil, %for.body25.epil, %for.cond21.preheader %count.0.lcssa = phi i32 [ 0, %for.cond21.preheader ], [ %count.1.lcssa.ph, %cleanup.loopexit.unr-lcssa ], [ %count.067.unr, %for.body25.epil ], [ %spec.select.epil, %land.lhs.true.epil ] %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %11 = load i32, ptr %n, align 4, !tbaa !5 %cmp18 = icmp eq i32 %11, 0 br i1 %cmp18, label %while.end, label %for.cond21.preheader while.end: ; preds = %cleanup, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 200004, ptr nonnull %prime) #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}
#include <stdio.h> #include <stdlib.h> int main(void){ int i; int N,x; if(scanf("%d %d", &N, &x)<2){ exit(1); } int a[N]; for (i=0; i<N; i++){ if(scanf("%d",&a[i])<1){ exit(1); } } long count; count = 0; if(a[0]+a[1]>x){ count += (a[0]+a[1]-x); if(a[0]<=x){ a[1]= x-a[0]; } else{ a[1]=0; a[0]=x; } } for (i=1; i<N-1; i++){ if (a[i]+a[i+1]>x){ count += (a[i]+a[i+1]-x); a[i+1]=x-a[i]; } } printf("%ld",count); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144284/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144284/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %x) %cmp = icmp slt i32 %call, 2 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry call void @exit(i32 noundef 1) #6 unreachable if.end: ; preds = %entry %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 %cmp174 = icmp sgt i32 %3, 0 br i1 %cmp174, label %for.body, label %for.end for.cond: ; preds = %for.body %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 %cmp1 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp1, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.body: ; preds = %if.end, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %if.end ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %cmp3 = icmp slt i32 %call2, 1 br i1 %cmp3, label %if.then4, label %for.cond if.then4: ; preds = %for.body call void @exit(i32 noundef 1) #6 unreachable for.end.loopexit: ; preds = %for.cond %.pre = load i32, ptr %vla, align 16, !tbaa !5 %arrayidx7.phi.trans.insert = getelementptr inbounds i32, ptr %vla, i64 1 %.pre85 = load i32, ptr %arrayidx7.phi.trans.insert, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %if.end %6 = phi i32 [ undef, %if.end ], [ %.pre85, %for.end.loopexit ] %7 = phi i32 [ undef, %if.end ], [ %.pre, %for.end.loopexit ] %.lcssa = phi i32 [ %3, %if.end ], [ %4, %for.end.loopexit ] %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 1 %add = add nsw i32 %6, %7 %8 = load i32, ptr %x, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %add, %8 br i1 %cmp8, label %if.then9, label %if.end24 if.then9: ; preds = %for.end %sub = sub nsw i32 %add, %8 %conv = sext i32 %sub to i64 %cmp15.not = icmp sgt i32 %7, %8 br i1 %cmp15.not, label %if.else, label %if.then17 if.then17: ; preds = %if.then9 %sub19 = sub nsw i32 %8, %7 store i32 %sub19, ptr %arrayidx7, align 4, !tbaa !5 br label %if.end24 if.else: ; preds = %if.then9 store i32 0, ptr %arrayidx7, align 4, !tbaa !5 store i32 %8, ptr %vla, align 16, !tbaa !5 br label %if.end24 if.end24: ; preds = %if.then17, %if.else, %for.end %.pre86 = phi i32 [ %sub19, %if.then17 ], [ 0, %if.else ], [ %6, %for.end ] %count.0 = phi i64 [ %conv, %if.then17 ], [ %conv, %if.else ], [ 0, %for.end ] %cmp2776 = icmp sgt i32 %.lcssa, 2 br i1 %cmp2776, label %for.body29.preheader, label %for.end57 for.body29.preheader: ; preds = %if.end24 %sub26 = add i32 %.lcssa, -1 %wide.trip.count = zext i32 %sub26 to i64 %9 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %9, 1 %10 = icmp eq i32 %sub26, 2 br i1 %10, label %for.end57.loopexit.unr-lcssa, label %for.body29.preheader.new for.body29.preheader.new: ; preds = %for.body29.preheader %unroll_iter = and i64 %9, -2 %invariant.gep = getelementptr i32, ptr %vla, i64 1 br label %for.body29 for.body29: ; preds = %for.inc55.1, %for.body29.preheader.new %11 = phi i32 [ %.pre86, %for.body29.preheader.new ], [ %15, %for.inc55.1 ] %indvars.iv82 = phi i64 [ 1, %for.body29.preheader.new ], [ %indvars.iv.next83.1, %for.inc55.1 ] %count.178 = phi i64 [ %count.0, %for.body29.preheader.new ], [ %count.2.1, %for.inc55.1 ] %niter = phi i64 [ 0, %for.body29.preheader.new ], [ %niter.next.1, %for.inc55.1 ] %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv82 %12 = load i32, ptr %gep, align 4, !tbaa !5 %add35 = add nsw i32 %12, %11 %cmp36 = icmp sgt i32 %add35, %8 br i1 %cmp36, label %if.then38, label %for.inc55 if.then38: ; preds = %for.body29 %sub45 = sub nsw i32 %add35, %8 %conv46 = sext i32 %sub45 to i64 %add47 = add nsw i64 %count.178, %conv46 %sub50 = sub nsw i32 %8, %11 store i32 %sub50, ptr %gep, align 4, !tbaa !5 br label %for.inc55 for.inc55: ; preds = %for.body29, %if.then38 %13 = phi i32 [ %sub50, %if.then38 ], [ %12, %for.body29 ] %count.2 = phi i64 [ %add47, %if.then38 ], [ %count.178, %for.body29 ] %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2 %arrayidx34.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next83.1 %14 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5 %add35.1 = add nsw i32 %14, %13 %cmp36.1 = icmp sgt i32 %add35.1, %8 br i1 %cmp36.1, label %if.then38.1, label %for.inc55.1 if.then38.1: ; preds = %for.inc55 %sub45.1 = sub nsw i32 %add35.1, %8 %conv46.1 = sext i32 %sub45.1 to i64 %add47.1 = add nsw i64 %count.2, %conv46.1 %sub50.1 = sub nsw i32 %8, %13 store i32 %sub50.1, ptr %arrayidx34.1, align 4, !tbaa !5 br label %for.inc55.1 for.inc55.1: ; preds = %if.then38.1, %for.inc55 %15 = phi i32 [ %sub50.1, %if.then38.1 ], [ %14, %for.inc55 ] %count.2.1 = phi i64 [ %add47.1, %if.then38.1 ], [ %count.2, %for.inc55 ] %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.end57.loopexit.unr-lcssa.loopexit, label %for.body29, !llvm.loop !11 for.end57.loopexit.unr-lcssa.loopexit: ; preds = %for.inc55.1 %16 = add nuw nsw i64 %indvars.iv82, 3 br label %for.end57.loopexit.unr-lcssa for.end57.loopexit.unr-lcssa: ; preds = %for.end57.loopexit.unr-lcssa.loopexit, %for.body29.preheader %count.2.lcssa.ph = phi i64 [ undef, %for.body29.preheader ], [ %count.2.1, %for.end57.loopexit.unr-lcssa.loopexit ] %.unr = phi i32 [ %.pre86, %for.body29.preheader ], [ %15, %for.end57.loopexit.unr-lcssa.loopexit ] %indvars.iv82.unr = phi i64 [ 2, %for.body29.preheader ], [ %16, %for.end57.loopexit.unr-lcssa.loopexit ] %count.178.unr = phi i64 [ %count.0, %for.body29.preheader ], [ %count.2.1, %for.end57.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end57, label %for.body29.epil for.body29.epil: ; preds = %for.end57.loopexit.unr-lcssa %arrayidx34.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv82.unr %17 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5 %add35.epil = add nsw i32 %17, %.unr %cmp36.epil = icmp sgt i32 %add35.epil, %8 br i1 %cmp36.epil, label %if.then38.epil, label %for.end57 if.then38.epil: ; preds = %for.body29.epil %sub45.epil = sub nsw i32 %add35.epil, %8 %conv46.epil = sext i32 %sub45.epil to i64 %add47.epil = add nsw i64 %count.178.unr, %conv46.epil %sub50.epil = sub nsw i32 %8, %.unr store i32 %sub50.epil, ptr %arrayidx34.epil, align 4, !tbaa !5 br label %for.end57 for.end57: ; preds = %for.end57.loopexit.unr-lcssa, %if.then38.epil, %for.body29.epil, %if.end24 %count.1.lcssa = phi i64 [ %count.0, %if.end24 ], [ %count.2.lcssa.ph, %for.end57.loopexit.unr-lcssa ], [ %add47.epil, %if.then38.epil ], [ %count.178.unr, %for.body29.epil ] %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.1.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) 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 #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) #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 = { mustprogress nocallback nofree nosync nounwind willreturn } 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}
#include <stdio.h> int main(void) { char c; int i; while((c = getchar()) != EOF) { if(c == '@') { char a, n; n = getchar(); a = getchar(); for(i = 0; i < n - '0'; i++) { putchar(a); } } else putchar(c); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144327/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144327/source.c" target datalayout = "e-m:e-p270: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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %if.end, %entry %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext = shl i32 %call.i, 24 switch i32 %sext, label %if.else [ i32 -16777216, label %while.end i32 1073741824, label %if.then ] if.then: ; preds = %while.cond %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21 = tail call i32 @getc(ptr noundef %1) %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i22 = tail call i32 @getc(ptr noundef %2) %3 = trunc i32 %call.i21 to i8 %cmp1125 = icmp sgt i8 %3, 48 br i1 %cmp1125, label %for.body.lr.ph, label %if.end for.body.lr.ph: ; preds = %if.then %conv10 = and i32 %call.i21, 255 %sext20 = shl i32 %call.i22, 24 %conv13 = ashr exact i32 %sext20, 24 %4 = tail call i32 @llvm.smax.i32(i32 %conv10, i32 49) %5 = add nsw i32 %4, -49 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %i.026 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %6 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i23 = tail call i32 @putc(i32 noundef %conv13, ptr noundef %6) %inc = add nuw nsw i32 %i.026, 1 %exitcond.not = icmp eq i32 %i.026, %5 br i1 %exitcond.not, label %if.end, label %for.body, !llvm.loop !9 if.else: ; preds = %while.cond %conv1 = ashr exact i32 %sext, 24 %7 = load ptr, ptr @stdout, align 8, !tbaa !5 %call.i24 = tail call i32 @putc(i32 noundef %conv1, ptr noundef %7) br label %if.end if.end: ; preds = %for.body, %if.then, %if.else br label %while.cond, !llvm.loop !11 while.end: ; preds = %while.cond ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<string.h> int main(){ int i; char s[1000]; while(scanf("%s",s)!=EOF){ for(i=0;i<strlen(s);i++){ if(s[i]=='@'){ while(s[i+1]!='0'){ printf("%c",s[i+2]); s[i+1]--; } i=i+2; } else printf("%c",s[i]); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144392/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144392/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %s) #5 %call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not45 = icmp eq i32 %call44, -1 br i1 %cmp.not45, label %while.end29, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %char0 = load i8, ptr %s, align 16 %cmp341.not = icmp eq i8 %char0, 0 br i1 %cmp341.not, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.inc %conv43 = phi i64 [ %conv, %for.inc ], [ 0, %for.cond.preheader ] %i.042 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %conv43 %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp6 = icmp eq i8 %0, 64 br i1 %cmp6, label %while.cond8.preheader, label %if.else while.cond8.preheader: ; preds = %for.body %add = add nsw i32 %i.042, 1 %idxprom9 = sext i32 %add to i64 %arrayidx10 = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %idxprom9 %1 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.not39 = icmp eq i8 %1, 48 %.pre = add nsw i32 %i.042, 2 br i1 %cmp12.not39, label %for.inc, label %while.body14.lr.ph while.body14.lr.ph: ; preds = %while.cond8.preheader %idxprom16 = sext i32 %.pre to i64 %arrayidx17 = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %idxprom16 br label %while.body14 while.body14: ; preds = %while.body14.lr.ph, %while.body14 %2 = load i8, ptr %arrayidx17, align 1, !tbaa !5 %conv18 = sext i8 %2 to i32 %putchar38 = call i32 @putchar(i32 %conv18) %3 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %dec = add i8 %3, -1 store i8 %dec, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.not = icmp eq i8 %dec, 48 br i1 %cmp12.not, label %for.inc, label %while.body14, !llvm.loop !8 if.else: ; preds = %for.body %conv5 = sext i8 %0 to i32 %putchar37 = call i32 @putchar(i32 %conv5) br label %for.inc for.inc: ; preds = %while.body14, %while.cond8.preheader, %if.else %i.1 = phi i32 [ %i.042, %if.else ], [ %.pre, %while.cond8.preheader ], [ %.pre, %while.body14 ] %inc = add nsw i32 %i.1, 1 %conv = sext i32 %inc to i64 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp3 = icmp ugt i64 %call2, %conv br i1 %cmp3, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.inc, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end29, label %for.cond.preheader, !llvm.loop !11 while.end29: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9}
#include<stdio.h> #include<stdlib.h> #include<stdbool.h> typedef struct E{ int to; struct E *next; }edge; int N, M, ans; bool d[1<<17]; edge G[1<<17], *nil; void push(int i, int j){ edge *X = (edge*)malloc(sizeof(edge)); (*X).to = j; (*X).next = G[i].next; G[i].next = X; return; } void dfs(int i){ d[i] = true; edge *x = G[i].next; while(x != nil){ if(!d[(*x).to]){ dfs((*x).to); } x = (*x).next; } return; } int main(){ scanf("%d%d", &N, &M); for(int i=0; i<=N; i++){ G[i].next = nil; } while(M--){ int a, b; scanf("%d%d%*d", &a, &b); push(a, b); push(b, a); } for(int i=1; i<=N; i++){ if(!d[i]){ ans++; dfs(i); } } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144435/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144435/source.c" target datalayout = "e-m:e-p270: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.E = type { i32, ptr } @G = dso_local local_unnamed_addr global [131072 x %struct.E] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [131072 x i8] zeroinitializer, align 16 @nil = dso_local local_unnamed_addr global ptr null, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @N = dso_local global i32 0, align 4 @M = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [8 x i8] c"%d%d%*d\00", align 1 @ans = dso_local local_unnamed_addr global i32 0, align 4 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, argmem: none) uwtable define dso_local void @push(i32 noundef %i, i32 noundef %j) local_unnamed_addr #0 { entry: %call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6 store i32 %j, ptr %call, align 8, !tbaa !5 %idxprom = sext i32 %i to i64 %next = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %idxprom, i32 1 %0 = load ptr, ptr %next, align 8, !tbaa !11 %next1 = getelementptr inbounds %struct.E, ptr %call, i64 0, i32 1 store ptr %0, ptr %next1, align 8, !tbaa !11 store ptr %call, ptr %next, align 8, !tbaa !11 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @dfs(i32 noundef %i) local_unnamed_addr #3 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [131072 x i8], ptr @d, i64 0, i64 %idxprom store i8 1, ptr %arrayidx, align 1, !tbaa !12 %next = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %idxprom, i32 1 %x.011 = load ptr, ptr %next, align 8, !tbaa !11 %0 = load ptr, ptr @nil, align 8, !tbaa !14 %cmp.not12 = icmp eq ptr %x.011, %0 br i1 %cmp.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %1 = phi ptr [ %4, %if.end ], [ %0, %entry ] %x.013 = phi ptr [ %x.0, %if.end ], [ %x.011, %entry ] %2 = load i32, ptr %x.013, align 8, !tbaa !5 %idxprom3 = sext i32 %2 to i64 %arrayidx4 = getelementptr inbounds [131072 x i8], ptr @d, i64 0, i64 %idxprom3 %3 = load i8, ptr %arrayidx4, align 1, !tbaa !12, !range !15, !noundef !16 %tobool.not = icmp eq i8 %3, 0 br i1 %tobool.not, label %if.then, label %if.end if.then: ; preds = %while.body tail call void @dfs(i32 noundef %2) %.pre = load ptr, ptr @nil, align 8, !tbaa !14 br label %if.end if.end: ; preds = %if.then, %while.body %4 = phi ptr [ %.pre, %if.then ], [ %1, %while.body ] %next6 = getelementptr inbounds %struct.E, ptr %x.013, i64 0, i32 1 %x.0 = load ptr, ptr %next6, align 8, !tbaa !11 %cmp.not = icmp eq ptr %x.0, %4 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !17 while.end: ; preds = %if.end, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %call = tail 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 !19 %cmp.not24 = icmp slt i32 %0, 0 br i1 %cmp.not24, label %while.cond.preheader, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load ptr, ptr @nil, align 8, !tbaa !14 %2 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 3 %3 = icmp ult i32 %0, 3 br i1 %3, label %while.cond.preheader.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body while.cond.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %indvars.iv.unr = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.preheader, label %for.body.epil for.body.epil: ; preds = %while.cond.preheader.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %while.cond.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %while.cond.preheader.loopexit.unr-lcssa ] %next.epil = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %indvars.iv.epil, i32 1 store ptr %1, ptr %next.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 %while.cond.preheader, label %for.body.epil, !llvm.loop !20 while.cond.preheader: ; preds = %while.cond.preheader.loopexit.unr-lcssa, %for.body.epil, %entry %4 = load i32, ptr @M, align 4, !tbaa !19 %dec26 = add nsw i32 %4, -1 store i32 %dec26, ptr @M, align 4, !tbaa !19 %tobool.not27 = icmp eq i32 %4, 0 br i1 %tobool.not27, label %for.cond3.preheader, label %while.body for.body: ; preds = %for.body, %for.body.lr.ph.new %indvars.iv = phi i64 [ 0, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %next = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %indvars.iv, i32 1 store ptr %1, ptr %next, align 8, !tbaa !11 %indvars.iv.next = or i64 %indvars.iv, 1 %next.1 = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %indvars.iv.next, i32 1 store ptr %1, ptr %next.1, align 8, !tbaa !11 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %next.2 = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %indvars.iv.next.1, i32 1 store ptr %1, ptr %next.2, align 8, !tbaa !11 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %next.3 = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %indvars.iv.next.2, i32 1 store ptr %1, ptr %next.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 %while.cond.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !22 for.cond3.preheader.loopexit: ; preds = %while.body %.pre = load i32, ptr @N, align 4, !tbaa !19 br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.cond3.preheader.loopexit, %while.cond.preheader %5 = phi i32 [ %.pre, %for.cond3.preheader.loopexit ], [ %0, %while.cond.preheader ] %cmp4.not28 = icmp slt i32 %5, 1 br i1 %cmp4.not28, label %for.cond.cleanup5, label %for.body6 while.body: ; preds = %while.cond.preheader, %while.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %6 = load i32, ptr %a, align 4, !tbaa !19 %7 = load i32, ptr %b, align 4, !tbaa !19 %call.i = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6 store i32 %7, ptr %call.i, align 8, !tbaa !5 %idxprom.i = sext i32 %6 to i64 %next.i = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %idxprom.i, i32 1 %8 = load ptr, ptr %next.i, align 8, !tbaa !11 %next1.i = getelementptr inbounds %struct.E, ptr %call.i, i64 0, i32 1 store ptr %8, ptr %next1.i, align 8, !tbaa !11 store ptr %call.i, ptr %next.i, align 8, !tbaa !11 %call.i20 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6 store i32 %6, ptr %call.i20, align 8, !tbaa !5 %idxprom.i21 = sext i32 %7 to i64 %next.i22 = getelementptr inbounds [131072 x %struct.E], ptr @G, i64 0, i64 %idxprom.i21, i32 1 %9 = load ptr, ptr %next.i22, align 8, !tbaa !11 %next1.i23 = getelementptr inbounds %struct.E, ptr %call.i20, i64 0, i32 1 store ptr %9, ptr %next1.i23, align 8, !tbaa !11 store ptr %call.i20, ptr %next.i22, align 8, !tbaa !11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 %10 = load i32, ptr @M, align 4, !tbaa !19 %dec = add nsw i32 %10, -1 store i32 %dec, ptr @M, align 4, !tbaa !19 %tobool.not = icmp eq i32 %10, 0 br i1 %tobool.not, label %for.cond3.preheader.loopexit, label %while.body, !llvm.loop !23 for.cond.cleanup5: ; preds = %for.inc11, %for.cond3.preheader %11 = load i32, ptr @ans, align 4, !tbaa !19 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11) ret i32 0 for.body6: ; preds = %for.cond3.preheader, %for.inc11 %12 = phi i32 [ %16, %for.inc11 ], [ %5, %for.cond3.preheader ] %indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.inc11 ], [ 1, %for.cond3.preheader ] %arrayidx8 = getelementptr inbounds [131072 x i8], ptr @d, i64 0, i64 %indvars.iv31 %13 = load i8, ptr %arrayidx8, align 1, !tbaa !12, !range !15, !noundef !16 %tobool9.not = icmp eq i8 %13, 0 br i1 %tobool9.not, label %if.then, label %for.inc11 if.then: ; preds = %for.body6 %14 = load i32, ptr @ans, align 4, !tbaa !19 %inc10 = add nsw i32 %14, 1 store i32 %inc10, ptr @ans, align 4, !tbaa !19 %15 = trunc i64 %indvars.iv31 to i32 call void @dfs(i32 noundef %15) %.pre34 = load i32, ptr @N, align 4, !tbaa !19 br label %for.inc11 for.inc11: ; preds = %for.body6, %if.then %16 = phi i32 [ %12, %for.body6 ], [ %.pre34, %if.then ] %indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1 %17 = sext i32 %16 to i64 %cmp4.not.not = icmp slt i64 %indvars.iv31, %17 br i1 %cmp4.not.not, label %for.body6, label %for.cond.cleanup5, !llvm.loop !24 } ; 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 attributes #0 = { mustprogress nofree nounwind willreturn memory(readwrite, argmem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { nounwind allocsize(0) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"E", !7, i64 0, !10, i64 8} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!"any pointer", !8, i64 0} !11 = !{!6, !10, i64 8} !12 = !{!13, !13, i64 0} !13 = !{!"_Bool", !8, i64 0} !14 = !{!10, !10, i64 0} !15 = !{i8 0, i8 2} !16 = !{} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = !{!7, !7, i64 0} !20 = distinct !{!20, !21} !21 = !{!"llvm.loop.unroll.disable"} !22 = distinct !{!22, !18} !23 = distinct !{!23, !18} !24 = distinct !{!24, !18}
#include<stdio.h> int main(void){ int a,b,c,x,y; unsigned ans = 0; scanf("%d %d %d %d %d",&a,&b,&c,&x,&y); c*=2; if(a+b<=c)ans = a*x+b*y; else{ ans += c*(x<y?x:y); if((x<y?b:a) > c)ans += c*(x<y?y-x:x-y); else ans += (x<y?b:a)*(x<y?y-x:x-y); } printf("%u",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144608/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144608/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%u\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %c, align 4, !tbaa !5 %mul = shl nsw i32 %0, 1 store i32 %mul, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4 %2 = load i32, ptr %b, align 4 %add = add nsw i32 %2, %1 %cmp.not = icmp sgt i32 %add, %mul %3 = load i32, ptr %x, align 4 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %entry %mul1 = mul nsw i32 %3, %1 %4 = load i32, ptr %y, align 4, !tbaa !5 %mul2 = mul nsw i32 %4, %2 %add3 = add nsw i32 %mul2, %mul1 br label %if.end37 if.else: ; preds = %entry %5 = load i32, ptr %y, align 4 %cmp4 = icmp slt i32 %3, %5 %cond = call i32 @llvm.smin.i32(i32 %3, i32 %5) %cond11 = select i1 %cmp4, i32 %2, i32 %1 %cmp12 = icmp sgt i32 %cond11, %mul br i1 %cmp12, label %if.then13, label %if.else22 if.then13: ; preds = %if.else %sub17 = sub nsw i32 %3, %5 %cond19 = call i32 @llvm.abs.i32(i32 %sub17, i1 true) %mul2046 = add i32 %cond19, %cond %add21 = mul i32 %mul2046, %mul br label %if.end37 if.else22: ; preds = %if.else %mul5 = mul nsw i32 %cond, %mul %sub32 = sub nsw i32 %3, %5 %cond34 = call i32 @llvm.abs.i32(i32 %sub32, i1 true) %mul35 = mul nsw i32 %cond11, %cond34 %add36 = add i32 %mul35, %mul5 br label %if.end37 if.end37: ; preds = %if.then13, %if.else22, %if.then %ans.0 = phi i32 [ %add3, %if.then ], [ %add21, %if.then13 ], [ %add36, %if.else22 ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, 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 nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ char s[101]; long long k; scanf("%s %lld",s,&k); for(long long i = 0;i < k;i ++){ if(s[i] != '1'){ printf("%c",s[i]); return 0; } } puts("1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144651/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144651/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %lld\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %k) %0 = load i64, ptr %k, align 8, !tbaa !5 %cmp.not12 = icmp sgt i64 %0, 0 br i1 %cmp.not12, label %for.body, label %for.end for.cond: ; preds = %for.body %inc = add nuw nsw i64 %i.013, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.body: ; preds = %entry, %for.cond %i.013 = phi i64 [ %inc, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %i.013 %1 = load i8, ptr %arrayidx, align 1, !tbaa !11 %cmp1.not = icmp eq i8 %1, 49 br i1 %cmp1.not, label %for.cond, label %if.then if.then: ; preds = %for.body %conv = sext i8 %1 to i32 %putchar = call i32 @putchar(i32 %conv) br label %cleanup7 for.end: ; preds = %for.cond, %entry %call6 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %cleanup7 cleanup7: ; preds = %if.then, %for.end call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAXLEN 104 #define LL long long void solve(char *str, int len, LL K) { int i; for(i = 0; i < len; ++i) { if(str[i] != '1') { break; } if(i >= K-1) { break; } } printf("%c\n", str[i]); } int main() { char *str = (char*)malloc(MAXLEN * sizeof(char)); LL k; scanf("%s", str); scanf("%lld", &k); int len = strlen(str); //printf("k = %lld\n", k); solve(str, len, k); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144695/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144695/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @solve(ptr nocapture noundef readonly %str, i32 noundef %len, i64 noundef %K) local_unnamed_addr #0 { entry: %cmp16 = icmp sgt i32 %len, 0 br i1 %cmp16, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %sub = add nsw i64 %K, -1 %wide.trip.count = zext i32 %len to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp1.not = icmp eq i8 %0, 49 %cmp4.not = icmp sgt i64 %sub, %indvars.iv %or.cond = select i1 %cmp1.not, i1 %cmp4.not, i1 false br i1 %or.cond, label %for.inc, label %for.end.loopexit.split.loop.exit for.inc: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !8 for.end.loopexit.split.loop.exit: ; preds = %for.body %1 = trunc i64 %indvars.iv to i32 br label %for.end.loopexit for.end.loopexit: ; preds = %for.inc, %for.end.loopexit.split.loop.exit %i.0.lcssa.ph = phi i32 [ %1, %for.end.loopexit.split.loop.exit ], [ %len, %for.inc ] %2 = zext i32 %i.0.lcssa.ph to i64 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %i.0.lcssa = phi i64 [ 0, %entry ], [ %2, %for.end.loopexit ] %arrayidx9 = getelementptr inbounds i8, ptr %str, i64 %i.0.lcssa %3 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %conv10 = sext i8 %3 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv10) 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: %k = alloca i64, align 8 %call = tail call noalias dereferenceable_or_null(104) ptr @malloc(i64 noundef 104) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #6 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %k) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call) #7 %conv = trunc i64 %call3 to i32 %cmp16.i = icmp sgt i32 %conv, 0 br i1 %cmp16.i, label %for.body.lr.ph.i, label %solve.exit for.body.lr.ph.i: ; preds = %entry %0 = load i64, ptr %k, align 8, !tbaa !10 %sub.i = add nsw i64 %0, -1 %wide.trip.count.i = and i64 %call3, 4294967295 br label %for.body.i for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.inc.i ] %arrayidx.i = getelementptr inbounds i8, ptr %call, i64 %indvars.iv.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 %cmp1.not.i = icmp eq i8 %1, 49 %cmp4.not.i = icmp sgt i64 %sub.i, %indvars.iv.i %or.cond.i = select i1 %cmp1.not.i, i1 %cmp4.not.i, i1 false br i1 %or.cond.i, label %for.inc.i, label %for.body.i.for.end.loopexit.i_crit_edge for.body.i.for.end.loopexit.i_crit_edge: ; preds = %for.body.i %.pre = and i64 %indvars.iv.i, 4294967295 br label %solve.exit for.inc.i: ; preds = %for.body.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %solve.exit, label %for.body.i, !llvm.loop !8 solve.exit: ; preds = %for.inc.i, %for.body.i.for.end.loopexit.i_crit_edge, %entry %i.0.lcssa.i = phi i64 [ 0, %entry ], [ %.pre, %for.body.i.for.end.loopexit.i_crit_edge ], [ %wide.trip.count.i, %for.inc.i ] %arrayidx9.i = getelementptr inbounds i8, ptr %call, i64 %i.0.lcssa.i %2 = load i8, ptr %arrayidx9.i, align 1, !tbaa !5 %conv10.i = sext i8 %2 to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv10.i) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #6 ret i32 0 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; 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 #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind allocsize(0) } 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"} !10 = !{!11, !11, i64 0} !11 = !{!"long long", !6, i64 0}
#include <stdio.h> #include <math.h> #include <string.h> int main(){ char s[ 101 ]; unsigned long long int k; unsigned long long int i = 0; scanf( "%s", s ); scanf( "%llu", &k ); //scanf( "%d", &b ); int j = 0; unsigned long long int one_num = 0; // for ( j = 0; j < 101; j++ ){ // if ( atoi( s[ j ] ) == 1 ){ // one_num++; // }else // break; // } one_num = strspn( s, "1" ); //printf( "%llu\n", one_num ); if ( k <= one_num ){ printf( "1\n" ); return 0; } char number; number = s[ one_num ]; printf( "%c\n", number ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144745/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144745/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %call3 = call i64 @strspn(ptr noundef nonnull %s, ptr noundef nonnull @str) #6 %0 = load i64, ptr %k, align 8, !tbaa !5 %cmp.not = icmp ugt i64 %0, %call3 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup if.end: ; preds = %entry %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %call3 %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %1 to i32 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv) br label %cleanup cleanup: ; preds = %if.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strspn(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; 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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> #include <limits.h> #include <stdbool.h> #define rep(i, n) for(int i=0; i<(n); ++i) #define max 200001 //qsort(str, n, sizeof(int), up_comp); int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;} int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;} int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );} int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;} int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);} int main(void){ int x, mem; int sum=0; scanf("%d", &x); mem=x; while (x>0) { sum+=x%10; x=(x-x%10)/10; } if (mem%sum==0) { printf("Yes"); } else { printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144796/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144796/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @up_comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @down_comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @int_sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #9 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @count_digit(i32 noundef %a) local_unnamed_addr #3 { entry: %cmp.not3 = icmp eq i32 %a, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %a.addr.04 = phi i32 [ %div, %while.body ], [ %a, %entry ] %div = sdiv i32 %a.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %a.addr.04.off = add i32 %a.addr.04, 9 %cmp.not = icmp ult i32 %a.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @euclid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #5 { entry: br label %tailrecurse tailrecurse: ; preds = %if.end3, %entry %a.tr = phi i32 [ %a, %entry ], [ %spec.select17, %if.end3 ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %if.end3 ] %spec.select17 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr) %cmp1 = icmp slt i32 %spec.select17, 1 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %tailrecurse %spec.select = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr) %rem = srem i32 %spec.select, %spec.select17 %cmp4 = icmp eq i32 %rem, 0 br i1 %cmp4, label %cleanup, label %tailrecurse cleanup: ; preds = %if.end3, %tailrecurse %retval.0 = phi i32 [ -1, %tailrecurse ], [ %spec.select17, %if.end3 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #6 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %sum.08 = phi i32 [ %add, %while.body ], [ 0, %entry ] %1 = phi i32 [ %div, %while.body ], [ %0, %entry ] %rem = urem i32 %1, 10 %add = add nuw nsw i32 %sum.08, %rem %sub = sub nuw nsw i32 %1, %rem %div = sdiv i32 %sub, 10 %cmp = icmp sgt i32 %sub, 9 br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !11 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %div, ptr %x, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %sum.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ] %rem2 = srem i32 %0, %sum.0.lcssa %cmp3 = icmp eq i32 %rem2, 0 %.str.1..str.2 = select i1 %cmp3, ptr @.str.1, ptr @.str.2 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind willreturn memory(read) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ int N,n,r=0; scanf("%d",&N); n=N; while(n){r+=n%10;n/=10;} printf(N%r==0?"Yes":"No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144853/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.08 = phi i32 [ %add, %while.body ], [ 0, %entry ] %n.07 = phi i32 [ %div, %while.body ], [ %0, %entry ] %rem = srem i32 %n.07, 10 %add = add nsw i32 %r.08, %rem %div = sdiv i32 %n.07, 10 %n.07.off = add i32 %n.07, 9 %tobool.not = icmp ult i32 %n.07.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %rem1 = srem i32 %0, %r.0.lcssa %cmp = icmp eq i32 %rem1, 0 %cond = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int o,n,s,d; scanf("%d", &o); n=o; s=0; while (n!=0) { d = n % 10; n = n / 10; s = s + d; } if(o%s==0){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144897/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144897/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %o = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %o) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %o) %0 = load i32, ptr %o, align 4, !tbaa !5 %cmp.not9 = icmp eq i32 %0, 0 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %n.011 = phi i32 [ %div, %while.body ], [ %0, %entry ] %s.010 = phi i32 [ %add, %while.body ], [ 0, %entry ] %rem = srem i32 %n.011, 10 %div = sdiv i32 %n.011, 10 %add = add nsw i32 %rem, %s.010 %n.011.off = add i32 %n.011, 9 %cmp.not = icmp ult i32 %n.011.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %rem1 = srem i32 %0, %s.0.lcssa %cmp2 = icmp eq i32 %rem1, 0 %str.3.str = select i1 %cmp2, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %o) #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,k; scanf("%d %d",&n,&k); int arr[n]; for(int i=0; i<n; i++) scanf("%d ",&arr[i]); int count=0; int i=0; for(i=0; i<n; i++) { if(arr[i]<=k) count++; else break; } for(int j=n-1; j>i; j--) { if(arr[j]<=k) count++; else break; } printf("%d",count); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14494/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14494/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %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 %cmp36 = icmp sgt i32 %3, 0 br i1 %cmp36, label %for.body, label %for.end12 for.cond3.preheader: ; preds = %for.body %cmp438 = icmp sgt i32 %5, 0 br i1 %cmp438, label %for.body5.lr.ph, label %for.end12 for.body5.lr.ph: ; preds = %for.cond3.preheader %4 = load i32, ptr %k, align 4, !tbaa !5 %wide.trip.count = zext i32 %5 to i64 br label %for.body5 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.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %if.then %indvars.iv53 = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next54, %if.then ] %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv53 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not = icmp sgt i32 %7, %4 br i1 %cmp8.not, label %for.end12.loopexit.split.loop.exit, label %if.then if.then: ; preds = %for.body5 %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count br i1 %exitcond.not, label %for.end12, label %for.body5, !llvm.loop !11 for.end12.loopexit.split.loop.exit: ; preds = %for.body5 %indvars57.le = trunc i64 %indvars.iv53 to i32 br label %for.end12 for.end12: ; preds = %if.then, %for.end12.loopexit.split.loop.exit, %entry, %for.cond3.preheader %.lcssa63 = phi i32 [ %5, %for.cond3.preheader ], [ %3, %entry ], [ %5, %for.end12.loopexit.split.loop.exit ], [ %5, %if.then ] %count.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %indvars57.le, %for.end12.loopexit.split.loop.exit ], [ %5, %if.then ] %j.045 = add nsw i32 %.lcssa63, -1 %cmp1446 = icmp sgt i32 %j.045, %count.0.lcssa br i1 %cmp1446, label %for.body16.lr.ph, label %cleanup for.body16.lr.ph: ; preds = %for.end12 %8 = load i32, ptr %k, align 4, !tbaa !5 %9 = sext i32 %j.045 to i64 %10 = sext i32 %count.0.lcssa to i64 %11 = add i32 %.lcssa63, -1 br label %for.body16 for.body16: ; preds = %for.body16.lr.ph, %if.then20 %indvars.iv58 = phi i64 [ %9, %for.body16.lr.ph ], [ %indvars.iv.next59, %if.then20 ] %count.147 = phi i32 [ %count.0.lcssa, %for.body16.lr.ph ], [ %inc21, %if.then20 ] %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv58 %12 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19.not = icmp sgt i32 %12, %8 br i1 %cmp19.not, label %cleanup, label %if.then20 if.then20: ; preds = %for.body16 %inc21 = add nuw nsw i32 %count.147, 1 %indvars.iv.next59 = add nsw i64 %indvars.iv58, -1 %cmp14 = icmp sgt i64 %indvars.iv.next59, %10 br i1 %cmp14, label %for.body16, label %cleanup, !llvm.loop !12 cleanup: ; preds = %if.then20, %for.body16, %for.end12 %count.1.lcssa = phi i32 [ %count.0.lcssa, %for.end12 ], [ %count.147, %for.body16 ], [ %11, %if.then20 ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.1.lcssa) call void @llvm.stackrestore.p0(ptr %2) 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 i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int sum_of_digits(int n) { int sum = 0; while (n > 0) { sum += n % 10; n /= 10; } return sum; } int main(int argc, char *argv[]) { int n; int sum; scanf("%d", &n); int s = sum_of_digits(n); if (n % s == 0) { puts("Yes"); } else { puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144990/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144990/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @sum_of_digits(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %sum.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %n.addr.05 = phi i32 [ %div, %while.body ], [ %n, %entry ] %rem = urem i32 %n.addr.05, 10 %add = add nuw nsw i32 %sum.06, %rem %div = udiv i32 %n.addr.05, 10 %cmp.not = icmp ult i32 %n.addr.05, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 { 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 !7 %cmp4.i = icmp sgt i32 %0, 0 br i1 %cmp4.i, label %while.body.i, label %sum_of_digits.exit while.body.i: ; preds = %entry, %while.body.i %sum.06.i = phi i32 [ %add.i, %while.body.i ], [ 0, %entry ] %n.addr.05.i = phi i32 [ %div.i, %while.body.i ], [ %0, %entry ] %rem.i = urem i32 %n.addr.05.i, 10 %add.i = add nuw nsw i32 %rem.i, %sum.06.i %div.i = udiv i32 %n.addr.05.i, 10 %cmp.not.i = icmp ult i32 %n.addr.05.i, 10 br i1 %cmp.not.i, label %sum_of_digits.exit, label %while.body.i, !llvm.loop !5 sum_of_digits.exit: ; preds = %while.body.i, %entry %sum.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %while.body.i ] %rem = srem i32 %0, %sum.0.lcssa.i %cmp = icmp eq i32 %rem, 0 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int n,a,b; scanf("%d", &n); for(a=n,b=0;a>0;a/=10){ b+=a%10; } printf("%s\n", n%b==0?"Yes":"No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145032/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145032/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"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 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 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %b.09 = phi i32 [ %add, %for.body ], [ 0, %entry ] %a.08 = phi i32 [ %div, %for.body ], [ %0, %entry ] %rem = urem i32 %a.08, 10 %add = add nuw nsw i32 %b.09, %rem %div = udiv i32 %a.08, 10 %cmp.not = icmp ult i32 %a.08, 10 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry %b.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %rem1 = srem i32 %0, %b.0.lcssa %cmp2 = icmp eq i32 %rem1, 0 %cond = select i1 %cmp2, ptr @.str.2, ptr @.str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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> #define MIN(x,y) ((x<y)?(x):(y)) int main(void){ unsigned int math,algo,code; unsigned int input[6],sum; unsigned int i,j,k,min; unsigned int contest,mcon,acon,ccon; while(1){ for(i=0;i<6;i++) scanf("%u",&input[i]); sum=input[0]; for(i=1;i<6;i++) sum+=input[i]; if(sum==0) break; math=input[0]+input[3]; algo=input[1]+input[4]; code=input[2]+input[5]; mcon=math/3; acon=algo/3; ccon=code/3; contest=mcon+acon+ccon; math%=3; algo%=3; code%=3; min=MIN(MIN(math,algo),code); math-=min; algo-=min; code-=min; contest+=min; if(ccon>=1 && math==2 && algo==2) contest++; else if(mcon>=1 && algo==2 && code==2) contest++; else if(acon>=1 && code==2 && math==2) contest++; printf("%u\n",contest); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145076/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%u\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %input = alloca [6 x i32], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %input) #4 %arrayidx12 = getelementptr inbounds [6 x i32], ptr %input, i64 0, i64 3 %arrayidx14 = getelementptr inbounds [6 x i32], ptr %input, i64 0, i64 1 %arrayidx15 = getelementptr inbounds [6 x i32], ptr %input, i64 0, i64 4 %arrayidx17 = getelementptr inbounds [6 x i32], ptr %input, i64 0, i64 2 %arrayidx18 = getelementptr inbounds [6 x i32], ptr %input, i64 0, i64 5 br label %while.cond while.cond: ; preds = %if.end63, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx14) %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx17) %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx12) %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx15) %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx18) %0 = load i32, ptr %input, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %add = add i32 %1, %0 %2 = load i32, ptr %arrayidx17, align 8, !tbaa !5 %add.1 = add i32 %2, %add %3 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %add.2 = add i32 %3, %add.1 %4 = load i32, ptr %arrayidx15, align 16, !tbaa !5 %add.3 = add i32 %4, %add.2 %5 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %add.4 = sub i32 0, %add.3 %cmp10 = icmp eq i32 %5, %add.4 br i1 %cmp10, label %while.end, label %if.end if.end: ; preds = %while.cond %add13 = add i32 %3, %0 %add16 = add i32 %4, %1 %add19 = add i32 %5, %2 %div = udiv i32 %add13, 3 %div20 = udiv i32 %add16, 3 %div21 = udiv i32 %add19, 3 %add22 = add nuw i32 %div20, %div %add23 = add nuw i32 %add22, %div21 %rem = urem i32 %add13, 3 %rem24 = urem i32 %add16, 3 %rem25 = urem i32 %add19, 3 %cond = call i32 @llvm.umin.i32(i32 %rem, i32 %rem24) %cond.rem25 = call i32 @llvm.umin.i32(i32 %cond, i32 %rem25) %sub = sub nsw i32 %rem, %cond.rem25 %sub37 = sub nsw i32 %rem24, %cond.rem25 %add39 = add i32 %add23, %cond.rem25 %cmp40 = icmp ugt i32 %add19, 2 %cmp41 = icmp eq i32 %sub, 2 %or.cond = select i1 %cmp40, i1 %cmp41, i1 false %cmp43 = icmp eq i32 %sub37, 2 %or.cond65 = select i1 %or.cond, i1 %cmp43, i1 false br i1 %or.cond65, label %if.end63, label %if.else if.else: ; preds = %if.end %sub38 = sub nsw i32 %rem25, %cond.rem25 %cmp46 = icmp ugt i32 %add13, 2 %or.cond66 = select i1 %cmp46, i1 %cmp43, i1 false %cmp50 = icmp eq i32 %sub38, 2 %or.cond67 = select i1 %or.cond66, i1 %cmp50, i1 false br i1 %or.cond67, label %if.end63, label %if.else53 if.else53: ; preds = %if.else %cmp54 = icmp ugt i32 %add16, 2 %or.cond68 = select i1 %cmp54, i1 %cmp50, i1 false %or.cond69 = select i1 %or.cond68, i1 %cmp41, i1 false %inc60 = zext i1 %or.cond69 to i32 br label %if.end63 if.end63: ; preds = %if.else, %if.end, %if.else53 %inc60.sink = phi i32 [ %inc60, %if.else53 ], [ 1, %if.end ], [ 1, %if.else ] %spec.select = add i32 %add39, %inc60.sink %call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) br label %while.cond while.end: ; preds = %while.cond call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %input) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int num; int temp[5]; int i; int sum, min, max; while (1){ scanf("%d", &num); if (num == 0) break; for (i = 0; i < num; i++){ scanf("%d%d%d%d%d", &temp[0], &temp[1], &temp[2], &temp[3], &temp[4]); sum = temp[0] + temp[1] + temp[2] + temp[3] + temp[4]; if (i == 0) min = max = sum; else { if (sum < min) min = sum; if (sum > max) max = sum; } } printf("%d %d\n", max, min); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145126/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145126/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"%d%d%d%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: %num = alloca i32, align 4 %temp = alloca [5 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %temp) #4 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp40 = icmp eq i32 %0, 0 br i1 %cmp40, label %while.end, label %for.cond.preheader.lr.ph for.cond.preheader.lr.ph: ; preds = %entry %arrayidx2 = getelementptr inbounds [5 x i32], ptr %temp, i64 0, i64 1 %arrayidx3 = getelementptr inbounds [5 x i32], ptr %temp, i64 0, i64 2 %arrayidx4 = getelementptr inbounds [5 x i32], ptr %temp, i64 0, i64 3 %arrayidx5 = getelementptr inbounds [5 x i32], ptr %temp, i64 0, i64 4 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %for.end %1 = phi i32 [ %0, %for.cond.preheader.lr.ph ], [ %10, %for.end ] %max.042 = phi i32 [ undef, %for.cond.preheader.lr.ph ], [ %max.1.lcssa, %for.end ] %min.041 = phi i32 [ undef, %for.cond.preheader.lr.ph ], [ %min.1.lcssa, %for.end ] %cmp134 = icmp sgt i32 %1, 0 br i1 %cmp134, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %for.cond.preheader %call6.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %temp, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5) %2 = load <4 x i32>, ptr %temp, align 16, !tbaa !5 %3 = load i32, ptr %arrayidx5, align 16, !tbaa !5 %4 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2) %op.rdx = add i32 %4, %3 %5 = load i32, ptr %num, align 4, !tbaa !5 %cmp1.peel = icmp sgt i32 %5, 1 br i1 %cmp1.peel, label %for.body, label %for.end for.body: ; preds = %for.body.preheader, %for.body %max.137 = phi i32 [ %spec.select33, %for.body ], [ %op.rdx, %for.body.preheader ] %min.136 = phi i32 [ %spec.select, %for.body ], [ %op.rdx, %for.body.preheader ] %i.035 = phi i32 [ %inc, %for.body ], [ 1, %for.body.preheader ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %temp, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5) %6 = load <4 x i32>, ptr %temp, align 16, !tbaa !5 %7 = load i32, ptr %arrayidx5, align 16, !tbaa !5 %8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %6) %op.rdx45 = add i32 %8, %7 %spec.select = call i32 @llvm.smin.i32(i32 %op.rdx45, i32 %min.136) %spec.select33 = call i32 @llvm.smax.i32(i32 %op.rdx45, i32 %max.137) %inc = add nuw nsw i32 %i.035, 1 %9 = load i32, ptr %num, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %9 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.body.preheader, %for.cond.preheader %min.1.lcssa = phi i32 [ %min.041, %for.cond.preheader ], [ %op.rdx, %for.body.preheader ], [ %spec.select, %for.body ] %max.1.lcssa = phi i32 [ %max.042, %for.cond.preheader ], [ %op.rdx, %for.body.preheader ], [ %spec.select33, %for.body ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.1.lcssa, i32 noundef %min.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %10 = load i32, ptr %num, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %temp) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
/* * ex7-1 * kamecha */ #include<stdio.h> typedef struct point{ int x_elem; int y_elem; }point; //構造体の足し算 point add(point a, point b){ point tmp = {0, 0}; tmp.x_elem = a.x_elem + b.x_elem; tmp.y_elem = a.y_elem + b.y_elem; return tmp; } point dec(point a, point b){ point tmp = {0, 0}; tmp.x_elem = a.x_elem - b.x_elem; tmp.y_elem = a.y_elem - b.y_elem; return tmp; } //頂点を原点から90度時計回りにシフト point shift_point(point ptr){ point vec = {-ptr.y_elem, ptr.x_elem}; return add(vec, ptr); } int main(void){ point p1, p2, p3, p4; scanf("%d", &p1.x_elem); scanf("%d", &p1.y_elem); scanf("%d", &p2.x_elem); scanf("%d", &p2.y_elem); p3 = add(p1, shift_point(dec(p2, p1))); p4 = add(p2, shift_point(dec(p3, p2))); printf("%d %d %d %d\n", p3.x_elem, p3.y_elem, p4.x_elem, p4.y_elem); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145212/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145212/source.c" target datalayout = "e-m:e-p270: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.point = type { i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @add(i64 %a.coerce, i64 %b.coerce) local_unnamed_addr #0 { entry: %a.sroa.2.0.extract.shift = and i64 %a.coerce, -4294967296 %add = add i64 %b.coerce, %a.coerce %b.sroa.2.0.extract.shift7 = add i64 %a.sroa.2.0.extract.shift, %b.coerce %retval.sroa.3.0.insert.ext = and i64 %b.sroa.2.0.extract.shift7, -4294967296 %retval.sroa.0.0.insert.ext = and i64 %add, 4294967295 %retval.sroa.0.0.insert.insert = or i64 %retval.sroa.3.0.insert.ext, %retval.sroa.0.0.insert.ext ret i64 %retval.sroa.0.0.insert.insert } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @dec(i64 %a.coerce, i64 %b.coerce) local_unnamed_addr #0 { entry: %b.sroa.2.0.extract.shift = and i64 %b.coerce, -4294967296 %sub = sub i64 %a.coerce, %b.coerce %a.sroa.2.0.extract.shift7 = sub i64 %a.coerce, %b.sroa.2.0.extract.shift %retval.sroa.3.0.insert.ext = and i64 %a.sroa.2.0.extract.shift7, -4294967296 %retval.sroa.0.0.insert.ext = and i64 %sub, 4294967295 %retval.sroa.0.0.insert.insert = or i64 %retval.sroa.3.0.insert.ext, %retval.sroa.0.0.insert.ext ret i64 %retval.sroa.0.0.insert.insert } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @shift_point(i64 %ptr.coerce) local_unnamed_addr #0 { entry: %ptr.sroa.3.0.extract.shift = lshr i64 %ptr.coerce, 32 %add.i = sub i64 %ptr.coerce, %ptr.sroa.3.0.extract.shift %b.sroa.2.0.extract.shift7.i = mul i64 %ptr.coerce, 4294967297 %retval.sroa.3.0.insert.ext.i = and i64 %b.sroa.2.0.extract.shift7.i, -4294967296 %retval.sroa.0.0.insert.ext.i = and i64 %add.i, 4294967295 %retval.sroa.0.0.insert.insert.i = or i64 %retval.sroa.0.0.insert.ext.i, %retval.sroa.3.0.insert.ext.i ret i64 %retval.sroa.0.0.insert.insert.i } ; 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: %p1 = alloca %struct.point, align 8 %p2 = alloca %struct.point, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %p1) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %p2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p1) %y_elem = getelementptr inbounds %struct.point, ptr %p1, i64 0, i32 1 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y_elem) %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p2) %y_elem4 = getelementptr inbounds %struct.point, ptr %p2, i64 0, i32 1 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y_elem4) %0 = load i64, ptr %p2, align 8 %1 = load i64, ptr %p1, align 8 %b.sroa.2.0.extract.shift.i = and i64 %1, -4294967296 %sub.i = sub i64 %0, %1 %a.sroa.2.0.extract.shift7.i = sub i64 %0, %b.sroa.2.0.extract.shift.i %retval.sroa.3.0.insert.ext.i = and i64 %a.sroa.2.0.extract.shift7.i, -4294967296 %retval.sroa.0.0.insert.ext.i = and i64 %sub.i, 4294967295 %retval.sroa.0.0.insert.insert.i = or i64 %retval.sroa.3.0.insert.ext.i, %retval.sroa.0.0.insert.ext.i %ptr.sroa.3.0.extract.shift.i = lshr i64 %a.sroa.2.0.extract.shift7.i, 32 %add.i.i = sub i64 %sub.i, %ptr.sroa.3.0.extract.shift.i %b.sroa.2.0.extract.shift7.i.i = mul i64 %retval.sroa.0.0.insert.insert.i, 4294967297 %retval.sroa.3.0.insert.ext.i.i = and i64 %b.sroa.2.0.extract.shift7.i.i, -4294967296 %add.i = add i64 %add.i.i, %1 %b.sroa.2.0.extract.shift7.i = add i64 %retval.sroa.3.0.insert.ext.i.i, %b.sroa.2.0.extract.shift.i %p3.sroa.0.0.extract.trunc = trunc i64 %add.i to i32 %p3.sroa.5.0.extract.shift = lshr exact i64 %b.sroa.2.0.extract.shift7.i, 32 %p3.sroa.5.0.extract.trunc = trunc i64 %p3.sroa.5.0.extract.shift to i32 %b.sroa.2.0.extract.shift.i25 = and i64 %0, -4294967296 %sub.i26 = sub i64 %add.i, %0 %a.sroa.2.0.extract.shift7.i27 = sub i64 %b.sroa.2.0.extract.shift7.i, %b.sroa.2.0.extract.shift.i25 %retval.sroa.0.0.insert.ext.i29 = and i64 %sub.i26, 4294967295 %retval.sroa.0.0.insert.insert.i30 = or i64 %a.sroa.2.0.extract.shift7.i27, %retval.sroa.0.0.insert.ext.i29 %ptr.sroa.3.0.extract.shift.i31 = lshr exact i64 %a.sroa.2.0.extract.shift7.i27, 32 %add.i.i32 = sub i64 %sub.i26, %ptr.sroa.3.0.extract.shift.i31 %b.sroa.2.0.extract.shift7.i.i33 = mul i64 %retval.sroa.0.0.insert.insert.i30, 4294967297 %retval.sroa.3.0.insert.ext.i.i34 = and i64 %b.sroa.2.0.extract.shift7.i.i33, -4294967296 %add.i38 = add i64 %add.i.i32, %0 %b.sroa.2.0.extract.shift7.i39 = add i64 %0, %retval.sroa.3.0.insert.ext.i.i34 %p4.sroa.0.0.extract.trunc = trunc i64 %add.i38 to i32 %p4.sroa.4.0.extract.shift = lshr i64 %b.sroa.2.0.extract.shift7.i39, 32 %p4.sroa.4.0.extract.trunc = trunc i64 %p4.sroa.4.0.extract.shift to i32 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p3.sroa.0.0.extract.trunc, i32 noundef %p3.sroa.5.0.extract.trunc, i32 noundef %p4.sroa.0.0.extract.trunc, i32 noundef %p4.sroa.4.0.extract.trunc) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %p2) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %p1) #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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
/* ex7_1 Jun_JPN */ #include <stdio.h> typedef struct{ // 頂点の(x,y)座標 int x_elem; int y_elem; }point; point shift_point(point A_vec, point B_vec, int pm); // pm = 1 or -1 int main(void){ point A_vec, B_vec, C_vec, D_vec; scanf("%d %d %d %d", &A_vec.x_elem, &A_vec.y_elem, &B_vec.x_elem, &B_vec.y_elem); C_vec = shift_point(B_vec, A_vec, -1); // BAベクトルを-90度回転 D_vec = shift_point(A_vec, B_vec, 1); // ABベクトルを+90度回転 printf("%d %d %d %d\n", C_vec.x_elem, C_vec.y_elem, D_vec.x_elem, D_vec.y_elem); return 0; } /* ABベクトルをpm*90度回転した先にある点の座標を返す関数 */ point shift_point(point A_vec, point B_vec, int pm){ point AB_vec, AD_vec, D_vec; /* 引数OAベクトル,OBベクトルからABベクトルを計算 */ AB_vec.x_elem = B_vec.x_elem - A_vec.x_elem; AB_vec.y_elem = B_vec.y_elem - A_vec.y_elem; /* ABベクトルを90度回転し,ADベクトルを得る ただしpm=-1のときは-90度回転となる */ AD_vec.x_elem = (-1)*pm*AB_vec.y_elem; AD_vec.y_elem = pm*AB_vec.x_elem; /* OAベクトルとADベクトルの和を取ればODベクトルが得られる */ D_vec.x_elem = A_vec.x_elem + AD_vec.x_elem; D_vec.y_elem = A_vec.y_elem + AD_vec.y_elem; return D_vec; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145263/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145263/source.c" target datalayout = "e-m:e-p270: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.point = type { i32, i32 } @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A_vec = alloca %struct.point, align 8 %B_vec = alloca %struct.point, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A_vec) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B_vec) #4 %y_elem = getelementptr inbounds %struct.point, ptr %A_vec, i64 0, i32 1 %y_elem2 = getelementptr inbounds %struct.point, ptr %B_vec, i64 0, i32 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A_vec, ptr noundef nonnull %y_elem, ptr noundef nonnull %B_vec, ptr noundef nonnull %y_elem2) %0 = load i64, ptr %B_vec, align 8 %1 = load i64, ptr %A_vec, align 8 %A_vec.sroa.0.0.extract.trunc.i = trunc i64 %0 to i32 %A_vec.sroa.3.0.extract.shift.i = lshr i64 %0, 32 %A_vec.sroa.3.0.extract.trunc.i = trunc i64 %A_vec.sroa.3.0.extract.shift.i to i32 %B_vec.sroa.0.0.extract.trunc.i = trunc i64 %1 to i32 %B_vec.sroa.2.0.extract.shift.i = lshr i64 %1, 32 %B_vec.sroa.2.0.extract.trunc.i = trunc i64 %B_vec.sroa.2.0.extract.shift.i to i32 %sub.i.neg = sub i32 %A_vec.sroa.0.0.extract.trunc.i, %B_vec.sroa.0.0.extract.trunc.i %sub4.neg.i.neg = sub i64 %0, %A_vec.sroa.3.0.extract.shift.i %add.i = add i64 %sub4.neg.i.neg, %B_vec.sroa.2.0.extract.shift.i %add17.i = add nsw i32 %sub.i.neg, %A_vec.sroa.3.0.extract.trunc.i %C_vec.sroa.0.0.extract.trunc = trunc i64 %add.i to i32 %sub4.neg.i18 = sub i64 %1, %A_vec.sroa.3.0.extract.shift.i %add.i19 = add i64 %sub4.neg.i18, %B_vec.sroa.2.0.extract.shift.i %add17.i20 = add nsw i32 %sub.i.neg, %B_vec.sroa.2.0.extract.trunc.i %D_vec.sroa.0.0.extract.trunc = trunc i64 %add.i19 to i32 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %C_vec.sroa.0.0.extract.trunc, i32 noundef %add17.i, i32 noundef %D_vec.sroa.0.0.extract.trunc, i32 noundef %add17.i20) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B_vec) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A_vec) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @shift_point(i64 %A_vec.coerce, i64 %B_vec.coerce, i32 noundef %pm) local_unnamed_addr #3 { entry: %A_vec.sroa.0.0.extract.trunc = trunc i64 %A_vec.coerce to i32 %A_vec.sroa.3.0.extract.shift = lshr i64 %A_vec.coerce, 32 %A_vec.sroa.3.0.extract.trunc = trunc i64 %A_vec.sroa.3.0.extract.shift to i32 %B_vec.sroa.0.0.extract.trunc = trunc i64 %B_vec.coerce to i32 %B_vec.sroa.2.0.extract.shift = lshr i64 %B_vec.coerce, 32 %B_vec.sroa.2.0.extract.trunc = trunc i64 %B_vec.sroa.2.0.extract.shift to i32 %sub = sub nsw i32 %B_vec.sroa.0.0.extract.trunc, %A_vec.sroa.0.0.extract.trunc %sub4.neg = sub i32 %A_vec.sroa.3.0.extract.trunc, %B_vec.sroa.2.0.extract.trunc %.neg = mul i32 %sub4.neg, %pm %mul10 = mul nsw i32 %sub, %pm %add = add nsw i32 %.neg, %A_vec.sroa.0.0.extract.trunc %add17 = add nsw i32 %mul10, %A_vec.sroa.3.0.extract.trunc %retval.sroa.2.0.insert.ext = zext i32 %add17 to i64 %retval.sroa.2.0.insert.shift = shl nuw i64 %retval.sroa.2.0.insert.ext, 32 %retval.sroa.0.0.insert.ext = zext i32 %add to i64 %retval.sroa.0.0.insert.insert = or i64 %retval.sroa.2.0.insert.shift, %retval.sroa.0.0.insert.ext ret i64 %retval.sroa.0.0.insert.insert } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> int main(){ int x1, y1, x2, y2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2); int Xvecter = x2 - x1; int Yvecter = y2 - y1; printf("%d %d %d %d", x2 - Yvecter, y2 + Xvecter, x1 - Yvecter, y1 + Xvecter); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145306/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145306/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x1 = alloca i32, align 4 %y1 = alloca i32, align 4 %x2 = alloca i32, align 4 %y2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %0 = load i32, ptr %x2, align 4, !tbaa !5 %1 = load i32, ptr %x1, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %y2, align 4, !tbaa !5 %3 = load i32, ptr %y1, align 4, !tbaa !5 %sub1 = sub nsw i32 %2, %3 %sub2 = sub nsw i32 %0, %sub1 %add = add nsw i32 %2, %sub %sub3 = sub nsw i32 %1, %sub1 %add4 = add nsw i32 %3, %sub %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2, i32 noundef %add, i32 noundef %sub3, i32 noundef %add4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int i, j, k, m, n, temp; scanf("%d", &n); char str[n]; scanf("%s", str); for(i = 1; i <= n; i++) { if(n % i == 0) { for(j = 0, k = i-1; k >= (i)/2; k--, j++) { temp = str[j]; str[j] = str[k]; str[k] = temp; } } } for(i = 0; i < n; i++) { printf("%c", str[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14535/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14535/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %1, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not43 = icmp slt i32 %3, 1 br i1 %cmp.not43, label %for.end26, label %for.body.preheader for.body.preheader: ; preds = %entry %4 = add nuw i32 %3, 1 %wide.trip.count56 = zext i32 %4 to i64 %invariant.gep = getelementptr i8, ptr %vla, i64 -1 %invariant.gep62 = getelementptr i8, ptr %vla, i64 -1 br label %for.body for.cond16.preheader: ; preds = %for.inc13 %cmp1746 = icmp sgt i32 %3, 0 br i1 %cmp1746, label %for.body19, label %for.end26 for.body: ; preds = %for.body.preheader, %for.inc13 %indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %for.inc13 ] %indvars.iv48 = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next49, %for.inc13 ] %5 = add i32 %indvar, 1 %6 = lshr i32 %5, 1 %7 = sub i32 %5, %6 %8 = zext i32 %7 to i64 %indvars55 = trunc i64 %indvars.iv48 to i32 %9 = lshr i32 %indvars55, 1 %rem = srem i32 %3, %indvars55 %cmp2 = icmp eq i32 %rem, 0 %cmp4.not.not40 = icmp ult i32 %9, %indvars55 %or.cond = and i1 %cmp2, %cmp4.not.not40 br i1 %or.cond, label %for.body5.preheader, label %for.inc13 for.body5.preheader: ; preds = %for.body %xtraiter = and i64 %8, 1 %10 = icmp eq i32 %7, 1 br i1 %10, label %for.inc13.loopexit.unr-lcssa, label %for.body5.preheader.new for.body5.preheader.new: ; preds = %for.body5.preheader %unroll_iter = and i64 %8, 4294967294 br label %for.body5 for.body5: ; preds = %for.body5, %for.body5.preheader.new %indvars.iv50 = phi i64 [ %indvars.iv48, %for.body5.preheader.new ], [ %indvars.iv.next51.1, %for.body5 ] %indvars.iv = phi i64 [ 0, %for.body5.preheader.new ], [ %indvars.iv.next.1, %for.body5 ] %niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %11 = load i8, ptr %arrayidx, align 2, !tbaa !9 %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv50 %12 = load i8, ptr %gep, align 1, !tbaa !9 store i8 %12, ptr %arrayidx, align 2, !tbaa !9 store i8 %11, ptr %gep, align 1, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %indvars.iv.next51.1 = add nsw i64 %indvars.iv50, -2 %arrayidx.1 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.next %13 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %arrayidx7.1 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.next51.1 %14 = load i8, ptr %arrayidx7.1, align 1, !tbaa !9 store i8 %14, ptr %arrayidx.1, align 1, !tbaa !9 store i8 %13, ptr %arrayidx7.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.inc13.loopexit.unr-lcssa, label %for.body5, !llvm.loop !10 for.inc13.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader %indvars.iv50.unr = phi i64 [ %indvars.iv48, %for.body5.preheader ], [ %indvars.iv.next51.1, %for.body5 ] %indvars.iv.unr = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next.1, %for.body5 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc13, label %for.body5.epil for.body5.epil: ; preds = %for.inc13.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.unr %15 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %gep63 = getelementptr i8, ptr %invariant.gep62, i64 %indvars.iv50.unr %16 = load i8, ptr %gep63, align 1, !tbaa !9 store i8 %16, ptr %arrayidx.epil, align 1, !tbaa !9 store i8 %15, ptr %gep63, align 1, !tbaa !9 br label %for.inc13 for.inc13: ; preds = %for.body5.epil, %for.inc13.loopexit.unr-lcssa, %for.body %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1 %exitcond57.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count56 %indvar.next = add i32 %indvar, 1 br i1 %exitcond57.not, label %for.cond16.preheader, label %for.body, !llvm.loop !12 for.body19: ; preds = %for.cond16.preheader, %for.body19 %indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.body19 ], [ 0, %for.cond16.preheader ] %arrayidx21 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv58 %17 = load i8, ptr %arrayidx21, align 1, !tbaa !9 %conv22 = sext i8 %17 to i32 %putchar = call i32 @putchar(i32 %conv22) %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp17 = icmp slt i64 %indvars.iv.next59, %19 br i1 %cmp17, label %for.body19, label %for.end26, !llvm.loop !13 for.end26: ; preds = %for.body19, %entry, %for.cond16.preheader 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 declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = distinct !{!13, !11}
#include<stdio.h> #include<string.h> int main() { int i,j=1,l,m,k,n,sum=0,count=0,b[1000],p, q; char a[1000],c[1000],f; scanf("%d",&n); k=n/2; for(i=2;i<=k;i++) { if(n%i==0) { b[j]=i; j++; } } j--; q=j; scanf("%s",a); for(j=1;j<=q;j++) { k=b[j]/2; for(i=0,l=b[j]-1,p=0;p<k;p++,i++,l--) { f=a[i]; a[i]=a[l]; a[l]=f; } } for(i=n-1,m=0;m<n/2;m++,i--) { f=a[i]; a[i]=a[m]; a[m]=f; } printf("%s",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14540/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14540/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %b = alloca [1000 x i32], align 16 %a = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 1000, 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 %cmp.not74 = icmp slt i32 %0, 4 br i1 %cmp.not74, label %for.end.thread, label %for.body.preheader for.end.thread: ; preds = %entry %call3109 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) br label %for.end30 for.body.preheader: ; preds = %entry %div112114 = lshr i32 %0, 1 %1 = add nsw i32 %div112114, -1 %xtraiter = and i32 %1, 1 %2 = icmp eq i32 %div112114, 2 br i1 %2, label %for.end.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %1, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %i.076 = phi i32 [ 2, %for.body.preheader.new ], [ %inc2.1, %for.inc.1 ] %j.075 = phi i32 [ 1, %for.body.preheader.new ], [ %j.1.1, %for.inc.1 ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %rem = srem i32 %0, %i.076 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %idxprom = sext i32 %j.075 to i64 %arrayidx = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %idxprom store i32 %i.076, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %j.075, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %j.1 = phi i32 [ %inc, %if.then ], [ %j.075, %for.body ] %inc2 = or i32 %i.076, 1 %rem.1 = srem i32 %0, %inc2 %cmp1.1 = icmp eq i32 %rem.1, 0 br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %idxprom.1 = sext i32 %j.1 to i64 %arrayidx.1 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %idxprom.1 store i32 %inc2, ptr %arrayidx.1, align 4, !tbaa !5 %inc.1 = add nsw i32 %j.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %j.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %j.1, %for.inc ] %inc2.1 = add nuw nsw i32 %i.076, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.unr-lcssa, label %for.body, !llvm.loop !9 for.end.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %j.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %j.1.1, %for.inc.1 ] %i.076.unr = phi i32 [ 2, %for.body.preheader ], [ %inc2.1, %for.inc.1 ] %j.075.unr = phi i32 [ 1, %for.body.preheader ], [ %j.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.unr-lcssa %rem.epil = srem i32 %0, %i.076.unr %cmp1.epil = icmp eq i32 %rem.epil, 0 br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %idxprom.epil = sext i32 %j.075.unr to i64 %arrayidx.epil = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %idxprom.epil store i32 %i.076.unr, ptr %arrayidx.epil, align 4, !tbaa !5 %inc.epil = add nsw i32 %j.075.unr, 1 br label %for.end for.end: ; preds = %for.body.epil, %if.then.epil, %for.end.unr-lcssa %j.1.lcssa = phi i32 [ %j.1.lcssa.ph, %for.end.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ %j.075.unr, %for.body.epil ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %cmp5.not.not81 = icmp sgt i32 %j.1.lcssa, 1 br i1 %cmp5.not.not81, label %for.body6.preheader, label %for.end30 for.body6.preheader: ; preds = %for.end %wide.trip.count97 = zext i32 %j.1.lcssa to i64 br label %for.body6 for.body6: ; preds = %for.body6.preheader, %for.inc28 %indvars.iv94 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next95, %for.inc28 ] %arrayidx8 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv94 %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp1377 = icmp sgt i32 %3, 1 br i1 %cmp1377, label %for.body14.preheader, label %for.inc28 for.body14.preheader: ; preds = %for.body6 %div9113115 = lshr i32 %3, 1 %4 = zext i32 %3 to i64 %wide.trip.count = zext i32 %div9113115 to i64 %xtraiter118 = and i64 %wide.trip.count, 1 %5 = icmp eq i32 %div9113115, 1 br i1 %5, label %for.inc28.loopexit.unr-lcssa, label %for.body14.preheader.new for.body14.preheader.new: ; preds = %for.body14.preheader %unroll_iter120 = and i64 %wide.trip.count, 2147483646 br label %for.body14 for.body14: ; preds = %for.body14, %for.body14.preheader.new %indvars.iv86 = phi i64 [ %4, %for.body14.preheader.new ], [ %indvars.iv.next87.1, %for.body14 ] %indvars.iv = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next.1, %for.body14 ] %niter121 = phi i64 [ 0, %for.body14.preheader.new ], [ %niter121.next.1, %for.body14 ] %indvars.iv.next87 = add nsw i64 %indvars.iv86, -1 %arrayidx16 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv %6 = load i8, ptr %arrayidx16, align 2, !tbaa !11 %arrayidx18 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next87 %7 = load i8, ptr %arrayidx18, align 1, !tbaa !11 store i8 %7, ptr %arrayidx16, align 2, !tbaa !11 store i8 %6, ptr %arrayidx18, align 1, !tbaa !11 %indvars.iv.next = or i64 %indvars.iv, 1 %indvars.iv.next87.1 = add nsw i64 %indvars.iv86, -2 %arrayidx16.1 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next %8 = load i8, ptr %arrayidx16.1, align 1, !tbaa !11 %arrayidx18.1 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next87.1 %9 = load i8, ptr %arrayidx18.1, align 1, !tbaa !11 store i8 %9, ptr %arrayidx16.1, align 1, !tbaa !11 store i8 %8, ptr %arrayidx18.1, align 1, !tbaa !11 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter121.next.1 = add i64 %niter121, 2 %niter121.ncmp.1 = icmp eq i64 %niter121.next.1, %unroll_iter120 br i1 %niter121.ncmp.1, label %for.inc28.loopexit.unr-lcssa, label %for.body14, !llvm.loop !12 for.inc28.loopexit.unr-lcssa: ; preds = %for.body14, %for.body14.preheader %indvars.iv86.unr = phi i64 [ %4, %for.body14.preheader ], [ %indvars.iv.next87.1, %for.body14 ] %indvars.iv.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next.1, %for.body14 ] %lcmp.mod119.not = icmp eq i64 %xtraiter118, 0 br i1 %lcmp.mod119.not, label %for.inc28, label %for.body14.epil for.body14.epil: ; preds = %for.inc28.loopexit.unr-lcssa %indvars.iv.next87.epil = add nsw i64 %indvars.iv86.unr, -1 %arrayidx16.epil = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.unr %10 = load i8, ptr %arrayidx16.epil, align 1, !tbaa !11 %arrayidx18.epil = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next87.epil %11 = load i8, ptr %arrayidx18.epil, align 1, !tbaa !11 store i8 %11, ptr %arrayidx16.epil, align 1, !tbaa !11 store i8 %10, ptr %arrayidx18.epil, align 1, !tbaa !11 br label %for.inc28 for.inc28: ; preds = %for.body14.epil, %for.inc28.loopexit.unr-lcssa, %for.body6 %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97 br i1 %exitcond98.not, label %for.end30, label %for.body6, !llvm.loop !13 for.end30: ; preds = %for.inc28, %for.end.thread, %for.end %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp3483 = icmp sgt i32 %12, 1 br i1 %cmp3483, label %for.body35.preheader, label %for.end47 for.body35.preheader: ; preds = %for.end30 %div33111116 = lshr i32 %12, 1 %13 = zext i32 %12 to i64 %wide.trip.count106 = zext i32 %div33111116 to i64 %xtraiter122 = and i64 %wide.trip.count106, 1 %14 = icmp eq i32 %div33111116, 1 br i1 %14, label %for.end47.loopexit.unr-lcssa, label %for.body35.preheader.new for.body35.preheader.new: ; preds = %for.body35.preheader %unroll_iter124 = and i64 %wide.trip.count106, 2147483646 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.preheader.new %indvars.iv101 = phi i64 [ 0, %for.body35.preheader.new ], [ %indvars.iv.next102.1, %for.body35 ] %indvars.iv99 = phi i64 [ %13, %for.body35.preheader.new ], [ %indvars.iv.next100.1, %for.body35 ] %niter125 = phi i64 [ 0, %for.body35.preheader.new ], [ %niter125.next.1, %for.body35 ] %indvars.iv.next100 = add nsw i64 %indvars.iv99, -1 %arrayidx37 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next100 %15 = load i8, ptr %arrayidx37, align 1, !tbaa !11 %arrayidx39 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv101 %16 = load i8, ptr %arrayidx39, align 2, !tbaa !11 store i8 %16, ptr %arrayidx37, align 1, !tbaa !11 store i8 %15, ptr %arrayidx39, align 2, !tbaa !11 %indvars.iv.next102 = or i64 %indvars.iv101, 1 %indvars.iv.next100.1 = add nsw i64 %indvars.iv99, -2 %arrayidx37.1 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next100.1 %17 = load i8, ptr %arrayidx37.1, align 1, !tbaa !11 %arrayidx39.1 = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next102 %18 = load i8, ptr %arrayidx39.1, align 1, !tbaa !11 store i8 %18, ptr %arrayidx37.1, align 1, !tbaa !11 store i8 %17, ptr %arrayidx39.1, align 1, !tbaa !11 %indvars.iv.next102.1 = add nuw nsw i64 %indvars.iv101, 2 %niter125.next.1 = add i64 %niter125, 2 %niter125.ncmp.1 = icmp eq i64 %niter125.next.1, %unroll_iter124 br i1 %niter125.ncmp.1, label %for.end47.loopexit.unr-lcssa, label %for.body35, !llvm.loop !14 for.end47.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.preheader %indvars.iv101.unr = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next102.1, %for.body35 ] %indvars.iv99.unr = phi i64 [ %13, %for.body35.preheader ], [ %indvars.iv.next100.1, %for.body35 ] %lcmp.mod123.not = icmp eq i64 %xtraiter122, 0 br i1 %lcmp.mod123.not, label %for.end47, label %for.body35.epil for.body35.epil: ; preds = %for.end47.loopexit.unr-lcssa %indvars.iv.next100.epil = add nsw i64 %indvars.iv99.unr, -1 %arrayidx37.epil = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv.next100.epil %19 = load i8, ptr %arrayidx37.epil, align 1, !tbaa !11 %arrayidx39.epil = getelementptr inbounds [1000 x i8], ptr %a, i64 0, i64 %indvars.iv101.unr %20 = load i8, ptr %arrayidx39.epil, align 1, !tbaa !11 store i8 %20, ptr %arrayidx37.epil, align 1, !tbaa !11 store i8 %19, ptr %arrayidx39.epil, align 1, !tbaa !11 br label %for.end47 for.end47: ; preds = %for.body35.epil, %for.end47.loopexit.unr-lcssa, %for.end30 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %a) call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #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 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
//set many funcs template //Ver.20180717 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int nHr(int a,int b){return nCr(a+b-1,b);} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} int sankaku(int x){return ((1+x)*x)/2;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);} int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);} void shuffledget(int x[],int n){ srand(time(0)); int i,b[524288],p,c; for(i=0;i<n;i++){ b[i]=i; } for(i=n;i>=1;i--){ p=rand()%i; c=b[i-1];b[i-1]=b[p];b[p]=c; } for(i=0;i<n;i++){ scanf("%d",&x[b[i]]); } } int dx4[4]={1,-1,0,0}; int dy4[4]={0,0,1,-1}; int dx8[8]={-1,-1,-1,0,0,1,1,1}; int dy8[8]={-1,0,1,-1,1,-1,0,1}; int search(int x,int a[],int n){ int st=0,fi=n-1,te; while(st<=fi){ te=(st+fi)/2; if(a[te]<x){st=te+1;}else{fi=te-1;} } return st; } typedef struct{ int val; int node; }sd; int sdsortfnc(const void *a,const void *b){ if(((sd*)a)->val < ((sd*)b)->val){return -1;} if(((sd*)a)->val > ((sd*)b)->val){return 1;} return 0; } int main(void){ int i,j,n,m,k,a,b,c,h,w,r=0,l,t; int x1,y1,x2,y2; double d; char s[524288]; scanf("%d%d%d%d",&x1,&y1,&x2,&y2); a=x1-x2; b=y1-y2; printf("%d %d %d %d\n",x2+b,y2-a,x1+b,y1-a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145443/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145443/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16 @dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16 @dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16 @dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16 @.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i32 %b, %a %cmp.not6.i = icmp slt i32 %b, 1 br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i32 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i32 %add, %i.07.i %mul.i = mul nsw i32 %sub.i, %r.08.i %div.i = sdiv i32 %mul.i, %i.07.i %inc.i = add nuw i32 %i.07.i, 1 %sub.i.1 = sub i32 %add, %inc.i %mul.i.1 = mul nsw i32 %sub.i.1, %div.i %div.i.1 = sdiv i32 %mul.i.1, %inc.i %inc.i.1 = add nuw i32 %i.07.i, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i32 %add, %i.07.i.unr %mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i32 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i32 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.05, 10 %add = add nsw i32 %r.06, %rem %div = sdiv i32 %x.addr.05, 10 %x.addr.05.off = add i32 %x.addr.05, 9 %tobool.not = icmp ult i32 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i32 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.06, %b %add = add nsw i32 %rem, %r.07 %div = sdiv i32 %x.addr.06, %b %tobool.not = icmp eq i32 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i32 %x, 1 %mul = mul nsw i32 %add, %x %div = sdiv i32 %mul, 2 ret i32 %div } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !17 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i64 %b, %a %cmp.not6.i = icmp slt i64 %b, 1 br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i64 %add, %i.07.i %mul.i = mul nsw i64 %sub.i, %r.08.i %div.i = sdiv i64 %mul.i, %i.07.i %inc.i = add nuw i64 %i.07.i, 1 %sub.i.1 = sub i64 %add, %inc.i %mul.i.1 = mul nsw i64 %sub.i.1, %div.i %div.i.1 = sdiv i64 %mul.i.1, %inc.i %inc.i.1 = add nuw i64 %i.07.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17 llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i64 %add, %i.07.i.unr %mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr br label %llnCr.exit llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i64 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !19 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.05, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !22 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i64 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.05, 10 %add = add nsw i64 %r.06, %rem %div = sdiv i64 %x.addr.05, 10 %x.addr.05.off = add i64 %x.addr.05, 9 %tobool.not = icmp ult i64 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i64 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.06, %b %add = add nsw i64 %rem, %r.07 %div = sdiv i64 %x.addr.06, %b %tobool.not = icmp eq i64 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i64 %x, 1 %mul = mul nsw i64 %add, %x %div = sdiv i64 %mul, 2 ret i64 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !25 %1 = load i32, ptr %b, align 4, !tbaa !25 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #13 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #13 ret i32 %call } ; Function Attrs: nounwind uwtable define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 { entry: %b = alloca [524288 x i32], align 16 %call = tail call i64 @time(ptr noundef null) #14 %conv = trunc i64 %call to i32 tail call void @srand(i32 noundef %conv) #14 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #14 %cmp44 = icmp sgt i32 %n, 0 br i1 %cmp44, label %for.body.preheader, label %for.end29 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader61, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !33 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61 for.body.preheader61: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond2.preheader: ; preds = %for.body, %middle.block br i1 %cmp44, label %for.body5.preheader, label %for.end29 for.body5.preheader: ; preds = %for.cond2.preheader %3 = zext i32 %n to i64 br label %for.body5 for.body: ; preds = %for.body.preheader61, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ] %arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !25 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !34 for.cond18.preheader: ; preds = %for.body5 br i1 %cmp44, label %for.body21.preheader, label %for.end29 for.body21.preheader: ; preds = %for.cond18.preheader %wide.trip.count58 = zext i32 %n to i64 br label %for.body21 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ] %call6 = tail call i32 @rand() #14 %5 = trunc i64 %indvars.iv51 to i32 %rem = srem i32 %call6, %5 %indvars.iv.next52 = add nsw i64 %indvars.iv51, -1 %idxprom7 = and i64 %indvars.iv.next52, 4294967295 %arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7 %6 = load i32, ptr %arrayidx8, align 4, !tbaa !25 %idxprom9 = sext i32 %rem to i64 %arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9 %7 = load i32, ptr %arrayidx10, align 4, !tbaa !25 store i32 %7, ptr %arrayidx8, align 4, !tbaa !25 store i32 %6, ptr %arrayidx10, align 4, !tbaa !25 %cmp3 = icmp ugt i64 %indvars.iv51, 1 br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !35 for.body21: ; preds = %for.body21.preheader, %for.body21 %indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ] %arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54 %8 = load i32, ptr %arrayidx23, align 4, !tbaa !25 %idxprom24 = sext i32 %8 to i64 %arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24 %call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25) %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1 %exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58 br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !36 for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #14 ret void } ; Function Attrs: nounwind declare void @srand(i32 noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i64 @time(ptr noundef) local_unnamed_addr #8 ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 { entry: %cmp.not9 = icmp slt i32 %n, 1 br i1 %cmp.not9, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ] %fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ] %add = add nsw i32 %st.011, %fi.010 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !25 %cmp1 = icmp slt i32 %0, %x %add2 = add nsw i32 %div, 1 %sub3 = add nsw i32 %div, -1 %fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3 %st.1 = select i1 %cmp1, i32 %add2, i32 %st.011 %cmp.not = icmp sgt i32 %st.1, %fi.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !37 while.end: ; preds = %while.body, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ] ret i32 %st.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !38 %1 = load i32, ptr %b, align 4, !tbaa !38 %cmp = icmp slt i32 %0, %1 %cmp4 = icmp sgt i32 %0, %1 %. = zext i1 %cmp4 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #11 { entry: %x1 = alloca i32, align 4 %y1 = alloca i32, align 4 %x2 = alloca i32, align 4 %y2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #14 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #14 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #14 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #14 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %0 = load i32, ptr %x1, align 4, !tbaa !25 %1 = load i32, ptr %x2, align 4, !tbaa !25 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %y1, align 4, !tbaa !25 %3 = load i32, ptr %y2, align 4, !tbaa !25 %sub1 = sub nsw i32 %2, %3 %add = add nsw i32 %sub1, %1 %sub2 = sub nsw i32 %3, %sub %add3 = add nsw i32 %sub1, %0 %sub4 = sub nsw i32 %2, %sub %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %sub2, i32 noundef %add3, i32 noundef %sub4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #14 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #14 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #14 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #14 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #12 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #12 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind "no-trapping-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 = { 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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { nounwind willreturn memory(read) } 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.unroll.disable"} !21 = distinct !{!21, !6} !22 = distinct !{!22, !20} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = !{!26, !26, i64 0} !26 = !{!"int", !27, i64 0} !27 = !{!"omnipotent char", !28, i64 0} !28 = !{!"Simple C/C++ TBAA"} !29 = !{!30, !30, i64 0} !30 = !{!"long long", !27, i64 0} !31 = !{!32, !32, i64 0} !32 = !{!"double", !27, i64 0} !33 = distinct !{!33, !6, !9, !10} !34 = distinct !{!34, !6, !10, !9} !35 = distinct !{!35, !6} !36 = distinct !{!36, !6} !37 = distinct !{!37, !6} !38 = !{!39, !26, i64 0} !39 = !{!"", !26, i64 0, !26, i64 4}
#include <stdio.h> int main(void){ int x1, y1; int x2, y2; int x3, y3; int x4, y4; int xdiff, ydiff; scanf("%d %d %d %d", &x1, &y1, &x2, &y2); xdiff = x2-x1; ydiff = y2-y1; x3 = x2-ydiff; y3 = y2+xdiff; x4 = x1-ydiff; y4 = y1+xdiff; printf("%d %d %d %d", x3, y3, x4, y4); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145487/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145487/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x1 = alloca i32, align 4 %y1 = alloca i32, align 4 %x2 = alloca i32, align 4 %y2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %0 = load i32, ptr %x2, align 4, !tbaa !5 %1 = load i32, ptr %x1, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %y2, align 4, !tbaa !5 %3 = load i32, ptr %y1, align 4, !tbaa !5 %sub1 = sub nsw i32 %2, %3 %sub2 = sub nsw i32 %0, %sub1 %add = add nsw i32 %2, %sub %sub3 = sub nsw i32 %1, %sub1 %add4 = add nsw i32 %3, %sub %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub2, i32 noundef %add, i32 noundef %sub3, i32 noundef %add4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdbool.h> int main() { int n,k,i; scanf("%d %d",&n,&k); int a[n],f=0,b=0;bool flag=false; for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { if(a[i]>k) { break; } f++;if(f==n){flag=true;} } for(i=n-1;i>=0;i--) { if(a[i]>k) { break; } b++; } if(flag==true){printf("%d\n",f);} else if (flag==false){printf("%d\n",f+b);} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14553/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14553/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %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 %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 %cmp51 = icmp sgt i32 %3, 0 br i1 %cmp51, label %for.body, label %if.then34 for.cond2.preheader: ; preds = %for.body %cmp353 = icmp sgt i32 %5, 0 br i1 %cmp353, label %for.body4.lr.ph, label %if.then34 for.body4.lr.ph: ; preds = %for.cond2.preheader %4 = load i32, ptr %k, align 4, !tbaa !5 %wide.trip.count = zext i32 %5 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 i32, ptr %vla, 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 %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.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.lr.ph, %if.end %indvars.iv69 = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next70, %if.end ] %flag.056 = phi i8 [ 0, %for.body4.lr.ph ], [ %spec.select, %if.end ] %f.055 = phi i32 [ 0, %for.body4.lr.ph ], [ %inc8, %if.end ] %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv69 %7 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %7, %4 br i1 %cmp7, label %for.end14, label %if.end if.end: ; preds = %for.body4 %inc8 = add nuw nsw i32 %f.055, 1 %cmp9 = icmp eq i32 %inc8, %5 %spec.select = select i1 %cmp9, i8 1, i8 %flag.056 %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.end14, label %for.body4, !llvm.loop !11 for.end14: ; preds = %if.end, %for.body4 %f.0.lcssa.ph = phi i32 [ %5, %if.end ], [ %f.055, %for.body4 ] %flag.0.lcssa.ph = phi i8 [ %spec.select, %if.end ], [ %flag.056, %for.body4 ] %8 = and i8 %flag.0.lcssa.ph, 1 %9 = icmp eq i8 %8, 0 br i1 %cmp353, label %for.body17.lr.ph, label %for.end25 for.body17.lr.ph: ; preds = %for.end14 %10 = load i32, ptr %k, align 4, !tbaa !5 %11 = zext i32 %5 to i64 br label %for.body17 for.body17: ; preds = %for.body17.lr.ph, %if.end22 %indvars.iv71 = phi i64 [ %11, %for.body17.lr.ph ], [ %indvars.iv.next72, %if.end22 ] %b.063 = phi i32 [ 0, %for.body17.lr.ph ], [ %inc23, %if.end22 ] %indvars.iv.next72 = add nsw i64 %indvars.iv71, -1 %idxprom18 = and i64 %indvars.iv.next72, 4294967295 %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %idxprom18 %12 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %12, %10 br i1 %cmp20, label %for.end25, label %if.end22 if.end22: ; preds = %for.body17 %inc23 = add nuw nsw i32 %b.063, 1 %exitcond74.not = icmp eq i32 %inc23, %5 br i1 %exitcond74.not, label %for.end25, label %for.body17, !llvm.loop !12 for.end25: ; preds = %if.end22, %for.body17, %for.end14 %b.0.lcssa = phi i32 [ 0, %for.end14 ], [ %b.063, %for.body17 ], [ %5, %if.end22 ] br i1 %9, label %if.then34, label %if.end37 if.then34: ; preds = %for.cond2.preheader, %entry, %for.end25 %b.0.lcssa89 = phi i32 [ %b.0.lcssa, %for.end25 ], [ 0, %entry ], [ 0, %for.cond2.preheader ] %f.0.lcssa8388 = phi i32 [ %f.0.lcssa.ph, %for.end25 ], [ 0, %entry ], [ 0, %for.cond2.preheader ] %add = add nuw nsw i32 %b.0.lcssa89, %f.0.lcssa8388 br label %if.end37 if.end37: ; preds = %for.end25, %if.then34 %add.sink = phi i32 [ %add, %if.then34 ], [ %f.0.lcssa.ph, %for.end25 ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add.sink) call void @llvm.stackrestore.p0(ptr %2) 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 i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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} !12 = distinct !{!12, !10}
#include<stdio.h> int main(){ long long int N,A,B; scanf("%lld %lld %lld",&N,&A,&B); long long int C=N%(A+B); if(C<=A){ printf("%lld",N/(A+B)*A+C); }else{ printf("%lld",N/(A+B)*A+A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145573/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145573/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i64, align 8 %A = alloca i64, align 8 %B = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i64, ptr %N, align 8, !tbaa !5 %1 = load i64, ptr %A, align 8, !tbaa !5 %2 = load i64, ptr %B, align 8, !tbaa !5 %add = add nsw i64 %2, %1 %rem = srem i64 %0, %add %cmp.not = icmp sgt i64 %rem, %1 %div5 = sdiv i64 %0, %add br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %entry %mul = mul nsw i64 %div5, %1 %add2 = add nsw i64 %mul, %rem br label %if.end if.else: ; preds = %entry %mul610 = add i64 %div5, 1 %add7 = mul i64 %mul610, %1 br label %if.end if.end: ; preds = %if.else, %if.then %add7.sink = phi i64 [ %add7, %if.else ], [ %add2, %if.then ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add7.sink) 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 8, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { long n, a, b, divid, remain, ans; // 標準入力からの値取得 scanf("%ld %ld %ld", &n, &a, &b); // 計算 divid = n / (a + b); remain = n % (a + b); ans = a * divid + ((remain < a) ? remain : a); // 出力 printf("%ld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145616/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145616/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8 %2 = load i64, ptr %b, align 8, !tbaa !5 %add = add nsw i64 %2, %1 %div = sdiv i64 %0, %add %rem = srem i64 %0, %add %mul = mul nsw i64 %div, %1 %cond = call i64 @llvm.smin.i64(i64 %rem, i64 %1) %add2 = add nsw i64 %cond, %mul %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.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"}
#include <stdio.h> int main() { int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); for (int i = 0; i < n; i ++) printf("1 "); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14566/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14566/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"1 \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec7 = add nsw i32 %0, -1 store i32 %dec7, ptr %t, align 4, !tbaa !5 %tobool.not8 = icmp eq i32 %0, 0 br i1 %tobool.not8, label %while.end, label %while.body while.body: ; preds = %entry, %for.cond.cleanup call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %1, 0 br i1 %cmp5, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %while.body %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 for.body: ; preds = %while.body, %for.body %i.06 = phi i32 [ %inc, %for.body ], [ 0, %while.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %inc = add nuw nsw i32 %i.06, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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(){ long long N,A,B,num; scanf("%lld %lld %lld",&N,&A,&B); num=N%(A+B); if(num<A){ printf("%lld\n",(N/(A+B))*A+num); }else{ printf("%lld\n",(N/(A+B))*A+A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145702/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145702/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%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: %N = alloca i64, align 8 %A = alloca i64, align 8 %B = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i64, ptr %N, align 8, !tbaa !5 %1 = load i64, ptr %A, align 8, !tbaa !5 %2 = load i64, ptr %B, align 8, !tbaa !5 %add = add nsw i64 %2, %1 %rem = srem i64 %0, %add %cmp = icmp slt i64 %rem, %1 %div = sdiv i64 %0, %add br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %mul = mul nsw i64 %div, %1 %add2 = add nsw i64 %mul, %rem br label %if.end if.else: ; preds = %entry %mul610 = add i64 %div, 1 %add7 = mul i64 %mul610, %1 br label %if.end if.end: ; preds = %if.else, %if.then %add7.sink = phi i64 [ %add7, %if.else ], [ %add2, %if.then ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add7.sink) 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 8, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { long long int i,N,A,B,sum=0,t; scanf("%lld %lld %lld",&N,&A,&B); sum = N/(A+B)*A; t = N%(A+B); if(t != 0) { if(t > A) { sum = sum+A; } else { sum = sum + t; } } printf("%lld",sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145746/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145746/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i64, align 8 %A = alloca i64, align 8 %B = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i64, ptr %N, align 8, !tbaa !5 %1 = load i64, ptr %A, align 8, !tbaa !5 %2 = load i64, ptr %B, align 8, !tbaa !5 %add = add nsw i64 %2, %1 %div = sdiv i64 %0, %add %mul = mul nsw i64 %div, %1 %rem = srem i64 %0, %add %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %if.end6, label %if.then if.then: ; preds = %entry %cmp2 = icmp sgt i64 %rem, %1 br i1 %cmp2, label %if.then3, label %if.else if.then3: ; preds = %if.then %add4 = add nsw i64 %mul, %1 br label %if.end6 if.else: ; preds = %if.then %add5 = add nsw i64 %mul, %rem br label %if.end6 if.end6: ; preds = %if.then3, %if.else, %entry %sum.0 = phi i64 [ %add4, %if.then3 ], [ %add5, %if.else ], [ %mul, %entry ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0) 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 8, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> typedef long long int ll; int main() { int n,t; scanf("%d",&t); while(t--){ scanf("%d",&n); for(int i=0;i<n;i++)printf("1 "); printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14579/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14579/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"1 \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %t = alloca 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 %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec7 = add nsw i32 %0, -1 store i32 %dec7, ptr %t, align 4, !tbaa !5 %tobool.not8 = icmp eq i32 %0, 0 br i1 %tobool.not8, label %while.end, label %while.body while.body: ; preds = %entry, %for.cond.cleanup %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %1, 0 br i1 %cmp5, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %while.body %putchar = call i32 @putchar(i32 10) %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 for.body: ; preds = %while.body, %for.body %i.06 = phi i32 [ %inc, %for.body ], [ 0, %while.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %inc = add nuw nsw i32 %i.06, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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}
//set many funcs template //Ver.20190820 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #include<assert.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int nHr(int a,int b){return nCr(a+b-1,b);} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;} int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;} int sankaku(int x){return ((1+x)*x)/2;} void swap(int *a,int *b){int c;c=(*a);(*a)=(*b);(*b)=c;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;} long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;} long long llsankaku(long long x){return ((1+x)*x)/2;} void llswap(long long *a,long long *b){long long c;c=(*a);(*a)=(*b);(*b)=c;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} void dbswap(double *a,double *b){double c;c=(*a);(*a)=(*b);(*b)=c;} void chswap(char *a,char *b){char c;c=(*a);(*a)=(*b);(*b)=c;} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);} int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);} int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;} int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;} void shuffledget(int x[],int n){ int i,b[524288],p,c; for(i=0;i<n;i++){ b[i]=i; } for(i=n;i>=1;i--){ p=rand()%i; c=b[i-1];b[i-1]=b[p];b[p]=c; } for(i=0;i<n;i++){ scanf("%d",&x[b[i]]); } } int dx4[4]={1,-1,0,0}; int dy4[4]={0,0,1,-1}; int dx8[8]={-1,-1,-1,0,0,1,1,1}; int dy8[8]={-1,0,1,-1,1,-1,0,1}; int search(int x,int a[],int n){ int st=0,fi=n-1,te; while(st<=fi){ te=(st+fi)/2; if(a[te]<x){st=te+1;}else{fi=te-1;} } return st; } void prarr(int arr[],int n){ int i; for(i=0;i<n;i++){ if(i){printf(" ");} printf("%d",arr[i]); } printf("\n"); return; } void getperm(int a[],int n){ int i,p; for(i=0;i<n;i++){ a[i]=i; } for(i=n-1;i>=1;i--){ p=rand()%(i+1); swap(&a[p],&a[i]); } } typedef struct{ long long val; long long node; }sd; int sdsortfnc(const void *a,const void *b){ if(((sd*)a)->val < ((sd*)b)->val){return -1;} if(((sd*)a)->val > ((sd*)b)->val){return 1;} return 0; } int main(void){ long long i,j,n,m,k,a,b,c,h,w,r=0,l,t; long long dp[524288]={0}; sd dat[524288]; scanf("%lld",&n); for(i=1;i<=n;i++){ scanf("%lld%lld",&a,&l); dat[(i-1)].val=10*(a-l)+1; dat[(i-1)].node=-i; dat[n+(i-1)].val=10*(a+l)-1; dat[n+(i-1)].node=i; } qsort(dat,2*n,sizeof(dat[0]),sdsortfnc); for(i=0;i<2*n;i++){ //printf("%lld %lld\n",dat[i].node,dat[i].val); if(dat[i].node<0){ dp[-dat[i].node]=r+1; } else{ r=llmax(r,dp[dat[i].node]); } } printf("%lld\n",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145832/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145832/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.sd = type { i64, i64 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16 @dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16 @dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16 @dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16 @.str.3 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.4 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i32 %b, %a %cmp.not6.i = icmp slt i32 %b, 1 br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i32 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i32 %add, %i.07.i %mul.i = mul nsw i32 %sub.i, %r.08.i %div.i = sdiv i32 %mul.i, %i.07.i %inc.i = add nuw i32 %i.07.i, 1 %sub.i.1 = sub i32 %add, %inc.i %mul.i.1 = mul nsw i32 %sub.i.1, %div.i %div.i.1 = sdiv i32 %mul.i.1, %inc.i %inc.i.1 = add nuw i32 %i.07.i, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i32 %add, %i.07.i.unr %mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i32 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i32 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.05, 10 %add = add nsw i32 %r.06, %rem %div = sdiv i32 %x.addr.05, 10 %x.addr.05.off = add i32 %x.addr.05, 9 %tobool.not = icmp ult i32 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i32 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ] %rem = srem i32 %x.addr.06, %b %add = add nsw i32 %rem, %r.07 %div = sdiv i32 %x.addr.06, %b %tobool.not = icmp eq i32 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i32 %x, 1 %mul = mul nsw i32 %add, %x %div = sdiv i32 %mul, 2 ret i32 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !16 %1 = load i32, ptr %b, align 4, !tbaa !16 store i32 %1, ptr %a, align 4, !tbaa !16 store i32 %0, ptr %b, align 4, !tbaa !16 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !20 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !20 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i64 %b, %a %cmp.not6.i = icmp slt i64 %b, 1 br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i64 %add, %i.07.i %mul.i = mul nsw i64 %sub.i, %r.08.i %div.i = sdiv i64 %mul.i, %i.07.i %inc.i = add nuw i64 %i.07.i, 1 %sub.i.1 = sub i64 %add, %inc.i %mul.i.1 = mul nsw i64 %sub.i.1, %div.i %div.i.1 = sdiv i64 %mul.i.1, %inc.i %inc.i.1 = add nuw i64 %i.07.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !21 llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i64 %add, %i.07.i.unr %mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr br label %llnCr.exit llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i64 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !22 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !23 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.05, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !25 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !26 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i64 %x, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.05, 10 %add = add nsw i64 %r.06, %rem %div = sdiv i64 %x.addr.05, 10 %x.addr.05.off = add i64 %x.addr.05, 9 %tobool.not = icmp ult i64 %x.addr.05.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !27 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i64 %x, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ] %x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ] %rem = srem i64 %x.addr.06, %b %add = add nsw i64 %rem, %r.07 %div = sdiv i64 %x.addr.06, %b %tobool.not = icmp eq i64 %div, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !28 while.end: ; preds = %while.body, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 { entry: %add = add nsw i64 %x, 1 %mul = mul nsw i64 %add, %x %div = sdiv i64 %mul, 2 ret i64 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @llswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 store i64 %1, ptr %a, align 8, !tbaa !29 store i64 %0, ptr %b, align 8, !tbaa !29 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @dbswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 store double %1, ptr %a, align 8, !tbaa !31 store double %0, ptr %b, align 8, !tbaa !31 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @chswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 store i8 %1, ptr %a, align 1, !tbaa !33 store i8 %0, ptr %b, align 1, !tbaa !33 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !16 %1 = load i32, ptr %b, align 4, !tbaa !16 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i32, ptr %a, align 4, !tbaa !16 %1 = load i32, ptr %b, align 4, !tbaa !16 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i64, ptr %a, align 8, !tbaa !29 %1 = load i64, ptr %b, align 8, !tbaa !29 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load double, ptr %a, align 8, !tbaa !31 %1 = load double, ptr %b, align 8, !tbaa !31 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #17 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #17 ret i32 %call } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 %cmp = icmp sgt i8 %0, %1 %cmp5 = icmp ne i8 %0, %1 %. = sext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i8, ptr %a, align 1, !tbaa !33 %1 = load i8, ptr %b, align 1, !tbaa !33 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp ne i8 %0, %1 %. = sext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #8 { entry: %b = alloca [524288 x i32], align 16 call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #18 %cmp40 = icmp sgt i32 %n, 0 br i1 %cmp40, label %for.body.preheader, label %for.end25 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader57, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !16 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !16 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader57 for.body.preheader57: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block br i1 %cmp40, label %for.body3.preheader, label %for.end25 for.body3.preheader: ; preds = %for.cond1.preheader %3 = zext i32 %n to i64 br label %for.body3 for.body: ; preds = %for.body.preheader57, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader57 ] %arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !16 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !35 for.cond15.preheader: ; preds = %for.body3 br i1 %cmp40, label %for.body17.preheader, label %for.end25 for.body17.preheader: ; preds = %for.cond15.preheader %wide.trip.count54 = zext i32 %n to i64 br label %for.body17 for.body3: ; preds = %for.body3.preheader, %for.body3 %indvars.iv47 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next48, %for.body3 ] %call = tail call i32 @rand() #18 %5 = trunc i64 %indvars.iv47 to i32 %rem = srem i32 %call, %5 %indvars.iv.next48 = add nsw i64 %indvars.iv47, -1 %idxprom4 = and i64 %indvars.iv.next48, 4294967295 %arrayidx5 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom4 %6 = load i32, ptr %arrayidx5, align 4, !tbaa !16 %idxprom6 = sext i32 %rem to i64 %arrayidx7 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom6 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !16 store i32 %7, ptr %arrayidx5, align 4, !tbaa !16 store i32 %6, ptr %arrayidx7, align 4, !tbaa !16 %cmp2 = icmp ugt i64 %indvars.iv47, 1 br i1 %cmp2, label %for.body3, label %for.cond15.preheader, !llvm.loop !36 for.body17: ; preds = %for.body17.preheader, %for.body17 %indvars.iv50 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next51, %for.body17 ] %arrayidx19 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv50 %8 = load i32, ptr %arrayidx19, align 4, !tbaa !16 %idxprom20 = sext i32 %8 to i64 %arrayidx21 = getelementptr inbounds i32, ptr %x, i64 %idxprom20 %call22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx21) %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54 br i1 %exitcond55.not, label %for.end25, label %for.body17, !llvm.loop !37 for.end25: ; preds = %for.body17, %entry, %for.cond1.preheader, %for.cond15.preheader call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #18 ret void } ; Function Attrs: nounwind declare i32 @rand() local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #11 { entry: %cmp.not9 = icmp slt i32 %n, 1 br i1 %cmp.not9, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 br label %while.body while.body: ; preds = %while.body.preheader, %while.body %st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ] %fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ] %add = add nsw i32 %st.011, %fi.010 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !16 %cmp1 = icmp slt i32 %0, %x %add2 = add nsw i32 %div, 1 %sub3 = add nsw i32 %div, -1 %fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3 %st.1 = select i1 %cmp1, i32 %add2, i32 %st.011 %cmp.not = icmp sgt i32 %st.1, %fi.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38 while.end: ; preds = %while.body, %entry %st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ] ret i32 %st.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #12 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %if.end.peel, label %for.end if.end.peel: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %.pre = load i32, ptr %arr, align 4, !tbaa !16 %call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre) %exitcond.peel.not = icmp eq i32 %n, 1 br i1 %exitcond.peel.not, label %for.end, label %if.end if.end: ; preds = %if.end.peel, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ] %putchar6 = tail call i32 @putchar(i32 32) %arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !16 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39 for.end: ; preds = %if.end, %if.end.peel, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10 ; Function Attrs: nounwind uwtable define dso_local void @getperm(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #8 { entry: %cmp20 = icmp sgt i32 %n, 0 br i1 %cmp20, label %for.body.preheader, label %for.end9 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader30, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds i32, ptr %a, i64 %index store <4 x i32> %vec.ind, ptr %0, align 4, !tbaa !16 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 4, !tbaa !16 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i64 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !41 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader30 for.body.preheader30: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block %cmp222 = icmp sgt i32 %n, 1 br i1 %cmp222, label %for.body3.preheader, label %for.end9 for.body3.preheader: ; preds = %for.cond1.preheader %3 = zext i32 %n to i64 br label %for.body3 for.body: ; preds = %for.body.preheader30, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader30 ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !16 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !42 for.body3: ; preds = %for.body3.preheader, %for.body3 %indvars.iv25 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next26, %for.body3 ] %indvars.iv.next26 = add nsw i64 %indvars.iv25, -1 %call = tail call i32 @rand() #18 %5 = trunc i64 %indvars.iv25 to i32 %rem = srem i32 %call, %5 %idxprom4 = sext i32 %rem to i64 %arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %idxprom4 %idxprom6 = and i64 %indvars.iv.next26, 4294967295 %arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %idxprom6 %6 = load i32, ptr %arrayidx5, align 4, !tbaa !16 %7 = load i32, ptr %arrayidx7, align 4, !tbaa !16 store i32 %7, ptr %arrayidx5, align 4, !tbaa !16 store i32 %6, ptr %arrayidx7, align 4, !tbaa !16 %cmp2 = icmp ugt i64 %indvars.iv25, 2 br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !43 for.end9: ; preds = %for.body3, %entry, %for.cond1.preheader ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 { entry: %0 = load i64, ptr %a, align 8, !tbaa !44 %1 = load i64, ptr %b, align 8, !tbaa !44 %cmp = icmp slt i64 %0, %1 %cmp4 = icmp sgt i64 %0, %1 %. = zext i1 %cmp4 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #12 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %l = alloca i64, align 8 %dp = alloca [524288 x i64], align 16 %dat = alloca [524288 x %struct.sd], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #18 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #18 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #18 call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %dp) #18 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4194304) %dp, i8 0, i64 4194304, i1 false) call void @llvm.lifetime.start.p0(i64 8388608, ptr nonnull %dat) #18 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !29 %cmp.not53 = icmp slt i64 %0, 1 br i1 %cmp.not53, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %i.054 = phi i64 [ %inc, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %a, ptr noundef nonnull %l) %1 = load i64, ptr %a, align 8, !tbaa !29 %2 = load i64, ptr %l, align 8, !tbaa !29 %sub = sub nsw i64 %1, %2 %mul = mul nsw i64 %sub, 10 %add = or i64 %mul, 1 %sub2 = add nsw i64 %i.054, -1 %arrayidx = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %sub2 store i64 %add, ptr %arrayidx, align 16, !tbaa !44 %sub3 = sub nsw i64 0, %i.054 %node = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %sub2, i32 1 store i64 %sub3, ptr %node, align 8, !tbaa !46 %add6 = add nsw i64 %2, %1 %mul7 = mul nsw i64 %add6, 10 %sub8 = add nsw i64 %mul7, -1 %3 = load i64, ptr %n, align 8, !tbaa !29 %add10 = add nsw i64 %3, %sub2 %arrayidx11 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %add10 store i64 %sub8, ptr %arrayidx11, align 16, !tbaa !44 %node16 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %add10, i32 1 store i64 %i.054, ptr %node16, align 8, !tbaa !46 %inc = add nuw nsw i64 %i.054, 1 %cmp.not.not = icmp slt i64 %i.054, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !47 for.end: ; preds = %for.body, %entry %.lcssa = phi i64 [ %0, %entry ], [ %3, %for.body ] %mul17 = shl nsw i64 %.lcssa, 1 call void @qsort(ptr noundef nonnull %dat, i64 noundef %mul17, i64 noundef 16, ptr noundef nonnull @sdsortfnc) #18 %4 = load i64, ptr %n, align 8, !tbaa !29 %cmp2055 = icmp sgt i64 %4, 0 br i1 %cmp2055, label %for.body21.preheader, label %for.end36 for.body21.preheader: ; preds = %for.end %mul19 = shl nuw i64 %4, 1 %smax = call i64 @llvm.smax.i64(i64 %mul19, i64 1) br label %for.body21 for.body21: ; preds = %for.body21.preheader, %for.inc34 %i.157 = phi i64 [ %inc35, %for.inc34 ], [ 0, %for.body21.preheader ] %r.056 = phi i64 [ %r.1, %for.inc34 ], [ 0, %for.body21.preheader ] %node23 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %i.157, i32 1 %5 = load i64, ptr %node23, align 8, !tbaa !46 %cmp24 = icmp slt i64 %5, 0 br i1 %cmp24, label %if.then, label %if.else if.then: ; preds = %for.body21 %add25 = add nuw nsw i64 %r.056, 1 %sub28 = sub nsw i64 0, %5 %arrayidx29 = getelementptr inbounds [524288 x i64], ptr %dp, i64 0, i64 %sub28 store i64 %add25, ptr %arrayidx29, align 8, !tbaa !29 br label %for.inc34 if.else: ; preds = %for.body21 %arrayidx32 = getelementptr inbounds [524288 x i64], ptr %dp, i64 0, i64 %5 %6 = load i64, ptr %arrayidx32, align 8, !tbaa !29 %a.b.i = call i64 @llvm.smax.i64(i64 %r.056, i64 %6) br label %for.inc34 for.inc34: ; preds = %if.then, %if.else %r.1 = phi i64 [ %r.056, %if.then ], [ %a.b.i, %if.else ] %inc35 = add nuw nsw i64 %i.157, 1 %exitcond.not = icmp eq i64 %inc35, %smax br i1 %exitcond.not, label %for.end36, label %for.body21, !llvm.loop !48 for.end36: ; preds = %for.inc34, %for.end %r.0.lcssa = phi i64 [ 0, %for.end ], [ %r.1, %for.inc34 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %r.0.lcssa) call void @llvm.lifetime.end.p0(i64 8388608, ptr nonnull %dat) #18 call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %dp) #18 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #18 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #18 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #18 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #13 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #14 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #16 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #14 = { 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 #15 = { nofree nounwind } attributes #16 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #17 = { nounwind willreturn memory(read) } attributes #18 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = !{!17, !17, i64 0} !17 = !{!"int", !18, i64 0} !18 = !{!"omnipotent char", !19, i64 0} !19 = !{!"Simple C/C++ TBAA"} !20 = distinct !{!20, !6} !21 = distinct !{!21, !6} !22 = distinct !{!22, !6} !23 = distinct !{!23, !24} !24 = !{!"llvm.loop.unroll.disable"} !25 = distinct !{!25, !6} !26 = distinct !{!26, !24} !27 = distinct !{!27, !6} !28 = distinct !{!28, !6} !29 = !{!30, !30, i64 0} !30 = !{!"long long", !18, i64 0} !31 = !{!32, !32, i64 0} !32 = !{!"double", !18, i64 0} !33 = !{!18, !18, i64 0} !34 = distinct !{!34, !6, !9, !10} !35 = distinct !{!35, !6, !10, !9} !36 = distinct !{!36, !6} !37 = distinct !{!37, !6} !38 = distinct !{!38, !6} !39 = distinct !{!39, !6, !40} !40 = !{!"llvm.loop.peeled.count", i32 1} !41 = distinct !{!41, !6, !9, !10} !42 = distinct !{!42, !6, !10, !9} !43 = distinct !{!43, !6} !44 = !{!45, !30, i64 0} !45 = !{!"", !30, i64 0, !30, i64 8} !46 = !{!45, !30, i64 8} !47 = distinct !{!47, !6} !48 = distinct !{!48, !6}
#include <stdio.h> #include <stdlib.h> int main() { int x,i; char qwe[10]; while(~scanf("%s",qwe)) { x=0; for(i=0;i<4;i++) { if(qwe[i]=='+') { x=x+1; } if(qwe[i]=='-') { x=x-1; } }printf("%d\n",x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145890/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145890/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %qwe = alloca [10 x i8], align 4 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %qwe) #4 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %qwe) %tobool.not19 = icmp eq i32 %call18, -1 br i1 %tobool.not19, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.preheader %0 = load <4 x i8>, ptr %qwe, align 4, !tbaa !5 %1 = icmp eq <4 x i8> %0, <i8 45, i8 45, i8 45, i8 45> %2 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43> %3 = bitcast <4 x i1> %1 to i4 %4 = call i4 @llvm.ctpop.i4(i4 %3), !range !8 %5 = zext i4 %4 to i32 %6 = bitcast <4 x i1> %2 to i4 %7 = call i4 @llvm.ctpop.i4(i4 %6), !range !8 %8 = zext i4 %7 to i32 %op.rdx = sub nsw i32 %8, %5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %op.rdx) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %qwe) %tobool.not = icmp eq i32 %call, -1 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 while.end: ; preds = %for.cond.preheader, %entry call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %qwe) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i4 @llvm.ctpop.i4(i4) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{i4 0, i4 5} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int i,count=0; char s[5]; scanf("%s",s); for(i=0;s[i]!='\0';i++){ if(s[i]=='+') count=count+1; else if(s[i]=='-') count=count-1; } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145933/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145933/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) br label %for.cond for.cond: ; preds = %for.inc, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %count.0 = phi i32 [ %count.1, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %0, label %for.inc [ i8 0, label %for.end i8 43, label %if.then i8 45, label %if.then12 ] if.then: ; preds = %for.cond %add = add nsw i32 %count.0, 1 br label %for.inc if.then12: ; preds = %for.cond %sub = add nsw i32 %count.0, -1 br label %for.inc for.inc: ; preds = %for.cond, %if.then, %if.then12 %count.1 = phi i32 [ %add, %if.then ], [ %sub, %if.then12 ], [ %count.0, %for.cond ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %for.cond, !llvm.loop !8 for.end: ; preds = %for.cond %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int i,t=0; char S[4]; scanf("%s",S); for(i=0;i<4;i++){ if(S[i]=='+'){ t++; }else{ t--; } } printf("%d\n",t); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145977/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145977/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [4 x i8], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load <4 x i8>, ptr %S, align 4, !tbaa !5 %1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43> %2 = select <4 x i1> %1, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> %3 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2) %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { // your code goes here char s[5],i,a=0; scanf("%s",s); for(i=0;i<4;i++){ if(s[i]=='+') a++; else a--; } printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146019/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [5 x i8], align 4 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load <4 x i8>, ptr %s, align 4, !tbaa !5 %1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43> %2 = select <4 x i1> %1, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> %3 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2) %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include<string.h> int takahashi = 0; char s1 = '+'; void main (){ char str1[256]; scanf("%s", str1); for(int i = 0; i < 4; i++){ if(str1[i] == s1){ takahashi = takahashi + 1; }else { takahashi = takahashi - 1; } } printf("%d", takahashi); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146062/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146062/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @takahashi = dso_local local_unnamed_addr global i32 0, align 4 @s1 = dso_local local_unnamed_addr global i8 43, 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"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @main() local_unnamed_addr #0 { entry: %str1 = alloca [256 x i8], align 16 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %str1) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1) %0 = load i8, ptr @s1, align 1, !tbaa !5 %takahashi.promoted = load i32, ptr @takahashi, align 4 %1 = load <4 x i8>, ptr %str1, align 16, !tbaa !5 %2 = insertelement <4 x i8> poison, i8 %0, i64 0 %3 = shufflevector <4 x i8> %2, <4 x i8> poison, <4 x i32> zeroinitializer %4 = icmp eq <4 x i8> %1, %3 %5 = select <4 x i1> %4, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> %6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5) %op.rdx = add i32 %6, %takahashi.promoted store i32 %op.rdx, ptr @takahashi, align 4 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %op.rdx) call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %str1) #4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { char name[5]; int i=0; scanf("%s",name); if(name[0]=='+'){ i++; }else{ i--; } if(name[1]=='+'){ i++; }else{ i--; } if(name[2]=='+'){ i++; }else{ i--; } if(name[3]=='+'){ i++; }else{ i--; } printf("%d",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146149/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146149/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %name = alloca [5 x i8], align 4 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %name) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %name) %0 = load <4 x i8>, ptr %name, align 4, !tbaa !5 %1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43> %2 = extractelement <4 x i1> %1, i64 0 %. = select i1 %2, i32 1, i32 -1 %3 = extractelement <4 x i1> %1, i64 1 %i.1.v = select i1 %3, i32 1, i32 -1 %i.1 = add nsw i32 %i.1.v, %. %inc16 = or i32 %i.1, 1 %dec18 = add nsw i32 %i.1, -1 %4 = extractelement <4 x i1> %1, i64 2 %i.2 = select i1 %4, i32 %inc16, i32 %dec18 %5 = extractelement <4 x i1> %1, i64 3 %i.3.v = select i1 %5, i32 1, i32 -1 %i.3 = add nsw i32 %i.2, %i.3.v %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.3) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %name) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> char bus[1001][6]; int main() { unsigned n, res = 0; scanf("%u", &n); for (unsigned i = 0; i < n; i++) scanf("%s", (char*) (bus + i)); for (unsigned i = 0; i < n; i++) { if (!res && bus[i][0] == 'O' && bus[i][1] == 'O') { res = 1; bus[i][0] = '+', bus[i][1] = '+'; } if (!res && bus[i][3] == 'O' && bus[i][4] == 'O') { res = 1; bus[i][3] = '+', bus[i][4] = '+'; } } if (res) { printf("YES\n"); for (unsigned i = 0; i < n; i++) printf("%s\n", (char*) (bus + i)); } else { printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1462/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1462/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%u\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @bus = dso_local global [1001 x [6 x i8]] zeroinitializer, align 16 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.5 = 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) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp83.not = icmp eq i32 %0, 0 br i1 %cmp83.not, label %if.else, label %for.body for.cond3.preheader: ; preds = %for.body %cmp485.not = icmp eq i32 %1, 0 br i1 %cmp485.not, label %if.else, label %for.body6.preheader for.body6.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds [6 x i8], ptr @bus, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = zext i32 %1 to i64 %cmp = icmp ult i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.inc46 br i1 %7, label %if.else, label %if.then50 for.body6: ; preds = %for.body6.preheader, %for.inc46 %indvars.iv93 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next94, %for.inc46 ] %res.086 = phi i32 [ 0, %for.body6.preheader ], [ %res.2, %for.inc46 ] %tobool.not = icmp eq i32 %res.086, 0 br i1 %tobool.not, label %land.lhs.true, label %for.inc46 land.lhs.true: ; preds = %for.body6 %arrayidx = getelementptr inbounds [1001 x [6 x i8]], ptr @bus, i64 0, i64 %indvars.iv93 %3 = load i8, ptr %arrayidx, align 2, !tbaa !11 %cmp8 = icmp eq i8 %3, 79 br i1 %cmp8, label %land.lhs.true10, label %land.lhs.true24 land.lhs.true10: ; preds = %land.lhs.true %arrayidx13 = getelementptr inbounds [1001 x [6 x i8]], ptr @bus, i64 0, i64 %indvars.iv93, i64 1 %4 = load i8, ptr %arrayidx13, align 1, !tbaa !11 %cmp15 = icmp eq i8 %4, 79 br i1 %cmp15, label %if.then, label %land.lhs.true24 if.then: ; preds = %land.lhs.true10 store i8 43, ptr %arrayidx, align 2, !tbaa !11 store i8 43, ptr %arrayidx13, align 1, !tbaa !11 br label %for.inc46 land.lhs.true24: ; preds = %land.lhs.true, %land.lhs.true10 %arrayidx27 = getelementptr inbounds [1001 x [6 x i8]], ptr @bus, i64 0, i64 %indvars.iv93, i64 3 %5 = load i8, ptr %arrayidx27, align 1, !tbaa !11 %cmp29 = icmp eq i8 %5, 79 br i1 %cmp29, label %land.lhs.true31, label %for.inc46 land.lhs.true31: ; preds = %land.lhs.true24 %arrayidx34 = getelementptr inbounds [1001 x [6 x i8]], ptr @bus, i64 0, i64 %indvars.iv93, i64 4 %6 = load i8, ptr %arrayidx34, align 2, !tbaa !11 %cmp36 = icmp eq i8 %6, 79 br i1 %cmp36, label %if.then38, label %for.inc46 if.then38: ; preds = %land.lhs.true31 store i8 43, ptr %arrayidx27, align 1, !tbaa !11 store i8 43, ptr %arrayidx34, align 2, !tbaa !11 br label %for.inc46 for.inc46: ; preds = %for.body6, %if.then, %land.lhs.true24, %land.lhs.true31, %if.then38 %7 = phi i1 [ false, %if.then38 ], [ true, %land.lhs.true31 ], [ true, %land.lhs.true24 ], [ false, %if.then ], [ false, %for.body6 ] %res.2 = phi i32 [ 1, %if.then38 ], [ 0, %land.lhs.true31 ], [ 0, %land.lhs.true24 ], [ 1, %if.then ], [ 1, %for.body6 ] %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %exitcond.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !12 if.then50: ; preds = %for.cond.cleanup5 %puts81 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp5489.not = icmp eq i32 %8, 0 br i1 %cmp5489.not, label %if.end65, label %for.body57 for.body57: ; preds = %if.then50, %for.body57 %indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body57 ], [ 0, %if.then50 ] %add.ptr59 = getelementptr inbounds [6 x i8], ptr @bus, i64 %indvars.iv96 %puts82 = call i32 @puts(ptr nonnull dereferenceable(1) %add.ptr59) %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = zext i32 %9 to i64 %cmp54 = icmp ult i64 %indvars.iv.next97, %10 br i1 %cmp54, label %for.body57, label %if.end65, !llvm.loop !13 if.else: ; preds = %entry, %for.cond3.preheader, %for.cond.cleanup5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end65 if.end65: ; preds = %for.body57, %if.then50, %if.else 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 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> #include<math.h> int main() { int t; scanf("%d",&t); int n[t]; for(int i=0;i<t;i++) { scanf("%d",&n[i]); } for(int i=0;i<t;i++) { for(int j=0;j<n[i];j++) { printf("%d ",1); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14625/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14625/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, 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 %t, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %3, 0 br i1 %cmp26, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %4 = icmp sgt i32 %5, 0 br i1 %4, label %for.cond7.preheader, label %for.cond.cleanup5 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 %5 = load i32, ptr %t, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond7.preheader: ; preds = %for.cond3.preheader, %for.cond.cleanup11 %indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.cond.cleanup11 ], [ 0, %for.cond3.preheader ] %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv33 %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp1028 = icmp sgt i32 %7, 0 br i1 %cmp1028, label %for.body12, label %for.cond.cleanup11 for.cond.cleanup5: ; preds = %for.cond.cleanup11, %entry, %for.cond3.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 for.cond.cleanup11: ; preds = %for.body12, %for.cond7.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %8 = load i32, ptr %t, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp4 = icmp slt i64 %indvars.iv.next34, %9 br i1 %cmp4, label %for.cond7.preheader, label %for.cond.cleanup5, !llvm.loop !11 for.body12: ; preds = %for.cond7.preheader, %for.body12 %j.029 = phi i32 [ %inc15, %for.body12 ], [ 0, %for.cond7.preheader ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1) %inc15 = add nuw nsw i32 %j.029, 1 %10 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc15, %10 br i1 %cmp10, label %for.body12, label %for.cond.cleanup11, !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: 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(void){ int T,H,S,t,ans1,ans2,ans3; while(1){ scanf("%d %d %d",&T,&H,&S); if(T==-1 && H==-1 && S==-1){ break; } t=7200-(3600*T+60*H+S); ans1=t/3600; ans2=(t%3600)/60; ans3=t%60; printf("%02d:%02d:%02d\n",ans1,ans2,ans3); t=t*3; ans1=t/3600; ans2=(t%3600)/60; ans3=t%60; printf("%02d:%02d:%02d\n",ans1,ans2,ans3); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146321/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146321/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [16 x i8] c"%02d:%02d:%02d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca i32, align 4 %H = alloca i32, align 4 %S = 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 %H) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3 %call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T, ptr noundef nonnull %H, ptr noundef nonnull %S) %0 = load i32, ptr %T, align 4, !tbaa !5 %cmp28 = icmp eq i32 %0, -1 %1 = load i32, ptr %H, align 4 %cmp129 = icmp eq i32 %1, -1 %or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false %2 = load i32, ptr %S, align 4 %cmp331 = icmp eq i32 %2, -1 %or.cond1532 = select i1 %or.cond30, i1 %cmp331, i1 false br i1 %or.cond1532, label %while.end, label %if.end if.end: ; preds = %entry, %if.end %3 = phi i32 [ %8, %if.end ], [ %2, %entry ] %4 = phi i32 [ %7, %if.end ], [ %1, %entry ] %5 = phi i32 [ %6, %if.end ], [ %0, %entry ] %mul.neg = mul i32 %5, -3600 %mul4.neg = mul i32 %4, -60 %add.neg = add i32 %mul.neg, 7200 %add5.neg = add i32 %add.neg, %mul4.neg %sub = sub i32 %add5.neg, %3 %div = sdiv i32 %sub, 3600 %rem = srem i32 %sub, 3600 %div6.lhs.trunc = trunc i32 %rem to i16 %div625 = sdiv i16 %div6.lhs.trunc, 60 %div6.sext = sext i16 %div625 to i32 %rem7 = srem i32 %sub, 60 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div6.sext, i32 noundef %rem7) %mul9 = mul nsw i32 %sub, 3 %div10 = sdiv i32 %sub, 1200 %rem11 = srem i32 %mul9, 3600 %div12.lhs.trunc = trunc i32 %rem11 to i16 %div1226 = sdiv i16 %div12.lhs.trunc, 60 %div12.sext = sext i16 %div1226 to i32 %rem13 = srem i32 %mul9, 60 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div10, i32 noundef %div12.sext, i32 noundef %rem13) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T, ptr noundef nonnull %H, ptr noundef nonnull %S) %6 = load i32, ptr %T, align 4, !tbaa !5 %cmp = icmp eq i32 %6, -1 %7 = load i32, ptr %H, align 4 %cmp1 = icmp eq i32 %7, -1 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %8 = load i32, ptr %S, align 4 %cmp3 = icmp eq i32 %8, -1 %or.cond15 = select i1 %or.cond, i1 %cmp3, i1 false br i1 %or.cond15, label %while.end, label %if.end while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #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> #include <stdlib.h> int main() { int t; int n; int *a; int i; int el = 1; scanf("%d",&t); while(t--) { scanf("%d",&n); a = (int *)malloc(n*sizeof(int)); for(i = 0; i < n; i++) { a[i] = el; } for(i = 0; i < n; i++) printf("%d ",a[i]); printf("\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14638/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec25 = add nsw i32 %0, -1 store i32 %dec25, ptr %t, align 4, !tbaa !5 %tobool.not26 = icmp eq i32 %0, 0 br i1 %tobool.not26, label %while.end, label %while.body while.body: ; preds = %entry, %for.end13 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %1 to i64 %mul = shl nsw i64 %conv, 2 %call2 = call noalias ptr @malloc(i64 noundef %mul) #6 %cmp21 = icmp sgt i32 %1, 0 br i1 %cmp21, label %for.body.preheader, label %for.end13 for.body.preheader: ; preds = %while.body %wide.trip.count = zext i32 %1 to i64 %min.iters.check = icmp ult i32 %1, 8 br i1 %min.iters.check, label %for.body.preheader31, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds i32, ptr %call2, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 4, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader31 for.body.preheader31: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond4.preheader: ; preds = %for.body, %middle.block br i1 %cmp21, label %for.body7, label %for.end13 for.body: ; preds = %for.body.preheader31, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader31 ] %arrayidx = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv store i32 1, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond4.preheader, label %for.body, !llvm.loop !13 for.body7: ; preds = %for.cond4.preheader, %for.body7 %indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body7 ], [ 0, %for.cond4.preheader ] %arrayidx9 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv28 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) %indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp5 = icmp slt i64 %indvars.iv.next29, %7 br i1 %cmp5, label %for.body7, label %for.end13, !llvm.loop !14 for.end13: ; preds = %for.body7, %while.body, %for.cond4.preheader %putchar = call i32 @putchar(i32 10) %8 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %8, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %8, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %for.end13, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> int main() { int n,f[100][10],p[100][11],max=0,i,x[100],j[10],k,y,l; scanf("%d",&n); for (i=0;i<n;i++) { for (k=0;k<10;k++) { scanf("%d",&f[i][k]); } } for (i=0;i<n;i++) { for (k=0;k<=10;k++) { scanf("%d",&p[i][k]); } } for (j[0]=1;j[0]>=0;j[0]--) { for (j[1]=1;j[1]>=0;j[1]--) { for (j[2]=1;j[2]>=0;j[2]--) { for (j[3]=1;j[3]>=0;j[3]--) { for (j[4]=1;j[4]>=0;j[4]--) { for (j[5]=1;j[5]>=0;j[5]--) { for (j[6]=1;j[6]>=0;j[6]--) { for (j[7]=1;j[7]>=0;j[7]--) { for (j[8]=1;j[8]>=0;j[8]--) { for (j[9]=1;j[9]>=0;j[9]--) { for (i=0;i<n;i++) { x[i]=0; } for (i=0;i<n;i++) { for (k=0;k<10;k++) { x[i]+=f[i][k]*j[k]; } } y=0; for (i=0;i<n;i++) { y+=p[i][x[i]]; } k=1; for (i=0;i<10;i++) { k*=j[i]; } l=0; for (i=0;i<n;i++) { if (x[i]==0) { l++; } } if ((y>max&&l!=n)||k==1) { max=y; } }}}}}}}}}} printf("%d\n",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %f = alloca [100 x [10 x i32]], align 16 %p = alloca [100 x [11 x i32]], align 16 %x = 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 4000, ptr nonnull %f) #5 call void @llvm.lifetime.start.p0(i64 4400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %x) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp230 = icmp sgt i32 %0, 0 br i1 %cmp230, label %for.cond1.preheader, label %for.end180 for.cond1.preheader: ; preds = %entry, %for.cond1.preheader %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ] %arrayidx5 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 0 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %arrayidx5.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 1 %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1) %arrayidx5.2 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 2 %call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2) %arrayidx5.3 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 3 %call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3) %arrayidx5.4 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 4 %call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4) %arrayidx5.5 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 5 %call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5) %arrayidx5.6 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 6 %call6.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.6) %arrayidx5.7 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 7 %call6.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.7) %arrayidx5.8 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 8 %call6.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.8) %arrayidx5.9 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 9 %call6.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.9) %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.cond1.preheader, label %for.cond10.preheader, !llvm.loop !9 for.cond10.preheader: ; preds = %for.cond1.preheader %cmp11233 = icmp sgt i32 %1, 0 br i1 %cmp11233, label %for.cond13.preheader, label %for.end180 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.cond13.preheader %indvars.iv284 = phi i64 [ %indvars.iv.next285, %for.cond13.preheader ], [ 0, %for.cond10.preheader ] %arrayidx19 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 0 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19) %arrayidx19.1 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 1 %call20.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.1) %arrayidx19.2 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 2 %call20.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.2) %arrayidx19.3 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 3 %call20.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.3) %arrayidx19.4 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 4 %call20.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.4) %arrayidx19.5 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 5 %call20.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.5) %arrayidx19.6 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 6 %call20.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.6) %arrayidx19.7 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 7 %call20.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.7) %arrayidx19.8 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 8 %call20.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.8) %arrayidx19.9 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 9 %call20.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.9) %arrayidx19.10 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv284, i64 10 %call20.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.10) %indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp11 = icmp slt i64 %indvars.iv.next285, %4 br i1 %cmp11, label %for.cond13.preheader, label %for.cond28.preheader, !llvm.loop !11 for.cond28.preheader: ; preds = %for.cond13.preheader %cmp78235 = icmp sgt i32 %3, 0 br i1 %cmp78235, label %for.body31.us.preheader, label %for.end180 for.body31.us.preheader: ; preds = %for.cond28.preheader %5 = zext i32 %3 to i64 %6 = shl nuw nsw i64 %5, 2 %xtraiter = and i64 %5, 3 %7 = icmp ult i32 %3, 4 %unroll_iter = and i64 %5, 4294967292 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %min.iters.check457 = icmp ult i32 %3, 8 %n.vec460 = and i64 %5, 4294967288 %cmp.n462 = icmp eq i64 %n.vec460, %5 %xtraiter489 = and i64 %5, 3 %8 = icmp ult i32 %3, 4 %unroll_iter493 = and i64 %5, 4294967292 %lcmp.mod491.not = icmp eq i64 %xtraiter489, 0 %min.iters.check = icmp ult i32 %3, 8 %n.vec = and i64 %5, 4294967288 %cmp.n = icmp eq i64 %n.vec, %5 br label %for.body31.us for.body31.us: ; preds = %for.body31.us.preheader, %for.inc177.split.us.us %j.sroa.0.0 = phi i32 [ 1, %for.body31.us.preheader ], [ %dec179.us, %for.inc177.split.us.us ] %max.0275.us = phi i32 [ 0, %for.body31.us.preheader ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc177.split.us.us ] br label %for.body36.us.us for.body36.us.us: ; preds = %for.inc173.split.us.us.us, %for.body31.us %j.sroa.13.0 = phi i32 [ 1, %for.body31.us ], [ %dec175.us.us, %for.inc173.split.us.us.us ] %max.1273.us.us = phi i32 [ %max.0275.us, %for.body31.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc173.split.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.1 = mul nsw i32 %j.sroa.13.0, %j.sroa.0.0 br label %for.body41.us.us.us for.body41.us.us.us: ; preds = %for.inc169.split.us.us.us.us, %for.body36.us.us %j.sroa.25.0 = phi i32 [ 1, %for.body36.us.us ], [ %dec171.us.us.us, %for.inc169.split.us.us.us.us ] %max.2270.us.us.us = phi i32 [ %max.1273.us.us, %for.body36.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc169.split.us.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.2 = mul nsw i32 %j.sroa.25.0, %mul123.us.us.us.us.us.us.us.us.us.us.1 br label %for.body46.us.us.us.us for.body46.us.us.us.us: ; preds = %for.inc165.split.us.us.us.us.us, %for.body41.us.us.us %j.sroa.37.0 = phi i32 [ 1, %for.body41.us.us.us ], [ %dec167.us.us.us.us, %for.inc165.split.us.us.us.us.us ] %max.3268.us.us.us.us = phi i32 [ %max.2270.us.us.us, %for.body41.us.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc165.split.us.us.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.3 = mul nsw i32 %j.sroa.37.0, %mul123.us.us.us.us.us.us.us.us.us.us.2 br label %for.body51.us.us.us.us.us for.body51.us.us.us.us.us: ; preds = %for.inc161.split.us.us.us.us.us.us, %for.body46.us.us.us.us %j.sroa.49.0 = phi i32 [ 1, %for.body46.us.us.us.us ], [ %dec163.us.us.us.us.us, %for.inc161.split.us.us.us.us.us.us ] %max.4265.us.us.us.us.us = phi i32 [ %max.3268.us.us.us.us, %for.body46.us.us.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc161.split.us.us.us.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.4 = mul nsw i32 %j.sroa.49.0, %mul123.us.us.us.us.us.us.us.us.us.us.3 br label %for.body56.us.us.us.us.us.us for.body56.us.us.us.us.us.us: ; preds = %for.inc157.split.us.us.us.us.us.us.us, %for.body51.us.us.us.us.us %j.sroa.61.0 = phi i32 [ 1, %for.body51.us.us.us.us.us ], [ %dec159.us.us.us.us.us.us, %for.inc157.split.us.us.us.us.us.us.us ] %max.5263.us.us.us.us.us.us = phi i32 [ %max.4265.us.us.us.us.us, %for.body51.us.us.us.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc157.split.us.us.us.us.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.5 = mul nsw i32 %j.sroa.61.0, %mul123.us.us.us.us.us.us.us.us.us.us.4 br label %for.body61.us.us.us.us.us.us.us for.body61.us.us.us.us.us.us.us: ; preds = %for.inc153.split.us.us.us.us.us.us.us.us, %for.body56.us.us.us.us.us.us %j.sroa.73.0 = phi i32 [ 1, %for.body56.us.us.us.us.us.us ], [ %dec155.us.us.us.us.us.us.us, %for.inc153.split.us.us.us.us.us.us.us.us ] %max.6260.us.us.us.us.us.us.us = phi i32 [ %max.5263.us.us.us.us.us.us, %for.body56.us.us.us.us.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc153.split.us.us.us.us.us.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.6 = mul nsw i32 %j.sroa.73.0, %mul123.us.us.us.us.us.us.us.us.us.us.5 br label %for.body66.us.us.us.us.us.us.us.us for.body66.us.us.us.us.us.us.us.us: ; preds = %for.inc149.split.us.us.us.us.us.us.us.us.us, %for.body61.us.us.us.us.us.us.us %j.sroa.85.0 = phi i32 [ 1, %for.body61.us.us.us.us.us.us.us ], [ %dec151.us.us.us.us.us.us.us.us, %for.inc149.split.us.us.us.us.us.us.us.us.us ] %max.7258.us.us.us.us.us.us.us.us = phi i32 [ %max.6260.us.us.us.us.us.us.us, %for.body61.us.us.us.us.us.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc149.split.us.us.us.us.us.us.us.us.us ] %mul123.us.us.us.us.us.us.us.us.us.us.7 = mul nsw i32 %j.sroa.85.0, %mul123.us.us.us.us.us.us.us.us.us.us.6 br label %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us for.end136.us.us.us.us.us.us.us.us.us.us: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us, %middle.block455 %spec.select.us.us.us.us.us.us.us.us.us.us.lcssa = phi i32 [ %69, %middle.block455 ], [ %spec.select.us.us.us.us.us.us.us.us.us.us, %for.body129.us.us.us.us.us.us.us.us.us.us ] %cmp137.us.us.us.us.us.us.us.us.us.us = icmp sgt i32 %add114.us.us.us.us.us.us.us.us.us.us.lcssa, %max.8255.us.us.us.us.us.us.us.us.us br i1 %cmp137.us.us.us.us.us.us.us.us.us.us, label %land.lhs.true.us.us.us.us.us.us.us.us.us.us, label %lor.lhs.false.us.us.us.us.us.us.us.us.us.us lor.lhs.false.us.us.us.us.us.us.us.us.us.us: ; preds = %for.end136.us.us.us.us.us.us.us.us.us.us %cmp139.old.us.us.us.us.us.us.us.us.us.us = icmp eq i32 %mul123.us.us.us.us.us.us.us.us.us.us.8, 1 br i1 %cmp139.old.us.us.us.us.us.us.us.us.us.us, label %if.then140.us.us.us.us.us.us.us.us.us.us, label %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us.1 land.lhs.true.us.us.us.us.us.us.us.us.us.us: ; preds = %for.end136.us.us.us.us.us.us.us.us.us.us %cmp138.us.us.us.us.us.us.us.us.us.us = icmp ne i32 %spec.select.us.us.us.us.us.us.us.us.us.us.lcssa, %3 %cmp139.us.us.us.us.us.us.us.us.us.us = icmp eq i32 %mul123.us.us.us.us.us.us.us.us.us.us.8, 1 %or.cond.us.us.us.us.us.us.us.us.us.us = select i1 %cmp138.us.us.us.us.us.us.us.us.us.us, i1 true, i1 %cmp139.us.us.us.us.us.us.us.us.us.us br i1 %or.cond.us.us.us.us.us.us.us.us.us.us, label %if.then140.us.us.us.us.us.us.us.us.us.us, label %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us.1 if.then140.us.us.us.us.us.us.us.us.us.us: ; preds = %land.lhs.true.us.us.us.us.us.us.us.us.us.us, %lor.lhs.false.us.us.us.us.us.us.us.us.us.us br label %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us.1 for.cond85.preheader.us.us.us.us.us.us.us.us.us.us.1: ; preds = %if.then140.us.us.us.us.us.us.us.us.us.us, %land.lhs.true.us.us.us.us.us.us.us.us.us.us, %lor.lhs.false.us.us.us.us.us.us.us.us.us.us %max.10.us.us.us.us.us.us.us.us.us.us = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.lcssa, %if.then140.us.us.us.us.us.us.us.us.us.us ], [ %max.8255.us.us.us.us.us.us.us.us.us, %land.lhs.true.us.us.us.us.us.us.us.us.us.us ], [ %max.8255.us.us.us.us.us.us.us.us.us, %lor.lhs.false.us.us.us.us.us.us.us.us.us.us ] call void @llvm.memset.p0.i64(ptr nonnull align 16 %x, i8 0, i64 %6, i1 false), !tbaa !5 br label %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us.1 for.cond88.preheader.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us.1, %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv356.1 = phi i64 [ 0, %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us.1 ], [ %indvars.iv.next357.1, %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us.1 ] %arrayidx98.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv356.1 %arrayidx98.promoted.us.us.us.us.us.us.us.us.us.us.1 = load i32, ptr %arrayidx98.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %arrayidx94.us.us.us.us.us.us.us.us.us.us.1373 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 0 %9 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.1373, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.1374 = mul nsw i32 %j.sroa.0.0, %9 %add.us.us.us.us.us.us.us.us.us.us.1375 = add nsw i32 %arrayidx98.promoted.us.us.us.us.us.us.us.us.us.us.1, %mul.us.us.us.us.us.us.us.us.us.us.1374 %arrayidx94.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 1 %10 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.1.1 = mul nsw i32 %j.sroa.13.0, %10 %add.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.1375, %mul.us.us.us.us.us.us.us.us.us.us.1.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.2.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 2 %11 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.2.1, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.2.1 = mul nsw i32 %j.sroa.25.0, %11 %add.us.us.us.us.us.us.us.us.us.us.2.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.1.1, %mul.us.us.us.us.us.us.us.us.us.us.2.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.3.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 3 %12 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.3.1, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.3.1 = mul nsw i32 %j.sroa.37.0, %12 %add.us.us.us.us.us.us.us.us.us.us.3.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.2.1, %mul.us.us.us.us.us.us.us.us.us.us.3.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.4.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 4 %13 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.4.1, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.4.1 = mul nsw i32 %j.sroa.49.0, %13 %add.us.us.us.us.us.us.us.us.us.us.4.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.3.1, %mul.us.us.us.us.us.us.us.us.us.us.4.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.5.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 5 %14 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.5.1, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.5.1 = mul nsw i32 %j.sroa.61.0, %14 %add.us.us.us.us.us.us.us.us.us.us.5.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.4.1, %mul.us.us.us.us.us.us.us.us.us.us.5.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.6.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 6 %15 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.6.1, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.6.1 = mul nsw i32 %j.sroa.73.0, %15 %add.us.us.us.us.us.us.us.us.us.us.6.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.5.1, %mul.us.us.us.us.us.us.us.us.us.us.6.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.7.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 7 %16 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.7.1, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.7.1 = mul nsw i32 %j.sroa.85.0, %16 %add.us.us.us.us.us.us.us.us.us.us.7.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.6.1, %mul.us.us.us.us.us.us.us.us.us.us.7.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.8.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356.1, i64 8 %17 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.8.1, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.8.1 = mul nsw i32 %j.sroa.97.0, %17 %add.us.us.us.us.us.us.us.us.us.us.8.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.7.1, %mul.us.us.us.us.us.us.us.us.us.us.8.1 store i32 %add.us.us.us.us.us.us.us.us.us.us.8.1, ptr %arrayidx98.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %indvars.iv.next357.1 = add nuw nsw i64 %indvars.iv356.1, 1 %exitcond.1.not = icmp eq i64 %indvars.iv.next357.1, %5 br i1 %exitcond.1.not, label %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader, label %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us.1, !llvm.loop !12 for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader: ; preds = %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us.1 br i1 %8, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa, label %for.body107.us.us.us.us.us.us.us.us.us.us.1 for.body107.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader, %for.body107.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv359.1 = phi i64 [ %indvars.iv.next360.1.3, %for.body107.us.us.us.us.us.us.us.us.us.us.1 ], [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader ] %y.0244.us.us.us.us.us.us.us.us.us.us.1 = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.1.3, %for.body107.us.us.us.us.us.us.us.us.us.us.1 ], [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader ] %niter494 = phi i64 [ %niter494.next.3, %for.body107.us.us.us.us.us.us.us.us.us.us.1 ], [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader ] %arrayidx111.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv359.1 %18 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.1, align 16, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.1 = sext i32 %18 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv359.1, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.1 %19 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %19, %y.0244.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv.next360.1 = or i64 %indvars.iv359.1, 1 %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv.next360.1 %20 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.1 = sext i32 %20 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.1 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv.next360.1, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.1 %21 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.1, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.1.1 = add nsw i32 %21, %add114.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv.next360.1.1 = or i64 %indvars.iv359.1, 2 %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.2 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv.next360.1.1 %22 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.2, align 8, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.2 = sext i32 %22 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.2 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv.next360.1.1, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.2 %23 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.2, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.1.2 = add nsw i32 %23, %add114.us.us.us.us.us.us.us.us.us.us.1.1 %indvars.iv.next360.1.2 = or i64 %indvars.iv359.1, 3 %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.3 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv.next360.1.2 %24 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.3, align 4, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.3 = sext i32 %24 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.3 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv.next360.1.2, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.3 %25 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.3, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.1.3 = add nsw i32 %25, %add114.us.us.us.us.us.us.us.us.us.us.1.2 %indvars.iv.next360.1.3 = add nuw nsw i64 %indvars.iv359.1, 4 %niter494.next.3 = add i64 %niter494, 4 %niter494.ncmp.3 = icmp eq i64 %niter494.next.3, %unroll_iter493 br i1 %niter494.ncmp.3, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa, label %for.body107.us.us.us.us.us.us.us.us.us.us.1, !llvm.loop !13 for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa: ; preds = %for.body107.us.us.us.us.us.us.us.us.us.us.1, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader %add114.us.us.us.us.us.us.us.us.us.us.1.lcssa.ph = phi i32 [ undef, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader ], [ %add114.us.us.us.us.us.us.us.us.us.us.1.3, %for.body107.us.us.us.us.us.us.us.us.us.us.1 ] %indvars.iv359.1.unr = phi i64 [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader ], [ %indvars.iv.next360.1.3, %for.body107.us.us.us.us.us.us.us.us.us.us.1 ] %y.0244.us.us.us.us.us.us.us.us.us.us.1.unr = phi i32 [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.1.preheader ], [ %add114.us.us.us.us.us.us.us.us.us.us.1.3, %for.body107.us.us.us.us.us.us.us.us.us.us.1 ] br i1 %lcmp.mod491.not, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1, label %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil for.body107.us.us.us.us.us.us.us.us.us.us.1.epil: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa, %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil %indvars.iv359.1.epil = phi i64 [ %indvars.iv.next360.1.epil, %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil ], [ %indvars.iv359.1.unr, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa ] %y.0244.us.us.us.us.us.us.us.us.us.us.1.epil = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.1.epil, %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil ], [ %y.0244.us.us.us.us.us.us.us.us.us.us.1.unr, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa ] %epil.iter490 = phi i64 [ %epil.iter490.next, %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil ], [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa ] %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.epil = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv359.1.epil %26 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.1.epil, align 4, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.epil = sext i32 %26 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.epil = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv359.1.epil, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.1.epil %27 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.1.epil, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.1.epil = add nsw i32 %27, %y.0244.us.us.us.us.us.us.us.us.us.us.1.epil %indvars.iv.next360.1.epil = add nuw nsw i64 %indvars.iv359.1.epil, 1 %epil.iter490.next = add i64 %epil.iter490, 1 %epil.iter490.cmp.not = icmp eq i64 %epil.iter490.next, %xtraiter489 br i1 %epil.iter490.cmp.not, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1, label %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil, !llvm.loop !14 for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1: ; preds = %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa %add114.us.us.us.us.us.us.us.us.us.us.1.lcssa = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.1.lcssa.ph, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1.unr-lcssa ], [ %add114.us.us.us.us.us.us.us.us.us.us.1.epil, %for.body107.us.us.us.us.us.us.us.us.us.us.1.epil ] br i1 %min.iters.check, label %for.body129.us.us.us.us.us.us.us.us.us.us.1.preheader, label %vector.body vector.body: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1 ] %vec.phi = phi <4 x i32> [ %34, %vector.body ], [ zeroinitializer, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1 ] %vec.phi453 = phi <4 x i32> [ %35, %vector.body ], [ zeroinitializer, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1 ] %28 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %28, align 16, !tbaa !5 %29 = getelementptr inbounds i32, ptr %28, i64 4 %wide.load454 = load <4 x i32>, ptr %29, align 16, !tbaa !5 %30 = icmp eq <4 x i32> %wide.load, zeroinitializer %31 = icmp eq <4 x i32> %wide.load454, zeroinitializer %32 = zext <4 x i1> %30 to <4 x i32> %33 = zext <4 x i1> %31 to <4 x i32> %34 = add <4 x i32> %vec.phi, %32 %35 = add <4 x i32> %vec.phi453, %33 %index.next = add nuw i64 %index, 8 %36 = icmp eq i64 %index.next, %n.vec br i1 %36, label %middle.block, label %vector.body, !llvm.loop !16 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %35, %34 %37 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.end136.us.us.us.us.us.us.us.us.us.us.1, label %for.body129.us.us.us.us.us.us.us.us.us.us.1.preheader for.body129.us.us.us.us.us.us.us.us.us.us.1.preheader: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1, %middle.block %indvars.iv368.1.ph = phi i64 [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1 ], [ %n.vec, %middle.block ] %l.0250.us.us.us.us.us.us.us.us.us.us.1.ph = phi i32 [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.1 ], [ %37, %middle.block ] br label %for.body129.us.us.us.us.us.us.us.us.us.us.1 for.body129.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.1.preheader, %for.body129.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv368.1 = phi i64 [ %indvars.iv.next369.1, %for.body129.us.us.us.us.us.us.us.us.us.us.1 ], [ %indvars.iv368.1.ph, %for.body129.us.us.us.us.us.us.us.us.us.us.1.preheader ] %l.0250.us.us.us.us.us.us.us.us.us.us.1 = phi i32 [ %spec.select.us.us.us.us.us.us.us.us.us.us.1, %for.body129.us.us.us.us.us.us.us.us.us.us.1 ], [ %l.0250.us.us.us.us.us.us.us.us.us.us.1.ph, %for.body129.us.us.us.us.us.us.us.us.us.us.1.preheader ] %arrayidx131.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv368.1 %38 = load i32, ptr %arrayidx131.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %cmp132.us.us.us.us.us.us.us.us.us.us.1 = icmp eq i32 %38, 0 %inc133.us.us.us.us.us.us.us.us.us.us.1 = zext i1 %cmp132.us.us.us.us.us.us.us.us.us.us.1 to i32 %spec.select.us.us.us.us.us.us.us.us.us.us.1 = add nuw nsw i32 %l.0250.us.us.us.us.us.us.us.us.us.us.1, %inc133.us.us.us.us.us.us.us.us.us.us.1 %indvars.iv.next369.1 = add nuw nsw i64 %indvars.iv368.1, 1 %exitcond372.1.not = icmp eq i64 %indvars.iv.next369.1, %5 br i1 %exitcond372.1.not, label %for.end136.us.us.us.us.us.us.us.us.us.us.1, label %for.body129.us.us.us.us.us.us.us.us.us.us.1, !llvm.loop !19 for.end136.us.us.us.us.us.us.us.us.us.us.1: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.1, %middle.block %spec.select.us.us.us.us.us.us.us.us.us.us.1.lcssa = phi i32 [ %37, %middle.block ], [ %spec.select.us.us.us.us.us.us.us.us.us.us.1, %for.body129.us.us.us.us.us.us.us.us.us.us.1 ] %cmp137.us.us.us.us.us.us.us.us.us.us.1 = icmp sle i32 %add114.us.us.us.us.us.us.us.us.us.us.1.lcssa, %max.10.us.us.us.us.us.us.us.us.us.us %cmp138.us.us.us.us.us.us.us.us.us.us.1.not = icmp eq i32 %spec.select.us.us.us.us.us.us.us.us.us.us.1.lcssa, %3 %or.cond = select i1 %cmp137.us.us.us.us.us.us.us.us.us.us.1, i1 true, i1 %cmp138.us.us.us.us.us.us.us.us.us.us.1.not %max.10.us.us.us.us.us.us.us.us.us.us.1 = select i1 %or.cond, i32 %max.10.us.us.us.us.us.us.us.us.us.us, i32 %add114.us.us.us.us.us.us.us.us.us.us.1.lcssa %dec147.us.us.us.us.us.us.us.us.us = add nsw i32 %j.sroa.97.0, -1 %cmp70.us.us.us.us.us.us.us.us.us.not = icmp eq i32 %j.sroa.97.0, 0 br i1 %cmp70.us.us.us.us.us.us.us.us.us.not, label %for.inc149.split.us.us.us.us.us.us.us.us.us, label %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us, !llvm.loop !20 for.body129.us.us.us.us.us.us.us.us.us.us: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader472, %for.body129.us.us.us.us.us.us.us.us.us.us %indvars.iv368 = phi i64 [ %indvars.iv.next369, %for.body129.us.us.us.us.us.us.us.us.us.us ], [ %indvars.iv368.ph, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader472 ] %l.0250.us.us.us.us.us.us.us.us.us.us = phi i32 [ %spec.select.us.us.us.us.us.us.us.us.us.us, %for.body129.us.us.us.us.us.us.us.us.us.us ], [ %l.0250.us.us.us.us.us.us.us.us.us.us.ph, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader472 ] %arrayidx131.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv368 %39 = load i32, ptr %arrayidx131.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %cmp132.us.us.us.us.us.us.us.us.us.us = icmp eq i32 %39, 0 %inc133.us.us.us.us.us.us.us.us.us.us = zext i1 %cmp132.us.us.us.us.us.us.us.us.us.us to i32 %spec.select.us.us.us.us.us.us.us.us.us.us = add nuw nsw i32 %l.0250.us.us.us.us.us.us.us.us.us.us, %inc133.us.us.us.us.us.us.us.us.us.us %indvars.iv.next369 = add nuw nsw i64 %indvars.iv368, 1 %exitcond372.not = icmp eq i64 %indvars.iv.next369, %5 br i1 %exitcond372.not, label %for.end136.us.us.us.us.us.us.us.us.us.us, label %for.body129.us.us.us.us.us.us.us.us.us.us, !llvm.loop !21 for.body107.us.us.us.us.us.us.us.us.us.us: ; preds = %for.body107.us.us.us.us.us.us.us.us.us.us.preheader, %for.body107.us.us.us.us.us.us.us.us.us.us %indvars.iv359 = phi i64 [ %indvars.iv.next360.3, %for.body107.us.us.us.us.us.us.us.us.us.us ], [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader ] %y.0244.us.us.us.us.us.us.us.us.us.us = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.3, %for.body107.us.us.us.us.us.us.us.us.us.us ], [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader ] %niter = phi i64 [ %niter.next.3, %for.body107.us.us.us.us.us.us.us.us.us.us ], [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader ] %arrayidx111.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv359 %40 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us, align 16, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us = sext i32 %40 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv359, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us %41 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us = add nsw i32 %41, %y.0244.us.us.us.us.us.us.us.us.us.us %indvars.iv.next360 = or i64 %indvars.iv359, 1 %arrayidx111.us.us.us.us.us.us.us.us.us.us.1483 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv.next360 %42 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.1483, align 4, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.1484 = sext i32 %42 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.1485 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv.next360, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.1484 %43 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.1485, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.1486 = add nsw i32 %43, %add114.us.us.us.us.us.us.us.us.us.us %indvars.iv.next360.1487 = or i64 %indvars.iv359, 2 %arrayidx111.us.us.us.us.us.us.us.us.us.us.2 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv.next360.1487 %44 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.2, align 8, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.2 = sext i32 %44 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.2 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv.next360.1487, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.2 %45 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.2, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.2 = add nsw i32 %45, %add114.us.us.us.us.us.us.us.us.us.us.1486 %indvars.iv.next360.2 = or i64 %indvars.iv359, 3 %arrayidx111.us.us.us.us.us.us.us.us.us.us.3 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv.next360.2 %46 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.3, align 4, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.3 = sext i32 %46 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.3 = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv.next360.2, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.3 %47 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.3, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.3 = add nsw i32 %47, %add114.us.us.us.us.us.us.us.us.us.us.2 %indvars.iv.next360.3 = add nuw nsw i64 %indvars.iv359, 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.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa, label %for.body107.us.us.us.us.us.us.us.us.us.us, !llvm.loop !13 for.cond88.preheader.us.us.us.us.us.us.us.us.us.us: ; preds = %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us, %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us %indvars.iv356 = phi i64 [ 0, %for.cond85.preheader.us.us.us.us.us.us.us.us.us.us ], [ %indvars.iv.next357, %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us ] %arrayidx98.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv356 %arrayidx98.promoted.us.us.us.us.us.us.us.us.us.us = load i32, ptr %arrayidx98.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %arrayidx94.us.us.us.us.us.us.us.us.us.us = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 0 %48 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us = mul nsw i32 %j.sroa.0.0, %48 %add.us.us.us.us.us.us.us.us.us.us = add nsw i32 %arrayidx98.promoted.us.us.us.us.us.us.us.us.us.us, %mul.us.us.us.us.us.us.us.us.us.us %arrayidx94.us.us.us.us.us.us.us.us.us.us.1 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 1 %49 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.1, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.1 = mul nsw i32 %j.sroa.13.0, %49 %add.us.us.us.us.us.us.us.us.us.us.1 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us, %mul.us.us.us.us.us.us.us.us.us.us.1 %arrayidx94.us.us.us.us.us.us.us.us.us.us.2 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 2 %50 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.2, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.2 = mul nsw i32 %j.sroa.25.0, %50 %add.us.us.us.us.us.us.us.us.us.us.2 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.1, %mul.us.us.us.us.us.us.us.us.us.us.2 %arrayidx94.us.us.us.us.us.us.us.us.us.us.3 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 3 %51 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.3, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.3 = mul nsw i32 %j.sroa.37.0, %51 %add.us.us.us.us.us.us.us.us.us.us.3 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.2, %mul.us.us.us.us.us.us.us.us.us.us.3 %arrayidx94.us.us.us.us.us.us.us.us.us.us.4 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 4 %52 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.4, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.4 = mul nsw i32 %j.sroa.49.0, %52 %add.us.us.us.us.us.us.us.us.us.us.4 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.3, %mul.us.us.us.us.us.us.us.us.us.us.4 %arrayidx94.us.us.us.us.us.us.us.us.us.us.5 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 5 %53 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.5, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.5 = mul nsw i32 %j.sroa.61.0, %53 %add.us.us.us.us.us.us.us.us.us.us.5 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.4, %mul.us.us.us.us.us.us.us.us.us.us.5 %arrayidx94.us.us.us.us.us.us.us.us.us.us.6 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 6 %54 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.6, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.6 = mul nsw i32 %j.sroa.73.0, %54 %add.us.us.us.us.us.us.us.us.us.us.6 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.5, %mul.us.us.us.us.us.us.us.us.us.us.6 %arrayidx94.us.us.us.us.us.us.us.us.us.us.7 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 7 %55 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.7, align 4, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.7 = mul nsw i32 %j.sroa.85.0, %55 %add.us.us.us.us.us.us.us.us.us.us.7 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.6, %mul.us.us.us.us.us.us.us.us.us.us.7 %arrayidx94.us.us.us.us.us.us.us.us.us.us.8 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 8 %56 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.8, align 8, !tbaa !5 %mul.us.us.us.us.us.us.us.us.us.us.8 = mul nsw i32 %j.sroa.97.0, %56 %add.us.us.us.us.us.us.us.us.us.us.8 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.7, %mul.us.us.us.us.us.us.us.us.us.us.8 %arrayidx94.us.us.us.us.us.us.us.us.us.us.9 = getelementptr inbounds [100 x [10 x i32]], ptr %f, i64 0, i64 %indvars.iv356, i64 9 %57 = load i32, ptr %arrayidx94.us.us.us.us.us.us.us.us.us.us.9, align 4, !tbaa !5 %add.us.us.us.us.us.us.us.us.us.us.9 = add nsw i32 %add.us.us.us.us.us.us.us.us.us.us.8, %57 store i32 %add.us.us.us.us.us.us.us.us.us.us.9, ptr %arrayidx98.us.us.us.us.us.us.us.us.us.us, align 4, !tbaa !5 %indvars.iv.next357 = add nuw nsw i64 %indvars.iv356, 1 %exitcond.not = icmp eq i64 %indvars.iv.next357, %5 br i1 %exitcond.not, label %for.body107.us.us.us.us.us.us.us.us.us.us.preheader, label %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us, !llvm.loop !12 for.body107.us.us.us.us.us.us.us.us.us.us.preheader: ; preds = %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us br i1 %7, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa, label %for.body107.us.us.us.us.us.us.us.us.us.us for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa: ; preds = %for.body107.us.us.us.us.us.us.us.us.us.us, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader %add114.us.us.us.us.us.us.us.us.us.us.lcssa.ph = phi i32 [ undef, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader ], [ %add114.us.us.us.us.us.us.us.us.us.us.3, %for.body107.us.us.us.us.us.us.us.us.us.us ] %indvars.iv359.unr = phi i64 [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader ], [ %indvars.iv.next360.3, %for.body107.us.us.us.us.us.us.us.us.us.us ] %y.0244.us.us.us.us.us.us.us.us.us.us.unr = phi i32 [ 0, %for.body107.us.us.us.us.us.us.us.us.us.us.preheader ], [ %add114.us.us.us.us.us.us.us.us.us.us.3, %for.body107.us.us.us.us.us.us.us.us.us.us ] br i1 %lcmp.mod.not, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader, label %for.body107.us.us.us.us.us.us.us.us.us.us.epil for.body107.us.us.us.us.us.us.us.us.us.us.epil: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa, %for.body107.us.us.us.us.us.us.us.us.us.us.epil %indvars.iv359.epil = phi i64 [ %indvars.iv.next360.epil, %for.body107.us.us.us.us.us.us.us.us.us.us.epil ], [ %indvars.iv359.unr, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa ] %y.0244.us.us.us.us.us.us.us.us.us.us.epil = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.epil, %for.body107.us.us.us.us.us.us.us.us.us.us.epil ], [ %y.0244.us.us.us.us.us.us.us.us.us.us.unr, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body107.us.us.us.us.us.us.us.us.us.us.epil ], [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa ] %arrayidx111.us.us.us.us.us.us.us.us.us.us.epil = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv359.epil %58 = load i32, ptr %arrayidx111.us.us.us.us.us.us.us.us.us.us.epil, align 4, !tbaa !5 %idxprom112.us.us.us.us.us.us.us.us.us.us.epil = sext i32 %58 to i64 %arrayidx113.us.us.us.us.us.us.us.us.us.us.epil = getelementptr inbounds [100 x [11 x i32]], ptr %p, i64 0, i64 %indvars.iv359.epil, i64 %idxprom112.us.us.us.us.us.us.us.us.us.us.epil %59 = load i32, ptr %arrayidx113.us.us.us.us.us.us.us.us.us.us.epil, align 4, !tbaa !5 %add114.us.us.us.us.us.us.us.us.us.us.epil = add nsw i32 %59, %y.0244.us.us.us.us.us.us.us.us.us.us.epil %indvars.iv.next360.epil = add nuw nsw i64 %indvars.iv359.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.body129.us.us.us.us.us.us.us.us.us.us.preheader, label %for.body107.us.us.us.us.us.us.us.us.us.us.epil, !llvm.loop !22 for.body129.us.us.us.us.us.us.us.us.us.us.preheader: ; preds = %for.body107.us.us.us.us.us.us.us.us.us.us.epil, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa %add114.us.us.us.us.us.us.us.us.us.us.lcssa = phi i32 [ %add114.us.us.us.us.us.us.us.us.us.us.lcssa.ph, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader.unr-lcssa ], [ %add114.us.us.us.us.us.us.us.us.us.us.epil, %for.body107.us.us.us.us.us.us.us.us.us.us.epil ] %mul123.us.us.us.us.us.us.us.us.us.us.8 = mul nsw i32 %j.sroa.97.0, %mul123.us.us.us.us.us.us.us.us.us.us.7 br i1 %min.iters.check457, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader472, label %vector.body463 vector.body463: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader, %vector.body463 %index464 = phi i64 [ %index.next469, %vector.body463 ], [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader ] %vec.phi465 = phi <4 x i32> [ %66, %vector.body463 ], [ zeroinitializer, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader ] %vec.phi466 = phi <4 x i32> [ %67, %vector.body463 ], [ zeroinitializer, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader ] %60 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %index464 %wide.load467 = load <4 x i32>, ptr %60, align 16, !tbaa !5 %61 = getelementptr inbounds i32, ptr %60, i64 4 %wide.load468 = load <4 x i32>, ptr %61, align 16, !tbaa !5 %62 = icmp eq <4 x i32> %wide.load467, zeroinitializer %63 = icmp eq <4 x i32> %wide.load468, zeroinitializer %64 = zext <4 x i1> %62 to <4 x i32> %65 = zext <4 x i1> %63 to <4 x i32> %66 = add <4 x i32> %vec.phi465, %64 %67 = add <4 x i32> %vec.phi466, %65 %index.next469 = add nuw i64 %index464, 8 %68 = icmp eq i64 %index.next469, %n.vec460 br i1 %68, label %middle.block455, label %vector.body463, !llvm.loop !23 middle.block455: ; preds = %vector.body463 %bin.rdx470 = add <4 x i32> %67, %66 %69 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx470) br i1 %cmp.n462, label %for.end136.us.us.us.us.us.us.us.us.us.us, label %for.body129.us.us.us.us.us.us.us.us.us.us.preheader472 for.body129.us.us.us.us.us.us.us.us.us.us.preheader472: ; preds = %for.body129.us.us.us.us.us.us.us.us.us.us.preheader, %middle.block455 %indvars.iv368.ph = phi i64 [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader ], [ %n.vec460, %middle.block455 ] %l.0250.us.us.us.us.us.us.us.us.us.us.ph = phi i32 [ 0, %for.body129.us.us.us.us.us.us.us.us.us.us.preheader ], [ %69, %middle.block455 ] br label %for.body129.us.us.us.us.us.us.us.us.us.us for.cond85.preheader.us.us.us.us.us.us.us.us.us.us: ; preds = %for.end136.us.us.us.us.us.us.us.us.us.us.1, %for.body66.us.us.us.us.us.us.us.us %j.sroa.97.0 = phi i32 [ 1, %for.body66.us.us.us.us.us.us.us.us ], [ %dec147.us.us.us.us.us.us.us.us.us, %for.end136.us.us.us.us.us.us.us.us.us.us.1 ] %max.8255.us.us.us.us.us.us.us.us.us = phi i32 [ %max.7258.us.us.us.us.us.us.us.us, %for.body66.us.us.us.us.us.us.us.us ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.end136.us.us.us.us.us.us.us.us.us.us.1 ] call void @llvm.memset.p0.i64(ptr nonnull align 16 %x, i8 0, i64 %6, i1 false), !tbaa !5 br label %for.cond88.preheader.us.us.us.us.us.us.us.us.us.us for.inc149.split.us.us.us.us.us.us.us.us.us: ; preds = %for.end136.us.us.us.us.us.us.us.us.us.us.1 %dec151.us.us.us.us.us.us.us.us = add nsw i32 %j.sroa.85.0, -1 %cmp65.us.us.us.us.us.us.us.us.not = icmp eq i32 %j.sroa.85.0, 0 br i1 %cmp65.us.us.us.us.us.us.us.us.not, label %for.inc153.split.us.us.us.us.us.us.us.us, label %for.body66.us.us.us.us.us.us.us.us, !llvm.loop !24 for.inc153.split.us.us.us.us.us.us.us.us: ; preds = %for.inc149.split.us.us.us.us.us.us.us.us.us %dec155.us.us.us.us.us.us.us = add nsw i32 %j.sroa.73.0, -1 %cmp60.us.us.us.us.us.us.us.not = icmp eq i32 %j.sroa.73.0, 0 br i1 %cmp60.us.us.us.us.us.us.us.not, label %for.inc157.split.us.us.us.us.us.us.us, label %for.body61.us.us.us.us.us.us.us, !llvm.loop !25 for.inc157.split.us.us.us.us.us.us.us: ; preds = %for.inc153.split.us.us.us.us.us.us.us.us %dec159.us.us.us.us.us.us = add nsw i32 %j.sroa.61.0, -1 %cmp55.us.us.us.us.us.us.not = icmp eq i32 %j.sroa.61.0, 0 br i1 %cmp55.us.us.us.us.us.us.not, label %for.inc161.split.us.us.us.us.us.us, label %for.body56.us.us.us.us.us.us, !llvm.loop !26 for.inc161.split.us.us.us.us.us.us: ; preds = %for.inc157.split.us.us.us.us.us.us.us %dec163.us.us.us.us.us = add nsw i32 %j.sroa.49.0, -1 %cmp50.us.us.us.us.us.not = icmp eq i32 %j.sroa.49.0, 0 br i1 %cmp50.us.us.us.us.us.not, label %for.inc165.split.us.us.us.us.us, label %for.body51.us.us.us.us.us, !llvm.loop !27 for.inc165.split.us.us.us.us.us: ; preds = %for.inc161.split.us.us.us.us.us.us %dec167.us.us.us.us = add nsw i32 %j.sroa.37.0, -1 %cmp45.us.us.us.us.not = icmp eq i32 %j.sroa.37.0, 0 br i1 %cmp45.us.us.us.us.not, label %for.inc169.split.us.us.us.us, label %for.body46.us.us.us.us, !llvm.loop !28 for.inc169.split.us.us.us.us: ; preds = %for.inc165.split.us.us.us.us.us %dec171.us.us.us = add nsw i32 %j.sroa.25.0, -1 %cmp40.us.us.us.not = icmp eq i32 %j.sroa.25.0, 0 br i1 %cmp40.us.us.us.not, label %for.inc173.split.us.us.us, label %for.body41.us.us.us, !llvm.loop !29 for.inc173.split.us.us.us: ; preds = %for.inc169.split.us.us.us.us %dec175.us.us = add nsw i32 %j.sroa.13.0, -1 %cmp35.us.us.not = icmp eq i32 %j.sroa.13.0, 0 br i1 %cmp35.us.us.not, label %for.inc177.split.us.us, label %for.body36.us.us, !llvm.loop !30 for.inc177.split.us.us: ; preds = %for.inc173.split.us.us.us %dec179.us = add nsw i32 %j.sroa.0.0, -1 %cmp30.us.not = icmp eq i32 %j.sroa.0.0, 0 br i1 %cmp30.us.not, label %for.end180, label %for.body31.us, !llvm.loop !31 for.end180: ; preds = %for.inc177.split.us.us, %entry, %for.cond10.preheader, %for.cond28.preheader %.us-phi276 = phi i32 [ 0, %for.cond28.preheader ], [ 0, %for.cond10.preheader ], [ 0, %entry ], [ %max.10.us.us.us.us.us.us.us.us.us.us.1, %for.inc177.split.us.us ] %call181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.us-phi276) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare 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 = { 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, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10, !17, !18} !17 = !{!"llvm.loop.isvectorized", i32 1} !18 = !{!"llvm.loop.unroll.runtime.disable"} !19 = distinct !{!19, !10, !18, !17} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10, !18, !17} !22 = distinct !{!22, !15} !23 = distinct !{!23, !10, !17, !18} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = distinct !{!31, !10}
//x = human*y + (human+1)*z #include <stdio.h> int main() { int x, y, z, human = 1, total = 0; scanf( "%d %d %d", &x, &y, &z); while(total < x ) { total = human * y + (human + 1) * z; if( total > x ) break; human++; if( total == x ) break; } printf("%d\n", human-1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4 %2 = load i32, ptr %z, align 4 br label %while.cond while.cond: ; preds = %if.end, %entry %human.0 = phi i32 [ 1, %entry ], [ %add, %if.end ] %total.0 = phi i32 [ 0, %entry ], [ %add2, %if.end ] %cmp = icmp slt i32 %total.0, %0 br i1 %cmp, label %while.body, label %while.end while.body: ; preds = %while.cond %mul = mul nsw i32 %1, %human.0 %add = add nuw nsw i32 %human.0, 1 %mul1 = mul nsw i32 %2, %add %add2 = add nsw i32 %mul1, %mul %cmp3 = icmp sgt i32 %add2, %0 br i1 %cmp3, label %while.end, label %if.end if.end: ; preds = %while.body %cmp4 = icmp eq i32 %add2, %0 br i1 %cmp4, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %if.end, %while.body, %while.cond %human.1 = phi i32 [ %human.0, %while.body ], [ %add, %if.end ], [ %human.0, %while.cond ] %sub = add nsw i32 %human.1, -1 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 <stdlib.h> #include <math.h> #include <string.h> #define ll long long #define rep(i,n) for(ll i=0;i<(n);i++) #define max(p,q) ((p)>(q)?(p):(q)) #define min(p,q) ((p)<(q)?(p):(q)) #define chmax(a,b) ((a)=(a)>(b)?(a):(b)) #define chmin(a,b) ((a)=(a)<(b)?(a):(b)) #define abs(p) ((p)>=(0)?(p):(-(p))) #define MOD 1000000007 ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;} #define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0) #define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0) #define in(a) scanf("%lld", &(a)) #define in2(a,b) scanf("%lld %lld",&(a),&(b)) #define in3(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c)) #define ind(a) scanf("%lf", &(a)) #define ins(a) scanf("%s", (a)) #define put(a) printf("%lld\n", (a)) #define putd(a) printf("%.15f\n", (a)) // puts(a) printf("%s\n", a) 文字はこっち //your code here! int main(void){ ll X, Y, Z, ans=0; in3(X, Y, Z); while(1){ if(ans*Y+(ans+1)*Z > X){ put(--ans); return 0; } ans++; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%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 @powll(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { 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 ] %r.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 %r.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.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 %r.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 !5 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %r.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 %r.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 !7 } ; 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: %X = alloca i64, align 8 %Y = alloca i64, align 8 %Z = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Z) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X, ptr noundef nonnull %Y, ptr noundef nonnull %Z) %0 = load i64, ptr %Y, align 8, !tbaa !9 %1 = load i64, ptr %Z, align 8, !tbaa !9 %2 = load i64, ptr %X, align 8, !tbaa !9 br label %while.cond while.cond: ; preds = %while.cond, %entry %ans.0 = phi i64 [ 0, %entry ], [ %add, %while.cond ] %mul = mul nsw i64 %0, %ans.0 %add = add nuw nsw i64 %ans.0, 1 %mul1 = mul nsw i64 %1, %add %add2 = add nsw i64 %mul1, %mul %cmp = icmp sgt i64 %add2, %2 br i1 %cmp, label %if.then, label %while.cond if.then: ; preds = %while.cond %dec = add nsw i64 %ans.0, -1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %dec) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Z) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.unroll.disable"} !7 = distinct !{!7, !8} !8 = !{!"llvm.loop.mustprogress"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !11, i64 0} !11 = !{!"omnipotent char", !12, i64 0} !12 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int testCases; scanf("%d",&testCases); for(int i = 0; i < testCases; i++){ int n; scanf("%d",&n); int arr[n]; for(int j = 0; j < n; j++){ printf("2\t"); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14656/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14656/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"2\09\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %testCases = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %testCases) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %testCases) %0 = load i32, ptr %testCases, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup4, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %testCases) #5 ret i32 0 for.body: ; preds = %entry, %for.cond.cleanup4 %i.016 = phi i32 [ %inc9, %for.cond.cleanup4 ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = call ptr @llvm.stacksave.p0() %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp313 = icmp sgt i32 %2, 0 br i1 %cmp313, label %for.body5, label %for.cond.cleanup4 for.cond.cleanup4: ; preds = %for.body5, %for.body %putchar = call i32 @putchar(i32 10) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %inc9 = add nuw nsw i32 %i.016, 1 %3 = load i32, ptr %testCases, align 4, !tbaa !5 %cmp = icmp slt i32 %inc9, %3 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.body5: ; preds = %for.body, %for.body5 %j.014 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %inc = add nuw nsw i32 %j.014, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %4 br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: 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}
#include<stdio.h> int main() { int t,n; scanf("%d",&t); while(t--) { scanf("%d",&n); while(n--) printf("2 "); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14661/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14661/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"2 \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #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 %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec11 = add nsw i32 %0, -1 store i32 %dec11, ptr %t, align 4, !tbaa !5 %tobool.not12 = icmp eq i32 %0, 0 br i1 %tobool.not12, label %while.end8, label %while.body while.body: ; preds = %entry, %while.end %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %dec39 = add nsw i32 %1, -1 store i32 %dec39, ptr %n, align 4, !tbaa !5 %tobool4.not10 = icmp eq i32 %1, 0 br i1 %tobool4.not10, label %while.end, label %while.body5 while.body5: ; preds = %while.body, %while.body5 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %2 = load i32, ptr %n, align 4, !tbaa !5 %dec3 = add nsw i32 %2, -1 store i32 %dec3, ptr %n, align 4, !tbaa !5 %tobool4.not = icmp eq i32 %2, 0 br i1 %tobool4.not, label %while.end, label %while.body5, !llvm.loop !9 while.end: ; preds = %while.body5, %while.body %putchar = call i32 @putchar(i32 10) %3 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %3, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end8, label %while.body, !llvm.loop !11 while.end8: ; preds = %while.end, %entry 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: 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 x,y,z; char c,d; //int ans =(x+z)/(y+z); scanf("%d%d%d",&x,&y,&z); int ans =(x-z)/(y+z); printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146660/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %z, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %y, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %div = sdiv i32 %sub, %add %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b){ return *(int*)a - *(int*)b; } int minimum_vote(){ int vote[10000]; int index = 0; int sum = 0; char c = getchar(); while(1){ if(c == '['){ vote[index++] = minimum_vote(); c = getchar(); } else if(c == ']'){ qsort(vote, index, sizeof(int), compare_int); int i; for(i = 0; i < (index + 1) / 2; i++){ sum += vote[i]; } return sum; } else{ int t = c - '0'; c = getchar(); while(c >= '0' && c <= '9'){ t = t * 10 + (c - '0'); c = getchar(); } vote[index++] = (t + 1) / 2; } } } int main(void){ int n, i; scanf("%d", &n); for(i = 0; i < n; i++){ while(getchar() != '['); printf("%d\n", minimum_vote()); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146703/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146703/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @minimum_vote() local_unnamed_addr #1 { entry: %vote = alloca [10000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %vote) #6 %0 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = tail call i32 @getc(ptr noundef %0) br label %while.cond while.cond: ; preds = %if.end39, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %if.end39 ], [ 0, %entry ] %c.0.in = phi i32 [ %c.2.in, %if.end39 ], [ %call.i, %entry ] %c.0 = trunc i32 %c.0.in to i8 switch i8 %c.0, label %if.else17 [ i8 91, label %if.then i8 93, label %if.then9 ] if.then: ; preds = %while.cond %call3 = tail call i32 @minimum_vote() %arrayidx = getelementptr inbounds [10000 x i32], ptr %vote, i64 0, i64 %indvars.iv store i32 %call3, ptr %arrayidx, align 4, !tbaa !5 %1 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i53 = tail call i32 @getc(ptr noundef %1) br label %if.end39 if.then9: ; preds = %while.cond %conv10 = and i64 %indvars.iv, 4294967295 call void @qsort(ptr noundef nonnull %vote, i64 noundef %conv10, i64 noundef 4, ptr noundef nonnull @compare_int) #6 %2 = and i64 %indvars.iv, 4294967295 %cmp1161.not = icmp eq i64 %2, 0 br i1 %cmp1161.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %if.then9 %add = add i64 %indvars.iv, 1 %div56 = lshr i64 %add, 1 %3 = and i64 %div56, 2147483647 %umax = call i64 @llvm.umax.i64(i64 %3, i64 1) %min.iters.check = icmp ult i64 %3, 8 br i1 %min.iters.check, label %for.body.preheader71, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %umax, 2147483640 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %4 = getelementptr inbounds [10000 x i32], ptr %vote, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load70 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = add <4 x i32> %wide.load, %vec.phi %7 = add <4 x i32> %wide.load70, %vec.phi69 %index.next = add nuw i64 %index, 8 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %umax, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader71 for.body.preheader71: ; preds = %for.body.preheader, %middle.block %indvars.iv66.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.062.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader71, %for.body %indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body ], [ %indvars.iv66.ph, %for.body.preheader71 ] %sum.062 = phi i32 [ %add15, %for.body ], [ %sum.062.ph, %for.body.preheader71 ] %arrayidx14 = getelementptr inbounds [10000 x i32], ptr %vote, i64 0, i64 %indvars.iv66 %10 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %add15 = add nsw i32 %10, %sum.062 %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %cmp11 = icmp ult i64 %indvars.iv.next67, %3 br i1 %cmp11, label %for.body, label %for.end, !llvm.loop !15 for.end: ; preds = %for.body, %middle.block, %if.then9 %sum.0.lcssa = phi i32 [ 0, %if.then9 ], [ %9, %middle.block ], [ %add15, %for.body ] call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %vote) #6 ret i32 %sum.0.lcssa if.else17: ; preds = %while.cond %sext52 = shl i32 %c.0.in, 24 %conv1 = ashr exact i32 %sext52, 24 %sub = add nsw i32 %conv1, -48 %11 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i54 = tail call i32 @getc(ptr noundef %11) %sext57 = shl i32 %call.i54, 24 %12 = add i32 %sext57, -788529153 %13 = icmp ult i32 %12, 184549375 br i1 %13, label %while.body28, label %while.end while.body28: ; preds = %if.else17, %while.body28 %t.059 = phi i32 [ %add31, %while.body28 ], [ %sub, %if.else17 ] %c.1.in58 = phi i32 [ %call.i55, %while.body28 ], [ %call.i54, %if.else17 ] %conv22 = and i32 %c.1.in58, 255 %mul = mul nsw i32 %t.059, 10 %sub30 = add nsw i32 %conv22, -48 %add31 = add nsw i32 %sub30, %mul %14 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i55 = tail call i32 @getc(ptr noundef %14) %sext = shl i32 %call.i55, 24 %15 = add i32 %sext, -788529153 %16 = icmp ult i32 %15, 184549375 br i1 %16, label %while.body28, label %while.end, !llvm.loop !16 while.end: ; preds = %while.body28, %if.else17 %c.1.in.lcssa = phi i32 [ %call.i54, %if.else17 ], [ %call.i55, %while.body28 ] %t.0.lcssa = phi i32 [ %sub, %if.else17 ], [ %add31, %while.body28 ] %add34 = add nsw i32 %t.0.lcssa, 1 %div35 = sdiv i32 %add34, 2 %arrayidx38 = getelementptr inbounds [10000 x i32], ptr %vote, i64 0, i64 %indvars.iv store i32 %div35, ptr %arrayidx38, align 4, !tbaa !5 br label %if.end39 if.end39: ; preds = %while.end, %if.then %c.2.in = phi i32 [ %call.i53, %if.then ], [ %c.1.in.lcssa, %while.end ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %while.cond } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %while.cond.preheader, label %for.end while.cond.preheader: ; preds = %entry, %while.end %i.07 = phi i32 [ %inc, %while.end ], [ 0, %entry ] br label %while.cond while.cond: ; preds = %while.cond.preheader, %while.cond %1 = load ptr, ptr @stdin, align 8, !tbaa !9 %call.i = call i32 @getc(ptr noundef %1) %cmp2.not = icmp eq i32 %call.i, 91 br i1 %cmp2.not, label %while.end, label %while.cond, !llvm.loop !17 while.end: ; preds = %while.cond %call3 = call i32 @minimum_vote() %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call3) %inc = add nuw nsw i32 %i.07, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %while.cond.preheader, label %for.end, !llvm.loop !18 for.end: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12, !14, !13} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12}
#include <stdio.h> int main(void) { int a, b; scanf("%d", &a); scanf("%d", &b); int n = 1; if (b == 1) { printf("%d\n", 0); } else if (a >= b) { printf("%d\n", n); } else { int dif = b - a; int k; if (dif % (a - 1) == 0) { k = dif / (a - 1); } else { k = dif / (a - 1) + 1; } n += k; printf("%d\n", n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146747/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146747/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %if.end17, label %if.else if.else: ; preds = %entry %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp3.not = icmp slt i32 %1, %0 br i1 %cmp3.not, label %if.else6, label %if.end17 if.else6: ; preds = %if.else %sub = sub nsw i32 %0, %1 %sub7 = add nsw i32 %1, -1 %rem = srem i32 %sub, %sub7 %cmp8 = icmp ne i32 %rem, 0 %div = sdiv i32 %sub, %sub7 %add = zext i1 %cmp8 to i32 %k.0 = add nsw i32 %div, %add %add14 = add nsw i32 %k.0, 1 br label %if.end17 if.end17: ; preds = %if.else, %entry, %if.else6 %.sink = phi i32 [ %add14, %if.else6 ], [ 0, %entry ], [ 1, %if.else ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* ============================================================================ Name : AtCoder3.c Author : Version: Copyright: Your copyright notice Description : Hello World in C, Ansi - style ============================================================================ */ #pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <float.h> #define i_cin(X) scanf("%d", &X) #define i_cin2(X,Y) scanf("%d %d",&X,&Y) #define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z) #define l_cin(X) scanf("%ld",&X) #define f_cin(X) scanf("%f",&X) #define l_cin2(X,Y) scanf("%ld %ld",&X,&Y) #define s_cin(X) scanf("%s",&X) #define i_cout(X) printf("%d\n",X) #define f_cout(X) printf("%g\n",X) #define i_cout2(X,Y) printf("%d %d\n",X,Y) #define l_cout(X) printf("%ld\n",X) #define s_cout(X) printf("%s\n",X) #define ll_cout(X) printf("%lld\n",X) typedef long long ll; #define rept(x, s, n) for (int x = s; x < n; x++) #define Yes_RTN s_cout("Yes");return 0 #define No_RTN s_cout("No");return 0 #define YES_RTN s_cout("YES");return 0 #define NO_RTN s_cout("NO");return 0 int i_cins(int n, int* A); int l_cins2(int n, long* A,long* B); int s_dsort(const void* a, const void* b); int s_asort(const void* a, const void* b); int _gcd(int a, int b); int s_asorts(const void* a, const void* b); int main(void) { int A, B, tmp, r; i_cin2(A, B); tmp = (B -1) / (A - 1); i_cout((B - 1) % (A - 1)?tmp+1:tmp); return 0; } long _max(long a, long b) { return a > b ? a : b; } long _min(long a, long b) { return a < b ? a : b; } //昇順 int s_asorts(const void* a, const void* b) { return(strcmp((char*)a, (char*)b)); } int s_dsort(const void* a, const void* b) { return(*(int*)b - *(int*)a); } int s_asort(const void* a, const void* b) { return(*(int*)a -*(int*)b); } int l_cins2(int n, long* a, long* b) { int i; rept(i, 0, n) { l_cin2(*(a + i), *(b + i)); } return 0; } int i_cins(int n, int* a) { int i; for (i = 0; i < n; i++) { i_cin(*(a + i)); } return 0; } int _gcd(int a, int b) { int r, tmp; if (a < b) { tmp = a; a = b; b = tmp; } r = a % b; while (r) { if (!r) break; a = b; b = r; r = a % b; } return(b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146790/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146790/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.2 = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %B, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %A, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %div = sdiv i32 %sub, %sub1 %rem = srem i32 %sub, %sub1 %tobool.not = icmp ne i32 %rem, 0 %add = zext i1 %tobool.not to i32 %cond = add nsw i32 %div, %add %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #9 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { 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 @_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asorts(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #10 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @l_cins2(i32 noundef %n, ptr noundef %a, ptr noundef %b) local_unnamed_addr #0 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry ret i32 0 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %add.ptr = getelementptr inbounds i64, ptr %a, i64 %indvars.iv %add.ptr3 = getelementptr inbounds i64, ptr %b, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %add.ptr, ptr noundef %add.ptr3) %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 !9 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @i_cins(i32 noundef %n, ptr noundef %a) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i32 %n, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry ret i32 0 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @_gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #7 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %spec.select15 = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %rem = srem i32 %spec.select15, %spec.select %tobool.not16 = icmp eq i32 %rem, 0 br i1 %tobool.not16, label %while.end, label %if.end3 if.end3: ; preds = %entry, %if.end3 %r.018 = phi i32 [ %rem4, %if.end3 ], [ %rem, %entry ] %b.addr.117 = phi i32 [ %r.018, %if.end3 ], [ %spec.select, %entry ] %rem4 = srem i32 %b.addr.117, %r.018 %tobool.not = icmp eq i32 %rem4, 0 br i1 %tobool.not, label %while.end, label %if.end3, !llvm.loop !12 while.end: ; preds = %if.end3, %entry %b.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %r.018, %if.end3 ] ret i32 %b.addr.1.lcssa } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #8 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-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) uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind } attributes #10 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}