Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <stdbool.h> static bool _has_s[601] = {}; int main() { int N; scanf("%d\n", &N); for(int i = 0 ; i < N ; ++i) { int s; scanf("%d ", &s); _has_s[s] = true; } int count = 0; for(int i = 1 ; i <= 600 ; ++i) if(_has_s[i]) ++count; printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16397/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16397/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @_has_s = internal unnamed_addr global [601 x i8] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = 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 %vector.body.preheader vector.body.preheader: ; preds = %for.body, %entry br label %vector.body vector.body: ; preds = %vector.body, %vector.body.preheader %index = phi i64 [ 0, %vector.body.preheader ], [ %index.next.2, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.body.preheader ], [ %17, %vector.body ] %vec.phi23 = phi <4 x i32> [ zeroinitializer, %vector.body.preheader ], [ %18, %vector.body ] %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds [601 x i8], ptr @_has_s, i64 0, i64 %offset.idx %wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !9 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load24 = load <4 x i8>, ptr %2, align 1, !tbaa !9 %3 = zext <4 x i8> %wide.load to <4 x i32> %4 = zext <4 x i8> %wide.load24 to <4 x i32> %5 = add <4 x i32> %vec.phi, %3 %6 = add <4 x i32> %vec.phi23, %4 %offset.idx.1 = add nuw i64 %index, 9 %7 = getelementptr inbounds [601 x i8], ptr @_has_s, i64 0, i64 %offset.idx.1 %wide.load.1 = load <4 x i8>, ptr %7, align 1, !tbaa !9 %8 = getelementptr inbounds i8, ptr %7, i64 4 %wide.load24.1 = load <4 x i8>, ptr %8, align 1, !tbaa !9 %9 = zext <4 x i8> %wide.load.1 to <4 x i32> %10 = zext <4 x i8> %wide.load24.1 to <4 x i32> %11 = add <4 x i32> %5, %9 %12 = add <4 x i32> %6, %10 %offset.idx.2 = add nuw i64 %index, 17 %13 = getelementptr inbounds [601 x i8], ptr @_has_s, i64 0, i64 %offset.idx.2 %wide.load.2 = load <4 x i8>, ptr %13, align 1, !tbaa !9 %14 = getelementptr inbounds i8, ptr %13, i64 4 %wide.load24.2 = load <4 x i8>, ptr %14, align 1, !tbaa !9 %15 = zext <4 x i8> %wide.load.2 to <4 x i32> %16 = zext <4 x i8> %wide.load24.2 to <4 x i32> %17 = add <4 x i32> %11, %15 %18 = add <4 x i32> %12, %16 %index.next.2 = add nuw nsw i64 %index, 24 %19 = icmp eq i64 %index.next.2, 600 br i1 %19, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %18, %17 %20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 for.body: ; preds = %entry, %for.body %i.019 = phi i32 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %21 = load i32, ptr %s, align 4, !tbaa !5 %idxprom = sext i32 %21 to i64 %arrayidx = getelementptr inbounds [601 x i8], ptr @_has_s, i64 0, i64 %idxprom store i8 1, ptr %arrayidx, align 1, !tbaa !9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 %inc = add nuw nsw i32 %i.019, 1 %22 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %22 br i1 %cmp, label %for.body, label %vector.body.preheader, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"_Bool", !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}
#include <stdio.h> int main(void){ int N,K,i,j,k,a[51],max=0,sum=0; scanf("%d %d",&N,&K); for(i=0;i<N;i++){scanf("%d",&a[i]);} for(i=0;i<K;i++){ for(j=0;j<N;j++){if(max<a[j]){max=a[j];k=j;}} sum+=max; a[k]=0; max=0; } printf("%d",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164019/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a = alloca [51 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %a) #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 %cmp33 = icmp sgt i32 %0, 0 br i1 %cmp33, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %13, %for.body ] %1 = load i32, ptr %K, align 4, !tbaa !5 %cmp341 = icmp sgt i32 %1, 0 br i1 %cmp341, label %for.cond5.preheader.lr.ph, label %for.end20 for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %cmp635 = icmp sgt i32 %.lcssa, 0 br i1 %cmp635, label %for.cond5.preheader.us.preheader, label %for.cond5.preheader.lr.ph.split for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph %wide.trip.count = zext i32 %.lcssa to i64 %xtraiter = and i64 %wide.trip.count, 3 %2 = icmp ult i32 %.lcssa, 4 %unroll_iter = and i64 %wide.trip.count, 4294967292 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond5.preheader.us for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.end15_crit_edge.us %sum.044.us = phi i32 [ %add.us, %for.cond5.for.end15_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ] %k.043.us = phi i32 [ %spec.select.us.lcssa, %for.cond5.for.end15_crit_edge.us ], [ undef, %for.cond5.preheader.us.preheader ] %i.142.us = phi i32 [ %inc19.us, %for.cond5.for.end15_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ] br i1 %2, label %for.cond5.for.end15_crit_edge.us.unr-lcssa, label %for.body7.us for.body7.us: ; preds = %for.cond5.preheader.us, %for.body7.us %indvars.iv49 = phi i64 [ %indvars.iv.next50.3, %for.body7.us ], [ 0, %for.cond5.preheader.us ] %max.138.us = phi i32 [ %spec.select32.us.3, %for.body7.us ], [ 0, %for.cond5.preheader.us ] %k.137.us = phi i32 [ %spec.select.us.3, %for.body7.us ], [ %k.043.us, %for.cond5.preheader.us ] %niter = phi i64 [ %niter.next.3, %for.body7.us ], [ 0, %for.cond5.preheader.us ] %arrayidx9.us = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %indvars.iv49 %3 = load i32, ptr %arrayidx9.us, align 16, !tbaa !5 %cmp10.us = icmp slt i32 %max.138.us, %3 %4 = trunc i64 %indvars.iv49 to i32 %spec.select.us = select i1 %cmp10.us, i32 %4, i32 %k.137.us %spec.select32.us = call i32 @llvm.smax.i32(i32 %max.138.us, i32 %3) %indvars.iv.next50 = or i64 %indvars.iv49, 1 %arrayidx9.us.1 = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %indvars.iv.next50 %5 = load i32, ptr %arrayidx9.us.1, align 4, !tbaa !5 %cmp10.us.1 = icmp slt i32 %spec.select32.us, %5 %6 = trunc i64 %indvars.iv.next50 to i32 %spec.select.us.1 = select i1 %cmp10.us.1, i32 %6, i32 %spec.select.us %spec.select32.us.1 = call i32 @llvm.smax.i32(i32 %spec.select32.us, i32 %5) %indvars.iv.next50.1 = or i64 %indvars.iv49, 2 %arrayidx9.us.2 = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %indvars.iv.next50.1 %7 = load i32, ptr %arrayidx9.us.2, align 8, !tbaa !5 %cmp10.us.2 = icmp slt i32 %spec.select32.us.1, %7 %8 = trunc i64 %indvars.iv.next50.1 to i32 %spec.select.us.2 = select i1 %cmp10.us.2, i32 %8, i32 %spec.select.us.1 %spec.select32.us.2 = call i32 @llvm.smax.i32(i32 %spec.select32.us.1, i32 %7) %indvars.iv.next50.2 = or i64 %indvars.iv49, 3 %arrayidx9.us.3 = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %indvars.iv.next50.2 %9 = load i32, ptr %arrayidx9.us.3, align 4, !tbaa !5 %cmp10.us.3 = icmp slt i32 %spec.select32.us.2, %9 %10 = trunc i64 %indvars.iv.next50.2 to i32 %spec.select.us.3 = select i1 %cmp10.us.3, i32 %10, i32 %spec.select.us.2 %spec.select32.us.3 = call i32 @llvm.smax.i32(i32 %spec.select32.us.2, i32 %9) %indvars.iv.next50.3 = add nuw nsw i64 %indvars.iv49, 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.cond5.for.end15_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !9 for.cond5.for.end15_crit_edge.us.unr-lcssa: ; preds = %for.body7.us, %for.cond5.preheader.us %spec.select.us.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us ], [ %spec.select.us.3, %for.body7.us ] %spec.select32.us.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us ], [ %spec.select32.us.3, %for.body7.us ] %indvars.iv49.unr = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next50.3, %for.body7.us ] %max.138.us.unr = phi i32 [ 0, %for.cond5.preheader.us ], [ %spec.select32.us.3, %for.body7.us ] %k.137.us.unr = phi i32 [ %k.043.us, %for.cond5.preheader.us ], [ %spec.select.us.3, %for.body7.us ] br i1 %lcmp.mod.not, label %for.cond5.for.end15_crit_edge.us, label %for.body7.us.epil for.body7.us.epil: ; preds = %for.cond5.for.end15_crit_edge.us.unr-lcssa, %for.body7.us.epil %indvars.iv49.epil = phi i64 [ %indvars.iv.next50.epil, %for.body7.us.epil ], [ %indvars.iv49.unr, %for.cond5.for.end15_crit_edge.us.unr-lcssa ] %max.138.us.epil = phi i32 [ %spec.select32.us.epil, %for.body7.us.epil ], [ %max.138.us.unr, %for.cond5.for.end15_crit_edge.us.unr-lcssa ] %k.137.us.epil = phi i32 [ %spec.select.us.epil, %for.body7.us.epil ], [ %k.137.us.unr, %for.cond5.for.end15_crit_edge.us.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body7.us.epil ], [ 0, %for.cond5.for.end15_crit_edge.us.unr-lcssa ] %arrayidx9.us.epil = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %indvars.iv49.epil %11 = load i32, ptr %arrayidx9.us.epil, align 4, !tbaa !5 %cmp10.us.epil = icmp slt i32 %max.138.us.epil, %11 %12 = trunc i64 %indvars.iv49.epil to i32 %spec.select.us.epil = select i1 %cmp10.us.epil, i32 %12, i32 %k.137.us.epil %spec.select32.us.epil = call i32 @llvm.smax.i32(i32 %max.138.us.epil, i32 %11) %indvars.iv.next50.epil = add nuw nsw i64 %indvars.iv49.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.cond5.for.end15_crit_edge.us, label %for.body7.us.epil, !llvm.loop !11 for.cond5.for.end15_crit_edge.us: ; preds = %for.body7.us.epil, %for.cond5.for.end15_crit_edge.us.unr-lcssa %spec.select.us.lcssa = phi i32 [ %spec.select.us.lcssa.ph, %for.cond5.for.end15_crit_edge.us.unr-lcssa ], [ %spec.select.us.epil, %for.body7.us.epil ] %spec.select32.us.lcssa = phi i32 [ %spec.select32.us.lcssa.ph, %for.cond5.for.end15_crit_edge.us.unr-lcssa ], [ %spec.select32.us.epil, %for.body7.us.epil ] %add.us = add nsw i32 %spec.select32.us.lcssa, %sum.044.us %idxprom16.us = sext i32 %spec.select.us.lcssa to i64 %arrayidx17.us = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %idxprom16.us store i32 0, ptr %arrayidx17.us, align 4, !tbaa !5 %inc19.us = add nuw nsw i32 %i.142.us, 1 %exitcond52.not = icmp eq i32 %inc19.us, %1 br i1 %exitcond52.not, label %for.end20, label %for.cond5.preheader.us, !llvm.loop !13 for.cond5.preheader.lr.ph.split: ; preds = %for.cond5.preheader.lr.ph store i32 0, ptr %a, align 16, !tbaa !5 br label %for.end20 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [51 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %13 = load i32, ptr %N, align 4, !tbaa !5 %14 = sext i32 %13 to i64 %cmp = icmp slt i64 %indvars.iv.next, %14 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !14 for.end20: ; preds = %for.cond5.for.end15_crit_edge.us, %for.cond5.preheader.lr.ph.split, %for.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %for.cond5.preheader.lr.ph.split ], [ %add.us, %for.cond5.for.end15_crit_edge.us ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %a) #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 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main(void) { int n, k, i, j, nonsense, ans = 0, l[50]; scanf("%d %d", &n, &k); for(i = 0; i < n; i++) { scanf("%d", &l[i]); } for(i = 0; i < n; i++) { for(j = i+1; j < n; j++) { if(l[i] < l[j]) { nonsense = l[i]; l[i] = l[j]; l[j] = nonsense; } } } for(i = 0; i < k; i++) { ans += l[i]; } printf("%d", ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164062/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164062/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %l = alloca [50 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %l) #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 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.cond27.preheader for.cond2.preheader: ; preds = %for.body %cmp358 = icmp sgt i32 %2, 0 br i1 %cmp358, label %for.body4.preheader, label %for.cond27.preheader for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count74 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [50 x i32], ptr %l, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2.loopexit: ; preds = %for.inc21, %for.body4 %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74 br i1 %exitcond75.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11 for.cond27.preheader: ; preds = %for.cond2.loopexit, %entry, %for.cond2.preheader %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp2860 = icmp sgt i32 %4, 0 br i1 %cmp2860, label %for.body29.preheader, label %for.end35 for.body29.preheader: ; preds = %for.cond27.preheader %wide.trip.count79 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body29.preheader85, label %vector.ph vector.ph: ; preds = %for.body29.preheader %n.vec = and i64 %wide.trip.count79, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi83 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %5 = getelementptr inbounds [50 x i32], ptr %l, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 %wide.load84 = load <4 x i32>, ptr %6, align 16, !tbaa !5 %7 = add <4 x i32> %wide.load, %vec.phi %8 = add <4 x i32> %wide.load84, %vec.phi83 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count79 br i1 %cmp.n, label %for.end35, label %for.body29.preheader85 for.body29.preheader85: ; preds = %for.body29.preheader, %middle.block %indvars.iv76.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ] %ans.062.ph = phi i32 [ 0, %for.body29.preheader ], [ %10, %middle.block ] br label %for.body29 for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit %indvars.iv71 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next72, %for.cond2.loopexit ] %indvars.iv66 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next67, %for.cond2.loopexit ] %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %cmp656 = icmp ult i64 %indvars.iv.next72, %1 br i1 %cmp656, label %for.body7.lr.ph, label %for.cond2.loopexit for.body7.lr.ph: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds [50 x i32], ptr %l, i64 0, i64 %indvars.iv71 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc21 %indvars.iv68 = phi i64 [ %indvars.iv66, %for.body7.lr.ph ], [ %indvars.iv.next69, %for.inc21 ] %11 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [50 x i32], ptr %l, i64 0, i64 %indvars.iv68 %12 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp slt i32 %11, %12 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %for.body7 store i32 %12, ptr %arrayidx9, align 4, !tbaa !5 store i32 %11, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count74 br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !15 for.body29: ; preds = %for.body29.preheader85, %for.body29 %indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body29 ], [ %indvars.iv76.ph, %for.body29.preheader85 ] %ans.062 = phi i32 [ %add32, %for.body29 ], [ %ans.062.ph, %for.body29.preheader85 ] %arrayidx31 = getelementptr inbounds [50 x i32], ptr %l, i64 0, i64 %indvars.iv76 %13 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %add32 = add nsw i32 %13, %ans.062 %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79 br i1 %exitcond80.not, label %for.end35, label %for.body29, !llvm.loop !16 for.end35: ; preds = %for.body29, %middle.block, %for.cond27.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ %10, %middle.block ], [ %add32, %for.body29 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %l) #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 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !14, !13}
#include <stdio.h> #include <stdlib.h> //降順 int compare(const void *a, const void *b){ return *(int *)b - *(int *)a; } int main(){ int N, K; int l[60] = {}; int l_tot = 0; scanf("%d%d", &N, &K); for(int i = 0; i < N; i++){ scanf("%d", &l[i]); } qsort(l, N, sizeof(int), compare); for(int i = 0; i < K; i++){ l_tot += l[i]; } printf("%d\n", l_tot); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164105/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 %K = alloca i32, align 4 %l = alloca [60 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #7 call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %l) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(240) %l, i8 0, i64 240, i1 false) %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 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %9, %for.body ] call void @qsort(ptr noundef nonnull %l, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #7 %1 = load i32, ptr %K, align 4, !tbaa !5 %cmp421 = icmp sgt i32 %1, 0 br i1 %cmp421, label %for.body7.preheader, label %for.cond.cleanup6 for.body7.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %1 to i64 %min.iters.check = icmp ult i32 %1, 8 br i1 %min.iters.check, label %for.body7.preheader32, label %vector.ph vector.ph: ; preds = %for.body7.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %vec.phi30 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ] %2 = getelementptr inbounds [60 x i32], ptr %l, 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.load31 = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = add <4 x i32> %wide.load, %vec.phi %5 = add <4 x i32> %wide.load31, %vec.phi30 %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 %bin.rdx = add <4 x i32> %5, %4 %7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup6, label %for.body7.preheader32 for.body7.preheader32: ; preds = %for.body7.preheader, %middle.block %indvars.iv27.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ] %l_tot.022.ph = phi i32 [ 0, %for.body7.preheader ], [ %7, %middle.block ] br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [60 x i32], ptr %l, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13 for.cond.cleanup6: ; preds = %for.body7, %middle.block, %for.cond.cleanup %l_tot.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %7, %middle.block ], [ %add, %for.body7 ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %l_tot.0.lcssa) call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 ret i32 0 for.body7: ; preds = %for.body7.preheader32, %for.body7 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ %indvars.iv27.ph, %for.body7.preheader32 ] %l_tot.022 = phi i32 [ %add, %for.body7 ], [ %l_tot.022.ph, %for.body7.preheader32 ] %arrayidx9 = getelementptr inbounds [60 x i32], ptr %l, i64 0, i64 %indvars.iv27 %10 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %add = add nsw i32 %10, %l_tot.022 %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1 %exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include <stdio.h> int main(void) { int n,k,i,j,sum=0,x; scanf("%d%d",&n,&k); int tot[n]; for(i=0;i<n;i++) scanf("%d",&tot[i]); for(i=0;i<n-1;i++) for(j=n-1;j>i;j--) if(tot[j]>tot[j-1]) { x=tot[j]; tot[j]=tot[j-1]; tot[j-1]=x; } for(i=0;i<k;i++) sum+=tot[i]; printf("%d",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164156/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164156/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %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 %cmp56 = icmp sgt i32 %3, 0 br i1 %cmp56, label %for.body, label %for.cond30.preheader for.cond2.preheader: ; preds = %for.body %cmp359 = icmp sgt i32 %6, 1 br i1 %cmp359, label %for.cond6.preheader.preheader, label %for.cond30.preheader for.cond6.preheader.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %6, -1 %4 = zext i32 %6 to i64 %5 = add nsw i64 %4, -1 %wide.trip.count = zext i32 %sub to i64 %arrayidx10.phi.trans.insert = getelementptr inbounds i32, ptr %vla, i64 %5 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds 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 %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.cond2.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.inc27 %indvars.iv70 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next71, %for.inc27 ] %.pre = load i32, ptr %arrayidx10.phi.trans.insert, align 4, !tbaa !5 br label %for.body8 for.cond30.preheader: ; preds = %for.inc27, %entry, %for.cond2.preheader %8 = load i32, ptr %k, align 4, !tbaa !5 %cmp3161 = icmp sgt i32 %8, 0 br i1 %cmp3161, label %for.body32.preheader, label %for.end37 for.body32.preheader: ; preds = %for.cond30.preheader %wide.trip.count76 = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body32.preheader82, label %vector.ph vector.ph: ; preds = %for.body32.preheader %n.vec = and i64 %wide.trip.count76, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.phi80 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ] %9 = getelementptr inbounds i32, ptr %vla, i64 %index %wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load81 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = add <4 x i32> %wide.load, %vec.phi %12 = add <4 x i32> %wide.load81, %vec.phi80 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count76 br i1 %cmp.n, label %for.end37, label %for.body32.preheader82 for.body32.preheader82: ; preds = %for.body32.preheader, %middle.block %indvars.iv73.ph = phi i64 [ 0, %for.body32.preheader ], [ %n.vec, %middle.block ] %sum.062.ph = phi i32 [ 0, %for.body32.preheader ], [ %14, %middle.block ] br label %for.body32 for.body8: ; preds = %for.cond6.preheader, %for.inc25 %15 = phi i32 [ %.pre, %for.cond6.preheader ], [ %17, %for.inc25 ] %indvars.iv67 = phi i64 [ %5, %for.cond6.preheader ], [ %indvars.iv.next68, %for.inc25 ] %indvars.iv.next68 = add nsw i64 %indvars.iv67, -1 %arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next68 %16 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %15, %16 br i1 %cmp14, label %if.then, label %for.inc25 if.then: ; preds = %for.body8 %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv67 store i32 %16, ptr %arrayidx10, align 4, !tbaa !5 store i32 %15, ptr %arrayidx13, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body8, %if.then %17 = phi i32 [ %16, %for.body8 ], [ %15, %if.then ] %cmp7 = icmp sgt i64 %indvars.iv.next68, %indvars.iv70 br i1 %cmp7, label %for.body8, label %for.inc27, !llvm.loop !14 for.inc27: ; preds = %for.inc25 %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count br i1 %exitcond.not, label %for.cond30.preheader, label %for.cond6.preheader, !llvm.loop !15 for.body32: ; preds = %for.body32.preheader82, %for.body32 %indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body32 ], [ %indvars.iv73.ph, %for.body32.preheader82 ] %sum.062 = phi i32 [ %add, %for.body32 ], [ %sum.062.ph, %for.body32.preheader82 ] %arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv73 %18 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %18, %sum.062 %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 %exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76 br i1 %exitcond77.not, label %for.end37, label %for.body32, !llvm.loop !16 for.end37: ; preds = %for.body32, %middle.block, %for.cond30.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond30.preheader ], [ %14, %middle.block ], [ %add, %for.body32 ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !13, !12}
#include <stdio.h> int main() {int t; scanf("%d", &t); while (t--) { int sum = 1, ans = 1, s,no=1; scanf("%d", &s); while (sum < s) {if(s-sum>=no+2){ ans++;no+=2;sum+=no;} else { ans++;no++;sum+=no;} } printf("%d\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1642/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1642/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %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.end11, label %while.body while.body: ; preds = %entry, %while.end call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %1 = load i32, ptr %s, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %1, 1 br i1 %cmp21, label %while.body3, label %while.end while.body3: ; preds = %while.body, %while.body3 %no.024 = phi i32 [ %no.1, %while.body3 ], [ 1, %while.body ] %ans.023 = phi i32 [ %ans.1, %while.body3 ], [ 1, %while.body ] %sum.022 = phi i32 [ %sum.1, %while.body3 ], [ 1, %while.body ] %sub = sub nsw i32 %1, %sum.022 %add = add nsw i32 %no.024, 2 %cmp4.not = icmp slt i32 %sub, %add %inc8 = add nsw i32 %no.024, 1 %no.1 = select i1 %cmp4.not, i32 %inc8, i32 %add %ans.1 = add nuw nsw i32 %ans.023, 1 %sum.1 = add nsw i32 %no.1, %sum.022 %cmp = icmp slt i32 %sum.1, %1 br i1 %cmp, label %while.body3, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %ans.0.lcssa = phi i32 [ 1, %while.body ], [ %ans.1, %while.body3 ] %call10 = 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 %s) #3 %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.end11, label %while.body, !llvm.loop !11 while.end11: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define ll long long #define max(p,q)((p)>(q)?(p):(q)) #define MOD 1000000007 #define add(x,k)(x=(x+(t)*(k))%MOD) ll dp[60][60][5000]; //dp[i][j][k]=i番目までみて、j個未確定で、奇妙さkが確定 int main(){ int n,kk; scanf("%d%d",&n,&kk); dp[0][0][0]=1; for(int i=0;i<n;i++)for(int j=0;j<=i;j++)for(int k=0;k<1300;k++){ ll t=dp[i][j][k]; //自分同士で結ぶ add(dp[i+1][j][k+2*j],1); //両方使う if(j)add(dp[i+1][j-1][k+2*(j-1)],j*j); //片方使う if(j)add(dp[i+1][j][k+2*j],2*j); //使わない add(dp[i+1][j+1][k+2*(j+1)],1); } printf("%lld",dp[n][0][kk]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164242/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164242/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @dp = dso_local local_unnamed_addr global [60 x [60 x [5000 x i64]]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %kk = 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 %kk) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %kk) store i64 1, ptr @dp, align 16, !tbaa !5 %0 = load i32, ptr %n, align 4, !tbaa !9 %cmp168 = icmp sgt i32 %0, 0 br i1 %cmp168, label %for.cond1.preheader.preheader, label %for.cond.cleanup for.cond1.preheader.preheader: ; preds = %entry %wide.trip.count198 = zext i32 %0 to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond.cleanup3 %indvars.iv193 = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvars.iv.next194, %for.cond.cleanup3 ] %indvars.iv191 = phi i64 [ 1, %for.cond1.preheader.preheader ], [ %indvars.iv.next192, %for.cond.cleanup3 ] %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1 br label %for.cond5.preheader for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry %idxprom113 = sext i32 %0 to i64 %arrayidx114 = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %idxprom113 %1 = load i32, ptr %kk, align 4, !tbaa !9 %idxprom116 = sext i32 %1 to i64 %arrayidx117 = getelementptr inbounds [5000 x i64], ptr %arrayidx114, i64 0, i64 %idxprom116 %2 = load i64, ptr %arrayidx117, align 8, !tbaa !5 %call118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kk) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.cond5.preheader: ; preds = %for.cond1.preheader, %for.cond.cleanup7 %indvars.iv181 = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next182, %for.cond.cleanup7 ] %3 = shl nuw nsw i64 %indvars.iv181, 1 %tobool.not = icmp eq i64 %indvars.iv181, 0 %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1 %4 = shl nuw nsw i64 %indvars.iv.next182, 1 %5 = add nsw i64 %indvars.iv181, -1 %6 = mul nsw i64 %indvars.iv181, %indvars.iv181 %conv = and i64 %6, 4294967295 br i1 %tobool.not, label %for.body8.us, label %for.body8.preheader for.body8.preheader: ; preds = %for.cond5.preheader %7 = trunc i64 %5 to i32 %mul37 = shl nsw i32 %7, 1 %8 = sext i32 %mul37 to i64 br label %for.body8 for.body8.us: ; preds = %for.cond5.preheader, %for.body8.us %indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.body8.us ], [ 0, %for.cond5.preheader ] %arrayidx12.us = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv193, i64 0, i64 %indvars.iv175 %9 = load i64, ptr %arrayidx12.us, align 8, !tbaa !5 %10 = add nuw nsw i64 %indvars.iv175, %3 %arrayidx19.us = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next194, i64 0, i64 %10 %11 = load i64, ptr %arrayidx19.us, align 8, !tbaa !5 %add21.us = add nsw i64 %11, %9 %rem.us = srem i64 %add21.us, 1000000007 store i64 %rem.us, ptr %arrayidx19.us, align 8, !tbaa !5 %12 = add nuw nsw i64 %indvars.iv175, %4 %arrayidx92.us = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next194, i64 %indvars.iv.next182, i64 %12 %13 = load i64, ptr %arrayidx92.us, align 8, !tbaa !5 %add94.us = add nsw i64 %13, %9 %rem95.us = srem i64 %add94.us, 1000000007 store i64 %rem95.us, ptr %arrayidx92.us, align 8, !tbaa !5 %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %exitcond180.not = icmp eq i64 %indvars.iv.next176, 1300 br i1 %exitcond180.not, label %for.cond.cleanup7, label %for.body8.us, !llvm.loop !11 for.cond.cleanup3: ; preds = %for.cond.cleanup7 %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1 %exitcond199.not = icmp eq i64 %indvars.iv.next194, %wide.trip.count198 br i1 %exitcond199.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !13 for.cond.cleanup7: ; preds = %for.body8, %for.body8.us %exitcond190.not = icmp eq i64 %indvars.iv.next182, %indvars.iv191 br i1 %exitcond190.not, label %for.cond.cleanup3, label %for.cond5.preheader, !llvm.loop !14 for.body8: ; preds = %for.body8.preheader, %for.body8 %indvars.iv = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next, %for.body8 ] %arrayidx12 = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv193, i64 %indvars.iv181, i64 %indvars.iv %14 = load i64, ptr %arrayidx12, align 8, !tbaa !5 %15 = add nuw i64 %indvars.iv, %3 %idxprom18 = and i64 %15, 4294967295 %arrayidx19 = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next194, i64 %indvars.iv181, i64 %idxprom18 %16 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %add21 = add nsw i64 %16, %14 %rem = srem i64 %add21, 1000000007 store i64 %rem, ptr %arrayidx19, align 8, !tbaa !5 %17 = add nsw i64 %indvars.iv, %8 %arrayidx40 = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next194, i64 %5, i64 %17 %18 = load i64, ptr %arrayidx40, align 8, !tbaa !5 %mul42 = mul nsw i64 %14, %conv %add43 = add nsw i64 %18, %mul42 %rem44 = srem i64 %add43, 1000000007 store i64 %rem44, ptr %arrayidx40, align 8, !tbaa !5 %19 = load i64, ptr %arrayidx19, align 8, !tbaa !5 %mul69 = mul nsw i64 %14, %3 %add70 = add nsw i64 %19, %mul69 %rem71 = srem i64 %add70, 1000000007 store i64 %rem71, ptr %arrayidx19, align 8, !tbaa !5 %20 = add nuw i64 %indvars.iv, %4 %idxprom91 = and i64 %20, 4294967295 %arrayidx92 = getelementptr inbounds [60 x [60 x [5000 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next194, i64 %indvars.iv.next182, i64 %idxprom91 %21 = load i64, ptr %arrayidx92, align 8, !tbaa !5 %add94 = add nsw i64 %21, %14 %rem95 = srem i64 %add94, 1000000007 store i64 %rem95, ptr %arrayidx92, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 1300 br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define FOR(n) for(int i=0;i<n;i++) #define FORJ(n) for(int j=0;j<n;j++) #define PRN(n) printf("%d\n",n) #define PRF(n) printf("%lf\n",n) #define PRL(n) printf("%lld\n",n) #define PRS(s) printf("%s\n",s) #define PRC(c) printf("%c",c) #define INF 10000000000 #define mod 1000000007 #define X 1000000 typedef long long int ll; ll finv[X]; ll fac[X]; ll inv[X]; ll u(const void *a, const void *b){return *(ll*)a-*(ll*)b;} ll d(const void *a, const void *b){return *(ll*)b-*(ll*)a;} ll z(ll a){ if(a<0)return -a; return a; } ll min(ll a,ll b){ if(a>b)return b; return a; } ll max(ll a,ll b){ if(a>b)return a; return b; } ll gcd(ll a,ll b){ if(!b)return a; return gcd(b,a%b); } ll lcm(ll a,ll b){return a*b/gcd(a,b);} int kt(ll a){ int sum=0; while(a){ a/=10; sum++; } return sum; } int ks(ll a){ int sum=0; while(a){ sum+=a%10; a/=10; } return sum; } ll nCr(int n,int k){ fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for (int i=2;i<X;i++){ fac[i]=fac[i-1]*i%mod; inv[i]=mod-inv[mod%i]*(mod/i)%mod; finv[i]=finv[i-1]*inv[i]%mod; } return fac[n] * (finv[k] * finv[n - k] % mod) % mod; } int main(void){ int a; scanf("%d",&a); FOR(100000){ if(i*100<=a&&a<=i*105){ PRN(1); return 0; } } PRN(0); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164286/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164286/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @fac = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @finv = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @inv = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @u(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i64 @d(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %sub = sub nsw i64 %0, %1 ret i64 %sub } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @z(i64 noundef %a) local_unnamed_addr #1 { entry: %retval.0 = tail call i64 @llvm.abs.i64(i64 %a, i1 true) ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %b.a } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i64 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %if.end ] 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 #2 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %b.tr6.i = phi i64 [ %rem.i, %if.end.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %if.end.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.end.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %if.end.i ] %mul = mul nsw i64 %b, %a %div = sdiv i64 %mul, %a.tr.lcssa.i ret i64 %div } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @kt(i64 noundef %a) local_unnamed_addr #2 { entry: %tobool.not3 = icmp eq i64 %a, 0 br i1 %tobool.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %sum.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %a.addr.04 = phi i64 [ %div, %while.body ], [ %a, %entry ] %div = sdiv i64 %a.addr.04, 10 %inc = add nuw nsw i32 %sum.05, 1 %a.addr.04.off = add i64 %a.addr.04, 9 %tobool.not = icmp ult i64 %a.addr.04.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %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) #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 @ks(i64 noundef %a) local_unnamed_addr #2 { entry: %tobool.not5 = icmp eq i64 %a, 0 br i1 %tobool.not5, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %sum.07 = phi i32 [ %conv1, %while.body ], [ 0, %entry ] %a.addr.06 = phi i64 [ %div, %while.body ], [ %a, %entry ] %rem = srem i64 %a.addr.06, 10 %0 = trunc i64 %rem to i32 %conv1 = add i32 %sum.07, %0 %div = sdiv i64 %a.addr.06, 10 %a.addr.06.off = add i64 %a.addr.06, 9 %tobool.not = icmp ult i64 %a.addr.06.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %conv1, %while.body ] ret i32 %sum.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @nCr(i32 noundef %n, i32 noundef %k) local_unnamed_addr #4 { entry: store i64 1, ptr getelementptr inbounds ([1000000 x i64], ptr @fac, i64 0, i64 1), align 8, !tbaa !5 store i64 1, ptr @fac, align 16, !tbaa !5 store i64 1, ptr getelementptr inbounds ([1000000 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5 store i64 1, ptr @finv, align 16, !tbaa !5 store i64 1, ptr getelementptr inbounds ([1000000 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5 br label %for.body for.cond.cleanup: ; preds = %for.body %idxprom21 = sext i32 %n to i64 %arrayidx22 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %idxprom21 %0 = load i64, ptr %arrayidx22, align 8, !tbaa !5 %idxprom23 = sext i32 %k to i64 %arrayidx24 = getelementptr inbounds [1000000 x i64], ptr @finv, i64 0, i64 %idxprom23 %1 = load i64, ptr %arrayidx24, align 8, !tbaa !5 %sub25 = sub nsw i32 %n, %k %idxprom26 = sext i32 %sub25 to i64 %arrayidx27 = getelementptr inbounds [1000000 x i64], ptr @finv, i64 0, i64 %idxprom26 %2 = load i64, ptr %arrayidx27, align 8, !tbaa !5 %mul28 = mul nsw i64 %2, %1 %rem29 = srem i64 %mul28, 1000000007 %mul30 = mul nsw i64 %rem29, %0 %rem31 = srem i64 %mul30, 1000000007 ret i64 %rem31 for.body: ; preds = %entry, %for.body %3 = phi i64 [ 1, %entry ], [ %rem18, %for.body ] %4 = phi i64 [ 1, %entry ], [ %rem, %for.body ] %indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.body ] %mul = mul nsw i64 %4, %indvars.iv %rem = srem i64 %mul, 1000000007 %arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %indvars.iv store i64 %rem, ptr %arrayidx2, align 8, !tbaa !5 %5 = trunc i64 %indvars.iv to i32 %rem3 = urem i32 1000000007, %5 %idxprom4 = zext i32 %rem3 to i64 %arrayidx5 = getelementptr inbounds [1000000 x i64], ptr @inv, i64 0, i64 %idxprom4 %6 = load i64, ptr %arrayidx5, align 8, !tbaa !5 %div = udiv i32 1000000007, %5 %conv6 = zext i32 %div to i64 %mul7 = mul nsw i64 %6, %conv6 %rem8 = srem i64 %mul7, 1000000007 %sub9 = sub nsw i64 1000000007, %rem8 %arrayidx11 = getelementptr inbounds [1000000 x i64], ptr @inv, i64 0, i64 %indvars.iv store i64 %sub9, ptr %arrayidx11, align 8, !tbaa !5 %mul17 = mul nuw nsw i64 %sub9, %3 %rem18 = urem i64 %mul17, 1000000007 %arrayidx20 = getelementptr inbounds [1000000 x i64], ptr @finv, i64 0, i64 %indvars.iv store i64 %rem18, ptr %arrayidx20, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 1000000 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !13 br label %for.body for.cond: ; preds = %for.body %inc = or i32 %i.010, 1 %mul.1 = mul nuw nsw i32 %inc, 100 %cmp1.not.1 = icmp sgt i32 %mul.1, %0 %mul2.1 = mul nuw nsw i32 %inc, 105 %cmp3.not.1 = icmp sgt i32 %0, %mul2.1 %or.cond.1 = select i1 %cmp1.not.1, i1 true, i1 %cmp3.not.1 br i1 %or.cond.1, label %for.cond.1, label %cleanup6 for.cond.1: ; preds = %for.cond %inc.1 = add nuw nsw i32 %i.010, 2 %exitcond.1 = icmp eq i32 %inc.1, 100000 br i1 %exitcond.1, label %cleanup6, label %for.body, !llvm.loop !15 for.body: ; preds = %for.cond.1, %entry %i.010 = phi i32 [ 0, %entry ], [ %inc.1, %for.cond.1 ] %mul = mul nuw nsw i32 %i.010, 100 %cmp1.not = icmp sgt i32 %mul, %0 %mul2 = mul nuw nsw i32 %i.010, 105 %cmp3.not = icmp sgt i32 %0, %mul2 %or.cond = select i1 %cmp1.not, i1 true, i1 %cmp3.not br i1 %or.cond, label %for.cond, label %cleanup6 cleanup6: ; preds = %for.cond.1, %for.cond, %for.body %.sink = phi i32 [ 1, %for.body ], [ 1, %for.cond ], [ 0, %for.cond.1 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #7 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 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 = { nofree norecurse 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 #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = !{!14, !14, i64 0} !14 = !{!"int", !7, i64 0} !15 = distinct !{!15, !10}
#include <stdio.h> int main() { int X; int i,j; int diff; int diff2; scanf("%d",&X); i=X/100; diff=X-100*i; diff2=0; for(int j=0; j<=5*i; j++) { if(diff==diff2++) { printf("1"); return 0; } } printf("0"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164329/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164329/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i32, ptr %X, align 4, !tbaa !5 %cmp.not15 = icmp slt i32 %0, -99 br i1 %cmp.not15, label %for.end, label %for.body for.body: ; preds = %entry %div = sdiv i32 %0, 100 %mul2 = mul nuw nsw i32 %div, 5 %mul.neg = mul nsw i32 %div, -100 %sub = add i32 %mul.neg, %0 %.not = icmp ugt i32 %sub, %mul2 br i1 %.not, label %for.end, label %cleanup7 for.end: ; preds = %for.body, %entry br label %cleanup7 cleanup7: ; preds = %for.body, %for.end %.sink = phi i32 [ 48, %for.end ], [ 49, %for.body ] %putchar = call i32 @putchar(i32 %.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> long long maxMy(long long a, long long b){ if(a > b){ return a; } else{ return b; } } long long DP[3001][3001][4]; long long Gift[3001][3001]; long long r,c,k; int main(){ scanf("%lld %lld %lld", &r,&c,&k); int i; for(i=0; i<=r; i++){ for(int j = 0;j <= c; j ++){ DP[i][j][0] = 0; DP[i][j][1] = 0; DP[i][j][2] = 0; DP[i][j][3] = 0; Gift[i][j] = 0; } } for(i = 0; i < k; i ++){ long long rt, ct, vt; scanf("%lld %lld %lld",&rt,&ct,&vt); Gift[rt][ct] = vt; } for(i=1; i<=r; i++){ for(int j = 1;j <= c; j ++){ DP[i][j][0] = maxMy(maxMy(maxMy(DP[i-1][j][0],DP[i-1][j][1]),maxMy(DP[i-1][j][2],DP[i-1][j][3])),DP[i][j-1][0]); DP[i][j][1] = DP[i][j-1][1]; DP[i][j][2] = DP[i][j-1][2]; DP[i][j][3] = DP[i][j-1][3]; DP[i][j][3] = maxMy(DP[i][j][3],DP[i][j][2] + Gift[i][j]); DP[i][j][2] = maxMy(DP[i][j][2],DP[i][j][1] + Gift[i][j]); DP[i][j][1] = maxMy(DP[i][j][1],DP[i][j][0] + Gift[i][j]); } } printf("%lld",maxMy(maxMy(DP[r][c][0],DP[r][c][1]),maxMy(DP[r][c][2],DP[r][c][3]))); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164372/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164372/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @r = dso_local global i64 0, align 8 @c = dso_local global i64 0, align 8 @k = dso_local global i64 0, align 8 @DP = dso_local local_unnamed_addr global [3001 x [3001 x [4 x i64]]] zeroinitializer, align 16 @Gift = dso_local local_unnamed_addr global [3001 x [3001 x i64]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @maxMy(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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %rt = alloca i64, align 8 %ct = alloca i64, align 8 %vt = alloca i64, align 8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @r, ptr noundef nonnull @c, ptr noundef nonnull @k) %0 = load i64, ptr @r, align 8, !tbaa !5 %cmp.not287 = icmp slt i64 %0, 0 br i1 %cmp.not287, label %for.cond32.preheader, label %for.cond2.preheader.lr.ph for.cond2.preheader.lr.ph: ; preds = %entry %1 = load i64, ptr @c, align 8, !tbaa !5 %cmp4.not284 = icmp slt i64 %1, 0 br i1 %cmp4.not284, label %for.cond32.preheader, label %for.cond2.preheader.preheader for.cond2.preheader.preheader: ; preds = %for.cond2.preheader.lr.ph %2 = shl i64 %1, 5 %3 = add i64 %2, 32 %4 = shl i64 %1, 3 %5 = add i64 %4, 8 %6 = add i64 %0, 1 %xtraiter = and i64 %6, 3 %7 = icmp ult i64 %0, 3 br i1 %7, label %for.cond32.preheader.loopexit.unr-lcssa, label %for.cond2.preheader.preheader.new for.cond2.preheader.preheader.new: ; preds = %for.cond2.preheader.preheader %unroll_iter = and i64 %6, -4 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader, %for.cond2.preheader.preheader.new %indvar = phi i64 [ 0, %for.cond2.preheader.preheader.new ], [ %indvar.next.3, %for.cond2.preheader ] %niter = phi i64 [ 0, %for.cond2.preheader.preheader.new ], [ %niter.next.3, %for.cond2.preheader ] %8 = mul nuw nsw i64 %indvar, 24008 %scevgep300 = getelementptr i8, ptr @Gift, i64 %8 %9 = mul nuw nsw i64 %indvar, 96032 %scevgep = getelementptr i8, ptr @DP, i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %3, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep300, i8 0, i64 %5, i1 false), !tbaa !5 %indvar.next = or i64 %indvar, 1 %10 = mul nuw nsw i64 %indvar.next, 24008 %scevgep300.1 = getelementptr i8, ptr @Gift, i64 %10 %11 = mul nuw nsw i64 %indvar.next, 96032 %scevgep.1 = getelementptr i8, ptr @DP, i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.1, i8 0, i64 %3, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep300.1, i8 0, i64 %5, i1 false), !tbaa !5 %indvar.next.1 = or i64 %indvar, 2 %12 = mul nuw nsw i64 %indvar.next.1, 24008 %scevgep300.2 = getelementptr i8, ptr @Gift, i64 %12 %13 = mul nuw nsw i64 %indvar.next.1, 96032 %scevgep.2 = getelementptr i8, ptr @DP, i64 %13 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.2, i8 0, i64 %3, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep300.2, i8 0, i64 %5, i1 false), !tbaa !5 %indvar.next.2 = or i64 %indvar, 3 %14 = mul nuw nsw i64 %indvar.next.2, 24008 %scevgep300.3 = getelementptr i8, ptr @Gift, i64 %14 %15 = mul nuw nsw i64 %indvar.next.2, 96032 %scevgep.3 = getelementptr i8, ptr @DP, i64 %15 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.3, i8 0, i64 %3, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep300.3, i8 0, i64 %5, i1 false), !tbaa !5 %indvar.next.3 = add nuw nsw i64 %indvar, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond32.preheader.loopexit.unr-lcssa, label %for.cond2.preheader, !llvm.loop !9 for.cond32.preheader.loopexit.unr-lcssa: ; preds = %for.cond2.preheader, %for.cond2.preheader.preheader %indvar.unr = phi i64 [ 0, %for.cond2.preheader.preheader ], [ %indvar.next.3, %for.cond2.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond32.preheader, label %for.cond2.preheader.epil for.cond2.preheader.epil: ; preds = %for.cond32.preheader.loopexit.unr-lcssa, %for.cond2.preheader.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond2.preheader.epil ], [ %indvar.unr, %for.cond32.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond2.preheader.epil ], [ 0, %for.cond32.preheader.loopexit.unr-lcssa ] %16 = mul nuw nsw i64 %indvar.epil, 24008 %scevgep300.epil = getelementptr i8, ptr @Gift, i64 %16 %17 = mul nuw nsw i64 %indvar.epil, 96032 %scevgep.epil = getelementptr i8, ptr @DP, i64 %17 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %3, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep300.epil, i8 0, i64 %5, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond32.preheader, label %for.cond2.preheader.epil, !llvm.loop !11 for.cond32.preheader: ; preds = %for.cond32.preheader.loopexit.unr-lcssa, %for.cond2.preheader.epil, %for.cond2.preheader.lr.ph, %entry %18 = load i64, ptr @k, align 8, !tbaa !5 %cmp34290 = icmp sgt i64 %18, 0 br i1 %cmp34290, label %for.body36, label %for.cond43.preheader for.cond43.preheader.loopexit: ; preds = %for.body36 %.pre = load i64, ptr @r, align 8, !tbaa !5 br label %for.cond43.preheader for.cond43.preheader: ; preds = %for.cond43.preheader.loopexit, %for.cond32.preheader %19 = phi i64 [ %.pre, %for.cond43.preheader.loopexit ], [ %0, %for.cond32.preheader ] %cmp45.not295 = icmp slt i64 %19, 1 %.pre322 = load i64, ptr @c, align 8, !tbaa !5 %cmp51.not292 = icmp slt i64 %.pre322, 1 %or.cond = select i1 %cmp45.not295, i1 true, i1 %cmp51.not292 br i1 %or.cond, label %for.end193, label %for.cond49.preheader for.body36: ; preds = %for.cond32.preheader, %for.body36 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body36 ], [ 0, %for.cond32.preheader ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %rt) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ct) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %vt) #6 %call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %rt, ptr noundef nonnull %ct, ptr noundef nonnull %vt) %20 = load i64, ptr %vt, align 8, !tbaa !5 %21 = load i64, ptr %rt, align 8, !tbaa !5 %22 = load i64, ptr %ct, align 8, !tbaa !5 %arrayidx39 = getelementptr inbounds [3001 x [3001 x i64]], ptr @Gift, i64 0, i64 %21, i64 %22 store i64 %20, ptr %arrayidx39, align 8, !tbaa !5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %vt) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ct) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %rt) #6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %23 = load i64, ptr @k, align 8, !tbaa !5 %cmp34 = icmp sgt i64 %23, %indvars.iv.next br i1 %cmp34, label %for.body36, label %for.cond43.preheader.loopexit, !llvm.loop !13 for.cond49.preheader: ; preds = %for.cond43.preheader, %for.cond49.for.cond.cleanup53_crit_edge %indvars.iv310 = phi i64 [ %indvars.iv.next311, %for.cond49.for.cond.cleanup53_crit_edge ], [ 1, %for.cond43.preheader ] %24 = add nsw i64 %indvars.iv310, -1 %arrayidx85.phi.trans.insert = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 0 %.pre318 = load i64, ptr %arrayidx85.phi.trans.insert, align 16, !tbaa !5 %arrayidx98.phi.trans.insert = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 0, i64 1 %.pre319 = load i64, ptr %arrayidx98.phi.trans.insert, align 8, !tbaa !5 %arrayidx109.phi.trans.insert = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 0, i64 2 %.pre320 = load i64, ptr %arrayidx109.phi.trans.insert, align 16, !tbaa !5 %arrayidx120.phi.trans.insert = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 0, i64 3 %.pre321 = load i64, ptr %arrayidx120.phi.trans.insert, align 8, !tbaa !5 br label %for.body54 for.cond49.for.cond.cleanup53_crit_edge: ; preds = %for.body54 %indvars.iv.next311 = add nuw nsw i64 %indvars.iv310, 1 %exitcond314 = icmp eq i64 %indvars.iv310, %19 br i1 %exitcond314, label %for.end193, label %for.cond49.preheader, !llvm.loop !14 for.body54: ; preds = %for.cond49.preheader, %for.body54 %25 = phi i64 [ %.pre321, %for.cond49.preheader ], [ %a.b.i278, %for.body54 ] %26 = phi i64 [ %.pre320, %for.cond49.preheader ], [ %a.b.i279, %for.body54 ] %27 = phi i64 [ %.pre319, %for.cond49.preheader ], [ %a.b.i280, %for.body54 ] %28 = phi i64 [ %.pre318, %for.cond49.preheader ], [ %a.b.i277, %for.body54 ] %indvars.iv305 = phi i64 [ 1, %for.cond49.preheader ], [ %indvars.iv.next306, %for.body54 ] %arrayidx58 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %24, i64 %indvars.iv305 %29 = load i64, ptr %arrayidx58, align 16, !tbaa !5 %arrayidx65 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %24, i64 %indvars.iv305, i64 1 %30 = load i64, ptr %arrayidx65, align 8, !tbaa !5 %a.b.i = call i64 @llvm.smax.i64(i64 %29, i64 %30) %arrayidx72 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %24, i64 %indvars.iv305, i64 2 %31 = load i64, ptr %arrayidx72, align 16, !tbaa !5 %arrayidx78 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %24, i64 %indvars.iv305, i64 3 %32 = load i64, ptr %arrayidx78, align 8, !tbaa !5 %a.b.i275 = call i64 @llvm.smax.i64(i64 %31, i64 %32) %a.b.i276 = call i64 @llvm.smax.i64(i64 %a.b.i, i64 %a.b.i275) %a.b.i277 = call i64 @llvm.smax.i64(i64 %a.b.i276, i64 %28) %arrayidx91 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 %indvars.iv305 store i64 %a.b.i277, ptr %arrayidx91, align 16, !tbaa !5 %arrayidx103 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 %indvars.iv305, i64 1 %arrayidx114 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 %indvars.iv305, i64 2 %arrayidx125 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %indvars.iv310, i64 %indvars.iv305, i64 3 %arrayidx139 = getelementptr inbounds [3001 x [3001 x i64]], ptr @Gift, i64 0, i64 %indvars.iv310, i64 %indvars.iv305 %33 = load i64, ptr %arrayidx139, align 8, !tbaa !5 %add = add nsw i64 %33, %26 %a.b.i278 = call i64 @llvm.smax.i64(i64 %25, i64 %add) store i64 %a.b.i278, ptr %arrayidx125, align 8, !tbaa !5 %add160 = add nsw i64 %33, %27 %a.b.i279 = call i64 @llvm.smax.i64(i64 %26, i64 %add160) store i64 %a.b.i279, ptr %arrayidx114, align 16, !tbaa !5 %add181 = add nsw i64 %33, %a.b.i277 %a.b.i280 = call i64 @llvm.smax.i64(i64 %27, i64 %add181) store i64 %a.b.i280, ptr %arrayidx103, align 8, !tbaa !5 %indvars.iv.next306 = add nuw nsw i64 %indvars.iv305, 1 %exitcond309 = icmp eq i64 %indvars.iv305, %.pre322 br i1 %exitcond309, label %for.cond49.for.cond.cleanup53_crit_edge, label %for.body54, !llvm.loop !15 for.end193: ; preds = %for.cond49.for.cond.cleanup53_crit_edge, %for.cond43.preheader %arrayidx195 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %19, i64 %.pre322 %34 = load i64, ptr %arrayidx195, align 16, !tbaa !5 %arrayidx199 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %19, i64 %.pre322, i64 1 %35 = load i64, ptr %arrayidx199, align 8, !tbaa !5 %a.b.i281 = call i64 @llvm.smax.i64(i64 %34, i64 %35) %arrayidx203 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %19, i64 %.pre322, i64 2 %36 = load i64, ptr %arrayidx203, align 16, !tbaa !5 %arrayidx206 = getelementptr inbounds [3001 x [3001 x [4 x i64]]], ptr @DP, i64 0, i64 %19, i64 %.pre322, i64 3 %37 = load i64, ptr %arrayidx206, align 8, !tbaa !5 %a.b.i282 = call i64 @llvm.smax.i64(i64 %36, i64 %37) %a.b.i283 = call i64 @llvm.smax.i64(i64 %a.b.i281, i64 %a.b.i282) %call209 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %a.b.i283) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 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) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> int main(void){ int N,A,B; int p[100]; int i,min; int under_A = 0,middle_AtoB,over_B = 0; scanf("%d",&N); scanf("%d %d",&A,&B); for(i = 0;i < N;i++){ scanf("%d",&p[i]); } for(i = 0;i < N;i++){ if(p[i] <= A){ under_A++; }else if(p[i] >= A + 1 && p[i] <= B){ middle_AtoB++; }else if(p[i] >= B + 1){ over_B++; } } if(under_A < middle_AtoB && under_A < over_B){ min = under_A; }else if(under_A > middle_AtoB && middle_AtoB < over_B){ min = middle_AtoB; }else if(over_B < middle_AtoB && under_A > over_B){ min = over_B; } printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164415/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164415/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca i32, align 4 %B = alloca i32, align 4 %p = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #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.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp75 = icmp sgt i32 %0, 0 br i1 %cmp75, label %for.body, label %for.end29 for.cond3.preheader: ; preds = %for.body %cmp477 = icmp sgt i32 %4, 0 br i1 %cmp477, label %for.body5.lr.ph, label %for.end29 for.body5.lr.ph: ; preds = %for.cond3.preheader %1 = load i32, ptr %A, align 4, !tbaa !5 %2 = load i32, ptr %B, align 4 %wide.trip.count = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %4, 1 br i1 %3, label %for.end29.loopexit.unr-lcssa, label %for.body5.lr.ph.new for.body5.lr.ph.new: ; preds = %for.body5.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body5 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.inc27.1, %for.body5.lr.ph.new %indvars.iv87 = phi i64 [ 0, %for.body5.lr.ph.new ], [ %indvars.iv.next88.1, %for.inc27.1 ] %over_B.081 = phi i32 [ 0, %for.body5.lr.ph.new ], [ %over_B.1.1, %for.inc27.1 ] %middle_AtoB.080 = phi i32 [ undef, %for.body5.lr.ph.new ], [ %middle_AtoB.1.1, %for.inc27.1 ] %under_A.079 = phi i32 [ 0, %for.body5.lr.ph.new ], [ %under_A.1.1, %for.inc27.1 ] %niter = phi i64 [ 0, %for.body5.lr.ph.new ], [ %niter.next.1, %for.inc27.1 ] %arrayidx7 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv87 %6 = load i32, ptr %arrayidx7, align 8, !tbaa !5 %cmp8.not = icmp sgt i32 %6, %1 br i1 %cmp8.not, label %land.lhs.true, label %if.then if.then: ; preds = %for.body5 %inc9 = add nsw i32 %under_A.079, 1 br label %for.inc27 land.lhs.true: ; preds = %for.body5 %cmp15.not = icmp sgt i32 %6, %2 br i1 %cmp15.not, label %if.else18, label %if.then16 if.then16: ; preds = %land.lhs.true %inc17 = add nsw i32 %middle_AtoB.080, 1 br label %for.inc27 if.else18: ; preds = %land.lhs.true %inc24 = add nsw i32 %over_B.081, 1 br label %for.inc27 for.inc27: ; preds = %if.else18, %if.then, %if.then16 %under_A.1 = phi i32 [ %inc9, %if.then ], [ %under_A.079, %if.then16 ], [ %under_A.079, %if.else18 ] %middle_AtoB.1 = phi i32 [ %middle_AtoB.080, %if.then ], [ %inc17, %if.then16 ], [ %middle_AtoB.080, %if.else18 ] %over_B.1 = phi i32 [ %over_B.081, %if.then ], [ %over_B.081, %if.then16 ], [ %inc24, %if.else18 ] %indvars.iv.next88 = or i64 %indvars.iv87, 1 %arrayidx7.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next88 %7 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %cmp8.not.1 = icmp sgt i32 %7, %1 br i1 %cmp8.not.1, label %land.lhs.true.1, label %if.then.1 if.then.1: ; preds = %for.inc27 %inc9.1 = add nsw i32 %under_A.1, 1 br label %for.inc27.1 land.lhs.true.1: ; preds = %for.inc27 %cmp15.not.1 = icmp sgt i32 %7, %2 br i1 %cmp15.not.1, label %if.else18.1, label %if.then16.1 if.then16.1: ; preds = %land.lhs.true.1 %inc17.1 = add nsw i32 %middle_AtoB.1, 1 br label %for.inc27.1 if.else18.1: ; preds = %land.lhs.true.1 %inc24.1 = add nsw i32 %over_B.1, 1 br label %for.inc27.1 for.inc27.1: ; preds = %if.else18.1, %if.then16.1, %if.then.1 %under_A.1.1 = phi i32 [ %inc9.1, %if.then.1 ], [ %under_A.1, %if.then16.1 ], [ %under_A.1, %if.else18.1 ] %middle_AtoB.1.1 = phi i32 [ %middle_AtoB.1, %if.then.1 ], [ %inc17.1, %if.then16.1 ], [ %middle_AtoB.1, %if.else18.1 ] %over_B.1.1 = phi i32 [ %over_B.1, %if.then.1 ], [ %over_B.1, %if.then16.1 ], [ %inc24.1, %if.else18.1 ] %indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87, 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.end29.loopexit.unr-lcssa, label %for.body5, !llvm.loop !11 for.end29.loopexit.unr-lcssa: ; preds = %for.inc27.1, %for.body5.lr.ph %under_A.1.lcssa.ph = phi i32 [ undef, %for.body5.lr.ph ], [ %under_A.1.1, %for.inc27.1 ] %over_B.1.lcssa.ph = phi i32 [ undef, %for.body5.lr.ph ], [ %over_B.1.1, %for.inc27.1 ] %indvars.iv87.unr = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next88.1, %for.inc27.1 ] %over_B.081.unr = phi i32 [ 0, %for.body5.lr.ph ], [ %over_B.1.1, %for.inc27.1 ] %middle_AtoB.080.unr = phi i32 [ undef, %for.body5.lr.ph ], [ %middle_AtoB.1.1, %for.inc27.1 ] %under_A.079.unr = phi i32 [ 0, %for.body5.lr.ph ], [ %under_A.1.1, %for.inc27.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end29, label %for.body5.epil for.body5.epil: ; preds = %for.end29.loopexit.unr-lcssa %arrayidx7.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv87.unr %8 = load i32, ptr %arrayidx7.epil, align 4, !tbaa !5 %cmp8.not.epil = icmp sgt i32 %8, %1 br i1 %cmp8.not.epil, label %land.lhs.true.epil, label %if.then.epil if.then.epil: ; preds = %for.body5.epil %inc9.epil = add nsw i32 %under_A.079.unr, 1 br label %for.end29 land.lhs.true.epil: ; preds = %for.body5.epil %cmp15.not.epil = icmp sgt i32 %8, %2 br i1 %cmp15.not.epil, label %if.else18.epil, label %if.then16.epil if.then16.epil: ; preds = %land.lhs.true.epil %inc17.epil = add nsw i32 %middle_AtoB.080.unr, 1 br label %for.end29 if.else18.epil: ; preds = %land.lhs.true.epil %inc24.epil = add nsw i32 %over_B.081.unr, 1 br label %for.end29 for.end29: ; preds = %for.end29.loopexit.unr-lcssa, %if.else18.epil, %if.then16.epil, %if.then.epil, %entry, %for.cond3.preheader %under_A.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %under_A.1.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %inc9.epil, %if.then.epil ], [ %under_A.079.unr, %if.then16.epil ], [ %under_A.079.unr, %if.else18.epil ] %middle_AtoB.0.lcssa = phi i32 [ undef, %for.cond3.preheader ], [ undef, %entry ], [ %middle_AtoB.080.unr, %for.end29.loopexit.unr-lcssa ], [ %middle_AtoB.080.unr, %if.then.epil ], [ %inc17.epil, %if.then16.epil ], [ %middle_AtoB.080.unr, %if.else18.epil ] %over_B.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %over_B.1.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %over_B.081.unr, %if.then.epil ], [ %over_B.081.unr, %if.then16.epil ], [ %inc24.epil, %if.else18.epil ] %cmp30 = icmp slt i32 %under_A.0.lcssa, %middle_AtoB.0.lcssa %cmp32 = icmp slt i32 %under_A.0.lcssa, %over_B.0.lcssa %or.cond = select i1 %cmp30, i1 %cmp32, i1 false %cmp35 = icmp sgt i32 %under_A.0.lcssa, %middle_AtoB.0.lcssa %cmp37 = icmp slt i32 %middle_AtoB.0.lcssa, %over_B.0.lcssa %or.cond72 = select i1 %cmp35, i1 %cmp37, i1 false %spec.select74 = select i1 %or.cond72, i32 %middle_AtoB.0.lcssa, i32 %over_B.0.lcssa %min.0 = select i1 %or.cond, i32 %under_A.0.lcssa, i32 %spec.select74 %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %min.0) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #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 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> long long gcd(long long a,long long b){ long long r,tmp; if(a>b){ tmp=a; a=b; b=tmp; } if(a==0) return b; r=b%a; while(r!=0){ b=a; a=r; r=b%a; } return a; } int main(void){ long long n,a[100005],L[100005],R[100005],m[100005],max=0; scanf("%lld",&n); for(int i=0;i<n;i++){ scanf("%lld",&a[i]); } L[0]=0; R[n]=0; for(int i=0;i<=n-1;i++){ L[i+1] = gcd(L[i],a[i]); } for(int i=n;i>=1;i--){ R[i-1] = gcd(R[i],a[i-1]); } for(int i=0;i<n;i++){ m[i]=gcd(L[i],R[i+1]); if(max<m[i]) max=m[i]; } printf("%lld",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164466/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164466/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %spec.select = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) %spec.select18 = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) %cmp1 = icmp eq i64 %spec.select, 0 br i1 %cmp1, label %cleanup, label %if.end3 if.end3: ; preds = %entry %rem = srem i64 %spec.select18, %spec.select %cmp4.not19 = icmp eq i64 %rem, 0 br i1 %cmp4.not19, label %cleanup, label %while.body while.body: ; preds = %if.end3, %while.body %r.021 = phi i64 [ %rem5, %while.body ], [ %rem, %if.end3 ] %a.addr.120 = phi i64 [ %r.021, %while.body ], [ %spec.select, %if.end3 ] %rem5 = srem i64 %a.addr.120, %r.021 %cmp4.not = icmp eq i64 %rem5, 0 br i1 %cmp4.not, label %cleanup, label %while.body, !llvm.loop !5 cleanup: ; preds = %while.body, %if.end3, %entry %retval.0 = phi i64 [ %spec.select18, %entry ], [ %spec.select, %if.end3 ], [ %r.021, %while.body ] ret i64 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %a = alloca [100005 x i64], align 16 %L = alloca [100005 x i64], align 16 %R = alloca [100005 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %L) #5 call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %R) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !7 %cmp108 = icmp sgt i64 %0, 0 br i1 %cmp108, label %for.body, label %for.cond.cleanup.thread for.cond.cleanup.thread: ; preds = %entry store i64 0, ptr %L, align 16, !tbaa !7 %arrayidx4135 = getelementptr inbounds [100005 x i64], ptr %R, i64 0, i64 %0 store i64 0, ptr %arrayidx4135, align 8, !tbaa !7 br label %for.cond.cleanup10 for.cond.cleanup: ; preds = %for.body store i64 0, ptr %L, align 16, !tbaa !7 %arrayidx4 = getelementptr inbounds [100005 x i64], ptr %R, i64 0, i64 %1 store i64 0, ptr %arrayidx4, align 8, !tbaa !7 %cmp8.not.not111 = icmp sgt i64 %1, 0 br i1 %cmp8.not.not111, label %for.body11, label %for.cond.cleanup10 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100005 x i64], ptr %a, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i64, ptr %n, align 8, !tbaa !7 %cmp = icmp sgt i64 %1, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 for.cond.cleanup10: ; preds = %gcd.exit, %for.cond.cleanup.thread, %for.cond.cleanup %cmp8.not.not111138 = phi i1 [ false, %for.cond.cleanup.thread ], [ false, %for.cond.cleanup ], [ %cmp8.not.not111, %gcd.exit ] %.lcssa137 = phi i64 [ %0, %for.cond.cleanup.thread ], [ %1, %for.cond.cleanup ], [ %1, %gcd.exit ] %conv23 = trunc i64 %.lcssa137 to i32 %cmp25114 = icmp sgt i32 %conv23, 0 br i1 %cmp25114, label %for.body28.preheader, label %for.cond41.preheader for.body28.preheader: ; preds = %for.cond.cleanup10 %2 = and i64 %.lcssa137, 4294967295 br label %for.body28 for.body11: ; preds = %for.cond.cleanup, %gcd.exit %3 = phi i64 [ %retval.0.i, %gcd.exit ], [ 0, %for.cond.cleanup ] %indvars.iv123 = phi i64 [ %indvars.iv.next124, %gcd.exit ], [ 0, %for.cond.cleanup ] %arrayidx15 = getelementptr inbounds [100005 x i64], ptr %a, i64 0, i64 %indvars.iv123 %4 = load i64, ptr %arrayidx15, align 8, !tbaa !7 %spec.select.i = call i64 @llvm.smin.i64(i64 %3, i64 %4) %spec.select18.i = call i64 @llvm.smax.i64(i64 %3, i64 %4) %cmp1.i = icmp eq i64 %spec.select.i, 0 br i1 %cmp1.i, label %gcd.exit, label %if.end3.i if.end3.i: ; preds = %for.body11 %rem.i = srem i64 %spec.select18.i, %spec.select.i %cmp4.not19.i = icmp eq i64 %rem.i, 0 br i1 %cmp4.not19.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %if.end3.i, %while.body.i %r.021.i = phi i64 [ %rem5.i, %while.body.i ], [ %rem.i, %if.end3.i ] %a.addr.120.i = phi i64 [ %r.021.i, %while.body.i ], [ %spec.select.i, %if.end3.i ] %rem5.i = srem i64 %a.addr.120.i, %r.021.i %cmp4.not.i = icmp eq i64 %rem5.i, 0 br i1 %cmp4.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %for.body11, %if.end3.i %retval.0.i = phi i64 [ %spec.select18.i, %for.body11 ], [ %spec.select.i, %if.end3.i ], [ %r.021.i, %while.body.i ] %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %arrayidx18 = getelementptr inbounds [100005 x i64], ptr %L, i64 0, i64 %indvars.iv.next124 store i64 %retval.0.i, ptr %arrayidx18, align 8, !tbaa !7 %exitcond.not = icmp eq i64 %indvars.iv.next124, %1 br i1 %exitcond.not, label %for.cond.cleanup10, label %for.body11, !llvm.loop !12 for.cond41.preheader: ; preds = %gcd.exit94, %for.cond.cleanup10 br i1 %cmp8.not.not111138, label %for.body46, label %for.cond.cleanup45 for.body28: ; preds = %for.body28.preheader, %gcd.exit94 %indvars.iv126 = phi i64 [ %2, %for.body28.preheader ], [ %indvars.iv.next127, %gcd.exit94 ] %arrayidx30 = getelementptr inbounds [100005 x i64], ptr %R, i64 0, i64 %indvars.iv126 %5 = load i64, ptr %arrayidx30, align 8, !tbaa !7 %indvars.iv.next127 = add nsw i64 %indvars.iv126, -1 %idxprom32 = and i64 %indvars.iv.next127, 4294967295 %arrayidx33 = getelementptr inbounds [100005 x i64], ptr %a, i64 0, i64 %idxprom32 %6 = load i64, ptr %arrayidx33, align 8, !tbaa !7 %spec.select.i82 = call i64 @llvm.smin.i64(i64 %5, i64 %6) %spec.select18.i83 = call i64 @llvm.smax.i64(i64 %5, i64 %6) %cmp1.i84 = icmp eq i64 %spec.select.i82, 0 br i1 %cmp1.i84, label %gcd.exit94, label %if.end3.i85 if.end3.i85: ; preds = %for.body28 %rem.i86 = srem i64 %spec.select18.i83, %spec.select.i82 %cmp4.not19.i87 = icmp eq i64 %rem.i86, 0 br i1 %cmp4.not19.i87, label %gcd.exit94, label %while.body.i88 while.body.i88: ; preds = %if.end3.i85, %while.body.i88 %r.021.i89 = phi i64 [ %rem5.i91, %while.body.i88 ], [ %rem.i86, %if.end3.i85 ] %a.addr.120.i90 = phi i64 [ %r.021.i89, %while.body.i88 ], [ %spec.select.i82, %if.end3.i85 ] %rem5.i91 = srem i64 %a.addr.120.i90, %r.021.i89 %cmp4.not.i92 = icmp eq i64 %rem5.i91, 0 br i1 %cmp4.not.i92, label %gcd.exit94, label %while.body.i88, !llvm.loop !5 gcd.exit94: ; preds = %while.body.i88, %for.body28, %if.end3.i85 %retval.0.i93 = phi i64 [ %spec.select18.i83, %for.body28 ], [ %spec.select.i82, %if.end3.i85 ], [ %r.021.i89, %while.body.i88 ] %arrayidx37 = getelementptr inbounds [100005 x i64], ptr %R, i64 0, i64 %idxprom32 store i64 %retval.0.i93, ptr %arrayidx37, align 8, !tbaa !7 %cmp25 = icmp sgt i64 %indvars.iv126, 1 br i1 %cmp25, label %for.body28, label %for.cond41.preheader, !llvm.loop !13 for.cond.cleanup45: ; preds = %gcd.exit107, %for.cond41.preheader %max.0.lcssa = phi i64 [ 0, %for.cond41.preheader ], [ %spec.select, %gcd.exit107 ] %call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %R) #5 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %L) #5 call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 for.body46: ; preds = %for.cond41.preheader, %gcd.exit107 %indvars.iv129 = phi i64 [ %indvars.iv.next130, %gcd.exit107 ], [ 0, %for.cond41.preheader ] %max.0117 = phi i64 [ %spec.select, %gcd.exit107 ], [ 0, %for.cond41.preheader ] %arrayidx48 = getelementptr inbounds [100005 x i64], ptr %L, i64 0, i64 %indvars.iv129 %7 = load i64, ptr %arrayidx48, align 8, !tbaa !7 %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 %arrayidx51 = getelementptr inbounds [100005 x i64], ptr %R, i64 0, i64 %indvars.iv.next130 %8 = load i64, ptr %arrayidx51, align 8, !tbaa !7 %spec.select.i95 = call i64 @llvm.smin.i64(i64 %7, i64 %8) %spec.select18.i96 = call i64 @llvm.smax.i64(i64 %7, i64 %8) %cmp1.i97 = icmp eq i64 %spec.select.i95, 0 br i1 %cmp1.i97, label %gcd.exit107, label %if.end3.i98 if.end3.i98: ; preds = %for.body46 %rem.i99 = srem i64 %spec.select18.i96, %spec.select.i95 %cmp4.not19.i100 = icmp eq i64 %rem.i99, 0 br i1 %cmp4.not19.i100, label %gcd.exit107, label %while.body.i101 while.body.i101: ; preds = %if.end3.i98, %while.body.i101 %r.021.i102 = phi i64 [ %rem5.i104, %while.body.i101 ], [ %rem.i99, %if.end3.i98 ] %a.addr.120.i103 = phi i64 [ %r.021.i102, %while.body.i101 ], [ %spec.select.i95, %if.end3.i98 ] %rem5.i104 = srem i64 %a.addr.120.i103, %r.021.i102 %cmp4.not.i105 = icmp eq i64 %rem5.i104, 0 br i1 %cmp4.not.i105, label %gcd.exit107, label %while.body.i101, !llvm.loop !5 gcd.exit107: ; preds = %while.body.i101, %for.body46, %if.end3.i98 %retval.0.i106 = phi i64 [ %spec.select18.i96, %for.body46 ], [ %spec.select.i95, %if.end3.i98 ], [ %r.021.i102, %while.body.i101 ] %spec.select = call i64 @llvm.smax.i64(i64 %max.0117, i64 %retval.0.i106) %exitcond133.not = icmp eq i64 %indvars.iv.next130, %.lcssa137 br i1 %exitcond133.not, label %for.cond.cleanup45, label %for.body46, !llvm.loop !14 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6} !14 = distinct !{!14, !6}
#include <stdio.h> #include <stdlib.h> int compare(const void *a,const void *b){ return *(int *)a - *(int *)b; } int main(){ int n; scanf("%d",&n); int a[1000000]; for(int i=0;i<n;i++){ scanf("%d",a+i); } qsort(a,n,sizeof(int),compare); int j,k; int count; int answer; for(j=a[1] ; j > 0 ; j--){ count = 0; for(k=0;k<n;k++){ if(a[k] % j != 0){ count += 1; } } if(count <= 1){ answer = j; break; } } printf("%d\n",answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164509/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164509/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %a = alloca [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %a) #5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %8, %for.body ] call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #5 %arrayidx = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 1 %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp438 = icmp sgt i32 %1, 0 br i1 %cmp438, label %for.cond7.preheader.lr.ph, label %for.end22 for.cond7.preheader.lr.ph: ; preds = %for.cond.cleanup %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp834 = icmp sgt i32 %2, 0 br i1 %cmp834, label %for.cond7.preheader.us.preheader, label %for.end22 for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %2, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.inc21.us %j.039.us = phi i32 [ %dec.us, %for.inc21.us ], [ %1, %for.cond7.preheader.us.preheader ] br i1 %3, label %for.cond7.for.end16_crit_edge.us.unr-lcssa, label %for.body10.us for.inc21.us: ; preds = %for.cond7.for.end16_crit_edge.us %dec.us = add nsw i32 %j.039.us, -1 %cmp4.us = icmp sgt i32 %j.039.us, 1 br i1 %cmp4.us, label %for.cond7.preheader.us, label %for.end22, !llvm.loop !9 for.body10.us: ; preds = %for.cond7.preheader.us, %for.body10.us %indvars.iv45 = phi i64 [ %indvars.iv.next46.1, %for.body10.us ], [ 0, %for.cond7.preheader.us ] %count.036.us = phi i32 [ %spec.select.us.1, %for.body10.us ], [ 0, %for.cond7.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.body10.us ], [ 0, %for.cond7.preheader.us ] %arrayidx11.us = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv45 %4 = load i32, ptr %arrayidx11.us, align 8, !tbaa !5 %rem.us = srem i32 %4, %j.039.us %cmp12.not.us = icmp ne i32 %rem.us, 0 %add.us = zext i1 %cmp12.not.us to i32 %spec.select.us = add nuw nsw i32 %count.036.us, %add.us %indvars.iv.next46 = or i64 %indvars.iv45, 1 %arrayidx11.us.1 = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv.next46 %5 = load i32, ptr %arrayidx11.us.1, align 4, !tbaa !5 %rem.us.1 = srem i32 %5, %j.039.us %cmp12.not.us.1 = icmp ne i32 %rem.us.1, 0 %add.us.1 = zext i1 %cmp12.not.us.1 to i32 %spec.select.us.1 = add nuw nsw i32 %spec.select.us, %add.us.1 %indvars.iv.next46.1 = add nuw nsw i64 %indvars.iv45, 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.cond7.for.end16_crit_edge.us.unr-lcssa, label %for.body10.us, !llvm.loop !11 for.cond7.for.end16_crit_edge.us.unr-lcssa: ; preds = %for.body10.us, %for.cond7.preheader.us %spec.select.us.lcssa.ph = phi i32 [ undef, %for.cond7.preheader.us ], [ %spec.select.us.1, %for.body10.us ] %indvars.iv45.unr = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next46.1, %for.body10.us ] %count.036.us.unr = phi i32 [ 0, %for.cond7.preheader.us ], [ %spec.select.us.1, %for.body10.us ] br i1 %lcmp.mod.not, label %for.cond7.for.end16_crit_edge.us, label %for.body10.us.epil for.body10.us.epil: ; preds = %for.cond7.for.end16_crit_edge.us.unr-lcssa %arrayidx11.us.epil = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv45.unr %6 = load i32, ptr %arrayidx11.us.epil, align 4, !tbaa !5 %rem.us.epil = srem i32 %6, %j.039.us %cmp12.not.us.epil = icmp ne i32 %rem.us.epil, 0 %add.us.epil = zext i1 %cmp12.not.us.epil to i32 %spec.select.us.epil = add nuw nsw i32 %count.036.us.unr, %add.us.epil br label %for.cond7.for.end16_crit_edge.us for.cond7.for.end16_crit_edge.us: ; preds = %for.cond7.for.end16_crit_edge.us.unr-lcssa, %for.body10.us.epil %spec.select.us.lcssa = phi i32 [ %spec.select.us.lcssa.ph, %for.cond7.for.end16_crit_edge.us.unr-lcssa ], [ %spec.select.us.epil, %for.body10.us.epil ] %cmp17.us = icmp ult i32 %spec.select.us.lcssa, 2 br i1 %cmp17.us, label %for.end22, label %for.inc21.us for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12 for.end22: ; preds = %for.inc21.us, %for.cond7.for.end16_crit_edge.us, %for.cond7.preheader.lr.ph, %for.cond.cleanup %j.0.lcssa = phi i32 [ %1, %for.cond.cleanup ], [ %1, %for.cond7.preheader.lr.ph ], [ %j.039.us, %for.cond7.for.end16_crit_edge.us ], [ 0, %for.inc21.us ] %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.0.lcssa) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long #define TBMod 1000000007 // gcd(a,b) TLong gcd(TLong a,TLong b){ if(a==0) return b; else if(b==0) return a; else return gcd(b,a % b); } // lcm(a,b) TLong lcm(TLong a,TLong b){ return (a * b) / gcd(a,b); } int main(int argc, char const *argv[]) { TLong n,a[100007]; TLong l[100007],r[100007]; TLong max = 1; scanf("%lld",&n); for (TLong i = 0; i < n; i++) scanf("%lld",&a[i]); l[0] = 0; r[n] = 0; for (TLong i = 0; i < n; i++){ l[i + 1] = gcd(l[i],a[i]); r[n - i - 1] = gcd(r[n - i],a[n - i - 1]); } for (TLong i = 0; i < n; i++){ if (max < gcd(l[i],r[i + 1])) max = gcd(l[i],r[i + 1]); } printf("%lld\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164552/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164552/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cmp9 = icmp eq i64 %a, 0 br i1 %cmp9, label %return, label %if.else.preheader if.else.preheader: ; preds = %entry %cmp113 = icmp eq i64 %b, 0 br i1 %cmp113, label %return, label %if.else3 if.else3: ; preds = %if.else.preheader, %if.else3 %a.tr1015 = phi i64 [ %b.tr1114, %if.else3 ], [ %a, %if.else.preheader ] %b.tr1114 = phi i64 [ %rem, %if.else3 ], [ %b, %if.else.preheader ] %rem = srem i64 %a.tr1015, %b.tr1114 %cmp1 = icmp eq i64 %rem, 0 br i1 %cmp1, label %return, label %if.else3 return: ; preds = %if.else3, %if.else.preheader, %entry %retval.0 = phi i64 [ %b, %entry ], [ %a, %if.else.preheader ], [ %b.tr1114, %if.else3 ] ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %cmp9.i = icmp eq i64 %a, 0 br i1 %cmp9.i, label %gcd.exit, label %if.else.i.preheader if.else.i.preheader: ; preds = %entry %cmp1.i3 = icmp eq i64 %b, 0 br i1 %cmp1.i3, label %gcd.exit, label %if.else3.i if.else3.i: ; preds = %if.else.i.preheader, %if.else3.i %a.tr10.i5 = phi i64 [ %b.tr11.i4, %if.else3.i ], [ %a, %if.else.i.preheader ] %b.tr11.i4 = phi i64 [ %rem.i, %if.else3.i ], [ %b, %if.else.i.preheader ] %rem.i = srem i64 %a.tr10.i5, %b.tr11.i4 %cmp1.i = icmp eq i64 %rem.i, 0 br i1 %cmp1.i, label %gcd.exit, label %if.else3.i gcd.exit: ; preds = %if.else3.i, %if.else.i.preheader, %entry %retval.0.i = phi i64 [ %b, %entry ], [ %a, %if.else.i.preheader ], [ %b.tr11.i4, %if.else3.i ] %mul = mul nsw i64 %b, %a %div = sdiv i64 %mul, %retval.0.i ret i64 %div } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 { entry: %n = alloca i64, align 8 %a = alloca [100007 x i64], align 16 %l = alloca [100007 x i64], align 16 %r = alloca [100007 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %l) #5 call void @llvm.lifetime.start.p0(i64 800056, ptr nonnull %r) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp86 = icmp sgt i64 %0, 0 br i1 %cmp86, label %for.body, label %for.cond.cleanup27 for.cond.cleanup: ; preds = %for.body store i64 0, ptr %l, align 16, !tbaa !5 %arrayidx3 = getelementptr inbounds [100007 x i64], ptr %r, i64 0, i64 %1 store i64 0, ptr %arrayidx3, align 8, !tbaa !5 %cmp696 = icmp sgt i64 %1, 0 br i1 %cmp696, label %for.body8, label %for.cond.cleanup27 for.body: ; preds = %entry, %for.body %i.087 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100007 x i64], ptr %a, i64 0, i64 %i.087 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.087, 1 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.cond25.preheader: ; preds = %gcd.exit65 br i1 %cmp696, label %for.body28, label %for.cond.cleanup27 for.body8: ; preds = %for.cond.cleanup, %gcd.exit65 %2 = phi i64 [ %retval.0.i, %gcd.exit65 ], [ 0, %for.cond.cleanup ] %i4.097 = phi i64 [ %add, %gcd.exit65 ], [ 0, %for.cond.cleanup ] %arrayidx10 = getelementptr inbounds [100007 x i64], ptr %a, i64 0, i64 %i4.097 %3 = load i64, ptr %arrayidx10, align 8, !tbaa !5 %cmp9.i = icmp eq i64 %2, 0 br i1 %cmp9.i, label %gcd.exit, label %if.else.i.preheader if.else.i.preheader: ; preds = %for.body8 %cmp1.i88 = icmp eq i64 %3, 0 br i1 %cmp1.i88, label %gcd.exit, label %if.else3.i if.else3.i: ; preds = %if.else.i.preheader, %if.else3.i %a.tr10.i90 = phi i64 [ %b.tr11.i89, %if.else3.i ], [ %2, %if.else.i.preheader ] %b.tr11.i89 = phi i64 [ %rem.i, %if.else3.i ], [ %3, %if.else.i.preheader ] %rem.i = srem i64 %a.tr10.i90, %b.tr11.i89 %cmp1.i = icmp eq i64 %rem.i, 0 br i1 %cmp1.i, label %gcd.exit, label %if.else3.i gcd.exit: ; preds = %if.else3.i, %if.else.i.preheader, %for.body8 %retval.0.i = phi i64 [ %3, %for.body8 ], [ %2, %if.else.i.preheader ], [ %b.tr11.i89, %if.else3.i ] %add = add nuw nsw i64 %i4.097, 1 %arrayidx12 = getelementptr inbounds [100007 x i64], ptr %l, i64 0, i64 %add store i64 %retval.0.i, ptr %arrayidx12, align 8, !tbaa !5 %sub = sub nsw i64 %1, %i4.097 %arrayidx13 = getelementptr inbounds [100007 x i64], ptr %r, i64 0, i64 %sub %4 = load i64, ptr %arrayidx13, align 8, !tbaa !5 %sub15 = add nsw i64 %sub, -1 %arrayidx16 = getelementptr inbounds [100007 x i64], ptr %a, i64 0, i64 %sub15 %5 = load i64, ptr %arrayidx16, align 8, !tbaa !5 %cmp9.i57 = icmp eq i64 %4, 0 br i1 %cmp9.i57, label %gcd.exit65, label %if.else.i58.preheader if.else.i58.preheader: ; preds = %gcd.exit %cmp1.i6192 = icmp eq i64 %5, 0 br i1 %cmp1.i6192, label %gcd.exit65, label %if.else3.i62 if.else3.i62: ; preds = %if.else.i58.preheader, %if.else3.i62 %a.tr10.i6094 = phi i64 [ %b.tr11.i5993, %if.else3.i62 ], [ %4, %if.else.i58.preheader ] %b.tr11.i5993 = phi i64 [ %rem.i63, %if.else3.i62 ], [ %5, %if.else.i58.preheader ] %rem.i63 = srem i64 %a.tr10.i6094, %b.tr11.i5993 %cmp1.i61 = icmp eq i64 %rem.i63, 0 br i1 %cmp1.i61, label %gcd.exit65, label %if.else3.i62 gcd.exit65: ; preds = %if.else3.i62, %if.else.i58.preheader, %gcd.exit %retval.0.i64 = phi i64 [ %5, %gcd.exit ], [ %4, %if.else.i58.preheader ], [ %b.tr11.i5993, %if.else3.i62 ] %6 = xor i64 %i4.097, -1 %sub19 = add i64 %1, %6 %arrayidx20 = getelementptr inbounds [100007 x i64], ptr %r, i64 0, i64 %sub19 store i64 %retval.0.i64, ptr %arrayidx20, align 8, !tbaa !5 %exitcond.not = icmp eq i64 %add, %1 br i1 %exitcond.not, label %for.cond25.preheader, label %for.body8, !llvm.loop !11 for.cond.cleanup27: ; preds = %for.inc38, %entry, %for.cond.cleanup, %for.cond25.preheader %max.0.lcssa = phi i64 [ 1, %for.cond25.preheader ], [ 1, %for.cond.cleanup ], [ 1, %entry ], [ %max.1, %for.inc38 ] %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 800056, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 800056, ptr nonnull %l) #5 call void @llvm.lifetime.end.p0(i64 800056, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 for.body28: ; preds = %for.cond25.preheader, %for.inc38 %i24.0108 = phi i64 [ %add30, %for.inc38 ], [ 0, %for.cond25.preheader ] %max.0107 = phi i64 [ %max.1, %for.inc38 ], [ 1, %for.cond25.preheader ] %arrayidx29 = getelementptr inbounds [100007 x i64], ptr %l, i64 0, i64 %i24.0108 %7 = load i64, ptr %arrayidx29, align 8, !tbaa !5 %add30 = add nuw nsw i64 %i24.0108, 1 %arrayidx31 = getelementptr inbounds [100007 x i64], ptr %r, i64 0, i64 %add30 %8 = load i64, ptr %arrayidx31, align 8, !tbaa !5 %cmp9.i66 = icmp eq i64 %7, 0 br i1 %cmp9.i66, label %gcd.exit74.thread, label %if.else.i67.preheader if.else.i67.preheader: ; preds = %for.body28 %cmp1.i7098 = icmp eq i64 %8, 0 br i1 %cmp1.i7098, label %gcd.exit74.thread119, label %if.else3.i71 if.else3.i71: ; preds = %if.else.i67.preheader, %if.else3.i71 %a.tr10.i69100 = phi i64 [ %b.tr11.i6899, %if.else3.i71 ], [ %7, %if.else.i67.preheader ] %b.tr11.i6899 = phi i64 [ %rem.i72, %if.else3.i71 ], [ %8, %if.else.i67.preheader ] %rem.i72 = srem i64 %a.tr10.i69100, %b.tr11.i6899 %cmp1.i70 = icmp eq i64 %rem.i72, 0 br i1 %cmp1.i70, label %gcd.exit74, label %if.else3.i71 gcd.exit74: ; preds = %if.else3.i71 %cmp33.not = icmp sge i64 %max.0107, %b.tr11.i6899 %brmerge = or i1 %cmp33.not, %cmp1.i7098 %max.0107.mux = select i1 %cmp33.not, i64 %max.0107, i64 %7 br i1 %brmerge, label %for.inc38, label %if.else3.i80 gcd.exit74.thread119: ; preds = %if.else.i67.preheader %spec.select123 = call i64 @llvm.smax.i64(i64 %max.0107, i64 %7) br label %for.inc38 gcd.exit74.thread: ; preds = %for.body28 %spec.select = call i64 @llvm.smax.i64(i64 %max.0107, i64 %8) br label %for.inc38 if.else3.i80: ; preds = %gcd.exit74, %if.else3.i80 %a.tr10.i78104 = phi i64 [ %b.tr11.i77103, %if.else3.i80 ], [ %7, %gcd.exit74 ] %b.tr11.i77103 = phi i64 [ %rem.i81, %if.else3.i80 ], [ %8, %gcd.exit74 ] %rem.i81 = srem i64 %a.tr10.i78104, %b.tr11.i77103 %cmp1.i79 = icmp eq i64 %rem.i81, 0 br i1 %cmp1.i79, label %for.inc38, label %if.else3.i80 for.inc38: ; preds = %if.else3.i80, %gcd.exit74.thread119, %gcd.exit74, %gcd.exit74.thread %max.1 = phi i64 [ %max.0107.mux, %gcd.exit74 ], [ %spec.select, %gcd.exit74.thread ], [ %spec.select123, %gcd.exit74.thread119 ], [ %b.tr11.i77103, %if.else3.i80 ] %exitcond111.not = icmp eq i64 %add30, %1 br i1 %exitcond111.not, label %for.cond.cleanup27, label %for.body28, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main() { // your code goes here int n; scanf("%d",&n); int ar[n]; for(int i=0;i<n;i++) scanf("%d",&ar[i]); int c[600-0+1],cnt=0; for(int i=1;i<=(600-0+1);i++) c[i]=0; for(int i=0;i<n;i++) c[ar[i]]++; for(int i=1;i<=601;i++){ if(c[i]>=1) cnt++; } printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16461/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16461/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %c = alloca [601 x i32], align 16 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 %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 %cmp47 = icmp sgt i32 %3, 0 br i1 %cmp47, label %for.body, label %for.cond.cleanup.thread for.cond.cleanup.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 2404, ptr nonnull %c) #6 %scevgep67 = getelementptr inbounds i8, ptr %c, i64 4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2404) %scevgep67, i8 0, i64 2404, i1 false), !tbaa !5 br label %vector.body.preheader for.cond.cleanup: ; preds = %for.body call void @llvm.lifetime.start.p0(i64 2404, ptr nonnull %c) #6 %scevgep = getelementptr inbounds i8, ptr %c, i64 4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2404) %scevgep, i8 0, i64 2404, i1 false), !tbaa !5 %cmp1450 = icmp sgt i32 %4, 0 br i1 %cmp1450, label %for.body16.preheader, label %vector.body.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %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.cond.cleanup, !llvm.loop !9 for.body16.preheader: ; preds = %for.cond.cleanup %wide.trip.count = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count, 3 %6 = icmp ult i32 %4, 4 br i1 %6, label %vector.body.preheader.loopexit.unr-lcssa, label %for.body16.preheader.new for.body16.preheader.new: ; preds = %for.body16.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body16 vector.body: ; preds = %vector.body.1, %vector.body.preheader %index = phi i64 [ 0, %vector.body.preheader ], [ %index.next.1, %vector.body.1 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.body.preheader ], [ %22, %vector.body.1 ] %vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.body.preheader ], [ %23, %vector.body.1 ] %offset.idx = or i64 %index, 1 %7 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 %wide.load70 = load <4 x i32>, ptr %8, align 4, !tbaa !5 %9 = icmp sgt <4 x i32> %wide.load, zeroinitializer %10 = icmp sgt <4 x i32> %wide.load70, zeroinitializer %11 = zext <4 x i1> %9 to <4 x i32> %12 = zext <4 x i1> %10 to <4 x i32> %13 = add <4 x i32> %vec.phi, %11 %14 = add <4 x i32> %vec.phi69, %12 %15 = icmp eq i64 %index, 592 br i1 %15, label %for.body29, label %vector.body.1, !llvm.loop !11 vector.body.1: ; preds = %vector.body %offset.idx.1 = or i64 %index, 9 %16 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %offset.idx.1 %wide.load.1 = load <4 x i32>, ptr %16, align 4, !tbaa !5 %17 = getelementptr inbounds i32, ptr %16, i64 4 %wide.load70.1 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = icmp sgt <4 x i32> %wide.load.1, zeroinitializer %19 = icmp sgt <4 x i32> %wide.load70.1, zeroinitializer %20 = zext <4 x i1> %18 to <4 x i32> %21 = zext <4 x i1> %19 to <4 x i32> %22 = add <4 x i32> %13, %20 %23 = add <4 x i32> %14, %21 %index.next.1 = add nuw nsw i64 %index, 16 br label %vector.body for.body16: ; preds = %for.body16, %for.body16.preheader.new %indvars.iv59 = phi i64 [ 0, %for.body16.preheader.new ], [ %indvars.iv.next60.3, %for.body16 ] %niter = phi i64 [ 0, %for.body16.preheader.new ], [ %niter.next.3, %for.body16 ] %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59 %24 = load i32, ptr %arrayidx18, align 16, !tbaa !5 %idxprom19 = sext i32 %24 to i64 %arrayidx20 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %idxprom19 %25 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %inc21 = add nsw i32 %25, 1 store i32 %inc21, ptr %arrayidx20, align 4, !tbaa !5 %indvars.iv.next60 = or i64 %indvars.iv59, 1 %arrayidx18.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next60 %26 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5 %idxprom19.1 = sext i32 %26 to i64 %arrayidx20.1 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %idxprom19.1 %27 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %inc21.1 = add nsw i32 %27, 1 store i32 %inc21.1, ptr %arrayidx20.1, align 4, !tbaa !5 %indvars.iv.next60.1 = or i64 %indvars.iv59, 2 %arrayidx18.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next60.1 %28 = load i32, ptr %arrayidx18.2, align 8, !tbaa !5 %idxprom19.2 = sext i32 %28 to i64 %arrayidx20.2 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %idxprom19.2 %29 = load i32, ptr %arrayidx20.2, align 4, !tbaa !5 %inc21.2 = add nsw i32 %29, 1 store i32 %inc21.2, ptr %arrayidx20.2, align 4, !tbaa !5 %indvars.iv.next60.2 = or i64 %indvars.iv59, 3 %arrayidx18.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next60.2 %30 = load i32, ptr %arrayidx18.3, align 4, !tbaa !5 %idxprom19.3 = sext i32 %30 to i64 %arrayidx20.3 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %idxprom19.3 %31 = load i32, ptr %arrayidx20.3, align 4, !tbaa !5 %inc21.3 = add nsw i32 %31, 1 store i32 %inc21.3, ptr %arrayidx20.3, align 4, !tbaa !5 %indvars.iv.next60.3 = add nuw nsw i64 %indvars.iv59, 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 %vector.body.preheader.loopexit.unr-lcssa, label %for.body16, !llvm.loop !14 vector.body.preheader.loopexit.unr-lcssa: ; preds = %for.body16, %for.body16.preheader %indvars.iv59.unr = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next60.3, %for.body16 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %vector.body.preheader, label %for.body16.epil for.body16.epil: ; preds = %vector.body.preheader.loopexit.unr-lcssa, %for.body16.epil %indvars.iv59.epil = phi i64 [ %indvars.iv.next60.epil, %for.body16.epil ], [ %indvars.iv59.unr, %vector.body.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body16.epil ], [ 0, %vector.body.preheader.loopexit.unr-lcssa ] %arrayidx18.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59.epil %32 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5 %idxprom19.epil = sext i32 %32 to i64 %arrayidx20.epil = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 %idxprom19.epil %33 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5 %inc21.epil = add nsw i32 %33, 1 store i32 %inc21.epil, ptr %arrayidx20.epil, align 4, !tbaa !5 %indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.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 %vector.body.preheader, label %for.body16.epil, !llvm.loop !15 vector.body.preheader: ; preds = %vector.body.preheader.loopexit.unr-lcssa, %for.body16.epil, %for.cond.cleanup, %for.cond.cleanup.thread br label %vector.body for.body29: ; preds = %vector.body %bin.rdx = add <4 x i32> %14, %13 %34 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %arrayidx31 = getelementptr inbounds [601 x i32], ptr %c, i64 0, i64 601 %35 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %35, 0 %inc33 = zext i1 %cmp32 to i32 %spec.select = add nuw nsw i32 %34, %inc33 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 2404, ptr nonnull %c) #6 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; 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 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"}
#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 NUM 20001 #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; } ll a[100000],b[100000]; int main(void) { int n,i; ll res=0,k; scanf("%d",&n); FOR(i,0,n) scanf("%lld%lld",&a[i],&b[i]); for(i=n-1;i>=0;i--){ a[i]+=res; k=(a[i]+b[i]-1)/b[i]; res+=b[i]*k-a[i]; } printf("%lld\n",res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164653/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @a = dso_local global [100000 x i64] zeroinitializer, align 16 @b = dso_local global [100000 x i64] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %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 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 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.body, label %for.end24 for.cond4.preheader: ; preds = %for.body %cmp542 = icmp sgt i32 %2, 0 br i1 %cmp542, label %for.body6.preheader, label %for.end24 for.body6.preheader: ; preds = %for.cond4.preheader %1 = zext i32 %2 to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !14 for.body6: ; preds = %for.body6.preheader, %for.body6 %indvars.iv48 = phi i64 [ %1, %for.body6.preheader ], [ %indvars.iv.next49, %for.body6 ] %res.043 = phi i64 [ 0, %for.body6.preheader ], [ %add22, %for.body6 ] %indvars.iv.next49 = add nsw i64 %indvars.iv48, -1 %idxprom7 = and i64 %indvars.iv.next49, 4294967295 %arrayidx8 = getelementptr inbounds [100000 x i64], ptr @a, i64 0, i64 %idxprom7 %4 = load i64, ptr %arrayidx8, align 8, !tbaa !15 %add = add nsw i64 %4, %res.043 store i64 %add, ptr %arrayidx8, align 8, !tbaa !15 %arrayidx12 = getelementptr inbounds [100000 x i64], ptr @b, i64 0, i64 %idxprom7 %5 = load i64, ptr %arrayidx12, align 8, !tbaa !15 %add13 = add nsw i64 %5, %add %add13.fr = freeze i64 %add13 %sub14 = add i64 %add13.fr, -1 %6 = srem i64 %sub14, %5 %7 = add i64 %4, %6 %add22 = sub i64 %sub14, %7 %cmp5 = icmp ugt i64 %indvars.iv48, 1 br i1 %cmp5, label %for.body6, label %for.end24, !llvm.loop !17 for.end24: ; preds = %for.body6, %entry, %for.cond4.preheader %res.0.lcssa = phi i64 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %add22, %for.body6 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %res.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!16, !16, i64 0} !16 = !{!"long long", !7, i64 0} !17 = distinct !{!17, !10}
#include <stdio.h> #include <stdlib.h> int puzzle[4][4]; int tmp[4][4]; int dx[4] = {0,1,0,-1}; int dy[4] = {1,0,-1,0}; void empty(int *,int *); int dfs(int,int,int,int,const int); int cal(); void swap(int *,int *); int main() { int i,j,a,x,y,l; for(i=0; i<4; i++) { for(j=0; j<4; j++) scanf("%d",&puzzle[i][j]); } empty(&x,&y); for(l=0; l<100; l++) { for(i=0; i<4; i++) { for(j=0; j<4; j++) tmp[i][j] = puzzle[i][j]; } a = dfs(x,y,-1,0,l); if(a!=-1) { printf("%d\n",a); break; } for(i=0 ; i<4; i++) { for(j=0 ; j<4; j++) puzzle[i][j] = tmp[i][j]; } a = -1; if(l==99) printf("%d\n",a); } return 0; } void empty(int *x,int *y) { int i,j; for(i=0; i<4; i++) { for(j=0; j<4; j++) { if(!puzzle[i][j]) { *x = j; *y = i; return; } } } } void swap(int *a,int *b) { int tmp; tmp = *a; *a = *b; *b = tmp; } int cal() { int i,a,sum=0; for(i=0; i<16; i++) { a = puzzle[i/4][i%4]; if(a) { a--; sum += abs(i/4 - a/4) + abs(i%4 - a%4); } } return sum; } int dfs(int x,int y,int p,int dep,const int lim) { int i,h,nx,ny,res; h = cal(); if(h==0) return dep; if(dep+h>lim) return -1; for(i=0; i<4; i++) { nx = x+dx[i]; ny = y+dy[i]; if(~p && i==(p+2)%4) continue; if(!(0<=nx && nx<4 && 0<=ny && ny<4)) continue; swap(&puzzle[y][x],&puzzle[ny][nx]); res = dfs(nx,ny,i,dep+1,lim); if(~res) return res; swap(&puzzle[y][x],&puzzle[ny][nx]); } return -1; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164703/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164703/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @dx = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16 @dy = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @puzzle = dso_local global [4 x [4 x i32]] zeroinitializer, align 16 @tmp = dso_local local_unnamed_addr global [4 x [4 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @puzzle) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 1)) %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 2)) %call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 3)) %call.198 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 0)) %call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 1)) %call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 2)) %call.3.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 3)) %call.2100 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 0)) %call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 1)) %call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 2)) %call.3.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 3)) %call.3102 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 0)) %call.1.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 1)) %call.2.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 2)) %call.3.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 3)) %0 = load i32, ptr @puzzle, align 16, !tbaa !5 %tobool.not.i = icmp eq i32 %0, 0 br i1 %tobool.not.i, label %empty.exit, label %for.inc.i for.inc.i: ; preds = %entry %1 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 1), align 4, !tbaa !5 %tobool.not.1.i = icmp eq i32 %1, 0 br i1 %tobool.not.1.i, label %empty.exit, label %for.inc.1.i for.inc.1.i: ; preds = %for.inc.i %2 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 2), align 8, !tbaa !5 %tobool.not.2.i = icmp eq i32 %2, 0 br i1 %tobool.not.2.i, label %empty.exit, label %for.inc.2.i for.inc.2.i: ; preds = %for.inc.1.i %3 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 3), align 4, !tbaa !5 %tobool.not.3.i = icmp eq i32 %3, 0 br i1 %tobool.not.3.i, label %empty.exit, label %for.inc.3.i for.inc.3.i: ; preds = %for.inc.2.i %4 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 0), align 16, !tbaa !5 %tobool.not.125.i = icmp eq i32 %4, 0 br i1 %tobool.not.125.i, label %empty.exit, label %for.inc.126.i for.inc.126.i: ; preds = %for.inc.3.i %5 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 1), align 4, !tbaa !5 %tobool.not.1.1.i = icmp eq i32 %5, 0 br i1 %tobool.not.1.1.i, label %empty.exit, label %for.inc.1.1.i for.inc.1.1.i: ; preds = %for.inc.126.i %6 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 2), align 8, !tbaa !5 %tobool.not.2.1.i = icmp eq i32 %6, 0 br i1 %tobool.not.2.1.i, label %empty.exit, label %for.inc.2.1.i for.inc.2.1.i: ; preds = %for.inc.1.1.i %7 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 3), align 4, !tbaa !5 %tobool.not.3.1.i = icmp eq i32 %7, 0 br i1 %tobool.not.3.1.i, label %empty.exit, label %for.inc.3.1.i for.inc.3.1.i: ; preds = %for.inc.2.1.i %8 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 0), align 16, !tbaa !5 %tobool.not.228.i = icmp eq i32 %8, 0 br i1 %tobool.not.228.i, label %empty.exit, label %for.inc.229.i for.inc.229.i: ; preds = %for.inc.3.1.i %9 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 1), align 4, !tbaa !5 %tobool.not.1.2.i = icmp eq i32 %9, 0 br i1 %tobool.not.1.2.i, label %empty.exit, label %for.inc.1.2.i for.inc.1.2.i: ; preds = %for.inc.229.i %10 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 2), align 8, !tbaa !5 %tobool.not.2.2.i = icmp eq i32 %10, 0 br i1 %tobool.not.2.2.i, label %empty.exit, label %for.inc.2.2.i for.inc.2.2.i: ; preds = %for.inc.1.2.i %11 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 3), align 4, !tbaa !5 %tobool.not.3.2.i = icmp eq i32 %11, 0 br i1 %tobool.not.3.2.i, label %empty.exit, label %for.inc.3.2.i for.inc.3.2.i: ; preds = %for.inc.2.2.i %12 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 0), align 16, !tbaa !5 %tobool.not.331.i = icmp eq i32 %12, 0 br i1 %tobool.not.331.i, label %empty.exit, label %for.inc.332.i for.inc.332.i: ; preds = %for.inc.3.2.i %13 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 1), align 4, !tbaa !5 %tobool.not.1.3.i = icmp eq i32 %13, 0 br i1 %tobool.not.1.3.i, label %empty.exit, label %for.inc.1.3.i for.inc.1.3.i: ; preds = %for.inc.332.i %14 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 2), align 8, !tbaa !5 %tobool.not.2.3.i = icmp eq i32 %14, 0 %spec.select = select i1 %tobool.not.2.3.i, i32 2, i32 3 br label %empty.exit empty.exit: ; preds = %for.inc.1.3.i, %entry, %for.inc.i, %for.inc.1.i, %for.inc.2.i, %for.inc.3.i, %for.inc.126.i, %for.inc.1.1.i, %for.inc.2.1.i, %for.inc.3.1.i, %for.inc.229.i, %for.inc.1.2.i, %for.inc.2.2.i, %for.inc.3.2.i, %for.inc.332.i %x.0 = phi i32 [ 0, %entry ], [ 1, %for.inc.i ], [ 2, %for.inc.1.i ], [ 3, %for.inc.2.i ], [ 0, %for.inc.3.i ], [ 1, %for.inc.126.i ], [ 2, %for.inc.1.1.i ], [ 3, %for.inc.2.1.i ], [ 0, %for.inc.3.1.i ], [ 1, %for.inc.229.i ], [ 2, %for.inc.1.2.i ], [ 3, %for.inc.2.2.i ], [ 0, %for.inc.3.2.i ], [ 1, %for.inc.332.i ], [ %spec.select, %for.inc.1.3.i ] %y.0 = phi i32 [ 0, %entry ], [ 0, %for.inc.i ], [ 0, %for.inc.1.i ], [ 0, %for.inc.2.i ], [ 1, %for.inc.3.i ], [ 1, %for.inc.126.i ], [ 1, %for.inc.1.1.i ], [ 1, %for.inc.2.1.i ], [ 2, %for.inc.3.1.i ], [ 2, %for.inc.229.i ], [ 2, %for.inc.1.2.i ], [ 2, %for.inc.2.2.i ], [ 3, %for.inc.3.2.i ], [ 3, %for.inc.332.i ], [ 3, %for.inc.1.3.i ] tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @tmp, ptr noundef nonnull align 16 dereferenceable(64) @puzzle, i64 64, i1 false), !tbaa !5 %call32112 = tail call i32 @dfs(i32 noundef %x.0, i32 noundef %y.0, i32 noundef -1, i32 noundef 0, i32 noundef 0) %cmp33.not113 = icmp eq i32 %call32112, -1 br i1 %cmp33.not113, label %for.cond38.preheader.preheader, label %for.end61 for.cond12.preheader: ; preds = %for.cond38.preheader.preheader %inc60 = add nuw nsw i32 %l.093114, 1 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @tmp, ptr noundef nonnull align 16 dereferenceable(64) @puzzle, i64 64, i1 false), !tbaa !5 %call32 = tail call i32 @dfs(i32 noundef %x.0, i32 noundef %y.0, i32 noundef -1, i32 noundef 0, i32 noundef %inc60) %cmp33.not = icmp eq i32 %call32, -1 br i1 %cmp33.not, label %for.cond38.preheader.preheader, label %for.end61 for.cond38.preheader.preheader: ; preds = %empty.exit, %for.cond12.preheader %l.093114 = phi i32 [ %inc60, %for.cond12.preheader ], [ 0, %empty.exit ] tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @puzzle, ptr noundef nonnull align 16 dereferenceable(64) @tmp, i64 64, i1 false), !tbaa !5 %cmp55 = icmp eq i32 %l.093114, 99 br i1 %cmp55, label %for.end61, label %for.cond12.preheader for.end61: ; preds = %for.cond12.preheader, %for.cond38.preheader.preheader, %empty.exit %.sink = phi i32 [ %call32112, %empty.exit ], [ %call32, %for.cond12.preheader ], [ -1, %for.cond38.preheader.preheader ] %call57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable define dso_local void @empty(ptr nocapture noundef writeonly %x, ptr nocapture noundef writeonly %y) local_unnamed_addr #2 { entry: %0 = load i32, ptr @puzzle, align 16, !tbaa !5 %tobool.not = icmp eq i32 %0, 0 br i1 %tobool.not, label %if.then, label %for.inc if.then: ; preds = %for.inc.2.3, %for.inc.1.3, %for.inc.332, %for.inc.3.2, %for.inc.2.2, %for.inc.1.2, %for.inc.229, %for.inc.3.1, %for.inc.2.1, %for.inc.1.1, %for.inc.126, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry %i.019.lcssa = phi i32 [ 0, %entry ], [ 0, %for.inc ], [ 0, %for.inc.1 ], [ 0, %for.inc.2 ], [ 1, %for.inc.3 ], [ 1, %for.inc.126 ], [ 1, %for.inc.1.1 ], [ 1, %for.inc.2.1 ], [ 2, %for.inc.3.1 ], [ 2, %for.inc.229 ], [ 2, %for.inc.1.2 ], [ 2, %for.inc.2.2 ], [ 3, %for.inc.3.2 ], [ 3, %for.inc.332 ], [ 3, %for.inc.1.3 ], [ 3, %for.inc.2.3 ] %j.018.lcssa.wide = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 3, %for.inc.2 ], [ 0, %for.inc.3 ], [ 1, %for.inc.126 ], [ 2, %for.inc.1.1 ], [ 3, %for.inc.2.1 ], [ 0, %for.inc.3.1 ], [ 1, %for.inc.229 ], [ 2, %for.inc.1.2 ], [ 3, %for.inc.2.2 ], [ 0, %for.inc.3.2 ], [ 1, %for.inc.332 ], [ 2, %for.inc.1.3 ], [ 3, %for.inc.2.3 ] store i32 %j.018.lcssa.wide, ptr %x, align 4, !tbaa !5 store i32 %i.019.lcssa, ptr %y, align 4, !tbaa !5 br label %cleanup for.inc: ; preds = %entry %1 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 1), align 4, !tbaa !5 %tobool.not.1 = icmp eq i32 %1, 0 br i1 %tobool.not.1, label %if.then, label %for.inc.1 for.inc.1: ; preds = %for.inc %2 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 2), align 8, !tbaa !5 %tobool.not.2 = icmp eq i32 %2, 0 br i1 %tobool.not.2, label %if.then, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %3 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 0, i64 3), align 4, !tbaa !5 %tobool.not.3 = icmp eq i32 %3, 0 br i1 %tobool.not.3, label %if.then, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %4 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 0), align 16, !tbaa !5 %tobool.not.125 = icmp eq i32 %4, 0 br i1 %tobool.not.125, label %if.then, label %for.inc.126 for.inc.126: ; preds = %for.inc.3 %5 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 1), align 4, !tbaa !5 %tobool.not.1.1 = icmp eq i32 %5, 0 br i1 %tobool.not.1.1, label %if.then, label %for.inc.1.1 for.inc.1.1: ; preds = %for.inc.126 %6 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 2), align 8, !tbaa !5 %tobool.not.2.1 = icmp eq i32 %6, 0 br i1 %tobool.not.2.1, label %if.then, label %for.inc.2.1 for.inc.2.1: ; preds = %for.inc.1.1 %7 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 1, i64 3), align 4, !tbaa !5 %tobool.not.3.1 = icmp eq i32 %7, 0 br i1 %tobool.not.3.1, label %if.then, label %for.inc.3.1 for.inc.3.1: ; preds = %for.inc.2.1 %8 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 0), align 16, !tbaa !5 %tobool.not.228 = icmp eq i32 %8, 0 br i1 %tobool.not.228, label %if.then, label %for.inc.229 for.inc.229: ; preds = %for.inc.3.1 %9 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 1), align 4, !tbaa !5 %tobool.not.1.2 = icmp eq i32 %9, 0 br i1 %tobool.not.1.2, label %if.then, label %for.inc.1.2 for.inc.1.2: ; preds = %for.inc.229 %10 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 2), align 8, !tbaa !5 %tobool.not.2.2 = icmp eq i32 %10, 0 br i1 %tobool.not.2.2, label %if.then, label %for.inc.2.2 for.inc.2.2: ; preds = %for.inc.1.2 %11 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 2, i64 3), align 4, !tbaa !5 %tobool.not.3.2 = icmp eq i32 %11, 0 br i1 %tobool.not.3.2, label %if.then, label %for.inc.3.2 for.inc.3.2: ; preds = %for.inc.2.2 %12 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 0), align 16, !tbaa !5 %tobool.not.331 = icmp eq i32 %12, 0 br i1 %tobool.not.331, label %if.then, label %for.inc.332 for.inc.332: ; preds = %for.inc.3.2 %13 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 1), align 4, !tbaa !5 %tobool.not.1.3 = icmp eq i32 %13, 0 br i1 %tobool.not.1.3, label %if.then, label %for.inc.1.3 for.inc.1.3: ; preds = %for.inc.332 %14 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 2), align 8, !tbaa !5 %tobool.not.2.3 = icmp eq i32 %14, 0 br i1 %tobool.not.2.3, label %if.then, label %for.inc.2.3 for.inc.2.3: ; preds = %for.inc.1.3 %15 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @puzzle, i64 0, i64 3, i64 3), align 4, !tbaa !5 %tobool.not.3.3 = icmp eq i32 %15, 0 br i1 %tobool.not.3.3, label %if.then, label %cleanup cleanup: ; preds = %for.inc.2.3, %if.then ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %x, i32 noundef %y, i32 noundef %p, i32 noundef %dep, i32 noundef %lim) local_unnamed_addr #3 { entry: br label %for.body.i for.body.i: ; preds = %for.inc.i, %entry %sum.020.i = phi i32 [ 0, %entry ], [ %sum.1.i, %for.inc.i ] %i.019.i = phi i32 [ 0, %entry ], [ %inc.i, %for.inc.i ] %div18.i = lshr i32 %i.019.i, 2 %idxprom.i = zext i32 %div18.i to i64 %rem.i = and i32 %i.019.i, 3 %idxprom1.i = zext i32 %rem.i to i64 %arrayidx2.i = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom.i, i64 %idxprom1.i %0 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %tobool.not.i = icmp eq i32 %0, 0 br i1 %tobool.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body.i %dec.i = add nsw i32 %0, -1 %div4.neg.i = sdiv i32 %dec.i, -4 %sub.i = add nsw i32 %div4.neg.i, %div18.i %1 = tail call i32 @llvm.abs.i32(i32 %sub.i, i1 true) %rem6.i = srem i32 %dec.i, 4 %sub7.i = sub nsw i32 %rem.i, %rem6.i %2 = tail call i32 @llvm.abs.i32(i32 %sub7.i, i1 true) %add.i = add i32 %2, %sum.020.i %add8.i = add i32 %add.i, %1 br label %for.inc.i for.inc.i: ; preds = %if.then.i, %for.body.i %sum.1.i = phi i32 [ %add8.i, %if.then.i ], [ %sum.020.i, %for.body.i ] %inc.i = add nuw nsw i32 %i.019.i, 1 %exitcond.not.i = icmp eq i32 %inc.i, 16 br i1 %exitcond.not.i, label %cal.exit, label %for.body.i, !llvm.loop !9 cal.exit: ; preds = %for.inc.i %cmp = icmp eq i32 %sum.1.i, 0 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %cal.exit %add = add nsw i32 %sum.1.i, %dep %cmp1 = icmp sgt i32 %add, %lim br i1 %cmp1, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %if.end %idxprom22 = sext i32 %y to i64 %idxprom24 = sext i32 %x to i64 %arrayidx25 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom22, i64 %idxprom24 %tobool.not = icmp eq i32 %p, -1 %add30 = add nsw i32 %dep, 1 br i1 %tobool.not, label %for.body.us.preheader, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %add9 = add nsw i32 %p, 2 %rem = srem i32 %add9, 4 %3 = load i32, ptr @dx, align 16, !tbaa !5 %add5 = add nsw i32 %3, %x %4 = load i32, ptr @dy, align 16, !tbaa !5 %add8 = add nsw i32 %4, %y %cmp10 = icmp eq i32 %rem, 0 br i1 %cmp10, label %if.end12.1, label %if.end12 for.body.us.preheader: ; preds = %for.cond.preheader %5 = load i32, ptr @dx, align 16, !tbaa !5 %add5.us = add nsw i32 %5, %x %6 = load i32, ptr @dy, align 16, !tbaa !5 %add8.us = add nsw i32 %6, %y %or.cond.us = icmp ult i32 %add5.us, 4 %cmp17.us = icmp sgt i32 %add8.us, -1 %or.cond48.us = select i1 %or.cond.us, i1 %cmp17.us, i1 false %cmp19.us = icmp slt i32 %add8.us, 4 %or.cond49.us = select i1 %or.cond48.us, i1 %cmp19.us, i1 false br i1 %or.cond49.us, label %if.end21.us, label %for.inc.us if.end21.us: ; preds = %for.body.us.preheader %idxprom26.us = zext i32 %add8.us to i64 %idxprom28.us = zext i32 %add5.us to i64 %arrayidx29.us = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.us, i64 %idxprom28.us %7 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 store i32 %8, ptr %arrayidx25, align 4, !tbaa !5 store i32 %7, ptr %arrayidx29.us, align 4, !tbaa !5 %call31.us = tail call i32 @dfs(i32 noundef %add5.us, i32 noundef %add8.us, i32 noundef 0, i32 noundef %add30, i32 noundef %lim) %tobool33.not.us = icmp eq i32 %call31.us, -1 br i1 %tobool33.not.us, label %if.end35.us, label %cleanup if.end35.us: ; preds = %if.end21.us %9 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 store i32 %10, ptr %arrayidx25, align 4, !tbaa !5 store i32 %9, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc.us for.inc.us: ; preds = %if.end35.us, %for.body.us.preheader %11 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5 %add5.us.1 = add nsw i32 %11, %x %12 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5 %add8.us.1 = add nsw i32 %12, %y %or.cond.us.1 = icmp ult i32 %add5.us.1, 4 %cmp17.us.1 = icmp sgt i32 %add8.us.1, -1 %or.cond48.us.1 = select i1 %or.cond.us.1, i1 %cmp17.us.1, i1 false %cmp19.us.1 = icmp slt i32 %add8.us.1, 4 %or.cond49.us.1 = select i1 %or.cond48.us.1, i1 %cmp19.us.1, i1 false br i1 %or.cond49.us.1, label %if.end21.us.1, label %for.inc.us.1 if.end21.us.1: ; preds = %for.inc.us %idxprom26.us.1 = zext i32 %add8.us.1 to i64 %idxprom28.us.1 = zext i32 %add5.us.1 to i64 %arrayidx29.us.1 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.us.1, i64 %idxprom28.us.1 %13 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %14 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5 store i32 %14, ptr %arrayidx25, align 4, !tbaa !5 store i32 %13, ptr %arrayidx29.us.1, align 4, !tbaa !5 %call31.us.1 = tail call i32 @dfs(i32 noundef %add5.us.1, i32 noundef %add8.us.1, i32 noundef 1, i32 noundef %add30, i32 noundef %lim) %tobool33.not.us.1 = icmp eq i32 %call31.us.1, -1 br i1 %tobool33.not.us.1, label %if.end35.us.1, label %cleanup if.end35.us.1: ; preds = %if.end21.us.1 %15 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5 store i32 %16, ptr %arrayidx25, align 4, !tbaa !5 store i32 %15, ptr %arrayidx29.us.1, align 4, !tbaa !5 br label %for.inc.us.1 for.inc.us.1: ; preds = %if.end35.us.1, %for.inc.us %17 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5 %add5.us.2 = add nsw i32 %17, %x %18 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5 %add8.us.2 = add nsw i32 %18, %y %or.cond.us.2 = icmp ult i32 %add5.us.2, 4 %cmp17.us.2 = icmp sgt i32 %add8.us.2, -1 %or.cond48.us.2 = select i1 %or.cond.us.2, i1 %cmp17.us.2, i1 false %cmp19.us.2 = icmp slt i32 %add8.us.2, 4 %or.cond49.us.2 = select i1 %or.cond48.us.2, i1 %cmp19.us.2, i1 false br i1 %or.cond49.us.2, label %if.end21.us.2, label %for.inc.us.2 if.end21.us.2: ; preds = %for.inc.us.1 %idxprom26.us.2 = zext i32 %add8.us.2 to i64 %idxprom28.us.2 = zext i32 %add5.us.2 to i64 %arrayidx29.us.2 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.us.2, i64 %idxprom28.us.2 %19 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5 store i32 %20, ptr %arrayidx25, align 4, !tbaa !5 store i32 %19, ptr %arrayidx29.us.2, align 4, !tbaa !5 %call31.us.2 = tail call i32 @dfs(i32 noundef %add5.us.2, i32 noundef %add8.us.2, i32 noundef 2, i32 noundef %add30, i32 noundef %lim) %tobool33.not.us.2 = icmp eq i32 %call31.us.2, -1 br i1 %tobool33.not.us.2, label %if.end35.us.2, label %cleanup if.end35.us.2: ; preds = %if.end21.us.2 %21 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %22 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5 store i32 %22, ptr %arrayidx25, align 4, !tbaa !5 store i32 %21, ptr %arrayidx29.us.2, align 4, !tbaa !5 br label %for.inc.us.2 for.inc.us.2: ; preds = %if.end35.us.2, %for.inc.us.1 %23 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5 %add5.us.3 = add nsw i32 %23, %x %24 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5 %add8.us.3 = add nsw i32 %24, %y %or.cond.us.3 = icmp ult i32 %add5.us.3, 4 %cmp17.us.3 = icmp sgt i32 %add8.us.3, -1 %or.cond48.us.3 = select i1 %or.cond.us.3, i1 %cmp17.us.3, i1 false %cmp19.us.3 = icmp slt i32 %add8.us.3, 4 %or.cond49.us.3 = select i1 %or.cond48.us.3, i1 %cmp19.us.3, i1 false br i1 %or.cond49.us.3, label %if.end21.us.3, label %cleanup if.end21.us.3: ; preds = %for.inc.us.2 %idxprom26.us.3 = zext i32 %add8.us.3 to i64 %idxprom28.us.3 = zext i32 %add5.us.3 to i64 %arrayidx29.us.3 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.us.3, i64 %idxprom28.us.3 %25 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %26 = load i32, ptr %arrayidx29.us.3, align 4, !tbaa !5 store i32 %26, ptr %arrayidx25, align 4, !tbaa !5 store i32 %25, ptr %arrayidx29.us.3, align 4, !tbaa !5 %call31.us.3 = tail call i32 @dfs(i32 noundef %add5.us.3, i32 noundef %add8.us.3, i32 noundef 3, i32 noundef %add30, i32 noundef %lim) %tobool33.not.us.3 = icmp eq i32 %call31.us.3, -1 br i1 %tobool33.not.us.3, label %cleanup.sink.split, label %cleanup if.end12: ; preds = %for.body.preheader %or.cond = icmp ult i32 %add5, 4 %cmp17 = icmp sgt i32 %add8, -1 %or.cond48 = select i1 %or.cond, i1 %cmp17, i1 false %cmp19 = icmp slt i32 %add8, 4 %or.cond49 = select i1 %or.cond48, i1 %cmp19, i1 false br i1 %or.cond49, label %if.end21, label %for.inc if.end21: ; preds = %if.end12 %idxprom26 = zext i32 %add8 to i64 %idxprom28 = zext i32 %add5 to i64 %arrayidx29 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26, i64 %idxprom28 %27 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %28 = load i32, ptr %arrayidx29, align 4, !tbaa !5 store i32 %28, ptr %arrayidx25, align 4, !tbaa !5 store i32 %27, ptr %arrayidx29, align 4, !tbaa !5 %call31 = tail call i32 @dfs(i32 noundef %add5, i32 noundef %add8, i32 noundef 0, i32 noundef %add30, i32 noundef %lim) %tobool33.not = icmp eq i32 %call31, -1 br i1 %tobool33.not, label %if.end35, label %cleanup if.end35: ; preds = %if.end21 %29 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %30 = load i32, ptr %arrayidx29, align 4, !tbaa !5 store i32 %30, ptr %arrayidx25, align 4, !tbaa !5 store i32 %29, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end12, %if.end35 %cmp10.1 = icmp eq i32 %rem, 1 br i1 %cmp10.1, label %if.end12.2, label %if.end12.1 if.end12.1: ; preds = %for.body.preheader, %for.inc %.pn95 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5 %add5.181 = add nsw i32 %.pn95, %x %.pn = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5 %add8.182 = add nsw i32 %.pn, %y %or.cond.1 = icmp ult i32 %add5.181, 4 %cmp17.1 = icmp sgt i32 %add8.182, -1 %or.cond48.1 = select i1 %or.cond.1, i1 %cmp17.1, i1 false %cmp19.1 = icmp slt i32 %add8.182, 4 %or.cond49.1 = select i1 %or.cond48.1, i1 %cmp19.1, i1 false br i1 %or.cond49.1, label %if.end21.1, label %for.inc.1 if.end21.1: ; preds = %if.end12.1 %idxprom26.1 = zext i32 %add8.182 to i64 %idxprom28.1 = zext i32 %add5.181 to i64 %arrayidx29.1 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.1, i64 %idxprom28.1 %31 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %32 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5 store i32 %32, ptr %arrayidx25, align 4, !tbaa !5 store i32 %31, ptr %arrayidx29.1, align 4, !tbaa !5 %call31.1 = tail call i32 @dfs(i32 noundef %add5.181, i32 noundef %add8.182, i32 noundef 1, i32 noundef %add30, i32 noundef %lim) %tobool33.not.1 = icmp eq i32 %call31.1, -1 br i1 %tobool33.not.1, label %if.end35.1, label %cleanup if.end35.1: ; preds = %if.end21.1 %33 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %34 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5 store i32 %34, ptr %arrayidx25, align 4, !tbaa !5 store i32 %33, ptr %arrayidx29.1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end35.1, %if.end12.1 %cmp10.2 = icmp eq i32 %rem, 2 br i1 %cmp10.2, label %if.end12.3, label %if.end12.2 if.end12.2: ; preds = %for.inc, %for.inc.1 %.pn97 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5 %add5.286 = add nsw i32 %.pn97, %x %.pn96 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5 %add8.287 = add nsw i32 %.pn96, %y %or.cond.2 = icmp ult i32 %add5.286, 4 %cmp17.2 = icmp sgt i32 %add8.287, -1 %or.cond48.2 = select i1 %or.cond.2, i1 %cmp17.2, i1 false %cmp19.2 = icmp slt i32 %add8.287, 4 %or.cond49.2 = select i1 %or.cond48.2, i1 %cmp19.2, i1 false br i1 %or.cond49.2, label %if.end21.2, label %for.inc.2 if.end21.2: ; preds = %if.end12.2 %idxprom26.2 = zext i32 %add8.287 to i64 %idxprom28.2 = zext i32 %add5.286 to i64 %arrayidx29.2 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.2, i64 %idxprom28.2 %35 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %36 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5 store i32 %36, ptr %arrayidx25, align 4, !tbaa !5 store i32 %35, ptr %arrayidx29.2, align 4, !tbaa !5 %call31.2 = tail call i32 @dfs(i32 noundef %add5.286, i32 noundef %add8.287, i32 noundef 2, i32 noundef %add30, i32 noundef %lim) %tobool33.not.2 = icmp eq i32 %call31.2, -1 br i1 %tobool33.not.2, label %if.end35.2, label %cleanup if.end35.2: ; preds = %if.end21.2 %37 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %38 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5 store i32 %38, ptr %arrayidx25, align 4, !tbaa !5 store i32 %37, ptr %arrayidx29.2, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end35.2, %if.end12.2 %cmp10.3 = icmp eq i32 %rem, 3 br i1 %cmp10.3, label %cleanup, label %if.end12.3 if.end12.3: ; preds = %for.inc.1, %for.inc.2 %.pn99 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5 %add5.391 = add nsw i32 %.pn99, %x %.pn98 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5 %add8.392 = add nsw i32 %.pn98, %y %or.cond.3 = icmp ult i32 %add5.391, 4 %cmp17.3 = icmp sgt i32 %add8.392, -1 %or.cond48.3 = select i1 %or.cond.3, i1 %cmp17.3, i1 false %cmp19.3 = icmp slt i32 %add8.392, 4 %or.cond49.3 = select i1 %or.cond48.3, i1 %cmp19.3, i1 false br i1 %or.cond49.3, label %if.end21.3, label %cleanup if.end21.3: ; preds = %if.end12.3 %idxprom26.3 = zext i32 %add8.392 to i64 %idxprom28.3 = zext i32 %add5.391 to i64 %arrayidx29.3 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom26.3, i64 %idxprom28.3 %39 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %40 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5 store i32 %40, ptr %arrayidx25, align 4, !tbaa !5 store i32 %39, ptr %arrayidx29.3, align 4, !tbaa !5 %call31.3 = tail call i32 @dfs(i32 noundef %add5.391, i32 noundef %add8.392, i32 noundef 3, i32 noundef %add30, i32 noundef %lim) %tobool33.not.3 = icmp eq i32 %call31.3, -1 br i1 %tobool33.not.3, label %cleanup.sink.split, label %cleanup cleanup.sink.split: ; preds = %if.end21.3, %if.end21.us.3 %arrayidx29.3.sink94 = phi ptr [ %arrayidx29.us.3, %if.end21.us.3 ], [ %arrayidx29.3, %if.end21.3 ] %41 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %42 = load i32, ptr %arrayidx29.3.sink94, align 4, !tbaa !5 store i32 %42, ptr %arrayidx25, align 4, !tbaa !5 store i32 %41, ptr %arrayidx29.3.sink94, align 4, !tbaa !5 br label %cleanup cleanup: ; preds = %cleanup.sink.split, %if.end21, %if.end21.1, %if.end21.2, %if.end21.3, %if.end12.3, %for.inc.2, %if.end21.us, %if.end21.us.1, %if.end21.us.2, %if.end21.us.3, %for.inc.us.2, %if.end, %cal.exit %retval.0 = phi i32 [ %dep, %cal.exit ], [ -1, %if.end ], [ %call31.us, %if.end21.us ], [ %call31.us.1, %if.end21.us.1 ], [ %call31.us.2, %if.end21.us.2 ], [ %call31.us.3, %if.end21.us.3 ], [ -1, %for.inc.us.2 ], [ %call31, %if.end21 ], [ %call31.1, %if.end21.1 ], [ %call31.2, %if.end21.2 ], [ %call31.3, %if.end21.3 ], [ -1, %if.end12.3 ], [ -1, %for.inc.2 ], [ -1, %cleanup.sink.split ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @cal() local_unnamed_addr #5 { entry: br label %for.body for.body: ; preds = %entry, %for.inc %sum.020 = phi i32 [ 0, %entry ], [ %sum.1, %for.inc ] %i.019 = phi i32 [ 0, %entry ], [ %inc, %for.inc ] %div18 = lshr i32 %i.019, 2 %idxprom = zext i32 %div18 to i64 %rem = and i32 %i.019, 3 %idxprom1 = zext i32 %rem to i64 %arrayidx2 = getelementptr inbounds [4 x [4 x i32]], ptr @puzzle, i64 0, i64 %idxprom, i64 %idxprom1 %0 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %tobool.not = icmp eq i32 %0, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.body %dec = add nsw i32 %0, -1 %div4.neg = sdiv i32 %dec, -4 %sub = add nsw i32 %div4.neg, %div18 %1 = tail call i32 @llvm.abs.i32(i32 %sub, i1 true) %rem6 = srem i32 %dec, 4 %sub7 = sub nsw i32 %rem, %rem6 %2 = tail call i32 @llvm.abs.i32(i32 %sub7, i1 true) %add = add i32 %2, %sum.020 %add8 = add i32 %add, %1 br label %for.inc for.inc: ; preds = %for.body, %if.then %sum.1 = phi i32 [ %add8, %if.then ], [ %sum.020, %for.body ] %inc = add nuw nsw i32 %i.019, 1 %exitcond.not = icmp eq i32 %inc, 16 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.inc ret i32 %sum.1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #6 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree 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 #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 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int dfs(int,int,int , int); int tag(); void change(int *, int *); int xarr[4]={-1,0,1,0},yarr[4]={0,-1,0,1}; int array[4][4],sum; int main(){ int i,j,zerox,zeroy; for(i=0;i<4;i++){ for(j=0;j<4;j++){ scanf("%d",&array[i][j]); if(array[i][j]==0){ zerox=j; zeroy=i; } } } for(sum=0;;sum++){ if(dfs(0,10,zerox,zeroy)==1) break; } printf("%d\n",sum); /*output*/ return 0; } int dfs(int dep, int prev, int zerox, int zeroy){ int i,xx,yy,ta; ta=tag(); if(ta==0) return 1; if(dep+ta>sum) return -1; for(i=0;i<4;i++){ if(i-prev==-2 || i-prev==2) continue; xx=zerox+xarr[i]; yy=zeroy+yarr[i]; if(xx<0 || yy<0 || xx>=4 || yy>=4) continue; change(&array[zeroy][zerox],&array[yy][xx]); if(dfs(dep+1,i,xx,yy)==1) return 1; change(&array[zeroy][zerox],&array[yy][xx]); } return -1; } int tag(){ int i,j,num=0; for(i=0;i<4;i++){ for(j=0;j<4;j++){ if(array[i][j]==0) continue; num+=abs((array[i][j]-1)/4-i)+abs((array[i][j]-1)%4-j); } } return num; } /*exchange array[zeroy][zerox] and array[yy][xx]*/ void change(int * num1, int *num2){ int ch; ch=*num1; *num1=*num2; *num2=ch; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164747/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164747/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @xarr = dso_local local_unnamed_addr global [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16 @yarr = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 -1, i32 0, i32 1], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @array = dso_local global [4 x [4 x i32]] zeroinitializer, align 16 @sum = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @array) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 1)) %0 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 1), align 4, !tbaa !5 %cmp10.1 = icmp eq i32 %0, 0 %spec.select.1 = zext i1 %cmp10.1 to i32 %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 2)) %1 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 2), align 8, !tbaa !5 %cmp10.2 = icmp eq i32 %1, 0 %spec.select.2 = select i1 %cmp10.2, i32 2, i32 %spec.select.1 %call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 3)) %2 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 3), align 4, !tbaa !5 %cmp10.3 = icmp eq i32 %2, 0 %spec.select.3 = select i1 %cmp10.3, i32 3, i32 %spec.select.2 %call.143 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 0)) %3 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 0), align 16, !tbaa !5 %cmp10.144 = icmp eq i32 %3, 0 %spec.select.145 = select i1 %cmp10.144, i32 0, i32 %spec.select.3 %call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 1)) %4 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 1), align 4, !tbaa !5 %cmp10.1.1 = icmp eq i32 %4, 0 %spec.select.1.1 = select i1 %cmp10.1.1, i32 1, i32 %spec.select.145 %call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 2)) %5 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 2), align 8, !tbaa !5 %cmp10.2.1 = icmp eq i32 %5, 0 %spec.select.2.1 = select i1 %cmp10.2.1, i32 2, i32 %spec.select.1.1 %call.3.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 3)) %6 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 3), align 4, !tbaa !5 %cmp10.3.1 = icmp eq i32 %6, 0 %spec.select.3.1 = select i1 %cmp10.3.1, i32 3, i32 %spec.select.2.1 %7 = select i1 %cmp10.3.1, i1 true, i1 %cmp10.2.1 %8 = select i1 %7, i1 true, i1 %cmp10.1.1 %narrow = select i1 %8, i1 true, i1 %cmp10.144 %spec.select31.3.1 = zext i1 %narrow to i32 %call.248 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 0)) %9 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 0), align 16 %10 = shufflevector <4 x i32> %9, <4 x i32> poison, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 1)) %11 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 1), align 4, !tbaa !5 %call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 2)) %12 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 2), align 8, !tbaa !5 %call.3.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 3)) %13 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 3), align 4, !tbaa !5 %call.353 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 0)) %14 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 0), align 16, !tbaa !5 %call.1.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 1)) %15 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 1), align 4, !tbaa !5 %call.2.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 2)) %16 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 2), align 8, !tbaa !5 %call.3.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 3)) %17 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 3), align 4, !tbaa !5 %18 = insertelement <8 x i32> %10, i32 %11, i64 1 %19 = insertelement <8 x i32> %18, i32 %12, i64 2 %20 = insertelement <8 x i32> %19, i32 %13, i64 3 %21 = insertelement <8 x i32> %20, i32 %14, i64 4 %22 = insertelement <8 x i32> %21, i32 %15, i64 5 %23 = insertelement <8 x i32> %22, i32 %16, i64 6 %24 = insertelement <8 x i32> %23, i32 %17, i64 7 %25 = icmp eq <8 x i32> %24, zeroinitializer %26 = extractelement <8 x i1> %25, i64 0 %spec.select.250 = select i1 %26, i32 0, i32 %spec.select.3.1 %27 = extractelement <8 x i1> %25, i64 1 %spec.select.1.2 = select i1 %27, i32 1, i32 %spec.select.250 %28 = extractelement <8 x i1> %25, i64 2 %spec.select.2.2 = select i1 %28, i32 2, i32 %spec.select.1.2 %29 = extractelement <8 x i1> %25, i64 3 %spec.select.3.2 = select i1 %29, i32 3, i32 %spec.select.2.2 %30 = select i1 %29, i1 true, i1 %28 %31 = select i1 %30, i1 true, i1 %27 %32 = select i1 %31, i1 true, i1 %26 %spec.select31.3.2 = select i1 %32, i32 2, i32 %spec.select31.3.1 %33 = extractelement <8 x i1> %25, i64 4 %spec.select.355 = select i1 %33, i32 0, i32 %spec.select.3.2 %34 = extractelement <8 x i1> %25, i64 5 %spec.select.1.3 = select i1 %34, i32 1, i32 %spec.select.355 %35 = extractelement <8 x i1> %25, i64 6 %spec.select.2.3 = select i1 %35, i32 2, i32 %spec.select.1.3 %36 = extractelement <8 x i1> %25, i64 7 %spec.select.3.3 = select i1 %36, i32 3, i32 %spec.select.2.3 %37 = select i1 %36, i1 true, i1 %35 %38 = select i1 %37, i1 true, i1 %34 %39 = select i1 %38, i1 true, i1 %33 %spec.select31.3.3 = select i1 %39, i32 3, i32 %spec.select31.3.2 store i32 0, ptr @sum, align 4, !tbaa !5 %call1538 = tail call i32 @dfs(i32 noundef 0, i32 noundef 10, i32 noundef %spec.select.3.3, i32 noundef %spec.select31.3.3), !range !9 %cmp1639 = icmp eq i32 %call1538, 1 br i1 %cmp1639, label %for.end21, label %for.inc19 for.inc19: ; preds = %entry, %for.inc19 %40 = load i32, ptr @sum, align 4, !tbaa !5 %inc20 = add nsw i32 %40, 1 store i32 %inc20, ptr @sum, align 4, !tbaa !5 %call15 = tail call i32 @dfs(i32 noundef 0, i32 noundef 10, i32 noundef %spec.select.3.3, i32 noundef %spec.select31.3.3), !range !9 %cmp16 = icmp eq i32 %call15, 1 br i1 %cmp16, label %for.end21, label %for.inc19 for.end21: ; preds = %for.inc19, %entry %41 = load i32, ptr @sum, align 4, !tbaa !5 %call22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %41) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @dfs(i32 noundef %dep, i32 noundef %prev, i32 noundef %zerox, i32 noundef %zeroy) local_unnamed_addr #2 { entry: %0 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 3), align 4 %1 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 3), align 4, !tbaa !5 %2 = insertelement <4 x i32> %0, i32 %1, i64 1 %3 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 3), align 4, !tbaa !5 %4 = insertelement <4 x i32> %2, i32 %3, i64 2 %5 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 3), align 4, !tbaa !5 %6 = insertelement <4 x i32> %4, i32 %5, i64 3 %.not = icmp eq <4 x i32> %6, zeroinitializer %7 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 2), align 8 %8 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 2), align 8, !tbaa !5 %9 = insertelement <4 x i32> %7, i32 %8, i64 1 %10 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 2), align 8, !tbaa !5 %11 = insertelement <4 x i32> %9, i32 %10, i64 2 %12 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 2), align 8, !tbaa !5 %13 = insertelement <4 x i32> %11, i32 %12, i64 3 %14 = icmp eq <4 x i32> %13, zeroinitializer %15 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 1), align 4 %16 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 1), align 4, !tbaa !5 %17 = insertelement <4 x i32> %15, i32 %16, i64 1 %18 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 1), align 4, !tbaa !5 %19 = insertelement <4 x i32> %17, i32 %18, i64 2 %20 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 1), align 4, !tbaa !5 %21 = insertelement <4 x i32> %19, i32 %20, i64 3 %22 = icmp eq <4 x i32> %21, zeroinitializer %23 = load <4 x i32>, ptr @array, align 16 %24 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 0), align 16, !tbaa !5 %25 = insertelement <4 x i32> %23, i32 %24, i64 1 %26 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 0), align 16, !tbaa !5 %27 = insertelement <4 x i32> %25, i32 %26, i64 2 %28 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 0), align 16, !tbaa !5 %29 = insertelement <4 x i32> %27, i32 %28, i64 3 %30 = icmp eq <4 x i32> %29, zeroinitializer %31 = add nsw <4 x i32> %29, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen = freeze <4 x i32> %31 %32 = sdiv <4 x i32> %.frozen, <i32 4, i32 4, i32 4, i32 4> %33 = mul <4 x i32> %32, <i32 4, i32 4, i32 4, i32 4> %.decomposed = sub <4 x i32> %.frozen, %33 %34 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %.decomposed, i1 true) %35 = add nsw <4 x i32> %32, <i32 0, i32 -1, i32 -2, i32 -3> %36 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %35, i1 true) %37 = add nuw <4 x i32> %34, %36 %predphi = select <4 x i1> %30, <4 x i32> zeroinitializer, <4 x i32> %37 %38 = add nsw <4 x i32> %21, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen81 = freeze <4 x i32> %38 %39 = sdiv <4 x i32> %.frozen81, <i32 4, i32 4, i32 4, i32 4> %40 = mul <4 x i32> %39, <i32 4, i32 4, i32 4, i32 4> %.decomposed82 = sub <4 x i32> %.frozen81, %40 %41 = add nsw <4 x i32> %.decomposed82, <i32 -1, i32 -1, i32 -1, i32 -1> %42 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %41, i1 true) %43 = add <4 x i32> %42, %predphi %44 = add nsw <4 x i32> %39, <i32 0, i32 -1, i32 -2, i32 -3> %45 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %44, i1 true) %46 = add <4 x i32> %43, %45 %predphi78 = select <4 x i1> %22, <4 x i32> %predphi, <4 x i32> %46 %47 = add nsw <4 x i32> %13, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen83 = freeze <4 x i32> %47 %48 = sdiv <4 x i32> %.frozen83, <i32 4, i32 4, i32 4, i32 4> %49 = mul <4 x i32> %48, <i32 4, i32 4, i32 4, i32 4> %.decomposed84 = sub <4 x i32> %.frozen83, %49 %50 = add nsw <4 x i32> %.decomposed84, <i32 -2, i32 -2, i32 -2, i32 -2> %51 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %50, i1 true) %52 = add <4 x i32> %51, %predphi78 %53 = add nsw <4 x i32> %48, <i32 0, i32 -1, i32 -2, i32 -3> %54 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %53, i1 true) %55 = add <4 x i32> %52, %54 %predphi79 = select <4 x i1> %14, <4 x i32> %predphi78, <4 x i32> %55 %56 = add <4 x i32> %predphi79, <i32 3, i32 3, i32 3, i32 3> %57 = add nsw <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen85 = freeze <4 x i32> %57 %58 = sdiv <4 x i32> %.frozen85, <i32 4, i32 4, i32 4, i32 4> %59 = mul <4 x i32> %58, <i32 4, i32 4, i32 4, i32 4> %.decomposed86 = sub <4 x i32> %.frozen85, %59 %60 = sub <4 x i32> %56, %.decomposed86 %61 = add nsw <4 x i32> %58, <i32 0, i32 -1, i32 -2, i32 -3> %62 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %61, i1 true) %63 = add <4 x i32> %60, %62 %predphi80 = select <4 x i1> %.not, <4 x i32> %predphi79, <4 x i32> %63 %64 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %predphi80) %cmp = icmp eq i32 %64, 0 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %add = add nsw i32 %64, %dep %65 = load i32, ptr @sum, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %add, %65 br i1 %cmp1, label %cleanup, label %for.cond.preheader for.cond.preheader: ; preds = %if.end %idxprom23 = sext i32 %zeroy to i64 %idxprom25 = sext i32 %zerox to i64 %arrayidx26 = getelementptr inbounds [4 x [4 x i32]], ptr @array, i64 0, i64 %idxprom23, i64 %idxprom25 %add31 = add nsw i32 %dep, 1 %sub = sub nsw i32 0, %prev switch i32 %sub, label %if.end9 [ i32 -2, label %for.inc i32 2, label %for.inc ] if.end9: ; preds = %for.cond.preheader %66 = load i32, ptr @xarr, align 16, !tbaa !5 %add10 = add nsw i32 %66, %zerox %67 = load i32, ptr @yarr, align 16, !tbaa !5 %add13 = add nsw i32 %67, %zeroy %cmp16 = icmp slt i32 %add13, 0 %68 = icmp ugt i32 %add10, 3 %or.cond47 = select i1 %68, i1 true, i1 %cmp16 %cmp20 = icmp sgt i32 %add13, 3 %or.cond48 = select i1 %or.cond47, i1 true, i1 %cmp20 br i1 %or.cond48, label %for.inc, label %if.end22 if.end22: ; preds = %if.end9 %idxprom27 = zext i32 %add13 to i64 %idxprom29 = zext i32 %add10 to i64 %arrayidx30 = getelementptr inbounds [4 x [4 x i32]], ptr @array, i64 0, i64 %idxprom27, i64 %idxprom29 %69 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %70 = load i32, ptr %arrayidx30, align 4, !tbaa !5 store i32 %70, ptr %arrayidx26, align 4, !tbaa !5 store i32 %69, ptr %arrayidx30, align 4, !tbaa !5 %call32 = tail call i32 @dfs(i32 noundef %add31, i32 noundef 0, i32 noundef %add10, i32 noundef %add13), !range !9 %cmp33 = icmp eq i32 %call32, 1 br i1 %cmp33, label %cleanup, label %if.end35 if.end35: ; preds = %if.end22 %71 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %72 = load i32, ptr %arrayidx30, align 4, !tbaa !5 store i32 %72, ptr %arrayidx26, align 4, !tbaa !5 store i32 %71, ptr %arrayidx30, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond.preheader, %for.cond.preheader, %if.end9, %if.end35 %sub.1 = sub nsw i32 1, %prev switch i32 %sub.1, label %if.end9.1 [ i32 -2, label %for.inc.1 i32 2, label %for.inc.1 ] if.end9.1: ; preds = %for.inc %73 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @xarr, i64 0, i64 1), align 4, !tbaa !5 %add10.1 = add nsw i32 %73, %zerox %74 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @yarr, i64 0, i64 1), align 4, !tbaa !5 %add13.1 = add nsw i32 %74, %zeroy %cmp16.1 = icmp slt i32 %add13.1, 0 %75 = icmp ugt i32 %add10.1, 3 %or.cond47.1 = select i1 %75, i1 true, i1 %cmp16.1 %cmp20.1 = icmp sgt i32 %add13.1, 3 %or.cond48.1 = select i1 %or.cond47.1, i1 true, i1 %cmp20.1 br i1 %or.cond48.1, label %for.inc.1, label %if.end22.1 if.end22.1: ; preds = %if.end9.1 %idxprom27.1 = zext i32 %add13.1 to i64 %idxprom29.1 = zext i32 %add10.1 to i64 %arrayidx30.1 = getelementptr inbounds [4 x [4 x i32]], ptr @array, i64 0, i64 %idxprom27.1, i64 %idxprom29.1 %76 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %77 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 store i32 %77, ptr %arrayidx26, align 4, !tbaa !5 store i32 %76, ptr %arrayidx30.1, align 4, !tbaa !5 %call32.1 = tail call i32 @dfs(i32 noundef %add31, i32 noundef 1, i32 noundef %add10.1, i32 noundef %add13.1), !range !9 %cmp33.1 = icmp eq i32 %call32.1, 1 br i1 %cmp33.1, label %cleanup, label %if.end35.1 if.end35.1: ; preds = %if.end22.1 %78 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %79 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 store i32 %79, ptr %arrayidx26, align 4, !tbaa !5 store i32 %78, ptr %arrayidx30.1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end35.1, %if.end9.1, %for.inc, %for.inc %sub.2 = sub nsw i32 2, %prev switch i32 %sub.2, label %if.end9.2 [ i32 -2, label %for.inc.2 i32 2, label %for.inc.2 ] if.end9.2: ; preds = %for.inc.1 %80 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @xarr, i64 0, i64 2), align 8, !tbaa !5 %add10.2 = add nsw i32 %80, %zerox %81 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @yarr, i64 0, i64 2), align 8, !tbaa !5 %add13.2 = add nsw i32 %81, %zeroy %cmp16.2 = icmp slt i32 %add13.2, 0 %82 = icmp ugt i32 %add10.2, 3 %or.cond47.2 = select i1 %82, i1 true, i1 %cmp16.2 %cmp20.2 = icmp sgt i32 %add13.2, 3 %or.cond48.2 = select i1 %or.cond47.2, i1 true, i1 %cmp20.2 br i1 %or.cond48.2, label %for.inc.2, label %if.end22.2 if.end22.2: ; preds = %if.end9.2 %idxprom27.2 = zext i32 %add13.2 to i64 %idxprom29.2 = zext i32 %add10.2 to i64 %arrayidx30.2 = getelementptr inbounds [4 x [4 x i32]], ptr @array, i64 0, i64 %idxprom27.2, i64 %idxprom29.2 %83 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %84 = load i32, ptr %arrayidx30.2, align 4, !tbaa !5 store i32 %84, ptr %arrayidx26, align 4, !tbaa !5 store i32 %83, ptr %arrayidx30.2, align 4, !tbaa !5 %call32.2 = tail call i32 @dfs(i32 noundef %add31, i32 noundef 2, i32 noundef %add10.2, i32 noundef %add13.2), !range !9 %cmp33.2 = icmp eq i32 %call32.2, 1 br i1 %cmp33.2, label %cleanup, label %if.end35.2 if.end35.2: ; preds = %if.end22.2 %85 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %86 = load i32, ptr %arrayidx30.2, align 4, !tbaa !5 store i32 %86, ptr %arrayidx26, align 4, !tbaa !5 store i32 %85, ptr %arrayidx30.2, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end35.2, %if.end9.2, %for.inc.1, %for.inc.1 %sub.3 = sub nsw i32 3, %prev switch i32 %sub.3, label %if.end9.3 [ i32 -2, label %cleanup i32 2, label %cleanup ] if.end9.3: ; preds = %for.inc.2 %87 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @xarr, i64 0, i64 3), align 4, !tbaa !5 %add10.3 = add nsw i32 %87, %zerox %88 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @yarr, i64 0, i64 3), align 4, !tbaa !5 %add13.3 = add nsw i32 %88, %zeroy %cmp16.3 = icmp slt i32 %add13.3, 0 %89 = icmp ugt i32 %add10.3, 3 %or.cond47.3 = select i1 %89, i1 true, i1 %cmp16.3 %cmp20.3 = icmp sgt i32 %add13.3, 3 %or.cond48.3 = select i1 %or.cond47.3, i1 true, i1 %cmp20.3 br i1 %or.cond48.3, label %cleanup, label %if.end22.3 if.end22.3: ; preds = %if.end9.3 %idxprom27.3 = zext i32 %add13.3 to i64 %idxprom29.3 = zext i32 %add10.3 to i64 %arrayidx30.3 = getelementptr inbounds [4 x [4 x i32]], ptr @array, i64 0, i64 %idxprom27.3, i64 %idxprom29.3 %90 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %91 = load i32, ptr %arrayidx30.3, align 4, !tbaa !5 store i32 %91, ptr %arrayidx26, align 4, !tbaa !5 store i32 %90, ptr %arrayidx30.3, align 4, !tbaa !5 %call32.3 = tail call i32 @dfs(i32 noundef %add31, i32 noundef 3, i32 noundef %add10.3, i32 noundef %add13.3), !range !9 %cmp33.3 = icmp eq i32 %call32.3, 1 br i1 %cmp33.3, label %cleanup, label %if.end35.3 if.end35.3: ; preds = %if.end22.3 %92 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %93 = load i32, ptr %arrayidx30.3, align 4, !tbaa !5 store i32 %93, ptr %arrayidx26, align 4, !tbaa !5 store i32 %92, ptr %arrayidx30.3, align 4, !tbaa !5 br label %cleanup cleanup: ; preds = %if.end22, %if.end22.1, %if.end22.2, %if.end22.3, %if.end35.3, %if.end9.3, %for.inc.2, %for.inc.2, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ -1, %if.end ], [ 1, %if.end22 ], [ 1, %if.end22.1 ], [ 1, %if.end22.2 ], [ 1, %if.end22.3 ], [ -1, %if.end35.3 ], [ -1, %if.end9.3 ], [ -1, %for.inc.2 ], [ -1, %for.inc.2 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @change(ptr nocapture noundef %num1, ptr nocapture noundef %num2) local_unnamed_addr #3 { entry: %0 = load i32, ptr %num1, align 4, !tbaa !5 %1 = load i32, ptr %num2, align 4, !tbaa !5 store i32 %1, ptr %num1, align 4, !tbaa !5 store i32 %0, ptr %num2, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @tag() local_unnamed_addr #4 { entry: %0 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 3), align 4 %1 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 3), align 4, !tbaa !5 %2 = insertelement <4 x i32> %0, i32 %1, i64 1 %3 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 3), align 4, !tbaa !5 %4 = insertelement <4 x i32> %2, i32 %3, i64 2 %5 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 3), align 4, !tbaa !5 %6 = insertelement <4 x i32> %4, i32 %5, i64 3 %.not = icmp eq <4 x i32> %6, zeroinitializer %7 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 2), align 8 %8 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 2), align 8, !tbaa !5 %9 = insertelement <4 x i32> %7, i32 %8, i64 1 %10 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 2), align 8, !tbaa !5 %11 = insertelement <4 x i32> %9, i32 %10, i64 2 %12 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 2), align 8, !tbaa !5 %13 = insertelement <4 x i32> %11, i32 %12, i64 3 %14 = icmp eq <4 x i32> %13, zeroinitializer %15 = load <4 x i32>, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 0, i64 1), align 4 %16 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 1), align 4, !tbaa !5 %17 = insertelement <4 x i32> %15, i32 %16, i64 1 %18 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 1), align 4, !tbaa !5 %19 = insertelement <4 x i32> %17, i32 %18, i64 2 %20 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 1), align 4, !tbaa !5 %21 = insertelement <4 x i32> %19, i32 %20, i64 3 %22 = icmp eq <4 x i32> %21, zeroinitializer %23 = load <4 x i32>, ptr @array, align 16 %24 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 1, i64 0), align 16, !tbaa !5 %25 = insertelement <4 x i32> %23, i32 %24, i64 1 %26 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 2, i64 0), align 16, !tbaa !5 %27 = insertelement <4 x i32> %25, i32 %26, i64 2 %28 = load i32, ptr getelementptr inbounds ([4 x [4 x i32]], ptr @array, i64 0, i64 3, i64 0), align 16, !tbaa !5 %29 = insertelement <4 x i32> %27, i32 %28, i64 3 %30 = icmp eq <4 x i32> %29, zeroinitializer %31 = add nsw <4 x i32> %29, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen = freeze <4 x i32> %31 %32 = sdiv <4 x i32> %.frozen, <i32 4, i32 4, i32 4, i32 4> %33 = mul <4 x i32> %32, <i32 4, i32 4, i32 4, i32 4> %.decomposed = sub <4 x i32> %.frozen, %33 %34 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %.decomposed, i1 true) %35 = add nsw <4 x i32> %32, <i32 0, i32 -1, i32 -2, i32 -3> %36 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %35, i1 true) %37 = add nuw <4 x i32> %34, %36 %predphi = select <4 x i1> %30, <4 x i32> zeroinitializer, <4 x i32> %37 %38 = add nsw <4 x i32> %21, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen48 = freeze <4 x i32> %38 %39 = sdiv <4 x i32> %.frozen48, <i32 4, i32 4, i32 4, i32 4> %40 = mul <4 x i32> %39, <i32 4, i32 4, i32 4, i32 4> %.decomposed49 = sub <4 x i32> %.frozen48, %40 %41 = add nsw <4 x i32> %.decomposed49, <i32 -1, i32 -1, i32 -1, i32 -1> %42 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %41, i1 true) %43 = add <4 x i32> %42, %predphi %44 = add nsw <4 x i32> %39, <i32 0, i32 -1, i32 -2, i32 -3> %45 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %44, i1 true) %46 = add <4 x i32> %43, %45 %predphi45 = select <4 x i1> %22, <4 x i32> %predphi, <4 x i32> %46 %47 = add nsw <4 x i32> %13, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen50 = freeze <4 x i32> %47 %48 = sdiv <4 x i32> %.frozen50, <i32 4, i32 4, i32 4, i32 4> %49 = mul <4 x i32> %48, <i32 4, i32 4, i32 4, i32 4> %.decomposed51 = sub <4 x i32> %.frozen50, %49 %50 = add nsw <4 x i32> %.decomposed51, <i32 -2, i32 -2, i32 -2, i32 -2> %51 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %50, i1 true) %52 = add <4 x i32> %51, %predphi45 %53 = add nsw <4 x i32> %48, <i32 0, i32 -1, i32 -2, i32 -3> %54 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %53, i1 true) %55 = add <4 x i32> %52, %54 %predphi46 = select <4 x i1> %14, <4 x i32> %predphi45, <4 x i32> %55 %56 = add nsw <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen52 = freeze <4 x i32> %56 %57 = sdiv <4 x i32> %.frozen52, <i32 4, i32 4, i32 4, i32 4> %58 = mul <4 x i32> %57, <i32 4, i32 4, i32 4, i32 4> %.decomposed53 = sub <4 x i32> %.frozen52, %58 %59 = sub <4 x i32> %predphi46, %.decomposed53 %60 = add <4 x i32> %59, <i32 3, i32 3, i32 3, i32 3> %61 = add nsw <4 x i32> %57, <i32 0, i32 -1, i32 -2, i32 -3> %62 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %61, i1 true) %63 = add <4 x i32> %60, %62 %predphi47 = select <4 x i1> %.not, <4 x i32> %predphi46, <4 x i32> %63 %64 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %predphi47) ret i32 %64 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #5 ; 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = !{i32 -1, i32 2}
#include <stdio.h> #include <stdlib.h> #define BOARD_SIDE_LENGTH 4 const int dy[] = {-1,0,1,0}; const int dx[] = {0,1,0,-1}; int calculateHeuristic(int board[BOARD_SIDE_LENGTH][BOARD_SIDE_LENGTH]) { int res = 0; int a, i, j; for (i = 0; i < BOARD_SIDE_LENGTH; i++) for (j = 0; j < BOARD_SIDE_LENGTH; j++) { if (board[i][j] == 0) continue; a = board[i][j] - 1; res += abs(a / BOARD_SIDE_LENGTH - i) + abs(a % BOARD_SIDE_LENGTH - j); } return res; } void swap(int * a, int * b) { int t = *a; *a = *b; *b = t; } int check(int board[BOARD_SIDE_LENGTH][BOARD_SIDE_LENGTH], int limit, int depth, int prev, int py, int px) { // printf("cheking: i: %d, j: %d, depth: %d\n", py,px,depth); int heuriScore = calculateHeuristic(board); if (heuriScore + depth > limit) return 0; // same board!! success! if (heuriScore == 0) return 1; // loop through the 4 possible exchanges for (int i = 0; i < 4; i++) { if (abs(i - prev) == 2) continue; // new position int ny = py + dy[i]; int nx = px + dx[i]; // skip if swapping is out of boundary if (ny < 0 || nx < 0 || ny >= BOARD_SIDE_LENGTH || nx >= BOARD_SIDE_LENGTH) continue; // try swapping swap(&board[ny][nx], &board[py][px]); // return true if success if (check(board, limit, depth + 1, i, ny, nx)) return 1; // not work, swap back swap(&board[ny][nx], &board[py][px]); } // not work even if all swaps are tried... return 0; } void solve(int board[BOARD_SIDE_LENGTH][BOARD_SIDE_LENGTH], int py, int px) { int limit = 0; while (1) { if (check(board, limit, 0, 99, py, px)) { printf("%d\n", limit); return; } // incremental limit. limit++; } } int main(int argc, char** argv) { int py, px, i, j; int board[BOARD_SIDE_LENGTH][BOARD_SIDE_LENGTH]; for (i = 0; i < BOARD_SIDE_LENGTH; i++) for (j = 0; j < BOARD_SIDE_LENGTH; j++) { scanf("%d", &board[i][j]); if (board[i][j] == 0) { py = i; px = j; } } solve(board, py, px); return (EXIT_SUCCESS); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164790/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164790/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @dy = dso_local local_unnamed_addr constant [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16 @dx = dso_local local_unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @calculateHeuristic(ptr nocapture noundef readonly %board) local_unnamed_addr #0 { entry: %0 = getelementptr inbounds [4 x i32], ptr %board, i64 0, i64 3 %1 = load i32, ptr %0, align 4, !tbaa !5 %2 = insertelement <4 x i32> poison, i32 %1, i64 0 %3 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 3 %4 = load i32, ptr %3, align 4, !tbaa !5 %5 = insertelement <4 x i32> %2, i32 %4, i64 1 %6 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 3 %7 = load i32, ptr %6, align 4, !tbaa !5 %8 = insertelement <4 x i32> %5, i32 %7, i64 2 %9 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 3 %10 = load i32, ptr %9, align 4, !tbaa !5 %11 = insertelement <4 x i32> %8, i32 %10, i64 3 %.not = icmp eq <4 x i32> %11, zeroinitializer %12 = getelementptr inbounds [4 x i32], ptr %board, i64 0, i64 2 %13 = load i32, ptr %12, align 4, !tbaa !5 %14 = insertelement <4 x i32> poison, i32 %13, i64 0 %15 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 2 %16 = load i32, ptr %15, align 4, !tbaa !5 %17 = insertelement <4 x i32> %14, i32 %16, i64 1 %18 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 2 %19 = load i32, ptr %18, align 4, !tbaa !5 %20 = insertelement <4 x i32> %17, i32 %19, i64 2 %21 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 2 %22 = load i32, ptr %21, align 4, !tbaa !5 %23 = insertelement <4 x i32> %20, i32 %22, i64 3 %24 = icmp eq <4 x i32> %23, zeroinitializer %25 = getelementptr inbounds [4 x i32], ptr %board, i64 0, i64 1 %26 = load i32, ptr %25, align 4, !tbaa !5 %27 = insertelement <4 x i32> poison, i32 %26, i64 0 %28 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 1 %29 = load i32, ptr %28, align 4, !tbaa !5 %30 = insertelement <4 x i32> %27, i32 %29, i64 1 %31 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 1 %32 = load i32, ptr %31, align 4, !tbaa !5 %33 = insertelement <4 x i32> %30, i32 %32, i64 2 %34 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 1 %35 = load i32, ptr %34, align 4, !tbaa !5 %36 = insertelement <4 x i32> %33, i32 %35, i64 3 %37 = icmp eq <4 x i32> %36, zeroinitializer %38 = load i32, ptr %board, align 4, !tbaa !5 %39 = insertelement <4 x i32> poison, i32 %38, i64 0 %40 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 0 %41 = load i32, ptr %40, align 4, !tbaa !5 %42 = insertelement <4 x i32> %39, i32 %41, i64 1 %43 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 0 %44 = load i32, ptr %43, align 4, !tbaa !5 %45 = insertelement <4 x i32> %42, i32 %44, i64 2 %46 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 0 %47 = load i32, ptr %46, align 4, !tbaa !5 %48 = insertelement <4 x i32> %45, i32 %47, i64 3 %49 = icmp eq <4 x i32> %48, zeroinitializer %50 = add nsw <4 x i32> %48, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen = freeze <4 x i32> %50 %51 = sdiv <4 x i32> %.frozen, <i32 4, i32 4, i32 4, i32 4> %52 = mul <4 x i32> %51, <i32 4, i32 4, i32 4, i32 4> %.decomposed = sub <4 x i32> %.frozen, %52 %53 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %.decomposed, i1 true) %54 = add nsw <4 x i32> %51, <i32 0, i32 -1, i32 -2, i32 -3> %55 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %54, i1 true) %56 = add nuw <4 x i32> %53, %55 %predphi = select <4 x i1> %49, <4 x i32> zeroinitializer, <4 x i32> %56 %57 = add nsw <4 x i32> %36, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen43 = freeze <4 x i32> %57 %58 = sdiv <4 x i32> %.frozen43, <i32 4, i32 4, i32 4, i32 4> %59 = mul <4 x i32> %58, <i32 4, i32 4, i32 4, i32 4> %.decomposed44 = sub <4 x i32> %.frozen43, %59 %60 = add nsw <4 x i32> %.decomposed44, <i32 -1, i32 -1, i32 -1, i32 -1> %61 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %60, i1 true) %62 = add <4 x i32> %61, %predphi %63 = add nsw <4 x i32> %58, <i32 0, i32 -1, i32 -2, i32 -3> %64 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %63, i1 true) %65 = add <4 x i32> %62, %64 %predphi40 = select <4 x i1> %37, <4 x i32> %predphi, <4 x i32> %65 %66 = add nsw <4 x i32> %23, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen45 = freeze <4 x i32> %66 %67 = sdiv <4 x i32> %.frozen45, <i32 4, i32 4, i32 4, i32 4> %68 = mul <4 x i32> %67, <i32 4, i32 4, i32 4, i32 4> %.decomposed46 = sub <4 x i32> %.frozen45, %68 %69 = add nsw <4 x i32> %.decomposed46, <i32 -2, i32 -2, i32 -2, i32 -2> %70 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %69, i1 true) %71 = add <4 x i32> %70, %predphi40 %72 = add nsw <4 x i32> %67, <i32 0, i32 -1, i32 -2, i32 -3> %73 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %72, i1 true) %74 = add <4 x i32> %71, %73 %predphi41 = select <4 x i1> %24, <4 x i32> %predphi40, <4 x i32> %74 %75 = add nsw <4 x i32> %11, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen47 = freeze <4 x i32> %75 %76 = sdiv <4 x i32> %.frozen47, <i32 4, i32 4, i32 4, i32 4> %77 = mul <4 x i32> %76, <i32 4, i32 4, i32 4, i32 4> %.decomposed48 = sub <4 x i32> %.frozen47, %77 %78 = sub <4 x i32> %predphi41, %.decomposed48 %79 = add <4 x i32> %78, <i32 3, i32 3, i32 3, i32 3> %80 = add nsw <4 x i32> %76, <i32 0, i32 -1, i32 -2, i32 -3> %81 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %80, i1 true) %82 = add <4 x i32> %79, %81 %predphi42 = select <4 x i1> %.not, <4 x i32> %predphi41, <4 x i32> %82 %83 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %predphi42) ret i32 %83 } ; 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 speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @check(ptr nocapture noundef %board, i32 noundef %limit, i32 noundef %depth, i32 noundef %prev, i32 noundef %py, i32 noundef %px) local_unnamed_addr #4 { entry: %0 = getelementptr inbounds [4 x i32], ptr %board, i64 0, i64 3 %1 = load i32, ptr %0, align 4, !tbaa !5 %2 = insertelement <4 x i32> poison, i32 %1, i64 0 %3 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 3 %4 = load i32, ptr %3, align 4, !tbaa !5 %5 = insertelement <4 x i32> %2, i32 %4, i64 1 %6 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 3 %7 = load i32, ptr %6, align 4, !tbaa !5 %8 = insertelement <4 x i32> %5, i32 %7, i64 2 %9 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 3 %10 = load i32, ptr %9, align 4, !tbaa !5 %11 = insertelement <4 x i32> %8, i32 %10, i64 3 %.not = icmp eq <4 x i32> %11, zeroinitializer %12 = getelementptr inbounds [4 x i32], ptr %board, i64 0, i64 2 %13 = load i32, ptr %12, align 4, !tbaa !5 %14 = insertelement <4 x i32> poison, i32 %13, i64 0 %15 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 2 %16 = load i32, ptr %15, align 4, !tbaa !5 %17 = insertelement <4 x i32> %14, i32 %16, i64 1 %18 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 2 %19 = load i32, ptr %18, align 4, !tbaa !5 %20 = insertelement <4 x i32> %17, i32 %19, i64 2 %21 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 2 %22 = load i32, ptr %21, align 4, !tbaa !5 %23 = insertelement <4 x i32> %20, i32 %22, i64 3 %24 = icmp eq <4 x i32> %23, zeroinitializer %25 = getelementptr inbounds [4 x i32], ptr %board, i64 0, i64 1 %26 = load i32, ptr %25, align 4, !tbaa !5 %27 = insertelement <4 x i32> poison, i32 %26, i64 0 %28 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 1 %29 = load i32, ptr %28, align 4, !tbaa !5 %30 = insertelement <4 x i32> %27, i32 %29, i64 1 %31 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 1 %32 = load i32, ptr %31, align 4, !tbaa !5 %33 = insertelement <4 x i32> %30, i32 %32, i64 2 %34 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 1 %35 = load i32, ptr %34, align 4, !tbaa !5 %36 = insertelement <4 x i32> %33, i32 %35, i64 3 %37 = icmp eq <4 x i32> %36, zeroinitializer %38 = load i32, ptr %board, align 4, !tbaa !5 %39 = insertelement <4 x i32> poison, i32 %38, i64 0 %40 = getelementptr inbounds [4 x i32], ptr %board, i64 1, i64 0 %41 = load i32, ptr %40, align 4, !tbaa !5 %42 = insertelement <4 x i32> %39, i32 %41, i64 1 %43 = getelementptr inbounds [4 x i32], ptr %board, i64 2, i64 0 %44 = load i32, ptr %43, align 4, !tbaa !5 %45 = insertelement <4 x i32> %42, i32 %44, i64 2 %46 = getelementptr inbounds [4 x i32], ptr %board, i64 3, i64 0 %47 = load i32, ptr %46, align 4, !tbaa !5 %48 = insertelement <4 x i32> %45, i32 %47, i64 3 %49 = icmp eq <4 x i32> %48, zeroinitializer %50 = add nsw <4 x i32> %48, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen = freeze <4 x i32> %50 %51 = sdiv <4 x i32> %.frozen, <i32 4, i32 4, i32 4, i32 4> %52 = mul <4 x i32> %51, <i32 4, i32 4, i32 4, i32 4> %.decomposed = sub <4 x i32> %.frozen, %52 %53 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %.decomposed, i1 true) %54 = add nsw <4 x i32> %51, <i32 0, i32 -1, i32 -2, i32 -3> %55 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %54, i1 true) %56 = add nuw <4 x i32> %53, %55 %predphi = select <4 x i1> %49, <4 x i32> zeroinitializer, <4 x i32> %56 %57 = add nsw <4 x i32> %36, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen84 = freeze <4 x i32> %57 %58 = sdiv <4 x i32> %.frozen84, <i32 4, i32 4, i32 4, i32 4> %59 = mul <4 x i32> %58, <i32 4, i32 4, i32 4, i32 4> %.decomposed85 = sub <4 x i32> %.frozen84, %59 %60 = add nsw <4 x i32> %.decomposed85, <i32 -1, i32 -1, i32 -1, i32 -1> %61 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %60, i1 true) %62 = add <4 x i32> %61, %predphi %63 = add nsw <4 x i32> %58, <i32 0, i32 -1, i32 -2, i32 -3> %64 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %63, i1 true) %65 = add <4 x i32> %62, %64 %predphi81 = select <4 x i1> %37, <4 x i32> %predphi, <4 x i32> %65 %66 = add nsw <4 x i32> %23, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen86 = freeze <4 x i32> %66 %67 = sdiv <4 x i32> %.frozen86, <i32 4, i32 4, i32 4, i32 4> %68 = mul <4 x i32> %67, <i32 4, i32 4, i32 4, i32 4> %.decomposed87 = sub <4 x i32> %.frozen86, %68 %69 = add nsw <4 x i32> %.decomposed87, <i32 -2, i32 -2, i32 -2, i32 -2> %70 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %69, i1 true) %71 = add <4 x i32> %70, %predphi81 %72 = add nsw <4 x i32> %67, <i32 0, i32 -1, i32 -2, i32 -3> %73 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %72, i1 true) %74 = add <4 x i32> %71, %73 %predphi82 = select <4 x i1> %24, <4 x i32> %predphi81, <4 x i32> %74 %75 = add <4 x i32> %predphi82, <i32 3, i32 3, i32 3, i32 3> %76 = add nsw <4 x i32> %11, <i32 -1, i32 -1, i32 -1, i32 -1> %.frozen88 = freeze <4 x i32> %76 %77 = sdiv <4 x i32> %.frozen88, <i32 4, i32 4, i32 4, i32 4> %78 = mul <4 x i32> %77, <i32 4, i32 4, i32 4, i32 4> %.decomposed89 = sub <4 x i32> %.frozen88, %78 %79 = sub <4 x i32> %75, %.decomposed89 %80 = add nsw <4 x i32> %77, <i32 0, i32 -1, i32 -2, i32 -3> %81 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %80, i1 true) %82 = add <4 x i32> %79, %81 %predphi83 = select <4 x i1> %.not, <4 x i32> %predphi82, <4 x i32> %82 %83 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %predphi83) %add = add nsw i32 %83, %depth %cmp = icmp sgt i32 %add, %limit br i1 %cmp, label %cleanup43, label %if.end if.end: ; preds = %entry %cmp1 = icmp eq i32 %83, 0 br i1 %cmp1, label %cleanup43, label %for.cond.preheader for.cond.preheader: ; preds = %if.end %idxprom24 = sext i32 %py to i64 %idxprom26 = sext i32 %px to i64 %arrayidx27 = getelementptr inbounds [4 x i32], ptr %board, i64 %idxprom24, i64 %idxprom26 %add28 = add nsw i32 %depth, 1 %84 = tail call i32 @llvm.abs.i32(i32 %prev, i1 true) %cmp5 = icmp eq i32 %84, 2 br i1 %cmp5, label %for.inc, label %if.end7 if.end7: ; preds = %for.cond.preheader %add8 = add nsw i32 %py, -1 %85 = or i32 %add8, %px %or.cond45.not = icmp ult i32 %85, 4 br i1 %or.cond45.not, label %if.end19, label %for.inc if.end19: ; preds = %if.end7 %idxprom20 = zext i32 %add8 to i64 %idxprom22 = zext i32 %px to i64 %arrayidx23 = getelementptr inbounds [4 x i32], ptr %board, i64 %idxprom20, i64 %idxprom22 %86 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %87 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %87, ptr %arrayidx23, align 4, !tbaa !5 store i32 %86, ptr %arrayidx27, align 4, !tbaa !5 %call29 = tail call i32 @check(ptr noundef nonnull %board, i32 noundef %limit, i32 noundef %add28, i32 noundef 0, i32 noundef %add8, i32 noundef %px) %tobool.not = icmp eq i32 %call29, 0 br i1 %tobool.not, label %if.end31, label %cleanup43 if.end31: ; preds = %if.end19 %88 = load i32, ptr %arrayidx23, align 4, !tbaa !5 %89 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %89, ptr %arrayidx23, align 4, !tbaa !5 store i32 %88, ptr %arrayidx27, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end7, %if.end31, %for.cond.preheader %sub.1 = sub nsw i32 1, %prev %90 = tail call i32 @llvm.abs.i32(i32 %sub.1, i1 true) %cmp5.1 = icmp eq i32 %90, 2 br i1 %cmp5.1, label %for.inc.1, label %if.end7.1 if.end7.1: ; preds = %for.inc %91 = icmp ugt i32 %py, 3 %92 = add i32 %px, -3 %93 = icmp ult i32 %92, -4 %or.cond45.1 = or i1 %91, %93 br i1 %or.cond45.1, label %for.inc.1, label %if.end19.1 if.end19.1: ; preds = %if.end7.1 %add11.1 = add nsw i32 %px, 1 %idxprom20.1 = zext i32 %py to i64 %idxprom22.1 = zext i32 %add11.1 to i64 %arrayidx23.1 = getelementptr inbounds [4 x i32], ptr %board, i64 %idxprom20.1, i64 %idxprom22.1 %94 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %95 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %95, ptr %arrayidx23.1, align 4, !tbaa !5 store i32 %94, ptr %arrayidx27, align 4, !tbaa !5 %call29.1 = tail call i32 @check(ptr noundef nonnull %board, i32 noundef %limit, i32 noundef %add28, i32 noundef 1, i32 noundef %py, i32 noundef %add11.1) %tobool.not.1 = icmp eq i32 %call29.1, 0 br i1 %tobool.not.1, label %if.end31.1, label %cleanup43 if.end31.1: ; preds = %if.end19.1 %96 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5 %97 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %97, ptr %arrayidx23.1, align 4, !tbaa !5 store i32 %96, ptr %arrayidx27, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.end31.1, %if.end7.1, %for.inc %sub.2 = sub nsw i32 2, %prev %98 = tail call i32 @llvm.abs.i32(i32 %sub.2, i1 true) %cmp5.2 = icmp eq i32 %98, 2 br i1 %cmp5.2, label %for.inc.2, label %if.end7.2 if.end7.2: ; preds = %for.inc.1 %add8.2 = add nsw i32 %py, 1 %99 = or i32 %add8.2, %px %or.cond45.2.not = icmp ult i32 %99, 4 br i1 %or.cond45.2.not, label %if.end19.2, label %for.inc.2 if.end19.2: ; preds = %if.end7.2 %idxprom20.2 = zext i32 %add8.2 to i64 %idxprom22.2 = zext i32 %px to i64 %arrayidx23.2 = getelementptr inbounds [4 x i32], ptr %board, i64 %idxprom20.2, i64 %idxprom22.2 %100 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5 %101 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %101, ptr %arrayidx23.2, align 4, !tbaa !5 store i32 %100, ptr %arrayidx27, align 4, !tbaa !5 %call29.2 = tail call i32 @check(ptr noundef nonnull %board, i32 noundef %limit, i32 noundef %add28, i32 noundef 2, i32 noundef %add8.2, i32 noundef %px) %tobool.not.2 = icmp eq i32 %call29.2, 0 br i1 %tobool.not.2, label %if.end31.2, label %cleanup43 if.end31.2: ; preds = %if.end19.2 %102 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5 %103 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %103, ptr %arrayidx23.2, align 4, !tbaa !5 store i32 %102, ptr %arrayidx27, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.end31.2, %if.end7.2, %for.inc.1 %sub.3 = sub nsw i32 3, %prev %104 = tail call i32 @llvm.abs.i32(i32 %sub.3, i1 true) %cmp5.3 = icmp eq i32 %104, 2 br i1 %cmp5.3, label %cleanup43, label %if.end7.3 if.end7.3: ; preds = %for.inc.2 %105 = icmp ugt i32 %py, 3 %106 = add i32 %px, -5 %107 = icmp ult i32 %106, -4 %or.cond45.3 = or i1 %105, %107 br i1 %or.cond45.3, label %cleanup43, label %if.end19.3 if.end19.3: ; preds = %if.end7.3 %add11.3 = add nsw i32 %px, -1 %idxprom20.3 = zext i32 %py to i64 %idxprom22.3 = zext i32 %add11.3 to i64 %arrayidx23.3 = getelementptr inbounds [4 x i32], ptr %board, i64 %idxprom20.3, i64 %idxprom22.3 %108 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5 %109 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %109, ptr %arrayidx23.3, align 4, !tbaa !5 store i32 %108, ptr %arrayidx27, align 4, !tbaa !5 %call29.3 = tail call i32 @check(ptr noundef nonnull %board, i32 noundef %limit, i32 noundef %add28, i32 noundef 3, i32 noundef %py, i32 noundef %add11.3) %tobool.not.3 = icmp eq i32 %call29.3, 0 br i1 %tobool.not.3, label %if.end31.3, label %cleanup43 if.end31.3: ; preds = %if.end19.3 %110 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5 %111 = load i32, ptr %arrayidx27, align 4, !tbaa !5 store i32 %111, ptr %arrayidx23.3, align 4, !tbaa !5 store i32 %110, ptr %arrayidx27, align 4, !tbaa !5 br label %cleanup43 cleanup43: ; preds = %if.end19, %if.end19.1, %if.end19.2, %if.end19.3, %if.end31.3, %if.end7.3, %for.inc.2, %if.end, %entry %retval.4 = phi i32 [ 0, %entry ], [ 1, %if.end ], [ 1, %if.end19 ], [ 1, %if.end19.1 ], [ 1, %if.end19.2 ], [ 1, %if.end19.3 ], [ 0, %if.end31.3 ], [ 0, %if.end7.3 ], [ 0, %for.inc.2 ] ret i32 %retval.4 } ; Function Attrs: nofree nounwind uwtable define dso_local void @solve(ptr nocapture noundef %board, i32 noundef %py, i32 noundef %px) local_unnamed_addr #5 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %limit.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %call = tail call i32 @check(ptr noundef %board, i32 noundef %limit.0, i32 noundef 0, i32 noundef 99, i32 noundef %py, i32 noundef %px) %tobool.not = icmp eq i32 %call, 0 %inc = add nuw nsw i32 %limit.0, 1 br i1 %tobool.not, label %while.cond, label %if.then if.then: ; preds = %while.cond %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %limit.0) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #5 { entry: %board = alloca [4 x [4 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %board) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %board) %arrayidx5.1 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.1) %0 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %cmp10.1 = icmp eq i32 %0, 0 %spec.select22.1 = zext i1 %cmp10.1 to i32 %arrayidx5.2 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.2) %1 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 %cmp10.2 = icmp eq i32 %1, 0 %spec.select22.2 = select i1 %cmp10.2, i32 2, i32 %spec.select22.1 %arrayidx5.3 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.3) %2 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5 %cmp10.3 = icmp eq i32 %2, 0 %spec.select22.3 = select i1 %cmp10.3, i32 3, i32 %spec.select22.2 %arrayidx5.131 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 1, i64 0 %call.132 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.131) %3 = load i32, ptr %arrayidx5.131, align 16, !tbaa !5 %cmp10.133 = icmp eq i32 %3, 0 %spec.select22.135 = select i1 %cmp10.133, i32 0, i32 %spec.select22.3 %arrayidx5.1.1 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 1, i64 1 %call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.1.1) %4 = load i32, ptr %arrayidx5.1.1, align 4, !tbaa !5 %cmp10.1.1 = icmp eq i32 %4, 0 %spec.select22.1.1 = select i1 %cmp10.1.1, i32 1, i32 %spec.select22.135 %arrayidx5.2.1 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 1, i64 2 %call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.2.1) %5 = load i32, ptr %arrayidx5.2.1, align 8, !tbaa !5 %cmp10.2.1 = icmp eq i32 %5, 0 %spec.select22.2.1 = select i1 %cmp10.2.1, i32 2, i32 %spec.select22.1.1 %arrayidx5.3.1 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 1, i64 3 %call.3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.3.1) %6 = load i32, ptr %arrayidx5.3.1, align 4, !tbaa !5 %cmp10.3.1 = icmp eq i32 %6, 0 %7 = select i1 %cmp10.3.1, i1 true, i1 %cmp10.2.1 %8 = select i1 %7, i1 true, i1 %cmp10.1.1 %narrow = select i1 %8, i1 true, i1 %cmp10.133 %spec.select.3.1 = zext i1 %narrow to i32 %spec.select22.3.1 = select i1 %cmp10.3.1, i32 3, i32 %spec.select22.2.1 %arrayidx5.236 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 2, i64 0 %call.237 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.236) %arrayidx5.1.2 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 2, i64 1 %arrayidx5.2.2 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 2, i64 2 %arrayidx5.3.2 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 2, i64 3 %arrayidx5.341 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 3, i64 0 %arrayidx5.1.3 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 3, i64 1 %arrayidx5.2.3 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 3, i64 2 %arrayidx5.3.3 = getelementptr inbounds [4 x [4 x i32]], ptr %board, i64 0, i64 3, i64 3 %9 = load <4 x i32>, ptr %arrayidx5.236, align 16 %10 = shufflevector <4 x i32> %9, <4 x i32> poison, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.1.2) %11 = load i32, ptr %arrayidx5.1.2, align 4, !tbaa !5 %call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.2.2) %12 = load i32, ptr %arrayidx5.2.2, align 8, !tbaa !5 %call.3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.3.2) %13 = load i32, ptr %arrayidx5.3.2, align 4, !tbaa !5 %call.342 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.341) %14 = load i32, ptr %arrayidx5.341, align 16, !tbaa !5 %call.1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.1.3) %15 = load i32, ptr %arrayidx5.1.3, align 4, !tbaa !5 %call.2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.2.3) %16 = load i32, ptr %arrayidx5.2.3, align 8, !tbaa !5 %call.3.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5.3.3) %17 = load i32, ptr %arrayidx5.3.3, align 4, !tbaa !5 %18 = insertelement <8 x i32> %10, i32 %11, i64 1 %19 = insertelement <8 x i32> %18, i32 %12, i64 2 %20 = insertelement <8 x i32> %19, i32 %13, i64 3 %21 = insertelement <8 x i32> %20, i32 %14, i64 4 %22 = insertelement <8 x i32> %21, i32 %15, i64 5 %23 = insertelement <8 x i32> %22, i32 %16, i64 6 %24 = insertelement <8 x i32> %23, i32 %17, i64 7 %25 = icmp eq <8 x i32> %24, zeroinitializer %26 = extractelement <8 x i1> %25, i64 0 %spec.select22.240 = select i1 %26, i32 0, i32 %spec.select22.3.1 %27 = extractelement <8 x i1> %25, i64 1 %spec.select22.1.2 = select i1 %27, i32 1, i32 %spec.select22.240 %28 = extractelement <8 x i1> %25, i64 2 %spec.select22.2.2 = select i1 %28, i32 2, i32 %spec.select22.1.2 %29 = extractelement <8 x i1> %25, i64 3 %30 = select i1 %29, i1 true, i1 %28 %31 = select i1 %30, i1 true, i1 %27 %32 = select i1 %31, i1 true, i1 %26 %spec.select.3.2 = select i1 %32, i32 2, i32 %spec.select.3.1 %spec.select22.3.2 = select i1 %29, i32 3, i32 %spec.select22.2.2 %33 = extractelement <8 x i1> %25, i64 4 %spec.select22.345 = select i1 %33, i32 0, i32 %spec.select22.3.2 %34 = extractelement <8 x i1> %25, i64 5 %spec.select22.1.3 = select i1 %34, i32 1, i32 %spec.select22.345 %35 = extractelement <8 x i1> %25, i64 6 %spec.select22.2.3 = select i1 %35, i32 2, i32 %spec.select22.1.3 %36 = extractelement <8 x i1> %25, i64 7 %37 = select i1 %36, i1 true, i1 %35 %38 = select i1 %37, i1 true, i1 %34 %39 = select i1 %38, i1 true, i1 %33 %spec.select.3.3 = select i1 %39, i32 3, i32 %spec.select.3.2 %spec.select22.3.3 = select i1 %36, i32 3, i32 %spec.select22.2.3 br label %while.cond.i while.cond.i: ; preds = %entry, %while.cond.i %limit.0.i = phi i32 [ %inc.i, %while.cond.i ], [ 0, %entry ] %call.i = call i32 @check(ptr noundef nonnull %board, i32 noundef %limit.0.i, i32 noundef 0, i32 noundef 99, i32 noundef %spec.select.3.3, i32 noundef %spec.select22.3.3) %tobool.not.i = icmp eq i32 %call.i, 0 %inc.i = add nuw nsw i32 %limit.0.i, 1 br i1 %tobool.not.i, label %while.cond.i, label %solve.exit solve.exit: ; preds = %while.cond.i %call1.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %limit.0.i) call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %board) #8 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> void merge_sort(long long x[], int n) { static long long y[100001] = {}; if (n <= 1) return; merge_sort(&(x[0]), n/2); merge_sort(&(x[n/2]), (n+1)/2); int i, p, q; for (i = 0, p = 0, q = n/2; i < n; i++) { if (p >= n/2) y[i] = x[q++]; else if (q >= n) y[i] = x[p++]; else y[i] = (x[p] > x[q])? x[p++]: x[q++]; } for (i = 0; i < n; i++) x[i] = y[i]; } int is_feasible(int n, int m, int* A[], int b[]) { int i, j, k, l, *p = (int*)malloc(sizeof(int) * (n + 1)); for (i = 1; i <= n; i++) p[i] = i; for (j = 1, k = 1; j <= m && k <= n; j++) { for (i = k; i <= n; i++) if (A[p[i]][j] == 1) break; if (i > n) continue; if (i != k) { p[i] ^= p[k]; p[k] ^= p[i]; p[i] ^= p[k]; } for (i = k + 1; i <= n; i++) { if (A[p[i]][j] == 1) { for (l = j; l <= m; l++) A[p[i]][l] ^= A[p[k]][l]; b[p[i]] ^= b[p[k]]; } } k++; } int ans = 0; for (i = 1; i < k; i++) if (b[p[i]] == 1) break; if (i < k) { for (i = k; i <= n; i++) if (b[p[i]] == 1) break; if (i > n) ans = 1; } free(p); return ans; } int main () { int i, N; long long a[100001]; scanf("%d", &N); for (i = 0; i < N; i++) scanf("%lld", &(a[i])); merge_sort(a, N); long long bit[61]; for (i = 1, bit[0] = 1; i <= 60; i++) bit[i] = bit[i-1] << 1; int j, k, l, m, n, *A[61], b[61], ans[61] = {}, count; for (i = 1; i <= 60; i++) A[i] = (int*)malloc(sizeof(int) * (N + 1)); for (i = 59; i >= 0; i--) { for (j = 0, count = 0; j < N && a[j] >= bit[i]; j++) if ((a[j] & bit[i]) != 0) count++; if (count == 0) continue; else if (count % 2 == 1) { ans[i] = 1; continue; } for (k = 59, n = 0; k >= i; k--) { if (ans[k] == 2 || k == i) b[++n] = 1; else continue; for (l = 0; l < j; l++) { if ((a[l] & bit[k]) != 0) A[n][l+1] = 1; else A[n][l+1] = 0; } } if (is_feasible(n, j, A, b) == 1) ans[i] = 2; } long long tmp = 0; for (i = 0; i <= 59; i++) tmp += bit[i] * ans[i]; printf("%lld\n", tmp); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164833/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164833/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @merge_sort.y = internal unnamed_addr global [100001 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @merge_sort(ptr noundef %x, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp = icmp slt i32 %n, 2 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %div78 = lshr i32 %n, 1 tail call void @merge_sort(ptr noundef %x, i32 noundef %div78) %idxprom = zext i32 %div78 to i64 %arrayidx2 = getelementptr inbounds i64, ptr %x, i64 %idxprom %add = add nuw nsw i32 %n, 1 %div37980 = lshr i32 %add, 1 tail call void @merge_sort(ptr noundef %arrayidx2, i32 noundef %div37980) %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond37.preheader: ; preds = %for.inc %cmp3884 = icmp sgt i32 %n, 0 br i1 %cmp3884, label %for.body39.preheader, label %return for.body39.preheader: ; preds = %for.cond37.preheader %0 = shl nuw nsw i64 %wide.trip.count, 3 tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %x, ptr nonnull align 16 @merge_sort.y, i64 %0, i1 false), !tbaa !5 br label %return for.body: ; preds = %if.end, %for.inc %indvars.iv = phi i64 [ 0, %if.end ], [ %indvars.iv.next, %for.inc ] %q.083 = phi i32 [ %div78, %if.end ], [ %q.2, %for.inc ] %p.082 = phi i32 [ 0, %if.end ], [ %p.2, %for.inc ] %cmp7.not = icmp slt i32 %p.082, %div78 br i1 %cmp7.not, label %if.else, label %if.then8 if.then8: ; preds = %for.body %inc = add nsw i32 %q.083, 1 %idxprom9 = sext i32 %q.083 to i64 %arrayidx10 = getelementptr inbounds i64, ptr %x, i64 %idxprom9 %1 = load i64, ptr %arrayidx10, align 8, !tbaa !5 br label %for.inc if.else: ; preds = %for.body %cmp13.not = icmp slt i32 %q.083, %n br i1 %cmp13.not, label %if.else20, label %if.then14 if.then14: ; preds = %if.else %inc15 = add nsw i32 %p.082, 1 %idxprom16 = sext i32 %p.082 to i64 %arrayidx17 = getelementptr inbounds i64, ptr %x, i64 %idxprom16 %2 = load i64, ptr %arrayidx17, align 8, !tbaa !5 br label %for.inc if.else20: ; preds = %if.else %idxprom21 = sext i32 %p.082 to i64 %arrayidx22 = getelementptr inbounds i64, ptr %x, i64 %idxprom21 %3 = load i64, ptr %arrayidx22, align 8, !tbaa !5 %idxprom23 = sext i32 %q.083 to i64 %arrayidx24 = getelementptr inbounds i64, ptr %x, i64 %idxprom23 %4 = load i64, ptr %arrayidx24, align 8, !tbaa !5 %cmp25 = icmp sgt i64 %3, %4 %inc26 = zext i1 %cmp25 to i32 %p.1 = add nsw i32 %p.082, %inc26 %not.cmp25 = xor i1 %cmp25, true %inc29 = zext i1 %not.cmp25 to i32 %q.1 = add nsw i32 %q.083, %inc29 %cond = tail call i64 @llvm.smax.i64(i64 %3, i64 %4) br label %for.inc for.inc: ; preds = %if.then8, %if.else20, %if.then14 %.sink = phi i64 [ %1, %if.then8 ], [ %cond, %if.else20 ], [ %2, %if.then14 ] %p.2 = phi i32 [ %p.082, %if.then8 ], [ %p.1, %if.else20 ], [ %inc15, %if.then14 ] %q.2 = phi i32 [ %inc, %if.then8 ], [ %q.1, %if.else20 ], [ %q.083, %if.then14 ] %arrayidx12 = getelementptr inbounds [100001 x i64], ptr @merge_sort.y, i64 0, i64 %indvars.iv store i64 %.sink, ptr %arrayidx12, align 8, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond37.preheader, label %for.body, !llvm.loop !9 return: ; preds = %for.body39.preheader, %for.cond37.preheader, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define dso_local i32 @is_feasible(i32 noundef %n, i32 noundef %m, ptr nocapture noundef readonly %A, ptr nocapture noundef %b) local_unnamed_addr #2 { entry: %add = add i32 %n, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #9 %cmp.not208 = icmp slt i32 %n, 1 br i1 %cmp.not208, label %if.end133, label %for.body.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %add to i64 %0 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i64 %0, 8 br i1 %min.iters.check, label %for.body.preheader299, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.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> %offset.idx = or i64 %index, 1 %1 = getelementptr inbounds i32, ptr %call, i64 %offset.idx store <4 x i32> %vec.ind, ptr %1, align 4, !tbaa !11 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> %step.add, ptr %2, align 4, !tbaa !11 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader299 for.body.preheader299: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.cond2.preheader: ; preds = %for.body, %middle.block %cmp3215 = icmp sgt i32 %m, 0 %cmp5216 = icmp sgt i32 %n, 0 %4 = and i1 %cmp3215, %cmp5216 br i1 %4, label %for.cond8.preheader.preheader, label %if.end133 for.cond8.preheader.preheader: ; preds = %for.cond2.preheader %5 = add nuw i32 %m, 1 %6 = add i32 %m, -1 %7 = add i32 %m, 1 br label %for.cond8.preheader for.body: ; preds = %for.body.preheader299, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader299 ] %arrayidx = getelementptr inbounds i32, ptr %call, i64 %indvars.iv %8 = trunc i64 %indvars.iv to i32 store i32 %8, ptr %arrayidx, align 4, !tbaa !11 %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 !16 for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.inc93 %indvar = phi i32 [ 0, %for.cond8.preheader.preheader ], [ %indvar.next, %for.inc93 ] %k.0220 = phi i32 [ 1, %for.cond8.preheader.preheader ], [ %k.1, %for.inc93 ] %j.0217 = phi i32 [ 1, %for.cond8.preheader.preheader ], [ %inc94, %for.inc93 ] %9 = sub i32 %6, %indvar %10 = zext i32 %9 to i64 %11 = add nuw nsw i64 %10, 1 %12 = zext i32 %j.0217 to i64 %13 = shl nuw nsw i64 %12, 2 %14 = sub i32 %6, %indvar %15 = zext i32 %14 to i64 %16 = add nuw nsw i64 %15, %12 %17 = shl nuw nsw i64 %16, 2 %18 = zext i32 %j.0217 to i64 %19 = sext i32 %k.0220 to i64 %smax = tail call i32 @llvm.smax.i32(i32 %k.0220, i32 %n) %20 = add i32 %smax, 1 br label %for.body11 for.cond96.preheader: ; preds = %for.inc93 %cmp97221 = icmp sgt i32 %k.1, 1 br i1 %cmp97221, label %for.body99.preheader, label %if.end133 for.body99.preheader: ; preds = %for.cond96.preheader %wide.trip.count254 = zext i32 %k.1 to i64 br label %for.body99 for.body11: ; preds = %for.cond8.preheader, %for.inc20 %indvars.iv232 = phi i64 [ %19, %for.cond8.preheader ], [ %indvars.iv.next233, %for.inc20 ] %arrayidx13 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv232 %21 = load i32, ptr %arrayidx13, align 4, !tbaa !11 %idxprom14 = sext i32 %21 to i64 %arrayidx15 = getelementptr inbounds ptr, ptr %A, i64 %idxprom14 %22 = load ptr, ptr %arrayidx15, align 8, !tbaa !17 %arrayidx17 = getelementptr inbounds i32, ptr %22, i64 %18 %23 = load i32, ptr %arrayidx17, align 4, !tbaa !11 %cmp18 = icmp eq i32 %23, 1 br i1 %cmp18, label %if.end26, label %for.inc20 for.inc20: ; preds = %for.body11 %indvars.iv.next233 = add nsw i64 %indvars.iv232, 1 %lftr.wideiv = trunc i64 %indvars.iv.next233 to i32 %exitcond235.not = icmp eq i32 %20, %lftr.wideiv br i1 %exitcond235.not, label %for.inc93, label %for.body11, !llvm.loop !19 if.end26: ; preds = %for.body11 %24 = trunc i64 %indvars.iv232 to i32 %cmp27.not = icmp eq i32 %k.0220, %24 br i1 %cmp27.not, label %if.end44, label %if.then29 if.then29: ; preds = %if.end26 %arrayidx31 = getelementptr inbounds i32, ptr %call, i64 %19 %25 = load i32, ptr %arrayidx31, align 4, !tbaa !11 %sext = shl i64 %indvars.iv232, 32 %idxprom32 = ashr exact i64 %sext, 32 %arrayidx33 = getelementptr inbounds i32, ptr %call, i64 %idxprom32 %26 = load i32, ptr %arrayidx33, align 4, !tbaa !11 %xor = xor i32 %26, %25 store i32 %xor, ptr %arrayidx33, align 4, !tbaa !11 %27 = load i32, ptr %arrayidx31, align 4, !tbaa !11 %xor38 = xor i32 %27, %xor store i32 %xor38, ptr %arrayidx31, align 4, !tbaa !11 %28 = load i32, ptr %arrayidx33, align 4, !tbaa !11 %xor43 = xor i32 %28, %xor38 store i32 %xor43, ptr %arrayidx33, align 4, !tbaa !11 br label %if.end44 if.end44: ; preds = %if.then29, %if.end26 %add45 = add nsw i32 %k.0220, 1 %cmp47.not213.not = icmp slt i32 %k.0220, %n br i1 %cmp47.not213.not, label %for.body49.preheader, label %for.inc93 for.body49.preheader: ; preds = %if.end44 %arrayidx64 = getelementptr inbounds i32, ptr %call, i64 %19 %29 = add nsw i64 %19, 1 %min.iters.check282 = icmp ult i32 %9, 7 %n.vec285 = and i64 %11, 8589934584 %ind.end286 = add nuw nsw i64 %n.vec285, %18 %cmp.n288 = icmp eq i64 %11, %n.vec285 br label %for.body49 for.body49: ; preds = %for.body49.preheader, %for.inc89 %indvars.iv241 = phi i64 [ %29, %for.body49.preheader ], [ %indvars.iv.next242, %for.inc89 ] %arrayidx51 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv241 %30 = load i32, ptr %arrayidx51, align 4, !tbaa !11 %idxprom52 = sext i32 %30 to i64 %arrayidx53 = getelementptr inbounds ptr, ptr %A, i64 %idxprom52 %31 = load ptr, ptr %arrayidx53, align 8, !tbaa !17 %arrayidx55 = getelementptr inbounds i32, ptr %31, i64 %18 %32 = load i32, ptr %arrayidx55, align 4, !tbaa !11 %cmp56 = icmp eq i32 %32, 1 br i1 %cmp56, label %for.cond59.preheader, label %for.inc89 for.cond59.preheader: ; preds = %for.body49 %33 = load i32, ptr %arrayidx64, align 4, !tbaa !11 %idxprom65 = sext i32 %33 to i64 %arrayidx66 = getelementptr inbounds ptr, ptr %A, i64 %idxprom65 %34 = load ptr, ptr %arrayidx66, align 8, !tbaa !17 br i1 %min.iters.check282, label %for.body62.preheader, label %vector.memcheck vector.memcheck: ; preds = %for.cond59.preheader %scevgep = getelementptr i8, ptr %31, i64 %13 %scevgep275 = getelementptr i8, ptr %31, i64 4 %scevgep276 = getelementptr i8, ptr %scevgep275, i64 %17 %scevgep277 = getelementptr i8, ptr %34, i64 %13 %scevgep278 = getelementptr i8, ptr %34, i64 4 %scevgep279 = getelementptr i8, ptr %scevgep278, i64 %17 %bound0 = icmp ult ptr %scevgep, %scevgep279 %bound1 = icmp ult ptr %scevgep277, %scevgep276 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body62.preheader, label %vector.body289 vector.body289: ; preds = %vector.memcheck, %vector.body289 %index290 = phi i64 [ %index.next295, %vector.body289 ], [ 0, %vector.memcheck ] %offset.idx291 = add i64 %index290, %18 %35 = getelementptr inbounds i32, ptr %34, i64 %offset.idx291 %wide.load = load <4 x i32>, ptr %35, align 4, !tbaa !11, !alias.scope !20 %36 = getelementptr inbounds i32, ptr %35, i64 4 %wide.load292 = load <4 x i32>, ptr %36, align 4, !tbaa !11, !alias.scope !20 %37 = getelementptr inbounds i32, ptr %31, i64 %offset.idx291 %wide.load293 = load <4 x i32>, ptr %37, align 4, !tbaa !11, !alias.scope !23, !noalias !20 %38 = getelementptr inbounds i32, ptr %37, i64 4 %wide.load294 = load <4 x i32>, ptr %38, align 4, !tbaa !11, !alias.scope !23, !noalias !20 %39 = xor <4 x i32> %wide.load293, %wide.load %40 = xor <4 x i32> %wide.load294, %wide.load292 store <4 x i32> %39, ptr %37, align 4, !tbaa !11, !alias.scope !23, !noalias !20 store <4 x i32> %40, ptr %38, align 4, !tbaa !11, !alias.scope !23, !noalias !20 %index.next295 = add nuw i64 %index290, 8 %41 = icmp eq i64 %index.next295, %n.vec285 br i1 %41, label %middle.block280, label %vector.body289, !llvm.loop !25 middle.block280: ; preds = %vector.body289 br i1 %cmp.n288, label %for.cond59.for.end78_crit_edge, label %for.body62.preheader for.body62.preheader: ; preds = %vector.memcheck, %for.cond59.preheader, %middle.block280 %indvars.iv236.ph = phi i64 [ %18, %vector.memcheck ], [ %18, %for.cond59.preheader ], [ %ind.end286, %middle.block280 ] %42 = trunc i64 %indvars.iv236.ph to i32 %43 = sub i32 %7, %42 %44 = sub i32 %m, %42 %xtraiter = and i32 %43, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body62.prol.loopexit, label %for.body62.prol for.body62.prol: ; preds = %for.body62.preheader, %for.body62.prol %indvars.iv236.prol = phi i64 [ %indvars.iv.next237.prol, %for.body62.prol ], [ %indvars.iv236.ph, %for.body62.preheader ] %prol.iter = phi i32 [ %prol.iter.next, %for.body62.prol ], [ 0, %for.body62.preheader ] %arrayidx68.prol = getelementptr inbounds i32, ptr %34, i64 %indvars.iv236.prol %45 = load i32, ptr %arrayidx68.prol, align 4, !tbaa !11 %arrayidx74.prol = getelementptr inbounds i32, ptr %31, i64 %indvars.iv236.prol %46 = load i32, ptr %arrayidx74.prol, align 4, !tbaa !11 %xor75.prol = xor i32 %46, %45 store i32 %xor75.prol, ptr %arrayidx74.prol, align 4, !tbaa !11 %indvars.iv.next237.prol = add nuw nsw i64 %indvars.iv236.prol, 1 %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 %for.body62.prol.loopexit, label %for.body62.prol, !llvm.loop !26 for.body62.prol.loopexit: ; preds = %for.body62.prol, %for.body62.preheader %indvars.iv236.unr = phi i64 [ %indvars.iv236.ph, %for.body62.preheader ], [ %indvars.iv.next237.prol, %for.body62.prol ] %47 = icmp ult i32 %44, 3 br i1 %47, label %for.cond59.for.end78_crit_edge, label %for.body62 for.body62: ; preds = %for.body62.prol.loopexit, %for.body62 %indvars.iv236 = phi i64 [ %indvars.iv.next237.3, %for.body62 ], [ %indvars.iv236.unr, %for.body62.prol.loopexit ] %arrayidx68 = getelementptr inbounds i32, ptr %34, i64 %indvars.iv236 %48 = load i32, ptr %arrayidx68, align 4, !tbaa !11 %arrayidx74 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv236 %49 = load i32, ptr %arrayidx74, align 4, !tbaa !11 %xor75 = xor i32 %49, %48 store i32 %xor75, ptr %arrayidx74, align 4, !tbaa !11 %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1 %arrayidx68.1 = getelementptr inbounds i32, ptr %34, i64 %indvars.iv.next237 %50 = load i32, ptr %arrayidx68.1, align 4, !tbaa !11 %arrayidx74.1 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv.next237 %51 = load i32, ptr %arrayidx74.1, align 4, !tbaa !11 %xor75.1 = xor i32 %51, %50 store i32 %xor75.1, ptr %arrayidx74.1, align 4, !tbaa !11 %indvars.iv.next237.1 = add nuw nsw i64 %indvars.iv236, 2 %arrayidx68.2 = getelementptr inbounds i32, ptr %34, i64 %indvars.iv.next237.1 %52 = load i32, ptr %arrayidx68.2, align 4, !tbaa !11 %arrayidx74.2 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv.next237.1 %53 = load i32, ptr %arrayidx74.2, align 4, !tbaa !11 %xor75.2 = xor i32 %53, %52 store i32 %xor75.2, ptr %arrayidx74.2, align 4, !tbaa !11 %indvars.iv.next237.2 = add nuw nsw i64 %indvars.iv236, 3 %arrayidx68.3 = getelementptr inbounds i32, ptr %34, i64 %indvars.iv.next237.2 %54 = load i32, ptr %arrayidx68.3, align 4, !tbaa !11 %arrayidx74.3 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv.next237.2 %55 = load i32, ptr %arrayidx74.3, align 4, !tbaa !11 %xor75.3 = xor i32 %55, %54 store i32 %xor75.3, ptr %arrayidx74.3, align 4, !tbaa !11 %indvars.iv.next237.3 = add nuw nsw i64 %indvars.iv236, 4 %lftr.wideiv239.3 = trunc i64 %indvars.iv.next237.3 to i32 %exitcond240.not.3 = icmp eq i32 %5, %lftr.wideiv239.3 br i1 %exitcond240.not.3, label %for.cond59.for.end78_crit_edge, label %for.body62, !llvm.loop !28 for.cond59.for.end78_crit_edge: ; preds = %for.body62.prol.loopexit, %for.body62, %middle.block280 %arrayidx82 = getelementptr inbounds i32, ptr %b, i64 %idxprom65 %56 = load i32, ptr %arrayidx82, align 4, !tbaa !11 %arrayidx86 = getelementptr inbounds i32, ptr %b, i64 %idxprom52 %57 = load i32, ptr %arrayidx86, align 4, !tbaa !11 %xor87 = xor i32 %57, %56 store i32 %xor87, ptr %arrayidx86, align 4, !tbaa !11 br label %for.inc89 for.inc89: ; preds = %for.body49, %for.cond59.for.end78_crit_edge %indvars.iv.next242 = add nsw i64 %indvars.iv241, 1 %lftr.wideiv244 = trunc i64 %indvars.iv.next242 to i32 %exitcond245.not = icmp eq i32 %add, %lftr.wideiv244 br i1 %exitcond245.not, label %for.inc93, label %for.body49, !llvm.loop !29 for.inc93: ; preds = %for.inc20, %for.inc89, %if.end44 %k.1 = phi i32 [ %add45, %if.end44 ], [ %add45, %for.inc89 ], [ %k.0220, %for.inc20 ] %inc94 = add i32 %j.0217, 1 %cmp3 = icmp sle i32 %inc94, %m %cmp5 = icmp sle i32 %k.1, %n %58 = select i1 %cmp3, i1 %cmp5, i1 false %indvar.next = add i32 %indvar, 1 br i1 %58, label %for.cond8.preheader, label %for.cond96.preheader, !llvm.loop !30 for.cond96: ; preds = %for.body99 %indvars.iv.next252 = add nuw nsw i64 %indvars.iv251, 1 %exitcond255.not = icmp eq i64 %indvars.iv.next252, %wide.trip.count254 br i1 %exitcond255.not, label %if.end133, label %for.body99, !llvm.loop !31 for.body99: ; preds = %for.body99.preheader, %for.cond96 %indvars.iv251 = phi i64 [ 1, %for.body99.preheader ], [ %indvars.iv.next252, %for.cond96 ] %arrayidx101 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv251 %59 = load i32, ptr %arrayidx101, align 4, !tbaa !11 %idxprom102 = sext i32 %59 to i64 %arrayidx103 = getelementptr inbounds i32, ptr %b, i64 %idxprom102 %60 = load i32, ptr %arrayidx103, align 4, !tbaa !11 %cmp104 = icmp eq i32 %60, 1 br i1 %cmp104, label %for.cond114.preheader, label %for.cond96 for.cond114.preheader: ; preds = %for.body99 %cmp115.not223 = icmp sgt i32 %k.1, %n br i1 %cmp115.not223, label %if.end133, label %for.body117.preheader for.body117.preheader: ; preds = %for.cond114.preheader %61 = sext i32 %k.1 to i64 %62 = sext i32 %n to i64 %arrayidx119268 = getelementptr inbounds i32, ptr %call, i64 %61 %63 = load i32, ptr %arrayidx119268, align 4, !tbaa !11 %idxprom120269 = sext i32 %63 to i64 %arrayidx121270 = getelementptr inbounds i32, ptr %b, i64 %idxprom120269 %64 = load i32, ptr %arrayidx121270, align 4, !tbaa !11 %cmp122271 = icmp eq i32 %64, 1 br i1 %cmp122271, label %if.end133, label %for.cond114 for.cond114: ; preds = %for.body117.preheader, %for.body117 %indvars.iv256272 = phi i64 [ %indvars.iv.next257, %for.body117 ], [ %61, %for.body117.preheader ] %indvars.iv.next257 = add nsw i64 %indvars.iv256272, 1 %lftr.wideiv258 = trunc i64 %indvars.iv.next257 to i32 %exitcond259 = icmp eq i32 %add, %lftr.wideiv258 br i1 %exitcond259, label %for.end128.loopexit.loopexit, label %for.body117, !llvm.loop !32 for.body117: ; preds = %for.cond114 %arrayidx119 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next257 %65 = load i32, ptr %arrayidx119, align 4, !tbaa !11 %idxprom120 = sext i32 %65 to i64 %arrayidx121 = getelementptr inbounds i32, ptr %b, i64 %idxprom120 %66 = load i32, ptr %arrayidx121, align 4, !tbaa !11 %cmp122 = icmp eq i32 %66, 1 br i1 %cmp122, label %for.end128.loopexit.loopexit, label %for.cond114, !llvm.loop !32 for.end128.loopexit.loopexit: ; preds = %for.body117, %for.cond114 %cmp115.not.le = icmp sge i64 %indvars.iv256272, %62 %67 = zext i1 %cmp115.not.le to i32 br label %if.end133 if.end133: ; preds = %for.cond96, %for.body117.preheader, %for.end128.loopexit.loopexit, %entry, %for.cond2.preheader, %for.cond114.preheader, %for.cond96.preheader %ans.0 = phi i32 [ 0, %for.cond96.preheader ], [ 1, %for.cond114.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ 0, %for.body117.preheader ], [ %67, %for.end128.loopexit.loopexit ], [ 0, %for.cond96 ] tail call void @free(ptr noundef %call) #10 ret i32 %ans.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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 %a = alloca [100001 x i64], align 16 %bit = alloca [61 x i64], align 16 %A = alloca [61 x ptr], align 16 %b = alloca [61 x i32], align 16 %ans = alloca [61 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #10 call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %a) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !11 %cmp171 = icmp sgt i32 %0, 0 br i1 %cmp171, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x i64], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !11 %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 !33 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @merge_sort(ptr noundef nonnull %a, i32 noundef %.lcssa) call void @llvm.lifetime.start.p0(i64 488, ptr nonnull %bit) #10 store i64 1, ptr %bit, align 16, !tbaa !5 %arrayidx9 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 1 store i64 2, ptr %arrayidx9, align 8, !tbaa !5 %arrayidx9.1 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 2 store i64 4, ptr %arrayidx9.1, align 16, !tbaa !5 %arrayidx9.2 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 3 store i64 8, ptr %arrayidx9.2, align 8, !tbaa !5 %arrayidx9.3 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 4 store i64 16, ptr %arrayidx9.3, align 16, !tbaa !5 %arrayidx9.4 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 5 store i64 32, ptr %arrayidx9.4, align 8, !tbaa !5 %arrayidx9.5 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 6 store i64 64, ptr %arrayidx9.5, align 16, !tbaa !5 %arrayidx9.6 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 7 store i64 128, ptr %arrayidx9.6, align 8, !tbaa !5 %arrayidx9.7 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 8 store i64 256, ptr %arrayidx9.7, align 16, !tbaa !5 %arrayidx9.8 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 9 store i64 512, ptr %arrayidx9.8, align 8, !tbaa !5 %arrayidx9.9 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 10 store i64 1024, ptr %arrayidx9.9, align 16, !tbaa !5 %arrayidx9.10 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 11 store i64 2048, ptr %arrayidx9.10, align 8, !tbaa !5 %arrayidx9.11 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 12 store i64 4096, ptr %arrayidx9.11, align 16, !tbaa !5 %arrayidx9.12 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 13 store i64 8192, ptr %arrayidx9.12, align 8, !tbaa !5 %arrayidx9.13 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 14 store i64 16384, ptr %arrayidx9.13, align 16, !tbaa !5 %arrayidx9.14 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 15 store i64 32768, ptr %arrayidx9.14, align 8, !tbaa !5 %arrayidx9.15 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 16 store i64 65536, ptr %arrayidx9.15, align 16, !tbaa !5 %arrayidx9.16 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 17 store i64 131072, ptr %arrayidx9.16, align 8, !tbaa !5 %arrayidx9.17 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 18 store i64 262144, ptr %arrayidx9.17, align 16, !tbaa !5 %arrayidx9.18 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 19 store i64 524288, ptr %arrayidx9.18, align 8, !tbaa !5 %arrayidx9.19 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 20 store i64 1048576, ptr %arrayidx9.19, align 16, !tbaa !5 %arrayidx9.20 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 21 store i64 2097152, ptr %arrayidx9.20, align 8, !tbaa !5 %arrayidx9.21 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 22 store i64 4194304, ptr %arrayidx9.21, align 16, !tbaa !5 %arrayidx9.22 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 23 store i64 8388608, ptr %arrayidx9.22, align 8, !tbaa !5 %arrayidx9.23 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 24 store i64 16777216, ptr %arrayidx9.23, align 16, !tbaa !5 %arrayidx9.24 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 25 store i64 33554432, ptr %arrayidx9.24, align 8, !tbaa !5 %arrayidx9.25 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 26 store i64 67108864, ptr %arrayidx9.25, align 16, !tbaa !5 %arrayidx9.26 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 27 store i64 134217728, ptr %arrayidx9.26, align 8, !tbaa !5 %arrayidx9.27 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 28 store i64 268435456, ptr %arrayidx9.27, align 16, !tbaa !5 %arrayidx9.28 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 29 store i64 536870912, ptr %arrayidx9.28, align 8, !tbaa !5 %arrayidx9.29 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 30 store i64 1073741824, ptr %arrayidx9.29, align 16, !tbaa !5 %arrayidx9.30 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 31 store i64 2147483648, ptr %arrayidx9.30, align 8, !tbaa !5 %arrayidx9.31 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 32 store i64 4294967296, ptr %arrayidx9.31, align 16, !tbaa !5 %arrayidx9.32 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 33 store i64 8589934592, ptr %arrayidx9.32, align 8, !tbaa !5 %arrayidx9.33 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 34 store i64 17179869184, ptr %arrayidx9.33, align 16, !tbaa !5 %arrayidx9.34 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 35 store i64 34359738368, ptr %arrayidx9.34, align 8, !tbaa !5 %arrayidx9.35 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 36 store i64 68719476736, ptr %arrayidx9.35, align 16, !tbaa !5 %arrayidx9.36 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 37 store i64 137438953472, ptr %arrayidx9.36, align 8, !tbaa !5 %arrayidx9.37 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 38 store i64 274877906944, ptr %arrayidx9.37, align 16, !tbaa !5 %arrayidx9.38 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 39 store i64 549755813888, ptr %arrayidx9.38, align 8, !tbaa !5 %arrayidx9.39 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 40 store i64 1099511627776, ptr %arrayidx9.39, align 16, !tbaa !5 %arrayidx9.40 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 41 store i64 2199023255552, ptr %arrayidx9.40, align 8, !tbaa !5 %arrayidx9.41 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 42 store i64 4398046511104, ptr %arrayidx9.41, align 16, !tbaa !5 %arrayidx9.42 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 43 store i64 8796093022208, ptr %arrayidx9.42, align 8, !tbaa !5 %arrayidx9.43 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 44 store i64 17592186044416, ptr %arrayidx9.43, align 16, !tbaa !5 %arrayidx9.44 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 45 store i64 35184372088832, ptr %arrayidx9.44, align 8, !tbaa !5 %arrayidx9.45 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 46 store i64 70368744177664, ptr %arrayidx9.45, align 16, !tbaa !5 %arrayidx9.46 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 47 store i64 140737488355328, ptr %arrayidx9.46, align 8, !tbaa !5 %arrayidx9.47 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 48 store i64 281474976710656, ptr %arrayidx9.47, align 16, !tbaa !5 %arrayidx9.48 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 49 store i64 562949953421312, ptr %arrayidx9.48, align 8, !tbaa !5 %arrayidx9.49 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 50 store i64 1125899906842624, ptr %arrayidx9.49, align 16, !tbaa !5 %arrayidx9.50 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 51 store i64 2251799813685248, ptr %arrayidx9.50, align 8, !tbaa !5 %arrayidx9.51 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 52 store i64 4503599627370496, ptr %arrayidx9.51, align 16, !tbaa !5 %arrayidx9.52 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 53 store i64 9007199254740992, ptr %arrayidx9.52, align 8, !tbaa !5 %arrayidx9.53 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 54 store i64 18014398509481984, ptr %arrayidx9.53, align 16, !tbaa !5 %arrayidx9.54 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 55 store i64 36028797018963968, ptr %arrayidx9.54, align 8, !tbaa !5 %arrayidx9.55 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 56 store i64 72057594037927936, ptr %arrayidx9.55, align 16, !tbaa !5 %arrayidx9.56 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 57 store i64 144115188075855872, ptr %arrayidx9.56, align 8, !tbaa !5 %arrayidx9.57 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 58 store i64 288230376151711744, ptr %arrayidx9.57, align 16, !tbaa !5 %arrayidx9.58 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 59 store i64 576460752303423488, ptr %arrayidx9.58, align 8, !tbaa !5 %arrayidx9.59 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 60 store i64 1152921504606846976, ptr %arrayidx9.59, align 16, !tbaa !5 call void @llvm.lifetime.start.p0(i64 488, ptr nonnull %A) #10 call void @llvm.lifetime.start.p0(i64 244, ptr nonnull %b) #10 call void @llvm.lifetime.start.p0(i64 244, ptr nonnull %ans) #10 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(244) %ans, i8 0, i64 244, i1 false) %3 = load i32, ptr %N, align 4, !tbaa !11 %add = add nsw i32 %3, 1 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 2 br label %for.body15 for.body15: ; preds = %for.end, %for.body15 %indvars.iv200 = phi i64 [ 1, %for.end ], [ %indvars.iv.next201, %for.body15 ] %call16 = call noalias ptr @malloc(i64 noundef %mul) #9 %arrayidx18 = getelementptr inbounds [61 x ptr], ptr %A, i64 0, i64 %indvars.iv200 store ptr %call16, ptr %arrayidx18, align 8, !tbaa !17 %indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1 %exitcond203.not = icmp eq i64 %indvars.iv.next201, 61 br i1 %exitcond203.not, label %for.cond26.preheader, label %for.body15, !llvm.loop !34 for.cond26.preheader: ; preds = %for.body15, %for.inc110 %indvar = phi i64 [ %indvar.next, %for.inc110 ], [ 0, %for.body15 ] %indvars.iv221 = phi i64 [ %indvars.iv.next222, %for.inc110 ], [ 59, %for.body15 ] %4 = add i64 %indvar, 1 %5 = load i32, ptr %N, align 4, !tbaa !11 %cmp27175 = icmp sgt i32 %5, 0 br i1 %cmp27175, label %land.rhs.lr.ph, label %for.inc110 land.rhs.lr.ph: ; preds = %for.cond26.preheader %arrayidx32 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv221 %6 = load i64, ptr %arrayidx32, align 8, !tbaa !5 %wide.trip.count = zext i32 %5 to i64 br label %land.rhs land.rhs: ; preds = %land.rhs.lr.ph, %for.body35 %indvars.iv204 = phi i64 [ 0, %land.rhs.lr.ph ], [ %indvars.iv.next205, %for.body35 ] %count.0177 = phi i32 [ 0, %land.rhs.lr.ph ], [ %spec.select, %for.body35 ] %arrayidx30 = getelementptr inbounds [100001 x i64], ptr %a, i64 0, i64 %indvars.iv204 %7 = load i64, ptr %arrayidx30, align 8, !tbaa !5 %cmp33.not = icmp slt i64 %7, %6 br i1 %cmp33.not, label %for.end45.split.loop.exit, label %for.body35 for.body35: ; preds = %land.rhs %and = and i64 %6, %7 %cmp40.not = icmp ne i64 %and, 0 %inc42 = zext i1 %cmp40.not to i32 %spec.select = add nuw nsw i32 %count.0177, %inc42 %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %exitcond207.not = icmp eq i64 %indvars.iv.next205, %wide.trip.count br i1 %exitcond207.not, label %for.end45, label %land.rhs, !llvm.loop !35 for.end45.split.loop.exit: ; preds = %land.rhs %8 = trunc i64 %indvars.iv204 to i32 br label %for.end45 for.end45: ; preds = %for.body35, %for.end45.split.loop.exit %j.0.lcssa = phi i32 [ %8, %for.end45.split.loop.exit ], [ %5, %for.body35 ] %count.0.lcssa = phi i32 [ %count.0177, %for.end45.split.loop.exit ], [ %spec.select, %for.body35 ] %j.0.lcssa.fr = freeze i32 %j.0.lcssa %cmp46 = icmp eq i32 %count.0.lcssa, 0 br i1 %cmp46, label %for.inc110, label %if.else if.else: ; preds = %for.end45 %9 = and i32 %count.0.lcssa, 1 %cmp49.not = icmp eq i32 %9, 0 br i1 %cmp49.not, label %for.body59.lr.ph, label %for.inc110.sink.split for.body59.lr.ph: ; preds = %if.else %cmp73182.not = icmp eq i32 %j.0.lcssa.fr, 0 br i1 %cmp73182.not, label %for.body59.preheader, label %for.body59.us.preheader for.body59.preheader: ; preds = %for.body59.lr.ph %xtraiter246 = and i64 %4, 1 %10 = icmp eq i64 %indvar, 0 br i1 %10, label %for.end100.loopexit.unr-lcssa, label %for.body59.preheader.new for.body59.preheader.new: ; preds = %for.body59.preheader %unroll_iter249 = and i64 %4, -2 br label %for.body59 for.body59.us.preheader: ; preds = %for.body59.lr.ph %wide.trip.count213 = zext i32 %j.0.lcssa.fr to i64 %xtraiter = and i64 %wide.trip.count213, 1 %11 = icmp eq i32 %j.0.lcssa.fr, 1 %unroll_iter = and i64 %wide.trip.count213, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body59.us for.body59.us: ; preds = %for.body59.us.preheader, %for.inc99.us %indvars.iv215 = phi i64 [ 59, %for.body59.us.preheader ], [ %indvars.iv.next216, %for.inc99.us ] %n.0186.us = phi i32 [ 0, %for.body59.us.preheader ], [ %n.1.us, %for.inc99.us ] %arrayidx61.us = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv215 %12 = load i32, ptr %arrayidx61.us, align 4, !tbaa !11 %cmp62.us = icmp eq i32 %12, 2 %cmp64.us = icmp eq i64 %indvars.iv215, %indvars.iv221 %or.cond.us = or i1 %cmp64.us, %cmp62.us br i1 %or.cond.us, label %if.then66.us, label %for.inc99.us if.then66.us: ; preds = %for.body59.us %inc67.us = add nsw i32 %n.0186.us, 1 %idxprom68.us = sext i32 %inc67.us to i64 %arrayidx69.us = getelementptr inbounds [61 x i32], ptr %b, i64 0, i64 %idxprom68.us store i32 1, ptr %arrayidx69.us, align 4, !tbaa !11 %arrayidx79.us = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv215 %13 = load i64, ptr %arrayidx79.us, align 8, !tbaa !5 %arrayidx85.us = getelementptr inbounds [61 x ptr], ptr %A, i64 0, i64 %idxprom68.us br i1 %11, label %for.inc99.us.loopexit.unr-lcssa, label %if.then66.us.new if.then66.us.new: ; preds = %if.then66.us %14 = load ptr, ptr %arrayidx85.us, align 8, !tbaa !17 %15 = load ptr, ptr %arrayidx85.us, align 8, !tbaa !17 br label %for.body75.us for.inc99.us.loopexit.unr-lcssa: ; preds = %for.body75.us, %if.then66.us %indvars.iv208.unr = phi i64 [ 0, %if.then66.us ], [ %22, %for.body75.us ] br i1 %lcmp.mod.not, label %for.inc99.us, label %for.body75.us.epil for.body75.us.epil: ; preds = %for.inc99.us.loopexit.unr-lcssa %arrayidx77.us.epil = getelementptr inbounds [100001 x i64], ptr %a, i64 0, i64 %indvars.iv208.unr %16 = load i64, ptr %arrayidx77.us.epil, align 8, !tbaa !5 %and80.us.epil = and i64 %13, %16 %cmp81.not.us.epil = icmp ne i64 %and80.us.epil, 0 %17 = load ptr, ptr %arrayidx85.us, align 8, !tbaa !17 %18 = getelementptr i32, ptr %17, i64 %indvars.iv208.unr %arrayidx94.us.epil = getelementptr i32, ptr %18, i64 1 %..epil = zext i1 %cmp81.not.us.epil to i32 store i32 %..epil, ptr %arrayidx94.us.epil, align 4, !tbaa !11 br label %for.inc99.us for.inc99.us: ; preds = %for.body75.us.epil, %for.inc99.us.loopexit.unr-lcssa, %for.body59.us %n.1.us = phi i32 [ %n.0186.us, %for.body59.us ], [ %inc67.us, %for.inc99.us.loopexit.unr-lcssa ], [ %inc67.us, %for.body75.us.epil ] %indvars.iv.next216 = add nsw i64 %indvars.iv215, -1 %cmp57.not.us.not = icmp ugt i64 %indvars.iv215, %indvars.iv221 br i1 %cmp57.not.us.not, label %for.body59.us, label %for.end100, !llvm.loop !36 for.body75.us: ; preds = %for.body75.us, %if.then66.us.new %indvars.iv208 = phi i64 [ 0, %if.then66.us.new ], [ %22, %for.body75.us ] %niter = phi i64 [ 0, %if.then66.us.new ], [ %niter.next.1, %for.body75.us ] %arrayidx77.us = getelementptr inbounds [100001 x i64], ptr %a, i64 0, i64 %indvars.iv208 %19 = load i64, ptr %arrayidx77.us, align 16, !tbaa !5 %and80.us = and i64 %13, %19 %cmp81.not.us = icmp ne i64 %and80.us, 0 %20 = or i64 %indvars.iv208, 1 %arrayidx94.us = getelementptr inbounds i32, ptr %14, i64 %20 %. = zext i1 %cmp81.not.us to i32 store i32 %., ptr %arrayidx94.us, align 4, !tbaa !11 %arrayidx77.us.1 = getelementptr inbounds [100001 x i64], ptr %a, i64 0, i64 %20 %21 = load i64, ptr %arrayidx77.us.1, align 8, !tbaa !5 %and80.us.1 = and i64 %13, %21 %cmp81.not.us.1 = icmp ne i64 %and80.us.1, 0 %22 = add nuw nsw i64 %indvars.iv208, 2 %arrayidx94.us.1 = getelementptr inbounds i32, ptr %15, i64 %22 %..1 = zext i1 %cmp81.not.us.1 to i32 store i32 %..1, ptr %arrayidx94.us.1, align 4, !tbaa !11 %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.inc99.us.loopexit.unr-lcssa, label %for.body75.us, !llvm.loop !37 for.body59: ; preds = %for.inc99.1, %for.body59.preheader.new %indvars.iv218 = phi i64 [ 59, %for.body59.preheader.new ], [ %indvars.iv.next219.1, %for.inc99.1 ] %n.0186 = phi i32 [ 0, %for.body59.preheader.new ], [ %n.1.1, %for.inc99.1 ] %niter250 = phi i64 [ 0, %for.body59.preheader.new ], [ %niter250.next.1, %for.inc99.1 ] %arrayidx61 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv218 %23 = load i32, ptr %arrayidx61, align 4, !tbaa !11 %cmp62 = icmp eq i32 %23, 2 %cmp64 = icmp eq i64 %indvars.iv218, %indvars.iv221 %or.cond = or i1 %cmp64, %cmp62 br i1 %or.cond, label %if.then66, label %for.inc99 if.then66: ; preds = %for.body59 %inc67 = add nsw i32 %n.0186, 1 %idxprom68 = sext i32 %inc67 to i64 %arrayidx69 = getelementptr inbounds [61 x i32], ptr %b, i64 0, i64 %idxprom68 store i32 1, ptr %arrayidx69, align 4, !tbaa !11 br label %for.inc99 for.inc99: ; preds = %if.then66, %for.body59 %n.1 = phi i32 [ %n.0186, %for.body59 ], [ %inc67, %if.then66 ] %indvars.iv.next219 = add nsw i64 %indvars.iv218, -1 %arrayidx61.1 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv.next219 %24 = load i32, ptr %arrayidx61.1, align 4, !tbaa !11 %cmp62.1 = icmp eq i32 %24, 2 %cmp64.1 = icmp eq i64 %indvars.iv.next219, %indvars.iv221 %or.cond.1 = or i1 %cmp64.1, %cmp62.1 br i1 %or.cond.1, label %if.then66.1, label %for.inc99.1 if.then66.1: ; preds = %for.inc99 %inc67.1 = add nsw i32 %n.1, 1 %idxprom68.1 = sext i32 %inc67.1 to i64 %arrayidx69.1 = getelementptr inbounds [61 x i32], ptr %b, i64 0, i64 %idxprom68.1 store i32 1, ptr %arrayidx69.1, align 4, !tbaa !11 br label %for.inc99.1 for.inc99.1: ; preds = %if.then66.1, %for.inc99 %n.1.1 = phi i32 [ %n.1, %for.inc99 ], [ %inc67.1, %if.then66.1 ] %indvars.iv.next219.1 = add nsw i64 %indvars.iv218, -2 %niter250.next.1 = add i64 %niter250, 2 %niter250.ncmp.1.not = icmp eq i64 %niter250.next.1, %unroll_iter249 br i1 %niter250.ncmp.1.not, label %for.end100.loopexit.unr-lcssa, label %for.body59, !llvm.loop !36 for.end100.loopexit.unr-lcssa: ; preds = %for.inc99.1, %for.body59.preheader %n.1.lcssa.ph = phi i32 [ undef, %for.body59.preheader ], [ %n.1.1, %for.inc99.1 ] %indvars.iv218.unr = phi i64 [ 59, %for.body59.preheader ], [ %indvars.iv.next219.1, %for.inc99.1 ] %n.0186.unr = phi i32 [ 0, %for.body59.preheader ], [ %n.1.1, %for.inc99.1 ] %lcmp.mod247.not = icmp eq i64 %xtraiter246, 0 br i1 %lcmp.mod247.not, label %for.end100, label %for.body59.epil for.body59.epil: ; preds = %for.end100.loopexit.unr-lcssa %arrayidx61.epil = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv218.unr %25 = load i32, ptr %arrayidx61.epil, align 4, !tbaa !11 %cmp62.epil = icmp eq i32 %25, 2 %cmp64.epil = icmp eq i64 %indvars.iv218.unr, %indvars.iv221 %or.cond.epil = or i1 %cmp64.epil, %cmp62.epil br i1 %or.cond.epil, label %if.then66.epil, label %for.end100 if.then66.epil: ; preds = %for.body59.epil %inc67.epil = add nsw i32 %n.0186.unr, 1 %idxprom68.epil = sext i32 %inc67.epil to i64 %arrayidx69.epil = getelementptr inbounds [61 x i32], ptr %b, i64 0, i64 %idxprom68.epil store i32 1, ptr %arrayidx69.epil, align 4, !tbaa !11 br label %for.end100 for.end100: ; preds = %for.inc99.us, %for.end100.loopexit.unr-lcssa, %if.then66.epil, %for.body59.epil %n.0.lcssa = phi i32 [ %n.1.lcssa.ph, %for.end100.loopexit.unr-lcssa ], [ %n.0186.unr, %for.body59.epil ], [ %inc67.epil, %if.then66.epil ], [ %n.1.us, %for.inc99.us ] %call103 = call i32 @is_feasible(i32 noundef %n.0.lcssa, i32 noundef %j.0.lcssa.fr, ptr noundef nonnull %A, ptr noundef nonnull %b), !range !38 %cmp104.not = icmp eq i32 %call103, 0 br i1 %cmp104.not, label %for.inc110, label %for.inc110.sink.split for.inc110.sink.split: ; preds = %for.end100, %if.else %.sink237 = phi i32 [ 1, %if.else ], [ 2, %for.end100 ] %arrayidx108 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv221 store i32 %.sink237, ptr %arrayidx108, align 4, !tbaa !11 br label %for.inc110 for.inc110: ; preds = %for.inc110.sink.split, %for.cond26.preheader, %for.end100, %for.end45 %indvars.iv.next222 = add nsw i64 %indvars.iv221, -1 %cmp23.not = icmp eq i64 %indvars.iv221, 0 %indvar.next = add i64 %indvar, 1 br i1 %cmp23.not, label %for.body116, label %for.cond26.preheader, !llvm.loop !39 for.body116: ; preds = %for.inc110, %for.body116 %indvars.iv224 = phi i64 [ %indvars.iv.next225.4, %for.body116 ], [ 0, %for.inc110 ] %tmp.0192 = phi i64 [ %add123.4, %for.body116 ], [ 0, %for.inc110 ] %arrayidx118 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv224 %26 = load i64, ptr %arrayidx118, align 8, !tbaa !5 %arrayidx120 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv224 %27 = load i32, ptr %arrayidx120, align 4, !tbaa !11 %conv121 = sext i32 %27 to i64 %mul122 = mul nsw i64 %26, %conv121 %add123 = add nsw i64 %mul122, %tmp.0192 %indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1 %arrayidx118.1 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv.next225 %28 = load i64, ptr %arrayidx118.1, align 8, !tbaa !5 %arrayidx120.1 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv.next225 %29 = load i32, ptr %arrayidx120.1, align 4, !tbaa !11 %conv121.1 = sext i32 %29 to i64 %mul122.1 = mul nsw i64 %28, %conv121.1 %add123.1 = add nsw i64 %mul122.1, %add123 %indvars.iv.next225.1 = add nuw nsw i64 %indvars.iv224, 2 %arrayidx118.2 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv.next225.1 %30 = load i64, ptr %arrayidx118.2, align 8, !tbaa !5 %arrayidx120.2 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv.next225.1 %31 = load i32, ptr %arrayidx120.2, align 4, !tbaa !11 %conv121.2 = sext i32 %31 to i64 %mul122.2 = mul nsw i64 %30, %conv121.2 %add123.2 = add nsw i64 %mul122.2, %add123.1 %indvars.iv.next225.2 = add nuw nsw i64 %indvars.iv224, 3 %arrayidx118.3 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv.next225.2 %32 = load i64, ptr %arrayidx118.3, align 8, !tbaa !5 %arrayidx120.3 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv.next225.2 %33 = load i32, ptr %arrayidx120.3, align 4, !tbaa !11 %conv121.3 = sext i32 %33 to i64 %mul122.3 = mul nsw i64 %32, %conv121.3 %add123.3 = add nsw i64 %mul122.3, %add123.2 %indvars.iv.next225.3 = add nuw nsw i64 %indvars.iv224, 4 %arrayidx118.4 = getelementptr inbounds [61 x i64], ptr %bit, i64 0, i64 %indvars.iv.next225.3 %34 = load i64, ptr %arrayidx118.4, align 8, !tbaa !5 %arrayidx120.4 = getelementptr inbounds [61 x i32], ptr %ans, i64 0, i64 %indvars.iv.next225.3 %35 = load i32, ptr %arrayidx120.4, align 4, !tbaa !11 %conv121.4 = sext i32 %35 to i64 %mul122.4 = mul nsw i64 %34, %conv121.4 %add123.4 = add nsw i64 %mul122.4, %add123.3 %indvars.iv.next225.4 = add nuw nsw i64 %indvars.iv224, 5 %exitcond227.not.4 = icmp eq i64 %indvars.iv.next225.4, 60 br i1 %exitcond227.not.4, label %for.end126, label %for.body116, !llvm.loop !40 for.end126: ; preds = %for.body116 %call127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add123.4) %36 = load ptr, ptr @stdout, align 8, !tbaa !17 %call128 = call i32 @fflush(ptr noundef %36) call void @llvm.lifetime.end.p0(i64 244, ptr nonnull %ans) #10 call void @llvm.lifetime.end.p0(i64 244, ptr nonnull %b) #10 call void @llvm.lifetime.end.p0(i64 488, ptr nonnull %A) #10 call void @llvm.lifetime.end.p0(i64 488, ptr nonnull %bit) #10 call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %a) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #10 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #7 attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #9 = { nounwind allocsize(0) } 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 = !{!12, !12, i64 0} !12 = !{!"int", !7, i64 0} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = !{!18, !18, i64 0} !18 = !{!"any pointer", !7, i64 0} !19 = distinct !{!19, !10} !20 = !{!21} !21 = distinct !{!21, !22} !22 = distinct !{!22, !"LVerDomain"} !23 = !{!24} !24 = distinct !{!24, !22} !25 = distinct !{!25, !10, !14, !15} !26 = distinct !{!26, !27} !27 = !{!"llvm.loop.unroll.disable"} !28 = distinct !{!28, !10, !14} !29 = distinct !{!29, !10} !30 = distinct !{!30, !10} !31 = distinct !{!31, !10} !32 = distinct !{!32, !10} !33 = distinct !{!33, !10} !34 = distinct !{!34, !10} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = !{i32 0, i32 2} !39 = distinct !{!39, !10} !40 = distinct !{!40, !10}
#include <stdio.h> int main(void) { int a, b, c; int rec = 0, rho = 0; while (scanf("%d,%d,%d", &a, &b, &c) != EOF){ if (c * c == a * a + b * b){ rec++; } else if (a == b){ rho++; } } printf("%d\n", rec); printf("%d\n", rho); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164877/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164877/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d,%d,%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %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 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %cmp.not13 = icmp eq i32 %call12, -1 br i1 %cmp.not13, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %rho.015 = phi i32 [ %rho.1, %while.body ], [ 0, %entry ] %rec.014 = phi i32 [ %rec.1, %while.body ], [ 0, %entry ] %0 = load i32, ptr %c, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %1 = load i32, ptr %a, align 4, !tbaa !5 %mul1 = mul nsw i32 %1, %1 %2 = load i32, ptr %b, align 4, !tbaa !5 %mul2 = mul nsw i32 %2, %2 %add = add nuw nsw i32 %mul2, %mul1 %cmp3 = icmp eq i32 %mul, %add %cmp4 = icmp eq i32 %1, %2 %inc = zext i1 %cmp3 to i32 %rec.1 = add nuw nsw i32 %rec.014, %inc %not.cmp3 = xor i1 %cmp3, true %narrow = select i1 %not.cmp3, i1 %cmp4, i1 false %spec.select = zext i1 %narrow to i32 %rho.1 = add nuw nsw i32 %rho.015, %spec.select %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %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 %rec.0.lcssa = phi i32 [ 0, %entry ], [ %rec.1, %while.body ] %rho.0.lcssa = phi i32 [ 0, %entry ], [ %rho.1, %while.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rec.0.lcssa) %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rho.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { // your code goes here int n; scanf("%d\n",&n); int arr[n],swap=0; int i,j,count=0; int temp[n]; for(i=0;i<n;i++) { scanf("%d",&arr[i]); } scanf("\n"); for(i=0;i<n-1;i++) { for(j=0;j<n-i-1;j++) { if(arr[j]>arr[j+1]) { swap=arr[j]; arr[j]=arr[j+1]; arr[j+1]=swap; } } } for(i=0;i<n-1;i++) { if(arr[i]!=arr[i+1] && arr[i]!=0) temp[++count]=arr[i]; } temp[++count]=arr[n]; printf("%d",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16492/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16492/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp84 = icmp sgt i32 %3, 0 br i1 %cmp84, 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 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2) %6 = load i32, ptr %n, align 4, !tbaa !5 %sub = add i32 %6, -1 %cmp588 = icmp sgt i32 %6, 1 br i1 %cmp588, label %for.cond7.preheader.preheader, label %for.end55 for.cond7.preheader.preheader: ; preds = %for.end %invariant.gep = getelementptr i32, ptr %vla, i64 1 br label %for.cond7.preheader for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.inc30 %indvars.iv98 = phi i32 [ %indvars.iv.next99, %for.inc30 ], [ %sub, %for.cond7.preheader.preheader ] %i.189 = phi i32 [ %inc31, %for.inc30 ], [ 0, %for.cond7.preheader.preheader ] %7 = zext i32 %indvars.iv98 to i64 %8 = xor i32 %i.189, -1 %sub9 = add i32 %6, %8 %cmp1086 = icmp sgt i32 %sub9, 0 br i1 %cmp1086, label %for.body11.preheader, label %for.inc30 for.body11.preheader: ; preds = %for.cond7.preheader %.pre = load i32, ptr %vla, align 16, !tbaa !5 %xtraiter = and i64 %7, 1 %9 = icmp eq i32 %indvars.iv98, 1 br i1 %9, label %for.inc30.loopexit.unr-lcssa, label %for.body11.preheader.new for.body11.preheader.new: ; preds = %for.body11.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body11 for.cond33.preheader: ; preds = %for.inc30 br i1 %cmp588, label %for.body36.preheader, label %for.end55 for.body36.preheader: ; preds = %for.cond33.preheader %wide.trip.count104 = zext i32 %sub to i64 %.pre106 = load i32, ptr %vla, align 16, !tbaa !5 %min.iters.check = icmp ult i32 %6, 9 br i1 %min.iters.check, label %for.body36.preheader109, label %vector.ph vector.ph: ; preds = %for.body36.preheader %n.vec = and i64 %wide.trip.count104, 4294967288 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre106, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load108, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ] %vec.phi107 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ] %10 = or i64 %index, 1 %11 = getelementptr inbounds i32, ptr %vla, i64 %10 %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load108 = load <4 x i32>, ptr %12, align 4, !tbaa !5 %13 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %14 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load108, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %15 = icmp ne <4 x i32> %13, %wide.load %16 = icmp ne <4 x i32> %14, %wide.load108 %17 = icmp ne <4 x i32> %13, zeroinitializer %18 = icmp ne <4 x i32> %14, zeroinitializer %19 = and <4 x i1> %17, %15 %20 = and <4 x i1> %18, %16 %21 = zext <4 x i1> %19 to <4 x i32> %22 = zext <4 x i1> %20 to <4 x i32> %23 = add <4 x i32> %vec.phi, %21 %24 = add <4 x i32> %vec.phi107, %22 %index.next = add nuw i64 %index, 8 %25 = icmp eq i64 %index.next, %n.vec br i1 %25, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %24, %23 %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count104 %vector.recur.extract = extractelement <4 x i32> %wide.load108, i64 3 br i1 %cmp.n, label %for.end55.loopexit, label %for.body36.preheader109 for.body36.preheader109: ; preds = %for.body36.preheader, %middle.block %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre106, %for.body36.preheader ] %indvars.iv101.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body36.preheader ] %count.092.ph = phi i32 [ %26, %middle.block ], [ 0, %for.body36.preheader ] br label %for.body36 for.body11: ; preds = %for.inc27.1, %for.body11.preheader.new %27 = phi i32 [ %.pre, %for.body11.preheader.new ], [ %31, %for.inc27.1 ] %indvars.iv95 = phi i64 [ 0, %for.body11.preheader.new ], [ %indvars.iv.next96.1, %for.inc27.1 ] %niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.inc27.1 ] %indvars.iv.next96 = or i64 %indvars.iv95, 1 %arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next96 %28 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %27, %28 br i1 %cmp16, label %if.then, label %for.inc27 if.then: ; preds = %for.body11 %arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv95 store i32 %28, ptr %arrayidx13, align 8, !tbaa !5 store i32 %27, ptr %arrayidx15, align 4, !tbaa !5 br label %for.inc27 for.inc27: ; preds = %for.body11, %if.then %29 = phi i32 [ %28, %for.body11 ], [ %27, %if.then ] %indvars.iv.next96.1 = add nuw nsw i64 %indvars.iv95, 2 %arrayidx15.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next96.1 %30 = load i32, ptr %arrayidx15.1, align 8, !tbaa !5 %cmp16.1 = icmp sgt i32 %29, %30 br i1 %cmp16.1, label %if.then.1, label %for.inc27.1 if.then.1: ; preds = %for.inc27 %arrayidx13.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next96 store i32 %30, ptr %arrayidx13.1, align 4, !tbaa !5 store i32 %29, ptr %arrayidx15.1, align 8, !tbaa !5 br label %for.inc27.1 for.inc27.1: ; preds = %if.then.1, %for.inc27 %31 = phi i32 [ %30, %for.inc27 ], [ %29, %if.then.1 ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.inc30.loopexit.unr-lcssa, label %for.body11, !llvm.loop !14 for.inc30.loopexit.unr-lcssa: ; preds = %for.inc27.1, %for.body11.preheader %.unr = phi i32 [ %.pre, %for.body11.preheader ], [ %31, %for.inc27.1 ] %indvars.iv95.unr = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next96.1, %for.inc27.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc30, label %for.body11.epil for.body11.epil: ; preds = %for.inc30.loopexit.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv95.unr %32 = load i32, ptr %gep, align 4, !tbaa !5 %cmp16.epil = icmp sgt i32 %.unr, %32 br i1 %cmp16.epil, label %if.then.epil, label %for.inc30 if.then.epil: ; preds = %for.body11.epil %arrayidx13.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv95.unr store i32 %32, ptr %arrayidx13.epil, align 4, !tbaa !5 store i32 %.unr, ptr %gep, align 4, !tbaa !5 br label %for.inc30 for.inc30: ; preds = %for.inc30.loopexit.unr-lcssa, %if.then.epil, %for.body11.epil, %for.cond7.preheader %inc31 = add nuw nsw i32 %i.189, 1 %indvars.iv.next99 = add i32 %indvars.iv98, -1 %exitcond100.not = icmp eq i32 %inc31, %sub br i1 %exitcond100.not, label %for.cond33.preheader, label %for.cond7.preheader, !llvm.loop !15 for.body36: ; preds = %for.body36.preheader109, %for.body36 %scalar.recur = phi i32 [ %33, %for.body36 ], [ %scalar.recur.ph, %for.body36.preheader109 ] %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body36 ], [ %indvars.iv101.ph, %for.body36.preheader109 ] %count.092 = phi i32 [ %count.1, %for.body36 ], [ %count.092.ph, %for.body36.preheader109 ] %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %arrayidx41 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next102 %33 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %cmp42.not = icmp ne i32 %scalar.recur, %33 %cmp45.not = icmp ne i32 %scalar.recur, 0 %or.cond.not = and i1 %cmp45.not, %cmp42.not %inc49 = zext i1 %or.cond.not to i32 %count.1 = add nuw nsw i32 %count.092, %inc49 %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104 br i1 %exitcond105.not, label %for.end55.loopexit, label %for.body36, !llvm.loop !16 for.end55.loopexit: ; preds = %for.body36, %middle.block %count.1.lcssa = phi i32 [ %26, %middle.block ], [ %count.1, %for.body36 ] %34 = add nuw nsw i32 %count.1.lcssa, 1 br label %for.end55 for.end55: ; preds = %for.end, %for.end55.loopexit, %for.cond33.preheader %count.0.lcssa = phi i32 [ 1, %for.cond33.preheader ], [ %34, %for.end55.loopexit ], [ 1, %for.end ] %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !13, !12}
/* AOJ 0032 * * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0032 */ #include <stdio.h> int main(){ int first, second, diagonal; int rect, loze; rect = 0; loze = 0; while(scanf("%d,%d,%d", &first, &second, &diagonal)==3){ if(diagonal < first + second){ if(diagonal*diagonal == first*first + second*second){ rect += 1; }else{ if(second == first){ loze += 1; } } } } printf("%d\n", rect); printf("%d\n", loze); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_164978/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_164978/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %first = alloca i32, align 4 %second = alloca i32, align 4 %diagonal = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %first) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %second) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %diagonal) #3 %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %first, ptr noundef nonnull %second, ptr noundef nonnull %diagonal) %cmp18 = icmp eq i32 %call17, 3 br i1 %cmp18, label %while.body, label %while.end while.body: ; preds = %entry, %if.end12 %loze.020 = phi i32 [ %loze.1, %if.end12 ], [ 0, %entry ] %rect.019 = phi i32 [ %rect.1, %if.end12 ], [ 0, %entry ] %0 = load i32, ptr %diagonal, align 4, !tbaa !5 %1 = load i32, ptr %first, align 4, !tbaa !5 %2 = load i32, ptr %second, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %cmp1 = icmp slt i32 %0, %add br i1 %cmp1, label %if.then, label %if.end12 if.then: ; preds = %while.body %mul = mul nsw i32 %0, %0 %mul2 = mul nsw i32 %1, %1 %mul3 = mul nsw i32 %2, %2 %add4 = add nuw nsw i32 %mul3, %mul2 %cmp5 = icmp eq i32 %mul, %add4 br i1 %cmp5, label %if.then6, label %if.else if.then6: ; preds = %if.then %add7 = add nsw i32 %rect.019, 1 br label %if.end12 if.else: ; preds = %if.then %cmp8 = icmp eq i32 %2, %1 %add10 = zext i1 %cmp8 to i32 %spec.select = add nsw i32 %loze.020, %add10 br label %if.end12 if.end12: ; preds = %if.else, %if.then6, %while.body %rect.1 = phi i32 [ %add7, %if.then6 ], [ %rect.019, %while.body ], [ %rect.019, %if.else ] %loze.1 = phi i32 [ %loze.020, %if.then6 ], [ %loze.020, %while.body ], [ %spec.select, %if.else ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %first, ptr noundef nonnull %second, ptr noundef nonnull %diagonal) %cmp = icmp eq i32 %call, 3 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %if.end12, %entry %rect.0.lcssa = phi i32 [ 0, %entry ], [ %rect.1, %if.end12 ] %loze.0.lcssa = phi i32 [ 0, %entry ], [ %loze.1, %if.end12 ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rect.0.lcssa) %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %loze.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %diagonal) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %second) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %first) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> int main() { int a,b,c,n1=0,n2=0; while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){ if(a*a+b*b==c*c) n1++; if(a==b) n2++; } printf("%d\n%d\n",n1,n2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165034/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165034/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %n2.014 = phi i32 [ %n2.1, %while.body ], [ 0, %entry ] %n1.013 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %1 = load i32, ptr %b, align 4, !tbaa !5 %mul1 = mul nsw i32 %1, %1 %add = add nuw nsw i32 %mul1, %mul %2 = load i32, ptr %c, align 4, !tbaa !5 %mul2 = mul nsw i32 %2, %2 %cmp3 = icmp eq i32 %add, %mul2 %inc = zext i1 %cmp3 to i32 %spec.select = add nuw nsw i32 %n1.013, %inc %cmp4 = icmp eq i32 %0, %1 %inc6 = zext i1 %cmp4 to i32 %n2.1 = add nuw nsw i32 %n2.014, %inc6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %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 %n1.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] %n2.0.lcssa = phi i32 [ 0, %entry ], [ %n2.1, %while.body ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n1.0.lcssa, i32 noundef %n2.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int h,w,n,m,o; scanf("%d\n%d\n%d\n", &h, &w, &n); if (h>w) { m = h; } else { m = w; } if (n % m > 0) { o = 1; } else { o = 0; } printf("%d\n", n / m + o); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165078/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165078/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d\0A%d\0A%d\0A\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: %h = alloca i32, align 4 %w = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #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 %h, ptr noundef nonnull %w, ptr noundef nonnull %n) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %. = call i32 @llvm.smax.i32(i32 %0, i32 %1) %2 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %2, %. %cmp1 = icmp sgt i32 %rem, 0 %o.0 = zext i1 %cmp1 to i32 %div = sdiv i32 %2, %. %add = add nsw i32 %div, %o.0 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int h,w,n; scanf("%d%d%d",&h,&w,&n); if(h<=w){ if(n%w==0) printf("%d\n",n/w); else printf("%d\n",n/w+1); }else{ if(n%h==0) printf("%d\n",n/h); else { printf("%d\n",n/h+1); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165120/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165120/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #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 %h, ptr noundef nonnull %w, ptr noundef nonnull %n) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %2 = load i32, ptr %n, align 4, !tbaa !5 %. = call i32 @llvm.smax.i32(i32 %0, i32 %1) %rem7 = srem i32 %2, %. %cmp8 = icmp ne i32 %rem7, 0 %div10 = sdiv i32 %2, %. %add14 = zext i1 %cmp8 to i32 %spec.select19 = add nsw i32 %div10, %add14 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select19) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(int argc, char *argv[]) { int h, w, n; scanf("%d", &h); scanf("%d", &w); scanf("%d", &n); int max, min; if (h > w) max = h; if (h <= w) max = w; int i = 0; while (1) { n -= max; i++; if (n <= 0) break; } printf("%d\n", i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165164/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165164/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #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 %h) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %h, align 4, !tbaa !5 %1 = load i32, ptr %w, align 4, !tbaa !5 %max.1 = call i32 @llvm.smax.i32(i32 %0, i32 %1) %n.promoted = load i32, ptr %n, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %sub11 = phi i32 [ %n.promoted, %entry ], [ %sub, %while.cond ] %i.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %sub = sub nsw i32 %sub11, %max.1 %inc = add nuw nsw i32 %i.0, 1 %cmp6 = icmp slt i32 %sub, 1 br i1 %cmp6, label %while.end, label %while.cond while.end: ; preds = %while.cond store i32 %sub, ptr %n, align 4, !tbaa !5 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #define MAX(a,b) (a) > (b) ? a:b #define MIN(a,b) (a) < (b) ? a:b int main(){ float x; float min=1000001; float max=-1; while(scanf("%f",&x)!=EOF){ max=MAX(max,x); min=MIN(min,x); } printf("%f\n",max-min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165207/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%f\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not13 = icmp eq i32 %call12, -1 br i1 %cmp.not13, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %max.015 = phi float [ %cond, %while.body ], [ -1.000000e+00, %entry ] %min.014 = phi float [ %cond6, %while.body ], [ 0x412E848200000000, %entry ] %0 = load float, ptr %x, align 4 %cmp1 = fcmp ogt float %max.015, %0 %cond = select i1 %cmp1, float %max.015, float %0 %cmp2 = fcmp olt float %min.014, %0 %cond6 = select i1 %cmp2, float %min.014, float %0 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !5 while.end.loopexit: ; preds = %while.body %1 = fsub float %cond, %cond6 %2 = fpext float %1 to double br label %while.end while.end: ; preds = %while.end.loopexit, %entry %sub = phi double [ 0xC12E848400000000, %entry ], [ %2, %while.end.loopexit ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sub) 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { float m, hm, lm; int first = 0; while (scanf("%f", &m) != EOF){ if (first == 0){ first = 1; hm = lm = m; } if (hm < m) hm = m; else if (lm > m) lm = m; } printf("%.1f\n", hm - lm); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165250/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165250/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%f\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%.1f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %cmp.not12 = icmp ne i32 %call11, -1 call void @llvm.assume(i1 %cmp.not12) %0 = load float, ptr %m, align 4 %call.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %cmp.not.peel = icmp eq i32 %call.peel, -1 br i1 %cmp.not.peel, label %while.end.loopexit, label %while.body while.body: ; preds = %entry, %if.end7 %lm.014 = phi float [ %lm.2, %if.end7 ], [ %0, %entry ] %hm.013 = phi float [ %hm.2, %if.end7 ], [ %0, %entry ] %1 = load float, ptr %m, align 4 %cmp2 = fcmp olt float %hm.013, %1 br i1 %cmp2, label %if.end7, label %if.else if.else: ; preds = %while.body %cmp4 = fcmp ogt float %lm.014, %1 br i1 %cmp4, label %if.then5, label %if.end7 if.then5: ; preds = %if.else br label %if.end7 if.end7: ; preds = %while.body, %if.else, %if.then5 %hm.2 = phi float [ %hm.013, %if.then5 ], [ %hm.013, %if.else ], [ %1, %while.body ] %lm.2 = phi float [ %1, %if.then5 ], [ %lm.014, %if.else ], [ %lm.014, %while.body ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !5 while.end.loopexit: ; preds = %if.end7, %entry %hm.2.lcssa = phi float [ %0, %entry ], [ %hm.2, %if.end7 ] %lm.2.lcssa = phi float [ %0, %entry ], [ %lm.2, %if.end7 ] %2 = fsub float %hm.2.lcssa, %lm.2.lcssa %3 = fpext float %2 to double %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #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 willreturn memory(inaccessiblemem: 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 = distinct !{!5, !6, !7} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> int main (int argc, const char * argv[]) { double data; double high; double low; double sa; int i; high = 0; low = 0; sa = 0; i = 0; while (scanf("%lf", &data) != EOF) { if (high < data) { high = data; } else if (low > data) { low = data; } if (i == 0) { low = data; i++; } } sa = high - low; printf("%.1f\n", sa); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165300/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165300/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%.1f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %data = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %data) #3 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data) %cmp.not13 = icmp eq i32 %call12, -1 br i1 %cmp.not13, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %0 = load double, ptr %data, align 8 %cmp1.peel = fcmp ogt double %0, 0.000000e+00 %high.1.peel = select i1 %cmp1.peel, double %0, double 0.000000e+00 %call.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data) %cmp.not.peel = icmp eq i32 %call.peel, -1 br i1 %cmp.not.peel, label %while.end.loopexit, label %while.body while.body: ; preds = %while.body.preheader, %if.end4 %low.015 = phi double [ %low.1, %if.end4 ], [ %0, %while.body.preheader ] %high.014 = phi double [ %high.1, %if.end4 ], [ %high.1.peel, %while.body.preheader ] %1 = load double, ptr %data, align 8 %cmp1 = fcmp olt double %high.014, %1 br i1 %cmp1, label %if.end4, label %if.else if.else: ; preds = %while.body %cmp2 = fcmp ogt double %low.015, %1 br i1 %cmp2, label %if.then3, label %if.end4 if.then3: ; preds = %if.else br label %if.end4 if.end4: ; preds = %while.body, %if.else, %if.then3 %high.1 = phi double [ %high.014, %if.then3 ], [ %high.014, %if.else ], [ %1, %while.body ] %low.1 = phi double [ %1, %if.then3 ], [ %low.015, %if.else ], [ %low.015, %while.body ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !5 while.end.loopexit: ; preds = %if.end4, %while.body.preheader %high.1.lcssa = phi double [ %high.1.peel, %while.body.preheader ], [ %high.1, %if.end4 ] %low.2.lcssa = phi double [ %0, %while.body.preheader ], [ %low.1, %if.end4 ] %2 = fsub double %high.1.lcssa, %low.2.lcssa br label %while.end while.end: ; preds = %while.end.loopexit, %entry %sub = phi double [ 0.000000e+00, %entry ], [ %2, %while.end.loopexit ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sub) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %data) #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 = distinct !{!5, !6, !7} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> int main(void) { double in, min, max; scanf("%lf", &in); min = max = in; while (scanf("%lf", &in) != EOF) { if (in < min) min = in; else if (max < in) max = in; } printf ("%.1f\n", max - min); exit(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165351/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165351/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%.1f\0A\00", align 1 ; Function Attrs: noreturn nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %in = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %in) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %0 = load double, ptr %in, align 8, !tbaa !5 %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %cmp.not10 = icmp eq i32 %call19, -1 br i1 %cmp.not10, label %while.end, label %while.body while.body: ; preds = %entry, %if.end5 %max.012 = phi double [ %max.1, %if.end5 ], [ %0, %entry ] %min.011 = phi double [ %min.1, %if.end5 ], [ %0, %entry ] %1 = load double, ptr %in, align 8, !tbaa !5 %cmp2 = fcmp olt double %1, %min.011 br i1 %cmp2, label %if.end5, label %if.else if.else: ; preds = %while.body %cmp3 = fcmp olt double %max.012, %1 br i1 %cmp3, label %if.then4, label %if.end5 if.then4: ; preds = %if.else br label %if.end5 if.end5: ; preds = %while.body, %if.else, %if.then4 %min.1 = phi double [ %min.011, %if.then4 ], [ %min.011, %if.else ], [ %1, %while.body ] %max.1 = phi double [ %1, %if.then4 ], [ %max.012, %if.else ], [ %max.012, %while.body ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %cmp.not = icmp eq i32 %call1, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end5, %entry %min.0.lcssa = phi double [ %0, %entry ], [ %min.1, %if.end5 ] %max.0.lcssa = phi double [ %0, %entry ], [ %max.1, %if.end5 ] %sub = fsub double %max.0.lcssa, %min.0.lcssa %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sub) call void @exit(i32 noundef 0) #5 unreachable } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #3 attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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(){ double max,min,h; max = 0; min = 1000000; while(scanf("%lf",&h)!=EOF){ if(max < h) max = h; else if(min > h) min = h; } printf("%lf\n",max-min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165423/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165423/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #3 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %if.end4 %min.011 = phi double [ %min.1, %if.end4 ], [ 1.000000e+06, %entry ] %max.010 = phi double [ %max.1, %if.end4 ], [ 0.000000e+00, %entry ] %0 = load double, ptr %h, align 8, !tbaa !5 %cmp1 = fcmp olt double %max.010, %0 br i1 %cmp1, label %if.end4, label %if.else if.else: ; preds = %while.body %cmp2 = fcmp ogt double %min.011, %0 br i1 %cmp2, label %if.then3, label %if.end4 if.then3: ; preds = %if.else br label %if.end4 if.end4: ; preds = %while.body, %if.else, %if.then3 %max.1 = phi double [ %max.010, %if.then3 ], [ %max.010, %if.else ], [ %0, %while.body ] %min.1 = phi double [ %0, %if.then3 ], [ %min.011, %if.else ], [ %min.011, %while.body ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !9 while.end.loopexit: ; preds = %if.end4 %1 = fsub double %max.1, %min.1 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %sub = phi double [ -1.000000e+06, %entry ], [ %1, %while.end.loopexit ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sub) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <unistd.h> void create_map_base(char *map, int x, int y) { int i; int j; j = -1; while (++j < y) { i = -1; while (++i < x) map[j * x + i] = '.'; } } void create_map(char *map, int x, int y) { int i; int j; char a[x]; j = 0; while (++j < y + 1) { read(0, a, x); i = 0; while (++i < x + 1) map[j * (x + 2) + i] = a[i - 1]; if (j != y) read(0, a, 1); } } int count_num(char *map, int x, int i, int j) { int count; count = 0; if (map[(j - 1) * (x + 2) + (i - 1)] == '#') count++; if (map[(j - 1) * (x + 2) + i] == '#') count++; if (map[(j - 1) * (x + 2) + (i + 1)] == '#') count++; if (map[j * (x + 2) + (i - 1)] == '#') count++; if (map[j * (x + 2) + (i + 1)] == '#') count++; if (map[(j + 1) * (x + 2) + (i - 1)] == '#') count++; if (map[(j + 1) * (x + 2) + i] == '#') count++; if (map[(j + 1) * (x + 2) + (i + 1)] == '#') count++; return (count); } void write_num(char *map, int x, int y) { int i; int j; char count; j = 0; while (++j < y + 1) { i = 0; while (++i < x + 1) { if (map[j * (x + 2) + i] == '.') { count = count_num(map, x, i, j) + '0'; write(1, &count, 1); } else write(1, "#", 1); } write(1, "\n", 1); } } void maping(int x, int y) { char map[y + 2][x + 2]; create_map_base(&map[0][0], x + 2, y + 2); create_map(&map[0][0], x, y); write_num(&map[0][0], x, y); } int main() { int x[2]; char c; int count; int num; count = 0; c = 0; while (c != 10) { if (read(0, &c, 1) == -1) return (0); if (c != 32) { num = 0; while (c != 10 && c != 32) { num = num * 10 + c - '0'; if (read(0, &c, 1) == -1) return (0); } x[count++] = num; } } maping(x[1], x[0]); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165474/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165474/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [2 x i8] c"#\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @create_map_base(ptr nocapture noundef writeonly %map, i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %cmp11 = icmp sgt i32 %y, 0 %cmp39 = icmp sgt i32 %x, 0 %or.cond = and i1 %cmp11, %cmp39 br i1 %or.cond, label %while.cond1.preheader.us.preheader, label %while.end5 while.cond1.preheader.us.preheader: ; preds = %entry %0 = zext i32 %x to i64 %1 = zext i32 %y to i64 %2 = mul nuw nsw i64 %1, %0 tail call void @llvm.memset.p0.i64(ptr align 1 %map, i8 46, i64 %2, i1 false), !tbaa !5 br label %while.end5 while.end5: ; preds = %while.cond1.preheader.us.preheader, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @create_map(ptr nocapture noundef writeonly %map, i32 noundef %x, i32 noundef %y) local_unnamed_addr #2 { entry: %0 = zext i32 %x to i64 %vla = alloca i8, i64 %0, align 16 %cmp25 = icmp sgt i32 %y, 0 br i1 %cmp25, label %while.body.lr.ph, label %while.end14 while.body.lr.ph: ; preds = %entry %conv = sext i32 %x to i64 %cmp423 = icmp sgt i32 %x, 0 %add7 = add i32 %x, 2 br i1 %cmp423, label %while.body.us.preheader, label %while.body while.body.us.preheader: ; preds = %while.body.lr.ph %1 = add nuw i32 %x, 3 %wide.trip.count = zext i32 %y to i64 br label %while.body.us while.body.us: ; preds = %while.body.us.preheader, %if.end.us %indvars.iv = phi i64 [ 0, %while.body.us.preheader ], [ %indvars.iv.next, %if.end.us ] %inc26.us = phi i32 [ 1, %while.body.us.preheader ], [ %inc.us, %if.end.us ] %2 = trunc i64 %indvars.iv to i32 %3 = mul i32 %add7, %2 %4 = add i32 %1, %3 %5 = sext i32 %4 to i64 %scevgep = getelementptr i8, ptr %map, i64 %5 %call.us = call i64 @read(i32 noundef 0, ptr noundef nonnull %vla, i64 noundef %conv) #7 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep, ptr nonnull align 16 %vla, i64 %0, i1 false), !tbaa !5 %cmp11.not.us = icmp eq i32 %inc26.us, %y br i1 %cmp11.not.us, label %if.end.us, label %if.then.us if.then.us: ; preds = %while.body.us %call13.us = call i64 @read(i32 noundef 0, ptr noundef nonnull %vla, i64 noundef 1) #7 br label %if.end.us if.end.us: ; preds = %if.then.us, %while.body.us %inc.us = add nuw nsw i32 %inc26.us, 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond31.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond31.not, label %while.end14, label %while.body.us, !llvm.loop !8 while.body: ; preds = %while.body.lr.ph, %if.end %inc26 = phi i32 [ %inc, %if.end ], [ 1, %while.body.lr.ph ] %call = call i64 @read(i32 noundef 0, ptr noundef nonnull %vla, i64 noundef %conv) #7 %cmp11.not = icmp eq i32 %inc26, %y br i1 %cmp11.not, label %if.end, label %if.then if.then: ; preds = %while.body %call13 = call i64 @read(i32 noundef 0, ptr noundef nonnull %vla, i64 noundef 1) #7 br label %if.end if.end: ; preds = %if.then, %while.body %inc = add nuw i32 %inc26, 1 %exitcond.not = icmp eq i32 %inc26, %y br i1 %exitcond.not, label %while.end14, label %while.body, !llvm.loop !8 while.end14: ; preds = %if.end, %if.end.us, %entry ret void } ; Function Attrs: nofree declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @count_num(ptr nocapture noundef readonly %map, i32 noundef %x, i32 noundef %i, i32 noundef %j) local_unnamed_addr #4 { entry: %sub = add nsw i32 %j, -1 %add = add nsw i32 %x, 2 %mul = mul nsw i32 %sub, %add %sub1 = add nsw i32 %i, -1 %add2 = add nsw i32 %mul, %sub1 %idxprom = sext i32 %add2 to i64 %arrayidx = getelementptr inbounds i8, ptr %map, i64 %idxprom %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 35 %spec.select = zext i1 %cmp to i32 %add7 = add nsw i32 %mul, %i %idxprom8 = sext i32 %add7 to i64 %arrayidx9 = getelementptr inbounds i8, ptr %map, i64 %idxprom8 %1 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %cmp11 = icmp eq i8 %1, 35 %inc14 = select i1 %cmp, i32 2, i32 1 %count.1 = select i1 %cmp11, i32 %inc14, i32 %spec.select %add19 = add nsw i32 %i, 1 %add20 = add nsw i32 %mul, %add19 %idxprom21 = sext i32 %add20 to i64 %arrayidx22 = getelementptr inbounds i8, ptr %map, i64 %idxprom21 %2 = load i8, ptr %arrayidx22, align 1, !tbaa !5 %cmp24 = icmp eq i8 %2, 35 %inc27 = zext i1 %cmp24 to i32 %count.2 = add nuw nsw i32 %count.1, %inc27 %mul30 = mul nsw i32 %add, %j %add32 = add nsw i32 %mul30, %sub1 %idxprom33 = sext i32 %add32 to i64 %arrayidx34 = getelementptr inbounds i8, ptr %map, i64 %idxprom33 %3 = load i8, ptr %arrayidx34, align 1, !tbaa !5 %cmp36 = icmp eq i8 %3, 35 %inc39 = zext i1 %cmp36 to i32 %count.3 = add nuw nsw i32 %count.2, %inc39 %add44 = add nsw i32 %mul30, %add19 %idxprom45 = sext i32 %add44 to i64 %arrayidx46 = getelementptr inbounds i8, ptr %map, i64 %idxprom45 %4 = load i8, ptr %arrayidx46, align 1, !tbaa !5 %cmp48 = icmp eq i8 %4, 35 %inc51 = zext i1 %cmp48 to i32 %count.4 = add nuw nsw i32 %count.3, %inc51 %add53 = add nsw i32 %j, 1 %mul55 = mul nsw i32 %add53, %add %add57 = add nsw i32 %mul55, %sub1 %idxprom58 = sext i32 %add57 to i64 %arrayidx59 = getelementptr inbounds i8, ptr %map, i64 %idxprom58 %5 = load i8, ptr %arrayidx59, align 1, !tbaa !5 %cmp61 = icmp eq i8 %5, 35 %inc64 = zext i1 %cmp61 to i32 %count.5 = add nuw nsw i32 %count.4, %inc64 %add69 = add nsw i32 %mul55, %i %idxprom70 = sext i32 %add69 to i64 %arrayidx71 = getelementptr inbounds i8, ptr %map, i64 %idxprom70 %6 = load i8, ptr %arrayidx71, align 1, !tbaa !5 %cmp73 = icmp eq i8 %6, 35 %inc76 = zext i1 %cmp73 to i32 %count.6 = add nuw nsw i32 %count.5, %inc76 %add82 = add nsw i32 %mul55, %add19 %idxprom83 = sext i32 %add82 to i64 %arrayidx84 = getelementptr inbounds i8, ptr %map, i64 %idxprom83 %7 = load i8, ptr %arrayidx84, align 1, !tbaa !5 %cmp86 = icmp eq i8 %7, 35 %inc89 = zext i1 %cmp86 to i32 %count.7 = add nuw nsw i32 %count.6, %inc89 ret i32 %count.7 } ; Function Attrs: nofree nounwind uwtable define dso_local void @write_num(ptr nocapture noundef readonly %map, i32 noundef %x, i32 noundef %y) local_unnamed_addr #2 { entry: %count = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %count) #7 %cmp26 = icmp sgt i32 %y, 0 br i1 %cmp26, label %while.cond1.preheader.lr.ph, label %while.end15 while.cond1.preheader.lr.ph: ; preds = %entry %cmp423 = icmp sgt i32 %x, 0 br i1 %cmp423, label %while.cond1.preheader.us.preheader, label %while.cond1.preheader while.cond1.preheader.us.preheader: ; preds = %while.cond1.preheader.lr.ph %add6 = add nuw nsw i32 %x, 2 %0 = zext i32 %add6 to i64 %wide.trip.count57 = zext i32 %y to i64 %wide.trip.count = zext i32 %x to i64 br label %while.cond1.preheader.us while.cond1.preheader.us: ; preds = %while.cond1.preheader.us.preheader, %while.cond1.while.end_crit_edge.us %indvars.iv49 = phi i64 [ 0, %while.cond1.preheader.us.preheader ], [ %indvars.iv.next50, %while.cond1.while.end_crit_edge.us ] %indvars.iv46 = phi i64 [ 1, %while.cond1.preheader.us.preheader ], [ %indvars.iv.next47, %while.cond1.while.end_crit_edge.us ] %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %1 = mul nsw i64 %indvars.iv46, %0 %2 = mul nsw i64 %indvars.iv49, %0 %3 = add nuw nsw i64 %indvars.iv49, 2 %4 = mul nsw i64 %3, %0 %invariant.gep = getelementptr i8, ptr %map, i64 %1 %invariant.gep60 = getelementptr i8, ptr %map, i64 %2 %invariant.gep62 = getelementptr i8, ptr %map, i64 %2 %invariant.gep64 = getelementptr i8, ptr %map, i64 %2 %invariant.gep66 = getelementptr i8, ptr %map, i64 %1 %invariant.gep68 = getelementptr i8, ptr %map, i64 %1 %invariant.gep70 = getelementptr i8, ptr %map, i64 %4 %invariant.gep72 = getelementptr i8, ptr %map, i64 %4 %invariant.gep74 = getelementptr i8, ptr %map, i64 %4 br label %while.body5.us while.body5.us: ; preds = %while.cond1.preheader.us, %if.end.us %indvars.iv33 = phi i64 [ 0, %while.cond1.preheader.us ], [ %indvars.iv.next34, %if.end.us ] %indvars.iv = phi i64 [ 1, %while.cond1.preheader.us ], [ %indvars.iv.next, %if.end.us ] %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv %5 = load i8, ptr %gep, align 1, !tbaa !5 %cmp8.us = icmp eq i8 %5, 46 br i1 %cmp8.us, label %if.then.us, label %if.else.us if.else.us: ; preds = %while.body5.us %call13.us = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str, i64 noundef 1) #7 br label %if.end.us if.then.us: ; preds = %while.body5.us %gep61 = getelementptr i8, ptr %invariant.gep60, i64 %indvars.iv33 %6 = load i8, ptr %gep61, align 1, !tbaa !5 %cmp.i.us = icmp eq i8 %6, 35 %spec.select.i.us = zext i1 %cmp.i.us to i8 %gep63 = getelementptr i8, ptr %invariant.gep62, i64 %indvars.iv %7 = load i8, ptr %gep63, align 1, !tbaa !5 %cmp11.i.us = icmp eq i8 %7, 35 %inc14.i.us = select i1 %cmp.i.us, i8 2, i8 1 %count.1.i.us = select i1 %cmp11.i.us, i8 %inc14.i.us, i8 %spec.select.i.us %8 = add nuw nsw i64 %indvars.iv33, 2 %gep65 = getelementptr i8, ptr %invariant.gep64, i64 %8 %9 = load i8, ptr %gep65, align 1, !tbaa !5 %cmp24.i.us = icmp eq i8 %9, 35 %inc27.i.us = zext i1 %cmp24.i.us to i8 %gep67 = getelementptr i8, ptr %invariant.gep66, i64 %indvars.iv33 %10 = load i8, ptr %gep67, align 1, !tbaa !5 %cmp36.i.us = icmp eq i8 %10, 35 %inc39.i.us = zext i1 %cmp36.i.us to i8 %gep69 = getelementptr i8, ptr %invariant.gep68, i64 %8 %11 = load i8, ptr %gep69, align 1, !tbaa !5 %cmp48.i.us = icmp eq i8 %11, 35 %inc51.i.us = zext i1 %cmp48.i.us to i8 %gep71 = getelementptr i8, ptr %invariant.gep70, i64 %indvars.iv33 %12 = load i8, ptr %gep71, align 1, !tbaa !5 %cmp61.i.us = icmp eq i8 %12, 35 %inc64.i.us = zext i1 %cmp61.i.us to i8 %gep73 = getelementptr i8, ptr %invariant.gep72, i64 %indvars.iv %13 = load i8, ptr %gep73, align 1, !tbaa !5 %cmp73.i.us = icmp eq i8 %13, 35 %inc76.i.us = zext i1 %cmp73.i.us to i8 %gep75 = getelementptr i8, ptr %invariant.gep74, i64 %8 %14 = load i8, ptr %gep75, align 1, !tbaa !5 %cmp86.i.us = icmp eq i8 %14, 35 %inc89.i.us = zext i1 %cmp86.i.us to i8 %count.2.i.us = or i8 %count.1.i.us, 48 %count.3.i.us = add nuw nsw i8 %count.2.i.us, %inc27.i.us %count.4.i.us = add nuw nsw i8 %count.3.i.us, %inc39.i.us %count.5.i.us = add nuw nsw i8 %count.4.i.us, %inc51.i.us %count.6.i.us = add nuw nsw i8 %count.5.i.us, %inc64.i.us %count.7.i.us = add nuw nsw i8 %count.6.i.us, %inc76.i.us %conv11.us = add nuw nsw i8 %count.7.i.us, %inc89.i.us store i8 %conv11.us, ptr %count, align 1, !tbaa !5 %call12.us = call i64 @write(i32 noundef 1, ptr noundef nonnull %count, i64 noundef 1) #7 br label %if.end.us if.end.us: ; preds = %if.then.us, %if.else.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond45.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count br i1 %exitcond45.not, label %while.cond1.while.end_crit_edge.us, label %while.body5.us, !llvm.loop !10 while.cond1.while.end_crit_edge.us: ; preds = %if.end.us %call14.us = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str.1, i64 noundef 1) #7 %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1 %exitcond58.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count57 br i1 %exitcond58.not, label %while.end15, label %while.cond1.preheader.us, !llvm.loop !11 while.cond1.preheader: ; preds = %while.cond1.preheader.lr.ph, %while.cond1.preheader %inc28 = phi i32 [ %inc, %while.cond1.preheader ], [ 1, %while.cond1.preheader.lr.ph ] %call14 = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str.1, i64 noundef 1) #7 %inc = add nuw i32 %inc28, 1 %exitcond.not = icmp eq i32 %inc28, %y br i1 %exitcond.not, label %while.end15, label %while.cond1.preheader, !llvm.loop !11 while.end15: ; preds = %while.cond1.preheader, %while.cond1.while.end_crit_edge.us, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %count) #7 ret void } ; Function Attrs: nofree declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @maping(i32 noundef %x, i32 noundef %y) local_unnamed_addr #2 { entry: %add = add nsw i32 %y, 2 %0 = zext i32 %add to i64 %add1 = add nsw i32 %x, 2 %1 = zext i32 %add1 to i64 %2 = mul nuw i64 %0, %1 %vla = alloca i8, i64 %2, align 16 %cmp11.i = icmp sgt i32 %y, -2 %cmp39.i = icmp sgt i32 %x, -2 %or.cond.i = and i1 %cmp39.i, %cmp11.i br i1 %or.cond.i, label %while.cond1.preheader.us.preheader.i, label %create_map_base.exit while.cond1.preheader.us.preheader.i: ; preds = %entry call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 46, i64 %2, i1 false), !tbaa !5 br label %create_map_base.exit create_map_base.exit: ; preds = %entry, %while.cond1.preheader.us.preheader.i call void @create_map(ptr noundef nonnull %vla, i32 noundef %x, i32 noundef %y) call void @write_num(ptr noundef nonnull %vla, i32 noundef %x, i32 noundef %y) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %x = alloca [2 x i32], align 4 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #7 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #7 store i8 0, ptr %c, align 1, !tbaa !5 br label %while.body while.body: ; preds = %entry, %if.end22 %count.033 = phi i32 [ 0, %entry ], [ %count.1, %if.end22 ] %call = call i64 @read(i32 noundef 0, ptr noundef nonnull %c, i64 noundef 1) #7 %cmp2 = icmp eq i64 %call, -1 br i1 %cmp2, label %cleanup, label %if.end if.end: ; preds = %while.body %0 = load i8, ptr %c, align 1 %cmp5.not = icmp eq i8 %0, 32 br i1 %cmp5.not, label %if.end22, label %while.cond8 while.cond8thread-pre-split: ; preds = %while.body15 %mul = mul nsw i32 %num.0, 10 %conv9 = sext i8 %1 to i32 %add = add nsw i32 %conv9, -48 %sub = add i32 %add, %mul %.pr30 = load i8, ptr %c, align 1 br label %while.cond8 while.cond8: ; preds = %if.end, %while.cond8thread-pre-split %1 = phi i8 [ %.pr30, %while.cond8thread-pre-split ], [ %0, %if.end ] %num.0 = phi i32 [ %sub, %while.cond8thread-pre-split ], [ 0, %if.end ] switch i8 %1, label %while.body15 [ i8 32, label %while.end i8 10, label %while.end ] while.body15: ; preds = %while.cond8 %call17 = call i64 @read(i32 noundef 0, ptr noundef nonnull %c, i64 noundef 1) #7 %cmp18 = icmp eq i64 %call17, -1 br i1 %cmp18, label %cleanup, label %while.cond8thread-pre-split, !llvm.loop !12 while.end: ; preds = %while.cond8, %while.cond8 %inc = add nsw i32 %count.033, 1 %idxprom = sext i32 %count.033 to i64 %arrayidx = getelementptr inbounds [2 x i32], ptr %x, i64 0, i64 %idxprom store i32 %num.0, ptr %arrayidx, align 4, !tbaa !13 br label %if.end22 if.end22: ; preds = %while.end, %if.end %.pr = phi i8 [ %1, %while.end ], [ 32, %if.end ] %count.1 = phi i32 [ %inc, %while.end ], [ %count.033, %if.end ] %cmp.not = icmp eq i8 %.pr, 10 br i1 %cmp.not, label %while.end23, label %while.body, !llvm.loop !15 while.end23: ; preds = %if.end22 %arrayidx24 = getelementptr inbounds [2 x i32], ptr %x, i64 0, i64 1 %2 = load i32, ptr %arrayidx24, align 4, !tbaa !13 %3 = load i32, ptr %x, align 4, !tbaa !13 tail call void @maping(i32 noundef %2, i32 noundef %3) br label %cleanup cleanup: ; preds = %while.body, %while.body15, %while.end23 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #7 ret i32 0 } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn 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 #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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9} !13 = !{!14, !14, i64 0} !14 = !{!"int", !6, i64 0} !15 = distinct !{!15, !9}
#include <stdio.h> int main(){ int H, W; char S[60][60] = {}; int count = 0; scanf("%d %d", &H, &W); for(int i = 0; i < H; i++){ scanf("%s", S[i]); } for(int i = 0; i < H; i++){ for(int j = 0; j < W; j++){ if(S[i][j] == '.'){ count = 0; for(int k = -1; k <= 1; k++){ for(int l = -1; l <= 1; l++){ if(k != 0 || l != 0){ if(i+k>=0 && i+k<H && j+l>=0 && j+l<W && S[i+k][j+l]=='#'){ count++; } } } } S[i][j] = count + '0'; } } } for(int i = 0; i < H; i++){ printf("%s\n", S[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165524/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165524/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 %S = alloca [60 x [60 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5 call void @llvm.lifetime.start.p0(i64 3600, ptr nonnull %S) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3600) %S, i8 0, i64 3600, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4 %cmp118 = icmp sgt i32 %0, 0 br i1 %cmp118, label %for.body, label %for.cond.cleanup81 for.cond3.preheader: ; preds = %for.body %cmp4126 = icmp sgt i32 %27, 0 br i1 %cmp4126, label %for.cond7.preheader.lr.ph, label %for.cond.cleanup81 for.cond7.preheader.lr.ph: ; preds = %for.cond3.preheader %1 = load i32, ptr %W, align 4 %cmp8124 = icmp sgt i32 %1, 0 br i1 %cmp8124, label %for.cond7.preheader.us.preheader, label %for.body82.preheader for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph %2 = zext i32 %1 to i64 %3 = zext i32 %27 to i64 %wide.trip.count182 = zext i32 %27 to i64 %wide.trip.count = zext i32 %1 to i64 %cmp43.us.us.2.peel = icmp ugt i32 %1, 1 %cmp43.us.us.2.1.peel = icmp ugt i32 %1, 1 %cmp43.us.us.2.2.peel = icmp ugt i32 %1, 1 %exitcond.not.peel = icmp eq i32 %1, 1 br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.cond.cleanup9_crit_edge.us %indvars.iv177 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next178, %for.cond7.for.cond.cleanup9_crit_edge.us ] %cmp32.us.not = icmp eq i64 %indvars.iv177, 0 %4 = add nuw i64 %indvars.iv177, 4294967295 %idxprom47.us = and i64 %4, 4294967295 %5 = add nuw nsw i64 %indvars.iv177, 1 %cmp35.us.2 = icmp slt i64 %5, %3 %or.cond.fr.us.2 = freeze i1 %cmp35.us.2 %arrayidx14.us.peel = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv177, i64 0 %6 = load i8, ptr %arrayidx14.us.peel, align 4, !tbaa !5 %cmp15.us.peel = icmp eq i8 %6, 46 br i1 %cmp15.us.peel, label %for.cond22.preheader.us.preheader.peel, label %for.inc71.us.peel for.cond22.preheader.us.preheader.peel: ; preds = %for.cond7.preheader.us br i1 %cmp32.us.not, label %if.then31.us.us.2.1.peel, label %if.then31.us.us.2.peel if.then31.us.us.2.peel: ; preds = %for.cond22.preheader.us.preheader.peel %arrayidx51.us.us.1.peel = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %idxprom47.us, i64 0 %7 = load i8, ptr %arrayidx51.us.us.1.peel, align 4, !tbaa !5 %cmp53.us.us.1.peel = icmp eq i8 %7, 35 %inc56.us.us.1.peel = zext i1 %cmp53.us.us.1.peel to i8 br i1 %cmp43.us.us.2.peel, label %land.lhs.true45.us.us.2.peel, label %if.then31.us.us.2.1.peel land.lhs.true45.us.us.2.peel: ; preds = %if.then31.us.us.2.peel %arrayidx51.us.us.2.peel = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %idxprom47.us, i64 1 %8 = load i8, ptr %arrayidx51.us.us.2.peel, align 1, !tbaa !5 %cmp53.us.us.2.peel = icmp eq i8 %8, 35 %inc56.us.us.2.peel = zext i1 %cmp53.us.us.2.peel to i8 %spec.select.us.us.2.peel = add nuw nsw i8 %inc56.us.us.1.peel, %inc56.us.us.2.peel br label %if.then31.us.us.2.1.peel if.then31.us.us.2.1.peel: ; preds = %for.cond22.preheader.us.preheader.peel, %if.then31.us.us.2.peel, %land.lhs.true45.us.us.2.peel %.us-phi.us.peel = phi i8 [ 0, %for.cond22.preheader.us.preheader.peel ], [ %inc56.us.us.1.peel, %if.then31.us.us.2.peel ], [ %spec.select.us.us.2.peel, %land.lhs.true45.us.us.2.peel ] br i1 %cmp43.us.us.2.1.peel, label %land.lhs.true45.us.us.2.1.peel, label %for.cond.cleanup25.us.1.peel land.lhs.true45.us.us.2.1.peel: ; preds = %if.then31.us.us.2.1.peel %arrayidx51.us.us.2.1.peel = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv177, i64 1 %9 = load i8, ptr %arrayidx51.us.us.2.1.peel, align 1, !tbaa !5 %cmp53.us.us.2.1.peel = icmp eq i8 %9, 35 %inc56.us.us.2.1.peel = zext i1 %cmp53.us.us.2.1.peel to i8 %spec.select.us.us.2.1.peel = add nuw nsw i8 %.us-phi.us.peel, %inc56.us.us.2.1.peel br label %for.cond.cleanup25.us.1.peel for.cond.cleanup25.us.1.peel: ; preds = %land.lhs.true45.us.us.2.1.peel, %if.then31.us.us.2.1.peel %count.2.us.us.2.1.peel = phi i8 [ %.us-phi.us.peel, %if.then31.us.us.2.1.peel ], [ %spec.select.us.us.2.1.peel, %land.lhs.true45.us.us.2.1.peel ] br i1 %or.cond.fr.us.2, label %if.then31.us.us.2.2.peel, label %for.cond.cleanup25.us.2.peel if.then31.us.us.2.2.peel: ; preds = %for.cond.cleanup25.us.1.peel %arrayidx51.us.us.1.2.peel = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %5, i64 0 %10 = load i8, ptr %arrayidx51.us.us.1.2.peel, align 4, !tbaa !5 %cmp53.us.us.1.2.peel = icmp eq i8 %10, 35 %inc56.us.us.1.2.peel = zext i1 %cmp53.us.us.1.2.peel to i8 %spec.select.us.us.1.2.peel = add nuw nsw i8 %count.2.us.us.2.1.peel, %inc56.us.us.1.2.peel br i1 %cmp43.us.us.2.2.peel, label %land.lhs.true45.us.us.2.2.peel, label %for.cond.cleanup25.us.2.peel land.lhs.true45.us.us.2.2.peel: ; preds = %if.then31.us.us.2.2.peel %arrayidx51.us.us.2.2.peel = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %5, i64 1 %11 = load i8, ptr %arrayidx51.us.us.2.2.peel, align 1, !tbaa !5 %cmp53.us.us.2.2.peel = icmp eq i8 %11, 35 %inc56.us.us.2.2.peel = zext i1 %cmp53.us.us.2.2.peel to i8 %spec.select.us.us.2.2.peel = add nuw nsw i8 %spec.select.us.us.1.2.peel, %inc56.us.us.2.2.peel br label %for.cond.cleanup25.us.2.peel for.cond.cleanup25.us.2.peel: ; preds = %land.lhs.true45.us.us.2.2.peel, %if.then31.us.us.2.2.peel, %for.cond.cleanup25.us.1.peel %.us-phi.us.2.peel = phi i8 [ %count.2.us.us.2.1.peel, %for.cond.cleanup25.us.1.peel ], [ %spec.select.us.us.1.2.peel, %if.then31.us.us.2.2.peel ], [ %spec.select.us.us.2.2.peel, %land.lhs.true45.us.us.2.2.peel ] %conv65.us.peel = add nuw nsw i8 %.us-phi.us.2.peel, 48 store i8 %conv65.us.peel, ptr %arrayidx14.us.peel, align 4, !tbaa !5 br label %for.inc71.us.peel for.inc71.us.peel: ; preds = %for.cond.cleanup25.us.2.peel, %for.cond7.preheader.us br i1 %exitcond.not.peel, label %for.cond7.for.cond.cleanup9_crit_edge.us, label %for.body10.us for.body10.us: ; preds = %for.inc71.us.peel, %for.inc71.us %indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.inc71.us ], [ 1, %for.inc71.us.peel ] %arrayidx14.us = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv177, i64 %indvars.iv168 %12 = load i8, ptr %arrayidx14.us, align 1, !tbaa !5 %cmp15.us = icmp eq i8 %12, 46 br i1 %cmp15.us, label %for.cond22.preheader.us.preheader, label %for.inc71.us for.cond22.preheader.us.preheader: ; preds = %for.body10.us br i1 %cmp32.us.not, label %land.lhs.true45.us.us.1152, label %land.lhs.true45.us.us for.inc71.us: ; preds = %for.cond.cleanup25.us.2, %for.body10.us %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count br i1 %exitcond.not, label %for.cond7.for.cond.cleanup9_crit_edge.us, label %for.body10.us, !llvm.loop !8 land.lhs.true45.us.us.1152: ; preds = %for.cond22.preheader.us.preheader, %land.lhs.true45.us.us.2, %land.lhs.true45.us.us %.us-phi.us = phi i8 [ 0, %for.cond22.preheader.us.preheader ], [ %spec.select.us.us.1, %land.lhs.true45.us.us ], [ %spec.select.us.us.2, %land.lhs.true45.us.us.2 ] %13 = add nuw i64 %indvars.iv168, 4294967295 %idxprom50.us.us.1147 = and i64 %13, 4294967295 %arrayidx51.us.us.1148 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv177, i64 %idxprom50.us.us.1147 %14 = load i8, ptr %arrayidx51.us.us.1148, align 1, !tbaa !5 %cmp53.us.us.1149 = icmp eq i8 %14, 35 %inc56.us.us.1150 = zext i1 %cmp53.us.us.1149 to i8 %spec.select.us.us.1151 = add nuw nsw i8 %.us-phi.us, %inc56.us.us.1150 %15 = add nuw nsw i64 %indvars.iv168, 1 %cmp43.us.us.2.1 = icmp ult i64 %15, %2 br i1 %cmp43.us.us.2.1, label %land.lhs.true45.us.us.2.1, label %for.cond.cleanup25.us.1 land.lhs.true45.us.us.2.1: ; preds = %land.lhs.true45.us.us.1152 %arrayidx51.us.us.2.1 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv177, i64 %15 %16 = load i8, ptr %arrayidx51.us.us.2.1, align 1, !tbaa !5 %cmp53.us.us.2.1 = icmp eq i8 %16, 35 %inc56.us.us.2.1 = zext i1 %cmp53.us.us.2.1 to i8 %spec.select.us.us.2.1 = add nuw nsw i8 %spec.select.us.us.1151, %inc56.us.us.2.1 br label %for.cond.cleanup25.us.1 for.cond.cleanup25.us.1: ; preds = %land.lhs.true45.us.us.1152, %land.lhs.true45.us.us.2.1 %count.2.us.us.2.1 = phi i8 [ %spec.select.us.us.1151, %land.lhs.true45.us.us.1152 ], [ %spec.select.us.us.2.1, %land.lhs.true45.us.us.2.1 ] br i1 %or.cond.fr.us.2, label %land.lhs.true45.us.us.2165, label %for.cond.cleanup25.us.2 land.lhs.true45.us.us.2165: ; preds = %for.cond.cleanup25.us.1 %17 = add nuw i64 %indvars.iv168, 4294967295 %idxprom50.us.us.2160 = and i64 %17, 4294967295 %arrayidx51.us.us.2161 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %5, i64 %idxprom50.us.us.2160 %18 = load i8, ptr %arrayidx51.us.us.2161, align 1, !tbaa !5 %cmp53.us.us.2162 = icmp eq i8 %18, 35 %inc56.us.us.2163 = zext i1 %cmp53.us.us.2162 to i8 %spec.select.us.us.2164 = add nuw nsw i8 %count.2.us.us.2.1, %inc56.us.us.2163 %arrayidx51.us.us.1.2 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %5, i64 %indvars.iv168 %19 = load i8, ptr %arrayidx51.us.us.1.2, align 1, !tbaa !5 %cmp53.us.us.1.2 = icmp eq i8 %19, 35 %inc56.us.us.1.2 = zext i1 %cmp53.us.us.1.2 to i8 %spec.select.us.us.1.2 = add nuw nsw i8 %spec.select.us.us.2164, %inc56.us.us.1.2 %20 = add nuw nsw i64 %indvars.iv168, 1 %cmp43.us.us.2.2 = icmp ult i64 %20, %2 br i1 %cmp43.us.us.2.2, label %land.lhs.true45.us.us.2.2, label %for.cond.cleanup25.us.2 land.lhs.true45.us.us.2.2: ; preds = %land.lhs.true45.us.us.2165 %arrayidx51.us.us.2.2 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %5, i64 %20 %21 = load i8, ptr %arrayidx51.us.us.2.2, align 1, !tbaa !5 %cmp53.us.us.2.2 = icmp eq i8 %21, 35 %inc56.us.us.2.2 = zext i1 %cmp53.us.us.2.2 to i8 %spec.select.us.us.2.2 = add nuw nsw i8 %spec.select.us.us.1.2, %inc56.us.us.2.2 br label %for.cond.cleanup25.us.2 for.cond.cleanup25.us.2: ; preds = %land.lhs.true45.us.us.2165, %land.lhs.true45.us.us.2.2, %for.cond.cleanup25.us.1 %.us-phi.us.2 = phi i8 [ %count.2.us.us.2.1, %for.cond.cleanup25.us.1 ], [ %spec.select.us.us.1.2, %land.lhs.true45.us.us.2165 ], [ %spec.select.us.us.2.2, %land.lhs.true45.us.us.2.2 ] %conv65.us = add nuw nsw i8 %.us-phi.us.2, 48 store i8 %conv65.us, ptr %arrayidx14.us, align 1, !tbaa !5 br label %for.inc71.us land.lhs.true45.us.us: ; preds = %for.cond22.preheader.us.preheader %22 = add nuw i64 %indvars.iv168, 4294967295 %idxprom50.us.us = and i64 %22, 4294967295 %arrayidx51.us.us = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %idxprom47.us, i64 %idxprom50.us.us %23 = load i8, ptr %arrayidx51.us.us, align 1, !tbaa !5 %cmp53.us.us = icmp eq i8 %23, 35 %inc56.us.us = zext i1 %cmp53.us.us to i8 %arrayidx51.us.us.1 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %idxprom47.us, i64 %indvars.iv168 %24 = load i8, ptr %arrayidx51.us.us.1, align 1, !tbaa !5 %cmp53.us.us.1 = icmp eq i8 %24, 35 %inc56.us.us.1 = zext i1 %cmp53.us.us.1 to i8 %spec.select.us.us.1 = add nuw nsw i8 %inc56.us.us, %inc56.us.us.1 %25 = add nuw nsw i64 %indvars.iv168, 1 %cmp43.us.us.2 = icmp ult i64 %25, %2 br i1 %cmp43.us.us.2, label %land.lhs.true45.us.us.2, label %land.lhs.true45.us.us.1152 land.lhs.true45.us.us.2: ; preds = %land.lhs.true45.us.us %arrayidx51.us.us.2 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %idxprom47.us, i64 %25 %26 = load i8, ptr %arrayidx51.us.us.2, align 1, !tbaa !5 %cmp53.us.us.2 = icmp eq i8 %26, 35 %inc56.us.us.2 = zext i1 %cmp53.us.us.2 to i8 %spec.select.us.us.2 = add nuw nsw i8 %spec.select.us.us.1, %inc56.us.us.2 br label %land.lhs.true45.us.us.1152 for.cond7.for.cond.cleanup9_crit_edge.us: ; preds = %for.inc71.us, %for.inc71.us.peel %indvars.iv.next178 = add i64 %indvars.iv177, 1 %exitcond183.not = icmp eq i64 %indvars.iv.next178, %wide.trip.count182 br i1 %exitcond183.not, label %for.cond78.preheader, label %for.cond7.preheader.us, !llvm.loop !11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %27 = load i32, ptr %H, align 4 %28 = sext i32 %27 to i64 %cmp = icmp slt i64 %indvars.iv.next, %28 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !12 for.cond78.preheader: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us br i1 %cmp4126, label %for.body82.preheader, label %for.cond.cleanup81 for.body82.preheader: ; preds = %for.cond7.preheader.lr.ph, %for.cond78.preheader br label %for.body82 for.cond.cleanup81: ; preds = %for.body82, %entry, %for.cond3.preheader, %for.cond78.preheader call void @llvm.lifetime.end.p0(i64 3600, ptr nonnull %S) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5 ret i32 0 for.body82: ; preds = %for.body82.preheader, %for.body82 %indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body82 ], [ 0, %for.body82.preheader ] %arrayidx84 = getelementptr inbounds [60 x [60 x i8]], ptr %S, i64 0, i64 %indvars.iv184 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx84) %indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1 %29 = load i32, ptr %H, align 4, !tbaa !13 %30 = sext i32 %29 to i64 %cmp79 = icmp slt i64 %indvars.iv.next185, %30 br i1 %cmp79, label %for.body82, label %for.cond.cleanup81, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.peeled.count", i32 1} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9} !13 = !{!14, !14, i64 0} !14 = !{!"int", !6, i64 0} !15 = distinct !{!15, !9}
#include <stdio.h> int main(void){ int s, w, sum, i, j, d, e; scanf("%d %d", &s, &w); char c[s+1][w+1]; for(i = 0; i < s; i++){ scanf("%s", c[i]); } for(i = 0; i < s; i++){ for(j=0; j < w; j++){ sum = 0; if(c[i][j] == '#') putchar('#'); else{ for(d = -1; d <= 1; d++){ for(e = -1; e <= 1; e++){ if(c[i+e][j+d] == '#'){ sum++; } } } printf("%d", sum); } } putchar('\n'); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165568/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165568/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) %0 = load i32, ptr %s, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = load i32, ptr %w, align 4, !tbaa !5 %add1 = add nsw i32 %2, 1 %3 = zext i32 %add1 to i64 %4 = call ptr @llvm.stacksave.p0() %5 = mul nuw i64 %3, %1 %vla = alloca i8, i64 %5, align 16 %6 = load i32, ptr %s, align 4, !tbaa !5 %cmp65 = icmp sgt i32 %6, 0 br i1 %cmp65, label %for.body, label %for.end49 for.cond3.preheader: ; preds = %for.body %7 = icmp sgt i32 %9, 0 br i1 %7, label %for.cond6.preheader.preheader, label %for.end49 for.cond6.preheader.preheader: ; preds = %for.cond3.preheader %invariant.gep99 = getelementptr i8, ptr %vla, i64 -1 br label %for.cond6.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %8 = mul nuw nsw i64 %indvars.iv, %3 %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %8 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr %s, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.preheader, %for.end45 %indvars.iv95 = phi i64 [ 0, %for.cond6.preheader.preheader ], [ %indvars.iv.next96, %for.end45 ] %11 = load i32, ptr %w, align 4, !tbaa !5 %cmp771 = icmp sgt i32 %11, 0 br i1 %cmp771, label %for.body8.lr.ph, label %for.end45 for.body8.lr.ph: ; preds = %for.cond6.preheader %12 = mul nuw nsw i64 %indvars.iv95, %3 %arrayidx10 = getelementptr inbounds i8, ptr %vla, i64 %12 %13 = add nsw i64 %indvars.iv95, -1 %14 = mul nsw i64 %13, %3 %15 = add nuw nsw i64 %indvars.iv95, 1 %16 = mul nuw nsw i64 %15, %3 %invariant.gep = getelementptr i8, ptr %vla, i64 %12 br label %for.body8 for.body8: ; preds = %for.body8.lr.ph, %for.inc43 %indvars.iv92 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next93.pre-phi, %for.inc43 ] %arrayidx12 = getelementptr inbounds i8, ptr %arrayidx10, i64 %indvars.iv92 %17 = load i8, ptr %arrayidx12, align 1, !tbaa !11 %cmp13 = icmp eq i8 %17, 35 br i1 %cmp13, label %if.then, label %for.cond20.preheader.preheader for.cond20.preheader.preheader: ; preds = %for.body8 %gep100 = getelementptr i8, ptr %invariant.gep99, i64 %indvars.iv92 %gep = getelementptr i8, ptr %gep100, i64 %14 %18 = load i8, ptr %gep, align 1, !tbaa !11 %gep.1 = getelementptr i8, ptr %gep100, i64 %12 %19 = load i8, ptr %gep.1, align 1, !tbaa !11 %gep.2 = getelementptr i8, ptr %gep100, i64 %16 %20 = load i8, ptr %gep.2, align 1, !tbaa !11 %invariant.gep.1 = getelementptr i8, ptr %vla, i64 %indvars.iv92 %gep.184 = getelementptr i8, ptr %invariant.gep.1, i64 %14 %gep.2.1 = getelementptr i8, ptr %invariant.gep.1, i64 %16 %21 = add nuw nsw i64 %indvars.iv92, 1 %22 = load <2 x i8>, ptr %gep.184, align 1, !tbaa !11 %gep101 = getelementptr i8, ptr %invariant.gep, i64 %21 %23 = load i8, ptr %gep101, align 1, !tbaa !11 %24 = load <2 x i8>, ptr %gep.2.1, align 1, !tbaa !11 %25 = insertelement <8 x i8> poison, i8 %19, i64 0 %26 = insertelement <8 x i8> %25, i8 %23, i64 1 %27 = insertelement <8 x i8> %26, i8 %18, i64 2 %28 = shufflevector <2 x i8> %22, <2 x i8> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %29 = shufflevector <8 x i8> %27, <8 x i8> %28, <8 x i32> <i32 0, i32 1, i32 2, i32 8, i32 9, i32 poison, i32 poison, i32 poison> %30 = insertelement <8 x i8> %29, i8 %20, i64 5 %31 = shufflevector <2 x i8> %24, <2 x i8> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %32 = shufflevector <8 x i8> %30, <8 x i8> %31, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9> %33 = icmp eq <8 x i8> %32, <i8 35, i8 35, i8 35, i8 35, i8 35, i8 35, i8 35, i8 35> %34 = bitcast <8 x i1> %33 to i8 %35 = call i8 @llvm.ctpop.i8(i8 %34), !range !12 %36 = zext i8 %35 to i32 %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36) br label %for.inc43 if.then: ; preds = %for.body8 %37 = load ptr, ptr @stdout, align 8, !tbaa !13 %call.i = call i32 @putc(i32 noundef 35, ptr noundef %37) %.pre = add nuw nsw i64 %indvars.iv92, 1 br label %for.inc43 for.inc43: ; preds = %if.then, %for.cond20.preheader.preheader %indvars.iv.next93.pre-phi = phi i64 [ %.pre, %if.then ], [ %21, %for.cond20.preheader.preheader ] %38 = load i32, ptr %w, align 4, !tbaa !5 %39 = sext i32 %38 to i64 %cmp7 = icmp slt i64 %indvars.iv.next93.pre-phi, %39 br i1 %cmp7, label %for.body8, label %for.end45, !llvm.loop !15 for.end45: ; preds = %for.inc43, %for.cond6.preheader %40 = load ptr, ptr @stdout, align 8, !tbaa !13 %call.i64 = call i32 @putc(i32 noundef 10, ptr noundef %40) %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1 %41 = load i32, ptr %s, align 4, !tbaa !5 %42 = sext i32 %41 to i64 %cmp4 = icmp slt i64 %indvars.iv.next96, %42 br i1 %cmp4, label %for.cond6.preheader, label %for.end49, !llvm.loop !16 for.end49: ; preds = %for.end45, %entry, %for.cond3.preheader call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.ctpop.i8(i8) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = !{i8 0, i8 9} !13 = !{!14, !14, i64 0} !14 = !{!"any pointer", !7, i64 0} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> #include <stdlib.h> int main(){ int H, W, i, j; scanf("%d%d", &H, &W); char **S = (char **)malloc(sizeof(char *) * (H + 2)); int **A = (int **)malloc(sizeof(int *) * (H + 2)); for(i = 0; i <= H + 1; i++){ S[i] = (char *)malloc(sizeof(char) * (W + 2)); A[i] = (int *)malloc(sizeof(int) * (W + 2)); for(j = 0; j <= W + 1; j++){ A[i][j] = 0; } if(i == 0 || i == H + 1){ for(j = 0; j <= W + 1; j++){ S[i][j] = '.'; } } else{ scanf("%s", &S[i][1]); S[i][0] = '.'; S[i][W + 1] = '.'; } } for(i = 1; i <= H; i++){ for(j = 1; j <= W; j++){ if(S[i][j] == '#'){ A[i - 1][j - 1]++; A[i - 1][j]++; A[i - 1][j + 1]++; A[i][j - 1]++; A[i][j + 1]++; A[i + 1][j - 1]++; A[i + 1][j]++; A[i + 1][j + 1]++; } } } for(i = 1; i <= H; i++){ for(j = 1; j <= W; j++){ if(S[i][j] == '#'){ printf("#"); } else{ printf("%d", A[i][j]); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165618/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165618/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\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: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %add = add nsw i32 %0, 2 %conv = sext i32 %add to i64 %mul = shl nsw i64 %conv, 3 %call1 = call noalias ptr @malloc(i64 noundef %mul) #8 %call5 = call noalias ptr @malloc(i64 noundef %mul) #8 %cmp.not233 = icmp slt i32 %0, -1 br i1 %cmp.not233, label %for.end163, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = load i32, ptr %W, align 4, !tbaa !5 %add8.peel = add i32 %1, 2 %conv9.peel = sext i32 %add8.peel to i64 %call11.peel = call noalias ptr @malloc(i64 noundef %conv9.peel) #8 store ptr %call11.peel, ptr %call1, align 8, !tbaa !9 %mul14.peel = shl nsw i64 %conv9.peel, 2 %call15.peel = call noalias ptr @malloc(i64 noundef %mul14.peel) #8 store ptr %call15.peel, ptr %call5, align 8, !tbaa !9 %cmp20.not227.peel = icmp slt i32 %1, -1 br i1 %cmp20.not227.peel, label %for.inc56.peel, label %for.body36.lr.ph.peel for.body36.lr.ph.peel: ; preds = %for.body.preheader %2 = zext i32 %add8.peel to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr align 4 %call15.peel, i8 0, i64 %3, i1 false), !tbaa !5 %4 = zext i32 %add8.peel to i64 call void @llvm.memset.p0.i64(ptr align 1 %call11.peel, i8 46, i64 %4, i1 false), !tbaa !11 br label %for.inc56.peel for.inc56.peel: ; preds = %for.body.preheader, %for.body36.lr.ph.peel %cmp.not.peel = icmp slt i32 %0, 0 br i1 %cmp.not.peel, label %for.end163, label %for.body for.cond59.preheader: ; preds = %for.inc56 %cmp60.not238 = icmp slt i32 %17, 1 br i1 %cmp60.not238, label %for.end163, label %for.cond63.preheader.lr.ph for.cond63.preheader.lr.ph: ; preds = %for.cond59.preheader %5 = load i32, ptr %W, align 4, !tbaa !5 %6 = icmp slt i32 %5, 1 br i1 %6, label %for.cond137.preheader.preheader, label %for.cond63.preheader.preheader for.cond63.preheader.preheader: ; preds = %for.cond63.preheader.lr.ph %invariant.gep = getelementptr ptr, ptr %call5, i64 -1 br label %for.cond63.preheader for.body: ; preds = %for.inc56.peel, %for.inc56 %7 = phi i32 [ %17, %for.inc56 ], [ %0, %for.inc56.peel ] %8 = phi i32 [ %18, %for.inc56 ], [ %1, %for.inc56.peel ] %9 = phi i32 [ %19, %for.inc56 ], [ %1, %for.inc56.peel ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc56 ], [ 1, %for.inc56.peel ] %add8 = add i32 %9, 2 %conv9 = sext i32 %add8 to i64 %call11 = call noalias ptr @malloc(i64 noundef %conv9) #8 %arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv store ptr %call11, ptr %arrayidx, align 8, !tbaa !9 %mul14 = shl nsw i64 %conv9, 2 %call15 = call noalias ptr @malloc(i64 noundef %mul14) #8 %arrayidx17 = getelementptr inbounds ptr, ptr %call5, i64 %indvars.iv store ptr %call15, ptr %arrayidx17, align 8, !tbaa !9 %cmp20.not227 = icmp slt i32 %9, -1 br i1 %cmp20.not227, label %lor.lhs.false, label %lor.lhs.false.thread lor.lhs.false: ; preds = %for.body %add29 = add nsw i32 %7, 1 %10 = zext i32 %add29 to i64 %cmp30 = icmp eq i64 %indvars.iv, %10 br i1 %cmp30, label %for.inc56, label %if.else lor.lhs.false.thread: ; preds = %for.body %11 = zext i32 %add8 to i64 %12 = shl nuw nsw i64 %11, 2 call void @llvm.memset.p0.i64(ptr align 4 %call15, i8 0, i64 %12, i1 false), !tbaa !5 %add29271 = add nsw i32 %7, 1 %13 = zext i32 %add29271 to i64 %cmp30272 = icmp eq i64 %indvars.iv, %13 br i1 %cmp30272, label %for.body36.lr.ph, label %if.else for.body36.lr.ph: ; preds = %lor.lhs.false.thread %smax246 = call i32 @llvm.smax.i32(i32 %8, i32 -1) %14 = add i32 %smax246, 2 %15 = zext i32 %14 to i64 call void @llvm.memset.p0.i64(ptr align 1 %call11, i8 46, i64 %15, i1 false), !tbaa !11 br label %for.inc56 if.else: ; preds = %lor.lhs.false.thread, %lor.lhs.false %arrayidx46 = getelementptr inbounds i8, ptr %call11, i64 1 %call47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx46) store i8 46, ptr %call11, align 1, !tbaa !11 %16 = load i32, ptr %W, align 4, !tbaa !5 %add53 = add nsw i32 %16, 1 %idxprom54 = sext i32 %add53 to i64 %arrayidx55 = getelementptr inbounds i8, ptr %call11, i64 %idxprom54 store i8 46, ptr %arrayidx55, align 1, !tbaa !11 %.pre = load i32, ptr %H, align 4, !tbaa !5 br label %for.inc56 for.inc56: ; preds = %lor.lhs.false, %for.body36.lr.ph, %if.else %17 = phi i32 [ %7, %for.body36.lr.ph ], [ %.pre, %if.else ], [ %7, %lor.lhs.false ] %18 = phi i32 [ %8, %for.body36.lr.ph ], [ %16, %if.else ], [ %8, %lor.lhs.false ] %19 = phi i32 [ %8, %for.body36.lr.ph ], [ %16, %if.else ], [ %9, %lor.lhs.false ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %20 = sext i32 %17 to i64 %cmp.not = icmp sgt i64 %indvars.iv, %20 br i1 %cmp.not, label %for.cond59.preheader, label %for.body, !llvm.loop !12 for.cond63.preheader: ; preds = %for.cond63.preheader.preheader, %for.inc130 %21 = phi i32 [ %17, %for.cond63.preheader.preheader ], [ %43, %for.inc130 ] %22 = phi i32 [ %5, %for.cond63.preheader.preheader ], [ %44, %for.inc130 ] %23 = phi i32 [ %5, %for.cond63.preheader.preheader ], [ %45, %for.inc130 ] %indvars.iv255 = phi i64 [ 1, %for.cond63.preheader.preheader ], [ %indvars.iv.next256.pre-phi, %for.inc130 ] %cmp64.not236 = icmp slt i32 %23, 1 br i1 %cmp64.not236, label %for.cond63.preheader.for.inc130_crit_edge, label %for.body66.lr.ph for.cond63.preheader.for.inc130_crit_edge: ; preds = %for.cond63.preheader %.pre268 = add nuw nsw i64 %indvars.iv255, 1 br label %for.inc130 for.body66.lr.ph: ; preds = %for.cond63.preheader %arrayidx68 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv255 %24 = load ptr, ptr %arrayidx68, align 8, !tbaa !9 %gep = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv255 %arrayidx95 = getelementptr inbounds ptr, ptr %call5, i64 %indvars.iv255 %25 = add nuw nsw i64 %indvars.iv255, 1 %idxprom107 = and i64 %25, 4294967295 %arrayidx108 = getelementptr inbounds ptr, ptr %call5, i64 %idxprom107 br label %for.body66 for.cond133.preheader: ; preds = %for.inc130 %cmp134.not242 = icmp slt i32 %43, 1 br i1 %cmp134.not242, label %for.end163, label %for.cond137.preheader.preheader for.cond137.preheader.preheader: ; preds = %for.cond63.preheader.lr.ph, %for.cond133.preheader br label %for.cond137.preheader for.body66: ; preds = %for.body66.lr.ph, %for.inc127 %26 = phi i32 [ %22, %for.body66.lr.ph ], [ %41, %for.inc127 ] %indvars.iv250 = phi i64 [ 1, %for.body66.lr.ph ], [ %indvars.iv.next251.pre-phi, %for.inc127 ] %arrayidx70 = getelementptr inbounds i8, ptr %24, i64 %indvars.iv250 %27 = load i8, ptr %arrayidx70, align 1, !tbaa !11 %cmp72 = icmp eq i8 %27, 35 br i1 %cmp72, label %if.then74, label %for.body66.for.inc127_crit_edge for.body66.for.inc127_crit_edge: ; preds = %for.body66 %.pre269 = add nuw nsw i64 %indvars.iv250, 1 br label %for.inc127 if.then74: ; preds = %for.body66 %28 = load ptr, ptr %gep, align 8, !tbaa !9 %29 = add nsw i64 %indvars.iv250, -1 %arrayidx79 = getelementptr inbounds i32, ptr %28, i64 %29 %30 = load <2 x i32>, ptr %arrayidx79, align 4, !tbaa !5 %31 = add nsw <2 x i32> %30, <i32 1, i32 1> store <2 x i32> %31, ptr %arrayidx79, align 4, !tbaa !5 %32 = add nuw nsw i64 %indvars.iv250, 1 %idxprom91 = and i64 %32, 4294967295 %arrayidx92 = getelementptr inbounds i32, ptr %28, i64 %idxprom91 %33 = load i32, ptr %arrayidx92, align 4, !tbaa !5 %inc93 = add nsw i32 %33, 1 store i32 %inc93, ptr %arrayidx92, align 4, !tbaa !5 %34 = load ptr, ptr %arrayidx95, align 8, !tbaa !9 %arrayidx98 = getelementptr inbounds i32, ptr %34, i64 %29 %35 = load i32, ptr %arrayidx98, align 4, !tbaa !5 %inc99 = add nsw i32 %35, 1 store i32 %inc99, ptr %arrayidx98, align 4, !tbaa !5 %arrayidx104 = getelementptr inbounds i32, ptr %34, i64 %idxprom91 %36 = load i32, ptr %arrayidx104, align 4, !tbaa !5 %inc105 = add nsw i32 %36, 1 store i32 %inc105, ptr %arrayidx104, align 4, !tbaa !5 %37 = load ptr, ptr %arrayidx108, align 8, !tbaa !9 %arrayidx111 = getelementptr inbounds i32, ptr %37, i64 %29 %38 = load <2 x i32>, ptr %arrayidx111, align 4, !tbaa !5 %39 = add nsw <2 x i32> %38, <i32 1, i32 1> store <2 x i32> %39, ptr %arrayidx111, align 4, !tbaa !5 %arrayidx124 = getelementptr inbounds i32, ptr %37, i64 %idxprom91 %40 = load i32, ptr %arrayidx124, align 4, !tbaa !5 %inc125 = add nsw i32 %40, 1 store i32 %inc125, ptr %arrayidx124, align 4, !tbaa !5 %.pre266 = load i32, ptr %W, align 4, !tbaa !5 br label %for.inc127 for.inc127: ; preds = %for.body66.for.inc127_crit_edge, %if.then74 %indvars.iv.next251.pre-phi = phi i64 [ %.pre269, %for.body66.for.inc127_crit_edge ], [ %32, %if.then74 ] %41 = phi i32 [ %26, %for.body66.for.inc127_crit_edge ], [ %.pre266, %if.then74 ] %42 = sext i32 %41 to i64 %cmp64.not.not = icmp slt i64 %indvars.iv250, %42 br i1 %cmp64.not.not, label %for.body66, label %for.inc130.loopexit, !llvm.loop !15 for.inc130.loopexit: ; preds = %for.inc127 %.pre267 = load i32, ptr %H, align 4, !tbaa !5 br label %for.inc130 for.inc130: ; preds = %for.cond63.preheader.for.inc130_crit_edge, %for.inc130.loopexit %indvars.iv.next256.pre-phi = phi i64 [ %.pre268, %for.cond63.preheader.for.inc130_crit_edge ], [ %25, %for.inc130.loopexit ] %43 = phi i32 [ %21, %for.cond63.preheader.for.inc130_crit_edge ], [ %.pre267, %for.inc130.loopexit ] %44 = phi i32 [ %22, %for.cond63.preheader.for.inc130_crit_edge ], [ %41, %for.inc130.loopexit ] %45 = phi i32 [ %23, %for.cond63.preheader.for.inc130_crit_edge ], [ %41, %for.inc130.loopexit ] %46 = sext i32 %43 to i64 %cmp60.not.not = icmp slt i64 %indvars.iv255, %46 br i1 %cmp60.not.not, label %for.cond63.preheader, label %for.cond133.preheader, !llvm.loop !16 for.cond137.preheader: ; preds = %for.cond137.preheader.preheader, %for.end159 %indvars.iv263 = phi i64 [ %indvars.iv.next264, %for.end159 ], [ 1, %for.cond137.preheader.preheader ] %47 = load i32, ptr %W, align 4, !tbaa !5 %cmp138.not240 = icmp slt i32 %47, 1 br i1 %cmp138.not240, label %for.end159, label %for.body140.lr.ph for.body140.lr.ph: ; preds = %for.cond137.preheader %arrayidx142 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv263 %48 = load ptr, ptr %arrayidx142, align 8, !tbaa !9 %arrayidx152 = getelementptr inbounds ptr, ptr %call5, i64 %indvars.iv263 br label %for.body140 for.body140: ; preds = %for.body140.lr.ph, %for.inc157 %indvars.iv260 = phi i64 [ 1, %for.body140.lr.ph ], [ %indvars.iv.next261, %for.inc157 ] %arrayidx144 = getelementptr inbounds i8, ptr %48, i64 %indvars.iv260 %49 = load i8, ptr %arrayidx144, align 1, !tbaa !11 %cmp146 = icmp eq i8 %49, 35 br i1 %cmp146, label %if.then148, label %if.else150 if.then148: ; preds = %for.body140 %putchar225 = call i32 @putchar(i32 35) br label %for.inc157 if.else150: ; preds = %for.body140 %50 = load ptr, ptr %arrayidx152, align 8, !tbaa !9 %arrayidx154 = getelementptr inbounds i32, ptr %50, i64 %indvars.iv260 %51 = load i32, ptr %arrayidx154, align 4, !tbaa !5 %call155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %51) br label %for.inc157 for.inc157: ; preds = %if.then148, %if.else150 %indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1 %52 = load i32, ptr %W, align 4, !tbaa !5 %53 = sext i32 %52 to i64 %cmp138.not.not = icmp slt i64 %indvars.iv260, %53 br i1 %cmp138.not.not, label %for.body140, label %for.end159, !llvm.loop !18 for.end159: ; preds = %for.inc157, %for.cond137.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next264 = add nuw nsw i64 %indvars.iv263, 1 %54 = load i32, ptr %H, align 4, !tbaa !5 %55 = sext i32 %54 to i64 %cmp134.not.not = icmp slt i64 %indvars.iv263, %55 br i1 %cmp134.not.not, label %for.cond137.preheader, label %for.end163, !llvm.loop !19 for.end163: ; preds = %for.end159, %for.inc56.peel, %entry, %for.cond59.preheader, %for.cond133.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } attributes #8 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13, !14} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!"llvm.loop.peeled.count", i32 1} !15 = distinct !{!15, !13} !16 = distinct !{!16, !13, !17} !17 = !{!"llvm.loop.unswitch.partial.disable"} !18 = distinct !{!18, !13} !19 = distinct !{!19, !13}
#include<stdio.h> int main(void) { int A,B,C,D; scanf("%d%d%d%d",&A,&B,&C,&D); if(B>C){ if(A>D) { printf("0\n"); return 0; } if((A>=C)&&(B>=D)){ printf("%d\n",D-A); return 0; } if((A>=C)&&(B<=D)){ printf("%d\n",B-A); return 0; } if((A<=C)&&(B<=D)){ printf("%d\n",B-C); return 0; } if((A<=C)&&(B>=D)){ printf("%d\n",D-C); return 0; } } else { printf("0\n"); return 0; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165661/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165661/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %C, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %2 = load i32, ptr %A, align 4, !tbaa !5 %3 = load i32, ptr %D, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %2, %3 br i1 %cmp1, label %if.then2, label %if.end if.then2: ; preds = %if.then %puts44 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.end: ; preds = %if.then %cmp4.not = icmp slt i32 %2, %1 %cmp5.not = icmp slt i32 %0, %3 %or.cond = or i1 %cmp4.not, %cmp5.not br i1 %or.cond, label %if.end8, label %if.then6 if.then6: ; preds = %if.end %sub = sub nsw i32 %3, %2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub) br label %cleanup if.end8: ; preds = %if.end %cmp11.not = icmp sgt i32 %0, %3 %or.cond45 = or i1 %cmp4.not, %cmp11.not br i1 %or.cond45, label %if.end15, label %if.then12 if.then12: ; preds = %if.end8 %sub13 = sub nsw i32 %0, %2 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub13) br label %cleanup if.end15: ; preds = %if.end8 %cmp16.not = icmp sgt i32 %2, %1 br i1 %cmp16.not, label %cleanup, label %land.lhs.true17 land.lhs.true17: ; preds = %if.end15 br i1 %cmp11.not, label %if.then26, label %if.then19 if.then19: ; preds = %land.lhs.true17 %sub20 = sub nsw i32 %0, %1 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20) br label %cleanup if.then26: ; preds = %land.lhs.true17 %sub27 = sub nsw i32 %3, %1 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub27) br label %cleanup if.else: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup cleanup: ; preds = %if.end15, %if.else, %if.then26, %if.then19, %if.then12, %if.then6, %if.then2 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <string.h> /*以下便利なマクロを定義する。*/ #define rep(i, min, max) for(i=min; i<=max; i=i+1) #define if_forall(i, min, max, prop)\ \ rep(i, min, max)\ {\ if(!(prop))\ {\ break;\ }\ }\ \ if(i==max+1)\ #define if_exists(i, min, max, prop)\ \ rep(i, min, max)\ {\ if(prop)\ {\ break;\ }\ }\ \ if(i<max+1)\ #define sum(i, min, max, sequence, answer)\ {\ answer=0;\ rep(i, min, max)\ {\ answer=answer+sequence;\ }\ }\ #define prod(i, min, max, sequence, answer)\ {\ answer=1;\ rep(i, min, max)\ {\ answer=answer*sequence;\ }\ }\ /*以下便利な関数を定義する。*/ void fill_int(int array[], int min, int max, int element) { int i=min; rep(i, min, max) { array[i]=element; } } void fill_char(char array[], int min, int max, char element) { int i=min; rep(i, min, max) { array[i]=element; } } void swap_int(int* x, int* y) { int tmp; tmp = *x; *x = *y; *y = tmp; } void swap_int_array(int x[], int y[], int min, int max) { int i; rep(i, min, max) { swap_int(&x[i], &y[i]); } } void swap_char(char* x, char* y) { char tmp; tmp = *x; *x = *y; *y = tmp; } void swap_char_array(char x[], char y[], int min, int max) { int i; rep(i, min, max) { swap_char(&x[i], &y[i]); } } void reverse_char(char array[], int min, int max) { int i; rep(i, min, (min+max)/2) { swap_char(&array[i], &array[min+max-i]); } } int max_int(int var1, int var2) { int answer=var1; if(answer<var2) { answer=var2; } return answer; } int min_int(int var1, int var2) { int answer=var1; if(answer>var2) { answer=var2; } return answer; } long int pow_int(int base, unsigned int exponent) { long int answer=1; answer=(long int)pow((double)base, (double)exponent); return answer; } long int pow_int_mod(int base, unsigned int exponent, int mod) { long int answer=1; while (exponent>0) { if (exponent&1) { answer=(answer*(base%mod))%mod; if(answer==0) { break; } } base=(base*base)%mod; exponent=exponent>>1; } return answer; } unsigned long int factorial(unsigned int num) { unsigned int i=0; unsigned long int answer=1; rep(i, 2, num) { answer=answer*i; } return answer; } unsigned long int factorial_mod(unsigned int num, int mod) { unsigned int i=0; unsigned long int answer=1; rep(i, 2, num) { answer=(answer*(i%mod))%mod; if(answer==0) { break; } } return answer; } unsigned long int combination(unsigned int n, unsigned int k) { unsigned int i=0; unsigned long int numerator=1; unsigned long int denominator=1; k=min_int(k, n-k); rep(i, 2, k) { numerator=numerator*(n+1-i); denominator=denominator*i; } return numerator/denominator; } double combination_general(double alpha, unsigned int k) { unsigned int i; double numerator=1; unsigned long int denominator=1; rep(i, 1, k) { numerator=numerator*(alpha+1-i); denominator=denominator*i; } return numerator/denominator; } int gcd(int a, int b) { if(a<b) { swap_int(&a, &b); } int r=a%b; while(r!=0) { a=b; b=r; r=a%b; } return b; } int lcm(int a, int b) { return (a/gcd(a, b))*b; } int order(long int num) { int answer=-1; while(num!=0) { num=num/10; answer=answer+1; } return answer; } long int convert_adic_int(char num[], unsigned int p_adic, unsigned int q_adic) { int i=0; long int answer=0; bool sgn=0; long int tmp=strtol(num, NULL, p_adic); if(tmp<0) { sgn=1; tmp=-tmp; } while(tmp>0) { answer=answer+(tmp%q_adic)*pow_int(10, i); tmp=tmp/q_adic; i=i+1; } if(sgn==0) { return answer; } else { return -answer; } } void convert_adic_char(char num[], unsigned int p_adic, unsigned int q_adic) { int i=0; int mod[32]={0}; bool sgn=0; int digit=0; long int tmp=strtol(num, NULL, p_adic); if(tmp<0) { sgn=1; tmp=-tmp; } while(tmp>0) { mod[i]=tmp%q_adic; digit=i; tmp=tmp/q_adic; i=i+1; } fill_char(num, 0, strlen(num)-1, '\0'); if(sgn==1) { num[0]='-'; } rep(i, 0, digit) { if(mod[i]<10) { num[sgn+digit-i]='0'+mod[i]; } else if(mod[i]<q_adic) { num[sgn+digit-i]='a'+(mod[i]-10); } } } int count_mod(int min, int max, int num) { if(min>0) { return max/num-(min-1)/num; } else if(min==0) { return max/num+1; } else { return -1; } } void shift_char(char array[], int min, int max, int num) { int i; for(i=max; i>=min; i=i-1) { array[i+num]=array[i]; } rep(i, min, min+num-1) { array[i]='\0'; } } void convert_char(char array[], int min, int max, char pre, char post) { int i=min; rep(i, min, max) { if(array[i]==pre) { array[i]=post; } } } void sort_asc_int(int array[], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(array[i]>array[j]) { swap_int(&array[i], &array[j]); } } } } void sort_des_int(int array[], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(array[i]<array[j]) { swap_int(&array[i], &array[j]); } } } } void sort_asc_char_dic(int size, char array[][size], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(strcmp(array[i], array[j])>0) { swap_char_array(array[i], array[j], 0, size-1); } } } } void sort_des_char_dic(int size, char array[][size], int min, int max) { int i, j; rep(i, min, max) { rep(j, i+1, max) { if(strcmp(array[i], array[j])<0) { swap_char_array(array[i], array[j], 0, size-1); } } } } int max_int_array(int array[], int min, int max) { int i; int answer; answer=array[min]; for(i=min+1; i<=max; i=i+1) { answer=max_int(answer, array[i]); } return answer; } void max_int_array_num(int array[], int min, int max, int answer[]) { int i=min; int count=0; int max_value=max_int_array(array, min, max); fill_int(answer, 0, max-min, -1); rep(i, min, max) { if(array[i]==max_value) { answer[count]=i; count=count+1; } } } int min_int_array(int array[], int min, int max) { int i; int answer; answer=array[min]; for(i=min+1; i<=max; i=i+1) { answer=min_int(answer, array[i]); } return answer; } void min_int_array_num(int array[], int min, int max, int answer[]) { int i=min; int count=0; int min_value=min_int_array(array, min, max); fill_int(answer, 0, max-min, -1); rep(i, min, max) { if(array[i]==min_value) { answer[count]=i; count=count+1; } } } int max_char_dic(int size, char array[][size], int min, int max) { int i; int answer=min; rep(i, min+1, max) { if(strcmp(array[answer], array[i])<0) { answer=i; } } return answer; } int min_char_dic(int size, char array[][size], int min, int max) { int i; int answer=min; rep(i, min+1, max) { if(strcmp(array[answer], array[i])>0) { answer=i; } } return answer; } int sum_array(int array[], int min, int max) { int i=min; int answer=0; rep(i, min, max) { answer=answer+array[i]; } return answer; } bool detect_int(int array[], int min, int max, int element) { int i; bool answer=0; if_exists(i, min, max, array[i]==element) { answer=1; } return answer; } bool detect_char(char array[], int min, int max, char element[], int start, int goal) { int i, j; bool answer=0; if(goal-start<=max-min) { for(i=min; i<=max-(goal-start); i=i+1) { if_forall(j, start, goal, array[i+j-start]==element[j]) { answer=1; break; } } } return answer; } int count_differentelement_int(int array[], int min, int max) { int i=min; int pickup[max]; fill_int(pickup, 0, max, 0); int answer=0; rep(i, min, max) { if(detect_int(pickup, 0, answer-1, array[i])==0) { pickup[answer]=array[i]; answer=answer+1; } } return answer; } int count_differentelement_char(char array[], int min, int max) { int i=min; char pickup[max]; fill_char(pickup, 0, max, '\0'); int answer=0; rep(i, min, max) { if(detect_char(pickup, 0, answer-1, array, i, i)==0) { pickup[answer]=array[i]; answer=answer+1; } } return answer; } int count_equalelement_int(int array[], int min, int max, int element) { int i; int answer=0; rep(i, min, max) { if(array[i]==element) { answer=answer+1; } } return answer; } int count_equalelement_char(char array[], int min, int max, char element) { int i; int answer=0; rep(i, min, max) { if(array[i]==element) { answer=answer+1; } } return answer; } void scanf_int_array(int array[], int min, int max) { int i; rep(i, min, max) { scanf("%d", &array[i]); } } void scanf_int_array_2(int array1[], int array2[], int min, int max) { int i; rep(i, min, max) { scanf("%d %d", &array1[i], &array2[i]); } } void scanf_int_array_3(int array1[], int array2[], int array3[], int min, int max) { int i; rep(i, min, max) { scanf("%d %d %d", &array1[i], &array2[i], &array3[i]); } } void scanf_char_array(char array[], int num) { scanf("%s", array); shift_char(array, 0, strlen(array)-1, num); } void printf_int_array(int array[], int min, int max) { int i; rep(i, min, max) { printf("%d\n", array[i]); } } void printf_char_array(char array[], int min, int max) { int i; for(i=min; i<=max; i=i+1) { printf("%c", array[i]); } } int main() { int i=0; int A, B, C, D; scanf("%d %d %d %d", &A, &B, &C, &D); printf("%d\n", max_int(0, min_int(B, D)-max_int(A, C))); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165711/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165711/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.6 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable define dso_local void @fill_int(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #0 { entry: %cmp.not4 = icmp sgt i32 %min, %max br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index store <4 x i32> %broadcast.splat, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 store <4 x i32> %broadcast.splat, ptr %5, align 4, !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 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader7 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv store i32 %element, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv 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) #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(argmem: write) uwtable define dso_local void @fill_char(ptr nocapture noundef writeonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #2 { entry: %cmp.not4 = icmp sgt i32 %min, %max br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %scevgep = getelementptr i8, ptr %array, i64 %0 %1 = sub i32 %max, %min %2 = zext i32 %1 to i64 %3 = add nuw nsw i64 %2, 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 %element, i64 %3, i1 false), !tbaa !14 br label %for.end for.end: ; preds = %for.body.preheader, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_int(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @swap_int_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 15 br i1 %min.iters.check, label %for.body.preheader15, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %5 = shl nsw i64 %0, 2 %scevgep = getelementptr i8, ptr %x, i64 %5 %6 = sub i32 %max, %min %7 = zext i32 %6 to i64 %8 = add nsw i64 %0, %7 %9 = shl nsw i64 %8, 2 %10 = add nsw i64 %9, 4 %scevgep9 = getelementptr i8, ptr %x, i64 %10 %scevgep10 = getelementptr i8, ptr %y, i64 %5 %scevgep11 = getelementptr i8, ptr %y, i64 %10 %bound0 = icmp ult ptr %scevgep, %scevgep11 %bound1 = icmp ult ptr %scevgep10, %scevgep9 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %11 = getelementptr inbounds i32, ptr %x, i64 %offset.idx %12 = getelementptr inbounds i32, ptr %y, i64 %offset.idx %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %13 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load12 = load <4 x i32>, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %wide.load13 = load <4 x i32>, ptr %12, align 4, !tbaa !5, !alias.scope !18 %14 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load14 = load <4 x i32>, ptr %14, align 4, !tbaa !5, !alias.scope !18 store <4 x i32> %wide.load13, ptr %11, align 4, !tbaa !5, !alias.scope !15, !noalias !18 store <4 x i32> %wide.load14, ptr %13, align 4, !tbaa !5, !alias.scope !15, !noalias !18 store <4 x i32> %wide.load, ptr %12, align 4, !tbaa !5, !alias.scope !18 store <4 x i32> %wide.load12, ptr %14, align 4, !tbaa !5, !alias.scope !18 %index.next = add nuw i64 %index, 8 %15 = icmp eq i64 %index.next, %n.vec br i1 %15, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %vector.memcheck, %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %16 = add i32 %max, 1 %17 = trunc i64 %indvars.iv.ph to i32 %18 = sub i32 %16, %17 %xtraiter = and i32 %18, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader15 %arrayidx.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.ph %arrayidx2.prol = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.ph %19 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5 %20 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5 store i32 %20, ptr %arrayidx.prol, align 4, !tbaa !5 store i32 %19, ptr %arrayidx2.prol, align 4, !tbaa !5 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader15 %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader15 ], [ %indvars.iv.next.prol, %for.body.prol ] %21 = icmp eq i32 %17, %max br i1 %21, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %22 = load i32, ptr %arrayidx, align 4, !tbaa !5 %23 = load i32, ptr %arrayidx2, align 4, !tbaa !5 store i32 %23, ptr %arrayidx, align 4, !tbaa !5 store i32 %22, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.next %24 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %25 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 store i32 %25, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %24, ptr %arrayidx2.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !21 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap_char(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #3 { entry: %0 = load i8, ptr %x, align 1, !tbaa !14 %1 = load i8, ptr %y, align 1, !tbaa !14 store i8 %1, ptr %x, align 1, !tbaa !14 store i8 %0, ptr %y, align 1, !tbaa !14 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @swap_char_array(ptr nocapture noundef %x, ptr nocapture noundef %y, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %scevgep = getelementptr i8, ptr %x, i64 %0 %5 = sub i32 %max, %min %6 = zext i32 %5 to i64 %7 = add nsw i64 %0, %6 %8 = add nsw i64 %7, 1 %scevgep9 = getelementptr i8, ptr %x, i64 %8 %scevgep10 = getelementptr i8, ptr %y, i64 %0 %scevgep11 = getelementptr i8, ptr %y, i64 %8 %bound0 = icmp ult ptr %scevgep, %scevgep11 %bound1 = icmp ult ptr %scevgep10, %scevgep9 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check12 = icmp ult i32 %2, 31 br i1 %min.iters.check12, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, 8589934560 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %9 = getelementptr inbounds i8, ptr %x, i64 %offset.idx %10 = getelementptr inbounds i8, ptr %y, i64 %offset.idx %wide.load = load <16 x i8>, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25 %11 = getelementptr inbounds i8, ptr %9, i64 16 %wide.load13 = load <16 x i8>, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25 %wide.load14 = load <16 x i8>, ptr %10, align 1, !tbaa !14, !alias.scope !25 %12 = getelementptr inbounds i8, ptr %10, i64 16 %wide.load15 = load <16 x i8>, ptr %12, align 1, !tbaa !14, !alias.scope !25 store <16 x i8> %wide.load14, ptr %9, align 1, !tbaa !14, !alias.scope !22, !noalias !25 store <16 x i8> %wide.load15, ptr %11, align 1, !tbaa !14, !alias.scope !22, !noalias !25 store <16 x i8> %wide.load, ptr %10, align 1, !tbaa !14, !alias.scope !25 store <16 x i8> %wide.load13, ptr %12, align 1, !tbaa !14, !alias.scope !25 %index.next = add nuw i64 %index, 32 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !27 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end18 = add nsw i64 %n.vec, %0 %n.vec.remaining = and i64 %4, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec17 = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec17, %0 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index20 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next24, %vec.epilog.vector.body ] %offset.idx21 = add i64 %index20, %0 %14 = getelementptr inbounds i8, ptr %x, i64 %offset.idx21 %15 = getelementptr inbounds i8, ptr %y, i64 %offset.idx21 %wide.load22 = load <8 x i8>, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31 %wide.load23 = load <8 x i8>, ptr %15, align 1, !tbaa !14, !alias.scope !31 store <8 x i8> %wide.load23, ptr %14, align 1, !tbaa !14, !alias.scope !28, !noalias !31 store <8 x i8> %wide.load22, ptr %15, align 1, !tbaa !14, !alias.scope !31 %index.next24 = add nuw i64 %index20, 8 %16 = icmp eq i64 %index.next24, %n.vec17 br i1 %16, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !33 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n19 = icmp eq i64 %4, %n.vec17 br i1 %cmp.n19, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %ind.end18, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %17 = add i32 %max, 1 %18 = trunc i64 %indvars.iv.ph to i32 %19 = sub i32 %17, %18 %xtraiter = and i32 %19, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx.prol = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.ph %arrayidx2.prol = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.ph %20 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14 %21 = load i8, ptr %arrayidx2.prol, align 1, !tbaa !14 store i8 %21, ptr %arrayidx.prol, align 1, !tbaa !14 store i8 %20, ptr %arrayidx2.prol, align 1, !tbaa !14 %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %22 = icmp eq i32 %18, %max br i1 %22, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i8, ptr %x, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv %23 = load i8, ptr %arrayidx, align 1, !tbaa !14 %24 = load i8, ptr %arrayidx2, align 1, !tbaa !14 store i8 %24, ptr %arrayidx, align 1, !tbaa !14 store i8 %23, ptr %arrayidx2, align 1, !tbaa !14 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %x, i64 %indvars.iv.next %arrayidx2.1 = getelementptr inbounds i8, ptr %y, i64 %indvars.iv.next %25 = load i8, ptr %arrayidx.1, align 1, !tbaa !14 %26 = load i8, ptr %arrayidx2.1, align 1, !tbaa !14 store i8 %26, ptr %arrayidx.1, align 1, !tbaa !14 store i8 %25, ptr %arrayidx2.1, align 1, !tbaa !14 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %1, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !34 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %vec.epilog.middle.block, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @reverse_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %add = add nsw i32 %max, %min %div = sdiv i32 %add, 2 %cmp.not12 = icmp slt i32 %div, %min br i1 %cmp.not12, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = sext i32 %add to i64 %2 = add nsw i32 %div, 1 %3 = add nsw i32 %div, 1 %4 = sub i32 %3, %min %xtraiter = and i32 %4, 1 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx.prol = getelementptr inbounds i8, ptr %array, i64 %0 %5 = sub nsw i64 %1, %0 %arrayidx3.prol = getelementptr inbounds i8, ptr %array, i64 %5 %6 = load i8, ptr %arrayidx.prol, align 1, !tbaa !14 %7 = load i8, ptr %arrayidx3.prol, align 1, !tbaa !14 store i8 %7, ptr %arrayidx.prol, align 1, !tbaa !14 store i8 %6, ptr %arrayidx3.prol, align 1, !tbaa !14 %indvars.iv.next.prol = add nsw i64 %0, 1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %8 = icmp eq i32 %div, %min br i1 %8, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %9 = sub nsw i64 %1, %indvars.iv %arrayidx3 = getelementptr inbounds i8, ptr %array, i64 %9 %10 = load i8, ptr %arrayidx, align 1, !tbaa !14 %11 = load i8, ptr %arrayidx3, align 1, !tbaa !14 store i8 %11, ptr %arrayidx, align 1, !tbaa !14 store i8 %10, ptr %arrayidx3, align 1, !tbaa !14 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next %12 = sub nsw i64 %1, %indvars.iv.next %arrayidx3.1 = getelementptr inbounds i8, ptr %array, i64 %12 %13 = load i8, ptr %arrayidx.1, align 1, !tbaa !14 %14 = load i8, ptr %arrayidx3.1, align 1, !tbaa !14 store i8 %14, ptr %arrayidx.1, align 1, !tbaa !14 store i8 %13, ptr %arrayidx3.1, align 1, !tbaa !14 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32 %exitcond.not.1 = icmp eq i32 %2, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !35 for.end: ; preds = %for.body.prol.loopexit, %for.body, %entry ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %var1, i32 %var2) ret i32 %spec.select } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min_int(i32 noundef %var1, i32 noundef %var2) local_unnamed_addr #5 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %var1, i32 %var2) ret i32 %spec.select } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable define dso_local i64 @pow_int(i32 noundef %base, i32 noundef %exponent) local_unnamed_addr #6 { entry: %conv = sitofp i32 %base to double %conv1 = uitofp i32 %exponent to double %call = tail call double @pow(double noundef %conv, double noundef %conv1) #23 %conv2 = fptosi double %call to i64 ret i64 %conv2 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #7 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @pow_int_mod(i32 noundef %base, i32 noundef %exponent, i32 noundef %mod) local_unnamed_addr #8 { entry: %cmp.not17 = icmp eq i32 %exponent, 0 br i1 %cmp.not17, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %conv1 = sext i32 %mod to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end6 %answer.020 = phi i64 [ 1, %while.body.lr.ph ], [ %answer.1, %if.end6 ] %base.addr.019 = phi i32 [ %base, %while.body.lr.ph ], [ %rem8, %if.end6 ] %exponent.addr.018 = phi i32 [ %exponent, %while.body.lr.ph ], [ %shr, %if.end6 ] %and = and i32 %exponent.addr.018, 1 %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %if.end6, label %if.then if.then: ; preds = %while.body %rem = srem i32 %base.addr.019, %mod %conv = sext i32 %rem to i64 %mul = mul nsw i64 %answer.020, %conv %rem2 = srem i64 %mul, %conv1 %cmp3 = icmp eq i64 %rem2, 0 br i1 %cmp3, label %while.end, label %if.end6 if.end6: ; preds = %if.then, %while.body %answer.1 = phi i64 [ %rem2, %if.then ], [ %answer.020, %while.body ] %mul7 = mul nsw i32 %base.addr.019, %base.addr.019 %rem8 = srem i32 %mul7, %mod %shr = lshr i32 %exponent.addr.018, 1 %cmp.not = icmp ult i32 %exponent.addr.018, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !36 while.end: ; preds = %if.end6, %if.then, %entry %answer.2 = phi i64 [ 1, %entry ], [ 0, %if.then ], [ %answer.1, %if.end6 ] ret i64 %answer.2 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @factorial(i32 noundef %num) local_unnamed_addr #9 { entry: %cmp.not4 = icmp ult i32 %num, 2 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add i32 %num, 1 %umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3) %wide.trip.count = zext i32 %umax to i64 %1 = add nsw i64 %wide.trip.count, -2 %2 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %1, 7 %3 = icmp ult i64 %2, 7 br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %1, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.7, %for.body ] %answer.06 = 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 i64 %answer.06, %indvars.iv %indvars.iv.next = or i64 %indvars.iv, 1 %mul.1 = mul i64 %mul, %indvars.iv.next %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %mul.2 = mul i64 %mul.1, %indvars.iv.next.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %mul.3 = mul i64 %mul.2, %indvars.iv.next.2 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %mul.4 = mul i64 %mul.3, %indvars.iv.next.3 %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5 %mul.5 = mul i64 %mul.4, %indvars.iv.next.4 %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv, 6 %mul.6 = mul i64 %mul.5, %indvars.iv.next.5 %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv, 7 %mul.7 = mul i64 %mul.6, %indvars.iv.next.6 %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 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 !37 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.7, %for.body ] %answer.06.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 %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ] %answer.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %answer.06.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 i64 %answer.06.epil, %indvars.iv.epil %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !38 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %answer.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @factorial_mod(i32 noundef %num, i32 noundef %mod) local_unnamed_addr #8 { entry: %cmp.not10 = icmp ult i32 %num, 2 br i1 %cmp.not10, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %conv1 = sext i32 %mod to i64 br label %for.body for.cond: ; preds = %for.body %add = add i32 %i.011, 1 %cmp.not = icmp ugt i32 %add, %num br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !40 for.body: ; preds = %for.body.lr.ph, %for.cond %answer.012 = phi i64 [ 1, %for.body.lr.ph ], [ %rem2, %for.cond ] %i.011 = phi i32 [ 2, %for.body.lr.ph ], [ %add, %for.cond ] %rem = urem i32 %i.011, %mod %conv = zext i32 %rem to i64 %mul = mul i64 %answer.012, %conv %rem2 = urem i64 %mul, %conv1 %cmp3 = icmp eq i64 %rem2, 0 br i1 %cmp3, label %for.end, label %for.cond for.end: ; preds = %for.cond, %for.body, %entry %answer.1 = phi i64 [ 1, %entry ], [ 0, %for.body ], [ %rem2, %for.cond ] ret i64 %answer.1 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @combination(i32 noundef %n, i32 noundef %k) local_unnamed_addr #9 { entry: %sub = sub i32 %n, %k %spec.select.i = tail call i32 @llvm.smin.i32(i32 %k, i32 %sub) %cmp.not13 = icmp ult i32 %spec.select.i, 2 br i1 %cmp.not13, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add i32 %n, 1 %0 = add i32 %spec.select.i, 1 %umax = tail call i32 @llvm.umax.i32(i32 %0, i32 3) %wide.trip.count = zext i32 %umax to i64 %1 = add nsw i64 %wide.trip.count, -2 %2 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %1, 3 %3 = icmp ult i64 %2, 3 br i1 %3, 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 %1, -4 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %indvars.iv = phi i64 [ 2, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ] %denominator.016 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul3.3, %for.body ] %numerator.015 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.3, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %4 = trunc i64 %indvars.iv to i32 %sub1 = sub i32 %add, %4 %conv = zext i32 %sub1 to i64 %mul = mul i64 %numerator.015, %conv %mul3 = mul i64 %denominator.016, %indvars.iv %indvars.iv.next = or i64 %indvars.iv, 1 %5 = trunc i64 %indvars.iv.next to i32 %sub1.1 = sub i32 %add, %5 %conv.1 = zext i32 %sub1.1 to i64 %mul.1 = mul i64 %mul, %conv.1 %mul3.1 = mul i64 %mul3, %indvars.iv.next %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %6 = trunc i64 %indvars.iv.next.1 to i32 %sub1.2 = sub i32 %add, %6 %conv.2 = zext i32 %sub1.2 to i64 %mul.2 = mul i64 %mul.1, %conv.2 %mul3.2 = mul i64 %mul3.1, %indvars.iv.next.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %7 = trunc i64 %indvars.iv.next.2 to i32 %sub1.3 = sub i32 %add, %7 %conv.3 = zext i32 %sub1.3 to i64 %mul.3 = mul i64 %mul.2, %conv.3 %mul3.3 = mul i64 %mul3.2, %indvars.iv.next.2 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !41 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ] %mul3.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul3.3, %for.body ] %indvars.iv.unr = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ] %denominator.016.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul3.3, %for.body ] %numerator.015.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ] %denominator.016.epil = phi i64 [ %mul3.epil, %for.body.epil ], [ %denominator.016.unr, %for.end.loopexit.unr-lcssa ] %numerator.015.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %numerator.015.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %8 = trunc i64 %indvars.iv.epil to i32 %sub1.epil = sub i32 %add, %8 %conv.epil = zext i32 %sub1.epil to i64 %mul.epil = mul i64 %numerator.015.epil, %conv.epil %mul3.epil = mul i64 %denominator.016.epil, %indvars.iv.epil %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !42 for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa %mul.lcssa = phi i64 [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] %mul3.lcssa = phi i64 [ %mul3.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul3.epil, %for.body.epil ] %9 = udiv i64 %mul.lcssa, %mul3.lcssa br label %for.end for.end: ; preds = %for.end.loopexit, %entry %div = phi i64 [ 1, %entry ], [ %9, %for.end.loopexit ] ret i64 %div } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local double @combination_general(double noundef %alpha, i32 noundef %k) local_unnamed_addr #9 { entry: %cmp.not10 = icmp eq i32 %k, 0 br i1 %cmp.not10, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = fadd double %alpha, 1.000000e+00 %0 = add i32 %k, 1 %umax = tail call i32 @llvm.umax.i32(i32 %0, i32 2) %wide.trip.count = zext i32 %umax to i64 %1 = add nsw i64 %wide.trip.count, -1 %2 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %1, 3 %3 = icmp ult i64 %2, 3 br i1 %3, 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 %1, -4 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %indvars.iv = phi i64 [ 1, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ] %denominator.013 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul2.3, %for.body ] %numerator.012 = phi double [ 1.000000e+00, %for.body.lr.ph.new ], [ %mul.3, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ] %4 = trunc i64 %indvars.iv to i32 %conv = uitofp i32 %4 to double %sub = fsub double %add, %conv %mul = fmul double %numerator.012, %sub %mul2 = mul i64 %denominator.013, %indvars.iv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = trunc i64 %indvars.iv.next to i32 %conv.1 = uitofp i32 %5 to double %sub.1 = fsub double %add, %conv.1 %mul.1 = fmul double %mul, %sub.1 %mul2.1 = mul i64 %mul2, %indvars.iv.next %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %6 = trunc i64 %indvars.iv.next.1 to i32 %conv.2 = uitofp i32 %6 to double %sub.2 = fsub double %add, %conv.2 %mul.2 = fmul double %mul.1, %sub.2 %mul2.2 = mul i64 %mul2.1, %indvars.iv.next.1 %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3 %7 = trunc i64 %indvars.iv.next.2 to i32 %conv.3 = uitofp i32 %7 to double %sub.3 = fsub double %add, %conv.3 %mul.3 = fmul double %mul.2, %sub.3 %mul2.3 = mul i64 %mul2.2, %indvars.iv.next.2 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !43 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %mul.lcssa.ph = phi double [ undef, %for.body.lr.ph ], [ %mul.3, %for.body ] %mul2.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul2.3, %for.body ] %indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ] %denominator.013.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul2.3, %for.body ] %numerator.012.unr = phi double [ 1.000000e+00, %for.body.lr.ph ], [ %mul.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ] %denominator.013.epil = phi i64 [ %mul2.epil, %for.body.epil ], [ %denominator.013.unr, %for.end.loopexit.unr-lcssa ] %numerator.012.epil = phi double [ %mul.epil, %for.body.epil ], [ %numerator.012.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %8 = trunc i64 %indvars.iv.epil to i32 %conv.epil = uitofp i32 %8 to double %sub.epil = fsub double %add, %conv.epil %mul.epil = fmul double %numerator.012.epil, %sub.epil %mul2.epil = mul i64 %denominator.013.epil, %indvars.iv.epil %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !44 for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa %mul.lcssa = phi double [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] %mul2.lcssa = phi i64 [ %mul2.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul2.epil, %for.body.epil ] %9 = uitofp i64 %mul2.lcssa to double %10 = fdiv double %mul.lcssa, %9 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %div = phi double [ 1.000000e+00, %entry ], [ %10, %for.end.loopexit ] ret double %div } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %spec.select8 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %rem = srem i32 %spec.select, %spec.select8 %cmp1.not9 = icmp eq i32 %rem, 0 br i1 %cmp1.not9, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %r.011 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ] %b.addr.110 = phi i32 [ %r.011, %while.body ], [ %spec.select8, %entry ] %rem2 = srem i32 %b.addr.110, %r.011 %cmp1.not = icmp eq i32 %rem2, 0 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !45 while.end: ; preds = %while.body, %entry %b.addr.1.lcssa = phi i32 [ %spec.select8, %entry ], [ %r.011, %while.body ] ret i32 %b.addr.1.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #9 { entry: %spec.select.i = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %spec.select8.i = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %rem.i = srem i32 %spec.select.i, %spec.select8.i %cmp1.not9.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not9.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %r.011.i = phi i32 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ] %b.addr.110.i = phi i32 [ %r.011.i, %while.body.i ], [ %spec.select8.i, %entry ] %rem2.i = srem i32 %b.addr.110.i, %r.011.i %cmp1.not.i = icmp eq i32 %rem2.i, 0 br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !45 gcd.exit: ; preds = %while.body.i, %entry %b.addr.1.lcssa.i = phi i32 [ %spec.select8.i, %entry ], [ %r.011.i, %while.body.i ] %div = sdiv i32 %a, %b.addr.1.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @order(i64 noundef %num) local_unnamed_addr #8 { entry: %cmp.not3 = icmp eq i64 %num, 0 br i1 %cmp.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %answer.05 = phi i32 [ %add, %while.body ], [ -1, %entry ] %num.addr.04 = phi i64 [ %div, %while.body ], [ %num, %entry ] %div = sdiv i64 %num.addr.04, 10 %add = add nsw i32 %answer.05, 1 %num.addr.04.off = add i64 %num.addr.04, 9 %cmp.not = icmp ult i64 %num.addr.04.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !46 while.end: ; preds = %while.body, %entry %answer.0.lcssa = phi i32 [ -1, %entry ], [ %add, %while.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @convert_adic_int(ptr nocapture noundef readonly %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 { entry: %call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #23 %cmp122.not = icmp eq i64 %call, 0 br i1 %cmp122.not, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true) %conv = zext i32 %q_adic to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %tmp.125 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ] %answer.024 = phi i64 [ 0, %while.body.lr.ph ], [ %add, %while.body ] %i.023 = phi i32 [ 0, %while.body.lr.ph ], [ %add4, %while.body ] %rem = urem i64 %tmp.125, %conv %conv1.i = uitofp i32 %i.023 to double %call.i = tail call double @pow(double noundef 1.000000e+01, double noundef %conv1.i) #23 %conv2.i = fptosi double %call.i to i64 %mul = mul nsw i64 %rem, %conv2.i %add = add nsw i64 %mul, %answer.024 %div = udiv i64 %tmp.125, %conv %add4 = add nuw nsw i32 %i.023, 1 %cmp1.not = icmp ult i64 %tmp.125, %conv br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !47 while.end: ; preds = %while.body, %entry %answer.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] %sub9 = sub nsw i64 0, %answer.0.lcssa %cmp621 = icmp slt i64 %call, 0 %retval.0 = select i1 %cmp621, i64 %sub9, i64 %answer.0.lcssa ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #11 ; Function Attrs: nofree nounwind uwtable define dso_local void @convert_adic_char(ptr nocapture noundef %num, i32 noundef %p_adic, i32 noundef %q_adic) local_unnamed_addr #10 { entry: %mod = alloca [32 x i32], align 16 call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %mod) #23 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %mod, i8 0, i64 128, i1 false) %call = tail call i64 @strtol(ptr nocapture noundef %num, ptr noundef null, i32 noundef %p_adic) #23 %cmp = icmp slt i64 %call, 0 %cmp174.not = icmp eq i64 %call, 0 br i1 %cmp174.not, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %spec.select = tail call i64 @llvm.abs.i64(i64 %call, i1 true) %conv = zext i32 %q_adic to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.body %indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %while.body ] %tmp.176 = phi i64 [ %spec.select, %while.body.lr.ph ], [ %div, %while.body ] %rem = urem i64 %tmp.176, %conv %conv2 = trunc i64 %rem to i32 %arrayidx = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv store i32 %conv2, ptr %arrayidx, align 4, !tbaa !5 %div = udiv i64 %tmp.176, %conv %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp1.not = icmp ult i64 %tmp.176, %conv br i1 %cmp1.not, label %while.end.loopexit, label %while.body, !llvm.loop !48 while.end.loopexit: ; preds = %while.body %0 = trunc i64 %indvars.iv to i32 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %digit.0.lcssa = phi i32 [ 0, %entry ], [ %0, %while.end.loopexit ] %call4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %num) #24 %1 = trunc i64 %call4 to i32 %conv6 = add i32 %1, -1 %cmp.not4.i = icmp slt i32 %conv6, 0 br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %while.end %2 = zext i32 %conv6 to i64 %3 = add nuw nsw i64 %2, 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %num, i8 0, i64 %3, i1 false), !tbaa !14 br label %fill_char.exit fill_char.exit: ; preds = %while.end, %for.body.preheader.i %call.lobit = lshr i64 %call, 63 %conv7 = trunc i64 %call.lobit to i32 br i1 %cmp, label %if.then10, label %if.end12 if.then10: ; preds = %fill_char.exit store i8 45, ptr %num, align 1, !tbaa !14 br label %if.end12 if.end12: ; preds = %if.then10, %fill_char.exit %add42 = add nuw nsw i32 %digit.0.lcssa, %conv7 %4 = add i32 %digit.0.lcssa, 1 %wide.trip.count = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 16 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %if.end12 %5 = add nsw i64 %wide.trip.count, -1 %6 = add i32 %digit.0.lcssa, %conv7 %7 = trunc i64 %5 to i32 %8 = sub i32 %6, %7 %9 = icmp sgt i32 %8, %6 %10 = icmp ugt i64 %5, 4294967295 %11 = or i1 %9, %10 br i1 %11, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %vector.scevcheck %n.vec = and i64 %wide.trip.count, 4294967292 %ind.end = sub nsw i64 0, %n.vec %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %q_adic, 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.continue95, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue95 ] %12 = trunc i64 %index to i32 %13 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = icmp slt <4 x i32> %wide.load, <i32 10, i32 10, i32 10, i32 10> %15 = icmp ult <4 x i32> %wide.load, %broadcast.splat %16 = xor <4 x i1> %14, <i1 true, i1 true, i1 true, i1 true> %17 = select <4 x i1> %16, <4 x i1> %15, <4 x i1> zeroinitializer %predphi = select <4 x i1> %17, <4 x i8> <i8 87, i8 87, i8 87, i8 87>, <4 x i8> <i8 48, i8 48, i8 48, i8 48> %18 = or <4 x i1> %17, %14 %19 = extractelement <4 x i1> %18, i64 0 br i1 %19, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %20 = sub i32 %add42, %12 %21 = sext i32 %20 to i64 %22 = bitcast <4 x i32> %wide.load to <16 x i8> %23 = extractelement <16 x i8> %22, i64 0 %24 = getelementptr inbounds i8, ptr %num, i64 %21 %25 = extractelement <4 x i8> %predphi, i64 0 %26 = add i8 %25, %23 store i8 %26, ptr %24, align 1, !tbaa !14 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %27 = extractelement <4 x i1> %18, i64 1 br i1 %27, label %pred.store.if90, label %pred.store.continue91 pred.store.if90: ; preds = %pred.store.continue %28 = xor i32 %12, -1 %29 = add i32 %add42, %28 %30 = sext i32 %29 to i64 %31 = bitcast <4 x i32> %wide.load to <16 x i8> %32 = extractelement <16 x i8> %31, i64 4 %33 = getelementptr inbounds i8, ptr %num, i64 %30 %34 = extractelement <4 x i8> %predphi, i64 1 %35 = add i8 %34, %32 store i8 %35, ptr %33, align 1, !tbaa !14 br label %pred.store.continue91 pred.store.continue91: ; preds = %pred.store.if90, %pred.store.continue %36 = extractelement <4 x i1> %18, i64 2 br i1 %36, label %pred.store.if92, label %pred.store.continue93 pred.store.if92: ; preds = %pred.store.continue91 %reass.sub = sub i32 %add42, %12 %37 = add i32 %reass.sub, -2 %38 = sext i32 %37 to i64 %39 = bitcast <4 x i32> %wide.load to <16 x i8> %40 = extractelement <16 x i8> %39, i64 8 %41 = getelementptr inbounds i8, ptr %num, i64 %38 %42 = extractelement <4 x i8> %predphi, i64 2 %43 = add i8 %42, %40 store i8 %43, ptr %41, align 1, !tbaa !14 br label %pred.store.continue93 pred.store.continue93: ; preds = %pred.store.if92, %pred.store.continue91 %44 = extractelement <4 x i1> %18, i64 3 br i1 %44, label %pred.store.if94, label %pred.store.continue95 pred.store.if94: ; preds = %pred.store.continue93 %reass.sub96 = sub i32 %add42, %12 %45 = add i32 %reass.sub96, -3 %46 = sext i32 %45 to i64 %47 = bitcast <4 x i32> %wide.load to <16 x i8> %48 = extractelement <16 x i8> %47, i64 12 %49 = getelementptr inbounds i8, ptr %num, i64 %46 %50 = extractelement <4 x i8> %predphi, i64 3 %51 = add i8 %50, %48 store i8 %51, ptr %49, align 1, !tbaa !14 br label %pred.store.continue95 pred.store.continue95: ; preds = %pred.store.if94, %pred.store.continue93 %index.next = add nuw i64 %index, 4 %52 = icmp eq i64 %index.next, %n.vec br i1 %52, label %middle.block, label %vector.body, !llvm.loop !49 middle.block: ; preds = %pred.store.continue95 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %vector.scevcheck, %if.end12, %middle.block %indvars.iv82.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %n.vec, %middle.block ] %indvars.iv80.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %if.end12 ], [ %ind.end, %middle.block ] %xtraiter = and i64 %wide.trip.count, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader %arrayidx16.prol = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82.ph %53 = load i32, ptr %arrayidx16.prol, align 16, !tbaa !5 %cmp17.prol = icmp slt i32 %53, 10 br i1 %cmp17.prol, label %for.inc.sink.split.prol, label %if.else.prol if.else.prol: ; preds = %for.body.prol %cmp32.prol = icmp ult i32 %53, %q_adic br i1 %cmp32.prol, label %for.inc.sink.split.prol, label %for.inc.prol for.inc.sink.split.prol: ; preds = %if.else.prol, %for.body.prol %.sink88.prol = phi i8 [ 48, %for.body.prol ], [ 87, %if.else.prol ] %54 = trunc i32 %53 to i8 %conv23.prol = add i8 %.sink88.prol, %54 %55 = trunc i64 %indvars.iv80.ph to i32 %sub27.prol = add i32 %add42, %55 %idxprom28.prol = sext i32 %sub27.prol to i64 %arrayidx29.prol = getelementptr inbounds i8, ptr %num, i64 %idxprom28.prol store i8 %conv23.prol, ptr %arrayidx29.prol, align 1, !tbaa !14 br label %for.inc.prol for.inc.prol: ; preds = %for.inc.sink.split.prol, %if.else.prol %indvars.iv.next83.prol = or i64 %indvars.iv82.ph, 1 %indvars.iv.next81.prol = add nsw i64 %indvars.iv80.ph, -1 br label %for.body.prol.loopexit for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader %indvars.iv82.unr = phi i64 [ %indvars.iv82.ph, %for.body.preheader ], [ %indvars.iv.next83.prol, %for.inc.prol ] %indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body.preheader ], [ %indvars.iv.next81.prol, %for.inc.prol ] %56 = sub nsw i64 0, %wide.trip.count %57 = xor i64 %indvars.iv82.ph, %56 %58 = icmp eq i64 %57, -1 br i1 %58, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.inc.1 %indvars.iv82 = phi i64 [ %indvars.iv.next83.1, %for.inc.1 ], [ %indvars.iv82.unr, %for.body.prol.loopexit ] %indvars.iv80 = phi i64 [ %indvars.iv.next81.1, %for.inc.1 ], [ %indvars.iv80.unr, %for.body.prol.loopexit ] %arrayidx16 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv82 %59 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp slt i32 %59, 10 br i1 %cmp17, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %cmp32 = icmp ult i32 %59, %q_adic br i1 %cmp32, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %for.body %.sink88 = phi i8 [ 48, %for.body ], [ 87, %if.else ] %60 = trunc i32 %59 to i8 %conv23 = add i8 %.sink88, %60 %61 = trunc i64 %indvars.iv80 to i32 %sub27 = add i32 %add42, %61 %idxprom28 = sext i32 %sub27 to i64 %arrayidx29 = getelementptr inbounds i8, ptr %num, i64 %idxprom28 store i8 %conv23, ptr %arrayidx29, align 1, !tbaa !14 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %arrayidx16.1 = getelementptr inbounds [32 x i32], ptr %mod, i64 0, i64 %indvars.iv.next83 %62 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %cmp17.1 = icmp slt i32 %62, 10 br i1 %cmp17.1, label %for.inc.sink.split.1, label %if.else.1 if.else.1: ; preds = %for.inc %cmp32.1 = icmp ult i32 %62, %q_adic br i1 %cmp32.1, label %for.inc.sink.split.1, label %for.inc.1 for.inc.sink.split.1: ; preds = %if.else.1, %for.inc %.sink88.1 = phi i8 [ 48, %for.inc ], [ 87, %if.else.1 ] %63 = trunc i32 %62 to i8 %conv23.1 = add i8 %.sink88.1, %63 %64 = trunc i64 %indvars.iv80 to i32 %65 = add i32 %64, -1 %sub27.1 = add i32 %add42, %65 %idxprom28.1 = sext i32 %sub27.1 to i64 %arrayidx29.1 = getelementptr inbounds i8, ptr %num, i64 %idxprom28.1 store i8 %conv23.1, ptr %arrayidx29.1, align 1, !tbaa !14 br label %for.inc.1 for.inc.1: ; preds = %for.inc.sink.split.1, %if.else.1 %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2 %indvars.iv.next81.1 = add nsw i64 %indvars.iv80, -2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next83.1, %wide.trip.count br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !50 for.end: ; preds = %for.body.prol.loopexit, %for.inc.1, %middle.block call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %mod) #23 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #13 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @count_mod(i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #14 { entry: %cmp = icmp sgt i32 %min, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %div = sdiv i32 %max, %num %sub = add nsw i32 %min, -1 %div1 = sdiv i32 %sub, %num %sub2 = sub nsw i32 %div, %div1 br label %return if.else: ; preds = %entry %cmp3 = icmp eq i32 %min, 0 br i1 %cmp3, label %if.then4, label %return if.then4: ; preds = %if.else %div5 = sdiv i32 %max, %num %add = add nsw i32 %div5, 1 br label %return return: ; preds = %if.else, %if.then4, %if.then %retval.0 = phi i32 [ %sub2, %if.then ], [ %add, %if.then4 ], [ -1, %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @shift_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i32 noundef %num) local_unnamed_addr #15 { entry: %array39 = ptrtoint ptr %array to i64 %cmp.not24 = icmp slt i32 %max, %min br i1 %cmp.not24, label %for.cond3.preheader, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %num to i64 %2 = sext i32 %min to i64 %invariant.gep = getelementptr i8, ptr %array, i64 %1 %3 = add nsw i64 %0, 1 %4 = sub nsw i64 %3, %2 %min.iters.check = icmp ult i64 %4, 4 br i1 %min.iters.check, label %for.body.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %5 = sub nsw i64 %0, %2 %6 = getelementptr i8, ptr %array, i64 %1 %scevgep34 = getelementptr i8, ptr %6, i64 %0 %7 = sub nsw i64 0, %5 %8 = getelementptr i8, ptr %scevgep34, i64 %7 %9 = icmp ugt ptr %8, %scevgep34 %scevgep35 = getelementptr i8, ptr %array, i64 %0 %10 = sub nsw i64 0, %5 %11 = getelementptr i8, ptr %scevgep35, i64 %10 %12 = icmp ugt ptr %11, %scevgep35 %13 = or i1 %9, %12 br i1 %13, label %for.body.preheader, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %14 = add i64 %array39, %0 %15 = add i64 %array39, %1 %16 = add i64 %15, %0 %17 = sub i64 %14, %16 %diff.check = icmp ult i64 %17, 16 br i1 %diff.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check40 = icmp ult i64 %4, 16 br i1 %min.iters.check40, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, -16 %invariant.gep52 = getelementptr i8, ptr %array, i64 -15 %invariant.gep54 = getelementptr i8, ptr %invariant.gep, i64 -15 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %0, %index %gep53 = getelementptr i8, ptr %invariant.gep52, i64 %offset.idx %wide.load = load <16 x i8>, ptr %gep53, align 1, !tbaa !14 %gep55 = getelementptr i8, ptr %invariant.gep54, i64 %offset.idx store <16 x i8> %wide.load, ptr %gep55, align 1, !tbaa !14 %index.next = add nuw i64 %index, 16 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !51 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.cond3.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end44 = sub nsw i64 %0, %n.vec %n.vec.remaining = and i64 %4, 12 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec43 = and i64 %4, -4 %ind.end = sub nsw i64 %0, %n.vec43 %invariant.gep56 = getelementptr i8, ptr %array, i64 -3 %invariant.gep58 = getelementptr i8, ptr %invariant.gep, i64 -3 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index46 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next51, %vec.epilog.vector.body ] %offset.idx47 = sub i64 %0, %index46 %gep57 = getelementptr i8, ptr %invariant.gep56, i64 %offset.idx47 %wide.load48 = load <4 x i8>, ptr %gep57, align 1, !tbaa !14 %gep59 = getelementptr i8, ptr %invariant.gep58, i64 %offset.idx47 store <4 x i8> %wide.load48, ptr %gep59, align 1, !tbaa !14 %index.next51 = add nuw i64 %index46, 4 %19 = icmp eq i64 %index.next51, %n.vec43 br i1 %19, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !52 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n45 = icmp eq i64 %4, %n.vec43 br i1 %cmp.n45, label %for.cond3.preheader, label %for.body.preheader for.body.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %0, %vector.memcheck ], [ %0, %vector.scevcheck ], [ %ind.end44, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] br label %for.body for.cond3.preheader: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry %cmp6.not.not26 = icmp sgt i32 %num, 0 br i1 %cmp6.not.not26, label %for.body7.preheader, label %for.end12 for.body7.preheader: ; preds = %for.cond3.preheader %add4 = add i32 %num, %min %20 = sext i32 %min to i64 %scevgep = getelementptr i8, ptr %array, i64 %20 %21 = add i32 %min, 1 %smax = tail call i32 @llvm.smax.i32(i32 %add4, i32 %21) %22 = xor i32 %min, -1 %23 = add i32 %smax, %22 %24 = zext i32 %23 to i64 %25 = add nuw nsw i64 %24, 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %25, i1 false), !tbaa !14 br label %for.end12 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %26 = load i8, ptr %arrayidx, align 1, !tbaa !14 %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv store i8 %26, ptr %gep, align 1, !tbaa !14 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp.not.not = icmp sgt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !53 for.end12: ; preds = %for.body7.preheader, %for.cond3.preheader ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @convert_char(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %pre, i8 noundef signext %post) local_unnamed_addr #4 { entry: %cmp.not11 = icmp sgt i32 %min, %max br i1 %cmp.not11, label %for.end, label %iter.check iter.check: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check14 = icmp ult i32 %2, 31 br i1 %min.iters.check14, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %4, 8589934560 %broadcast.splatinsert = insertelement <16 x i8> poison, i8 %pre, i64 0 %broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer %invariant.gep = getelementptr i8, ptr %array, i64 1 %invariant.gep104 = getelementptr i8, ptr %array, i64 2 %invariant.gep106 = getelementptr i8, ptr %array, i64 3 %invariant.gep108 = getelementptr i8, ptr %array, i64 4 %invariant.gep110 = getelementptr i8, ptr %array, i64 5 %invariant.gep112 = getelementptr i8, ptr %array, i64 6 %invariant.gep114 = getelementptr i8, ptr %array, i64 7 %invariant.gep116 = getelementptr i8, ptr %array, i64 8 %invariant.gep118 = getelementptr i8, ptr %array, i64 9 %invariant.gep120 = getelementptr i8, ptr %array, i64 10 %invariant.gep122 = getelementptr i8, ptr %array, i64 11 %invariant.gep124 = getelementptr i8, ptr %array, i64 12 %invariant.gep126 = getelementptr i8, ptr %array, i64 13 %invariant.gep128 = getelementptr i8, ptr %array, i64 14 %invariant.gep130 = getelementptr i8, ptr %array, i64 15 %invariant.gep132 = getelementptr i8, ptr %array, i64 16 %invariant.gep134 = getelementptr i8, ptr %array, i64 17 %invariant.gep136 = getelementptr i8, ptr %array, i64 18 %invariant.gep138 = getelementptr i8, ptr %array, i64 19 %invariant.gep140 = getelementptr i8, ptr %array, i64 20 %invariant.gep142 = getelementptr i8, ptr %array, i64 21 %invariant.gep144 = getelementptr i8, ptr %array, i64 22 %invariant.gep146 = getelementptr i8, ptr %array, i64 23 %invariant.gep148 = getelementptr i8, ptr %array, i64 24 %invariant.gep150 = getelementptr i8, ptr %array, i64 25 %invariant.gep152 = getelementptr i8, ptr %array, i64 26 %invariant.gep154 = getelementptr i8, ptr %array, i64 27 %invariant.gep156 = getelementptr i8, ptr %array, i64 28 %invariant.gep158 = getelementptr i8, ptr %array, i64 29 %invariant.gep160 = getelementptr i8, ptr %array, i64 30 %invariant.gep162 = getelementptr i8, ptr %array, i64 31 br label %vector.body vector.body: ; preds = %pred.store.continue77, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue77 ] %offset.idx = add i64 %index, %0 %5 = getelementptr inbounds i8, ptr %array, i64 %offset.idx %wide.load = load <16 x i8>, ptr %5, align 1, !tbaa !14 %6 = getelementptr inbounds i8, ptr %5, i64 16 %wide.load15 = load <16 x i8>, ptr %6, align 1, !tbaa !14 %7 = icmp eq <16 x i8> %wide.load, %broadcast.splat %8 = icmp eq <16 x i8> %wide.load15, %broadcast.splat %9 = extractelement <16 x i1> %7, i64 0 br i1 %9, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body %10 = getelementptr inbounds i8, ptr %array, i64 %offset.idx store i8 %post, ptr %10, align 1, !tbaa !14 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body %11 = extractelement <16 x i1> %7, i64 1 br i1 %11, label %pred.store.if16, label %pred.store.continue17 pred.store.if16: ; preds = %pred.store.continue %gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx store i8 %post, ptr %gep, align 1, !tbaa !14 br label %pred.store.continue17 pred.store.continue17: ; preds = %pred.store.if16, %pred.store.continue %12 = extractelement <16 x i1> %7, i64 2 br i1 %12, label %pred.store.if18, label %pred.store.continue19 pred.store.if18: ; preds = %pred.store.continue17 %gep105 = getelementptr i8, ptr %invariant.gep104, i64 %offset.idx store i8 %post, ptr %gep105, align 1, !tbaa !14 br label %pred.store.continue19 pred.store.continue19: ; preds = %pred.store.if18, %pred.store.continue17 %13 = extractelement <16 x i1> %7, i64 3 br i1 %13, label %pred.store.if20, label %pred.store.continue21 pred.store.if20: ; preds = %pred.store.continue19 %gep107 = getelementptr i8, ptr %invariant.gep106, i64 %offset.idx store i8 %post, ptr %gep107, align 1, !tbaa !14 br label %pred.store.continue21 pred.store.continue21: ; preds = %pred.store.if20, %pred.store.continue19 %14 = extractelement <16 x i1> %7, i64 4 br i1 %14, label %pred.store.if22, label %pred.store.continue23 pred.store.if22: ; preds = %pred.store.continue21 %gep109 = getelementptr i8, ptr %invariant.gep108, i64 %offset.idx store i8 %post, ptr %gep109, align 1, !tbaa !14 br label %pred.store.continue23 pred.store.continue23: ; preds = %pred.store.if22, %pred.store.continue21 %15 = extractelement <16 x i1> %7, i64 5 br i1 %15, label %pred.store.if24, label %pred.store.continue25 pred.store.if24: ; preds = %pred.store.continue23 %gep111 = getelementptr i8, ptr %invariant.gep110, i64 %offset.idx store i8 %post, ptr %gep111, align 1, !tbaa !14 br label %pred.store.continue25 pred.store.continue25: ; preds = %pred.store.if24, %pred.store.continue23 %16 = extractelement <16 x i1> %7, i64 6 br i1 %16, label %pred.store.if26, label %pred.store.continue27 pred.store.if26: ; preds = %pred.store.continue25 %gep113 = getelementptr i8, ptr %invariant.gep112, i64 %offset.idx store i8 %post, ptr %gep113, align 1, !tbaa !14 br label %pred.store.continue27 pred.store.continue27: ; preds = %pred.store.if26, %pred.store.continue25 %17 = extractelement <16 x i1> %7, i64 7 br i1 %17, label %pred.store.if28, label %pred.store.continue29 pred.store.if28: ; preds = %pred.store.continue27 %gep115 = getelementptr i8, ptr %invariant.gep114, i64 %offset.idx store i8 %post, ptr %gep115, align 1, !tbaa !14 br label %pred.store.continue29 pred.store.continue29: ; preds = %pred.store.if28, %pred.store.continue27 %18 = extractelement <16 x i1> %7, i64 8 br i1 %18, label %pred.store.if30, label %pred.store.continue31 pred.store.if30: ; preds = %pred.store.continue29 %gep117 = getelementptr i8, ptr %invariant.gep116, i64 %offset.idx store i8 %post, ptr %gep117, align 1, !tbaa !14 br label %pred.store.continue31 pred.store.continue31: ; preds = %pred.store.if30, %pred.store.continue29 %19 = extractelement <16 x i1> %7, i64 9 br i1 %19, label %pred.store.if32, label %pred.store.continue33 pred.store.if32: ; preds = %pred.store.continue31 %gep119 = getelementptr i8, ptr %invariant.gep118, i64 %offset.idx store i8 %post, ptr %gep119, align 1, !tbaa !14 br label %pred.store.continue33 pred.store.continue33: ; preds = %pred.store.if32, %pred.store.continue31 %20 = extractelement <16 x i1> %7, i64 10 br i1 %20, label %pred.store.if34, label %pred.store.continue35 pred.store.if34: ; preds = %pred.store.continue33 %gep121 = getelementptr i8, ptr %invariant.gep120, i64 %offset.idx store i8 %post, ptr %gep121, align 1, !tbaa !14 br label %pred.store.continue35 pred.store.continue35: ; preds = %pred.store.if34, %pred.store.continue33 %21 = extractelement <16 x i1> %7, i64 11 br i1 %21, label %pred.store.if36, label %pred.store.continue37 pred.store.if36: ; preds = %pred.store.continue35 %gep123 = getelementptr i8, ptr %invariant.gep122, i64 %offset.idx store i8 %post, ptr %gep123, align 1, !tbaa !14 br label %pred.store.continue37 pred.store.continue37: ; preds = %pred.store.if36, %pred.store.continue35 %22 = extractelement <16 x i1> %7, i64 12 br i1 %22, label %pred.store.if38, label %pred.store.continue39 pred.store.if38: ; preds = %pred.store.continue37 %gep125 = getelementptr i8, ptr %invariant.gep124, i64 %offset.idx store i8 %post, ptr %gep125, align 1, !tbaa !14 br label %pred.store.continue39 pred.store.continue39: ; preds = %pred.store.if38, %pred.store.continue37 %23 = extractelement <16 x i1> %7, i64 13 br i1 %23, label %pred.store.if40, label %pred.store.continue41 pred.store.if40: ; preds = %pred.store.continue39 %gep127 = getelementptr i8, ptr %invariant.gep126, i64 %offset.idx store i8 %post, ptr %gep127, align 1, !tbaa !14 br label %pred.store.continue41 pred.store.continue41: ; preds = %pred.store.if40, %pred.store.continue39 %24 = extractelement <16 x i1> %7, i64 14 br i1 %24, label %pred.store.if42, label %pred.store.continue43 pred.store.if42: ; preds = %pred.store.continue41 %gep129 = getelementptr i8, ptr %invariant.gep128, i64 %offset.idx store i8 %post, ptr %gep129, align 1, !tbaa !14 br label %pred.store.continue43 pred.store.continue43: ; preds = %pred.store.if42, %pred.store.continue41 %25 = extractelement <16 x i1> %7, i64 15 br i1 %25, label %pred.store.if44, label %pred.store.continue45 pred.store.if44: ; preds = %pred.store.continue43 %gep131 = getelementptr i8, ptr %invariant.gep130, i64 %offset.idx store i8 %post, ptr %gep131, align 1, !tbaa !14 br label %pred.store.continue45 pred.store.continue45: ; preds = %pred.store.if44, %pred.store.continue43 %26 = extractelement <16 x i1> %8, i64 0 br i1 %26, label %pred.store.if46, label %pred.store.continue47 pred.store.if46: ; preds = %pred.store.continue45 %gep133 = getelementptr i8, ptr %invariant.gep132, i64 %offset.idx store i8 %post, ptr %gep133, align 1, !tbaa !14 br label %pred.store.continue47 pred.store.continue47: ; preds = %pred.store.if46, %pred.store.continue45 %27 = extractelement <16 x i1> %8, i64 1 br i1 %27, label %pred.store.if48, label %pred.store.continue49 pred.store.if48: ; preds = %pred.store.continue47 %gep135 = getelementptr i8, ptr %invariant.gep134, i64 %offset.idx store i8 %post, ptr %gep135, align 1, !tbaa !14 br label %pred.store.continue49 pred.store.continue49: ; preds = %pred.store.if48, %pred.store.continue47 %28 = extractelement <16 x i1> %8, i64 2 br i1 %28, label %pred.store.if50, label %pred.store.continue51 pred.store.if50: ; preds = %pred.store.continue49 %gep137 = getelementptr i8, ptr %invariant.gep136, i64 %offset.idx store i8 %post, ptr %gep137, align 1, !tbaa !14 br label %pred.store.continue51 pred.store.continue51: ; preds = %pred.store.if50, %pred.store.continue49 %29 = extractelement <16 x i1> %8, i64 3 br i1 %29, label %pred.store.if52, label %pred.store.continue53 pred.store.if52: ; preds = %pred.store.continue51 %gep139 = getelementptr i8, ptr %invariant.gep138, i64 %offset.idx store i8 %post, ptr %gep139, align 1, !tbaa !14 br label %pred.store.continue53 pred.store.continue53: ; preds = %pred.store.if52, %pred.store.continue51 %30 = extractelement <16 x i1> %8, i64 4 br i1 %30, label %pred.store.if54, label %pred.store.continue55 pred.store.if54: ; preds = %pred.store.continue53 %gep141 = getelementptr i8, ptr %invariant.gep140, i64 %offset.idx store i8 %post, ptr %gep141, align 1, !tbaa !14 br label %pred.store.continue55 pred.store.continue55: ; preds = %pred.store.if54, %pred.store.continue53 %31 = extractelement <16 x i1> %8, i64 5 br i1 %31, label %pred.store.if56, label %pred.store.continue57 pred.store.if56: ; preds = %pred.store.continue55 %gep143 = getelementptr i8, ptr %invariant.gep142, i64 %offset.idx store i8 %post, ptr %gep143, align 1, !tbaa !14 br label %pred.store.continue57 pred.store.continue57: ; preds = %pred.store.if56, %pred.store.continue55 %32 = extractelement <16 x i1> %8, i64 6 br i1 %32, label %pred.store.if58, label %pred.store.continue59 pred.store.if58: ; preds = %pred.store.continue57 %gep145 = getelementptr i8, ptr %invariant.gep144, i64 %offset.idx store i8 %post, ptr %gep145, align 1, !tbaa !14 br label %pred.store.continue59 pred.store.continue59: ; preds = %pred.store.if58, %pred.store.continue57 %33 = extractelement <16 x i1> %8, i64 7 br i1 %33, label %pred.store.if60, label %pred.store.continue61 pred.store.if60: ; preds = %pred.store.continue59 %gep147 = getelementptr i8, ptr %invariant.gep146, i64 %offset.idx store i8 %post, ptr %gep147, align 1, !tbaa !14 br label %pred.store.continue61 pred.store.continue61: ; preds = %pred.store.if60, %pred.store.continue59 %34 = extractelement <16 x i1> %8, i64 8 br i1 %34, label %pred.store.if62, label %pred.store.continue63 pred.store.if62: ; preds = %pred.store.continue61 %gep149 = getelementptr i8, ptr %invariant.gep148, i64 %offset.idx store i8 %post, ptr %gep149, align 1, !tbaa !14 br label %pred.store.continue63 pred.store.continue63: ; preds = %pred.store.if62, %pred.store.continue61 %35 = extractelement <16 x i1> %8, i64 9 br i1 %35, label %pred.store.if64, label %pred.store.continue65 pred.store.if64: ; preds = %pred.store.continue63 %gep151 = getelementptr i8, ptr %invariant.gep150, i64 %offset.idx store i8 %post, ptr %gep151, align 1, !tbaa !14 br label %pred.store.continue65 pred.store.continue65: ; preds = %pred.store.if64, %pred.store.continue63 %36 = extractelement <16 x i1> %8, i64 10 br i1 %36, label %pred.store.if66, label %pred.store.continue67 pred.store.if66: ; preds = %pred.store.continue65 %gep153 = getelementptr i8, ptr %invariant.gep152, i64 %offset.idx store i8 %post, ptr %gep153, align 1, !tbaa !14 br label %pred.store.continue67 pred.store.continue67: ; preds = %pred.store.if66, %pred.store.continue65 %37 = extractelement <16 x i1> %8, i64 11 br i1 %37, label %pred.store.if68, label %pred.store.continue69 pred.store.if68: ; preds = %pred.store.continue67 %gep155 = getelementptr i8, ptr %invariant.gep154, i64 %offset.idx store i8 %post, ptr %gep155, align 1, !tbaa !14 br label %pred.store.continue69 pred.store.continue69: ; preds = %pred.store.if68, %pred.store.continue67 %38 = extractelement <16 x i1> %8, i64 12 br i1 %38, label %pred.store.if70, label %pred.store.continue71 pred.store.if70: ; preds = %pred.store.continue69 %gep157 = getelementptr i8, ptr %invariant.gep156, i64 %offset.idx store i8 %post, ptr %gep157, align 1, !tbaa !14 br label %pred.store.continue71 pred.store.continue71: ; preds = %pred.store.if70, %pred.store.continue69 %39 = extractelement <16 x i1> %8, i64 13 br i1 %39, label %pred.store.if72, label %pred.store.continue73 pred.store.if72: ; preds = %pred.store.continue71 %gep159 = getelementptr i8, ptr %invariant.gep158, i64 %offset.idx store i8 %post, ptr %gep159, align 1, !tbaa !14 br label %pred.store.continue73 pred.store.continue73: ; preds = %pred.store.if72, %pred.store.continue71 %40 = extractelement <16 x i1> %8, i64 14 br i1 %40, label %pred.store.if74, label %pred.store.continue75 pred.store.if74: ; preds = %pred.store.continue73 %gep161 = getelementptr i8, ptr %invariant.gep160, i64 %offset.idx store i8 %post, ptr %gep161, align 1, !tbaa !14 br label %pred.store.continue75 pred.store.continue75: ; preds = %pred.store.if74, %pred.store.continue73 %41 = extractelement <16 x i1> %8, i64 15 br i1 %41, label %pred.store.if76, label %pred.store.continue77 pred.store.if76: ; preds = %pred.store.continue75 %gep163 = getelementptr i8, ptr %invariant.gep162, i64 %offset.idx store i8 %post, ptr %gep163, align 1, !tbaa !14 br label %pred.store.continue77 pred.store.continue77: ; preds = %pred.store.if76, %pred.store.continue75 %index.next = add nuw i64 %index, 32 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %middle.block, label %vector.body, !llvm.loop !54 middle.block: ; preds = %pred.store.continue77 %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end80 = add nsw i64 %n.vec, %0 %n.vec.remaining = and i64 %4, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec79 = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec79, %0 %broadcast.splatinsert85 = insertelement <8 x i8> poison, i8 %pre, i64 0 %broadcast.splat86 = shufflevector <8 x i8> %broadcast.splatinsert85, <8 x i8> poison, <8 x i32> zeroinitializer %invariant.gep164 = getelementptr i8, ptr %array, i64 1 %invariant.gep166 = getelementptr i8, ptr %array, i64 2 %invariant.gep168 = getelementptr i8, ptr %array, i64 3 %invariant.gep170 = getelementptr i8, ptr %array, i64 4 %invariant.gep172 = getelementptr i8, ptr %array, i64 5 %invariant.gep174 = getelementptr i8, ptr %array, i64 6 %invariant.gep176 = getelementptr i8, ptr %array, i64 7 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %pred.store.continue102, %vec.epilog.ph %index82 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next103, %pred.store.continue102 ] %offset.idx83 = add i64 %index82, %0 %43 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83 %wide.load84 = load <8 x i8>, ptr %43, align 1, !tbaa !14 %44 = icmp eq <8 x i8> %wide.load84, %broadcast.splat86 %45 = extractelement <8 x i1> %44, i64 0 br i1 %45, label %pred.store.if87, label %pred.store.continue88 pred.store.if87: ; preds = %vec.epilog.vector.body %46 = getelementptr inbounds i8, ptr %array, i64 %offset.idx83 store i8 %post, ptr %46, align 1, !tbaa !14 br label %pred.store.continue88 pred.store.continue88: ; preds = %pred.store.if87, %vec.epilog.vector.body %47 = extractelement <8 x i1> %44, i64 1 br i1 %47, label %pred.store.if89, label %pred.store.continue90 pred.store.if89: ; preds = %pred.store.continue88 %gep165 = getelementptr i8, ptr %invariant.gep164, i64 %offset.idx83 store i8 %post, ptr %gep165, align 1, !tbaa !14 br label %pred.store.continue90 pred.store.continue90: ; preds = %pred.store.if89, %pred.store.continue88 %48 = extractelement <8 x i1> %44, i64 2 br i1 %48, label %pred.store.if91, label %pred.store.continue92 pred.store.if91: ; preds = %pred.store.continue90 %gep167 = getelementptr i8, ptr %invariant.gep166, i64 %offset.idx83 store i8 %post, ptr %gep167, align 1, !tbaa !14 br label %pred.store.continue92 pred.store.continue92: ; preds = %pred.store.if91, %pred.store.continue90 %49 = extractelement <8 x i1> %44, i64 3 br i1 %49, label %pred.store.if93, label %pred.store.continue94 pred.store.if93: ; preds = %pred.store.continue92 %gep169 = getelementptr i8, ptr %invariant.gep168, i64 %offset.idx83 store i8 %post, ptr %gep169, align 1, !tbaa !14 br label %pred.store.continue94 pred.store.continue94: ; preds = %pred.store.if93, %pred.store.continue92 %50 = extractelement <8 x i1> %44, i64 4 br i1 %50, label %pred.store.if95, label %pred.store.continue96 pred.store.if95: ; preds = %pred.store.continue94 %gep171 = getelementptr i8, ptr %invariant.gep170, i64 %offset.idx83 store i8 %post, ptr %gep171, align 1, !tbaa !14 br label %pred.store.continue96 pred.store.continue96: ; preds = %pred.store.if95, %pred.store.continue94 %51 = extractelement <8 x i1> %44, i64 5 br i1 %51, label %pred.store.if97, label %pred.store.continue98 pred.store.if97: ; preds = %pred.store.continue96 %gep173 = getelementptr i8, ptr %invariant.gep172, i64 %offset.idx83 store i8 %post, ptr %gep173, align 1, !tbaa !14 br label %pred.store.continue98 pred.store.continue98: ; preds = %pred.store.if97, %pred.store.continue96 %52 = extractelement <8 x i1> %44, i64 6 br i1 %52, label %pred.store.if99, label %pred.store.continue100 pred.store.if99: ; preds = %pred.store.continue98 %gep175 = getelementptr i8, ptr %invariant.gep174, i64 %offset.idx83 store i8 %post, ptr %gep175, align 1, !tbaa !14 br label %pred.store.continue100 pred.store.continue100: ; preds = %pred.store.if99, %pred.store.continue98 %53 = extractelement <8 x i1> %44, i64 7 br i1 %53, label %pred.store.if101, label %pred.store.continue102 pred.store.if101: ; preds = %pred.store.continue100 %gep177 = getelementptr i8, ptr %invariant.gep176, i64 %offset.idx83 store i8 %post, ptr %gep177, align 1, !tbaa !14 br label %pred.store.continue102 pred.store.continue102: ; preds = %pred.store.if101, %pred.store.continue100 %index.next103 = add nuw i64 %index82, 8 %54 = icmp eq i64 %index.next103, %n.vec79 br i1 %54, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !55 vec.epilog.middle.block: ; preds = %pred.store.continue102 %cmp.n81 = icmp eq i64 %4, %n.vec79 br i1 %cmp.n81, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %0, %iter.check ], [ %ind.end80, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %55 = load i8, ptr %arrayidx, align 1, !tbaa !14 %cmp2 = icmp eq i8 %55, %pre br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.body store i8 %post, ptr %arrayidx, align 1, !tbaa !14 br label %for.inc for.inc: ; preds = %for.body, %if.then %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !56 for.end: ; preds = %for.inc, %middle.block, %vec.epilog.middle.block, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_asc_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next34 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !57 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next34 = add nsw i64 %indvars.iv33, 1 %cmp2.not26.not = icmp slt i64 %indvars.iv33, %0 br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ] %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %4, %5 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next31 = add nsw i64 %indvars.iv30, 1 %cmp2.not.not = icmp slt i64 %indvars.iv30, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !58 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_des_int(ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #4 { entry: %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %max to i64 %1 = sext i32 %min to i64 %2 = add i32 %max, 1 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next34 to i32 %exitcond.not = icmp eq i32 %2, %lftr.wideiv br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !59 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv33 = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next34, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next34 = add nsw i64 %indvars.iv33, 1 %cmp2.not26.not = icmp slt i64 %indvars.iv33, %0 br i1 %cmp2.not26.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %3 = sext i32 %indvars.iv to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv30 = phi i64 [ %3, %for.body3.lr.ph ], [ %indvars.iv.next31, %for.inc ] %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv30 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp slt i32 %4, %5 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next31 = add nsw i64 %indvars.iv30, 1 %cmp2.not.not = icmp slt i64 %indvars.iv30, %0 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !60 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_asc_char_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 { entry: %0 = zext i32 %size to i64 %cmp.not29 = icmp sgt i32 %min, %max %cmp.not6.i = icmp slt i32 %size, 1 %or.cond = or i1 %cmp.not29, %cmp.not6.i br i1 %or.cond, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = sext i32 %max to i64 %2 = sext i32 %min to i64 %3 = add i32 %max, 1 %4 = add nsw i64 %2, 1 %5 = add i32 %min, 1 %min.iters.check = icmp ult i32 %size, 8 %min.iters.check45 = icmp ult i32 %size, 32 %n.vec = and i64 %0, 4294967264 %cmp.n = icmp eq i64 %n.vec, %0 %n.vec.remaining = and i64 %0, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 %n.vec50 = and i64 %0, 4294967288 %cmp.n51 = icmp eq i64 %n.vec50, %0 %xtraiter = and i64 %0, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %6 = sub nsw i64 0, %0 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next38 to i32 %exitcond.not = icmp eq i32 %3, %lftr.wideiv %indvar.next = add i64 %indvar, 1 br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !61 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %7 = add i64 %indvar, %2 %8 = mul i64 %7, %0 %scevgep = getelementptr i8, ptr %array, i64 %8 %9 = add i64 %4, %indvar %10 = mul i64 %9, %0 %scevgep40 = getelementptr i8, ptr %array, i64 %10 %11 = trunc i64 %indvar to i32 %12 = add i32 %5, %11 %13 = sext i32 %12 to i64 %14 = add nsw i64 %13, 1 %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next38 = add nsw i64 %indvars.iv37, 1 %cmp2.not27.not = icmp slt i64 %indvars.iv37, %1 br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %15 = sext i32 %indvars.iv to i64 %16 = mul nsw i64 %indvars.iv37, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %16 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ] %indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ] %17 = add i64 %indvar41, %13 %18 = mul i64 %17, %0 %scevgep43 = getelementptr i8, ptr %array, i64 %18 %19 = add i64 %14, %indvar41 %20 = mul i64 %19, %0 %scevgep44 = getelementptr i8, ptr %array, i64 %20 %21 = mul nsw i64 %indvars.iv34, %0 %arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #24 %cmp6 = icmp slt i32 %call, 1 br i1 %cmp6, label %for.inc, label %iter.check iter.check: ; preds = %for.body3 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %bound0 = icmp ult ptr %scevgep, %scevgep44 %bound1 = icmp ult ptr %scevgep43, %scevgep40 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body vector.body: ; preds = %vector.main.loop.iter.check, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ] %22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index %23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index %wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !62, !noalias !65 %24 = getelementptr inbounds i8, ptr %22, i64 16 %wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !62, !noalias !65 %wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !65 %25 = getelementptr inbounds i8, ptr %23, i64 16 %wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !65 store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !62, !noalias !65 store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !62, !noalias !65 store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !65 store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !65 %index.next = add nuw i64 %index, 32 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !67 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ] %27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52 %28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52 %wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !68, !noalias !71 %wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !71 store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !68, !noalias !71 store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !71 %index.next55 = add nuw i64 %index52, 8 %29 = icmp eq i64 %index.next55, %n.vec50 br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !73 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ] br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol for.body.i.prol: ; preds = %for.body.i.preheader %arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph %arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph %30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14 %31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14 store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14 store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14 %indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1 br label %for.body.i.prol.loopexit for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader %indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ] %32 = xor i64 %indvars.iv.i.ph, %6 %33 = icmp eq i64 %32, -1 br i1 %33, label %for.inc, label %for.body.i for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ] %arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i %arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i %34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14 store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14 store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i %arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i %36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14 %37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14 store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14 store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %38 = icmp eq i64 %indvars.iv.next.i.1, %0 br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !74 for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3 %indvars.iv.next35 = add nsw i64 %indvars.iv34, 1 %cmp2.not.not = icmp slt i64 %indvars.iv34, %1 %indvar.next42 = add i64 %indvar41, 1 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !75 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable define dso_local void @sort_des_char_dic(i32 noundef %size, ptr nocapture noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #16 { entry: %0 = zext i32 %size to i64 %cmp.not29 = icmp sgt i32 %min, %max %cmp.not6.i = icmp slt i32 %size, 1 %or.cond = or i1 %cmp.not29, %cmp.not6.i br i1 %or.cond, label %for.end14, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = sext i32 %max to i64 %2 = sext i32 %min to i64 %3 = add i32 %max, 1 %4 = add nsw i64 %2, 1 %5 = add i32 %min, 1 %min.iters.check = icmp ult i32 %size, 8 %min.iters.check45 = icmp ult i32 %size, 32 %n.vec = and i64 %0, 4294967264 %cmp.n = icmp eq i64 %n.vec, %0 %n.vec.remaining = and i64 %0, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 %n.vec50 = and i64 %0, 4294967288 %cmp.n51 = icmp eq i64 %n.vec50, %0 %xtraiter = and i64 %0, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %6 = sub nsw i64 0, %0 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %lftr.wideiv = trunc i64 %indvars.iv.next38 to i32 %exitcond.not = icmp eq i32 %3, %lftr.wideiv %indvar.next = add i64 %indvar, 1 br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !76 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.cond.loopexit ] %indvars.iv37 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next38, %for.cond.loopexit ] %indvars.iv.in = phi i32 [ %min, %for.body.preheader ], [ %indvars.iv, %for.cond.loopexit ] %7 = add i64 %indvar, %2 %8 = mul i64 %7, %0 %scevgep = getelementptr i8, ptr %array, i64 %8 %9 = add i64 %4, %indvar %10 = mul i64 %9, %0 %scevgep40 = getelementptr i8, ptr %array, i64 %10 %11 = trunc i64 %indvar to i32 %12 = add i32 %5, %11 %13 = sext i32 %12 to i64 %14 = add nsw i64 %13, 1 %indvars.iv = add i32 %indvars.iv.in, 1 %indvars.iv.next38 = add nsw i64 %indvars.iv37, 1 %cmp2.not27.not = icmp slt i64 %indvars.iv37, %1 br i1 %cmp2.not27.not, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %15 = sext i32 %indvars.iv to i64 %16 = mul nsw i64 %indvars.iv37, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %16 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvar41 = phi i64 [ 0, %for.body3.lr.ph ], [ %indvar.next42, %for.inc ] %indvars.iv34 = phi i64 [ %15, %for.body3.lr.ph ], [ %indvars.iv.next35, %for.inc ] %17 = add i64 %indvar41, %13 %18 = mul i64 %17, %0 %scevgep43 = getelementptr i8, ptr %array, i64 %18 %19 = add i64 %14, %indvar41 %20 = mul i64 %19, %0 %scevgep44 = getelementptr i8, ptr %array, i64 %20 %21 = mul nsw i64 %indvars.iv34, %0 %arrayidx5 = getelementptr inbounds i8, ptr %array, i64 %21 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx5) #24 %cmp6 = icmp sgt i32 %call, -1 br i1 %cmp6, label %for.inc, label %iter.check iter.check: ; preds = %for.body3 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %iter.check %bound0 = icmp ult ptr %scevgep, %scevgep44 %bound1 = icmp ult ptr %scevgep43, %scevgep40 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body.i.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck br i1 %min.iters.check45, label %vec.epilog.ph, label %vector.body vector.body: ; preds = %vector.main.loop.iter.check, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ] %22 = getelementptr inbounds i8, ptr %arrayidx, i64 %index %23 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index %wide.load = load <16 x i8>, ptr %22, align 1, !tbaa !14, !alias.scope !77, !noalias !80 %24 = getelementptr inbounds i8, ptr %22, i64 16 %wide.load46 = load <16 x i8>, ptr %24, align 1, !tbaa !14, !alias.scope !77, !noalias !80 %wide.load47 = load <16 x i8>, ptr %23, align 1, !tbaa !14, !alias.scope !80 %25 = getelementptr inbounds i8, ptr %23, i64 16 %wide.load48 = load <16 x i8>, ptr %25, align 1, !tbaa !14, !alias.scope !80 store <16 x i8> %wide.load47, ptr %22, align 1, !tbaa !14, !alias.scope !77, !noalias !80 store <16 x i8> %wide.load48, ptr %24, align 1, !tbaa !14, !alias.scope !77, !noalias !80 store <16 x i8> %wide.load, ptr %23, align 1, !tbaa !14, !alias.scope !80 store <16 x i8> %wide.load46, ptr %25, align 1, !tbaa !14, !alias.scope !80 %index.next = add nuw i64 %index, 32 %26 = icmp eq i64 %index.next, %n.vec br i1 %26, label %middle.block, label %vector.body, !llvm.loop !82 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.inc, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next55, %vec.epilog.vector.body ] %27 = getelementptr inbounds i8, ptr %arrayidx, i64 %index52 %28 = getelementptr inbounds i8, ptr %arrayidx5, i64 %index52 %wide.load53 = load <8 x i8>, ptr %27, align 1, !tbaa !14, !alias.scope !83, !noalias !86 %wide.load54 = load <8 x i8>, ptr %28, align 1, !tbaa !14, !alias.scope !86 store <8 x i8> %wide.load54, ptr %27, align 1, !tbaa !14, !alias.scope !83, !noalias !86 store <8 x i8> %wide.load53, ptr %28, align 1, !tbaa !14, !alias.scope !86 %index.next55 = add nuw i64 %index52, 8 %29 = icmp eq i64 %index.next55, %n.vec50 br i1 %29, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !88 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body br i1 %cmp.n51, label %for.inc, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec50, %vec.epilog.middle.block ] br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol for.body.i.prol: ; preds = %for.body.i.preheader %arrayidx.i.prol = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i.ph %arrayidx2.i.prol = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i.ph %30 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14 %31 = load i8, ptr %arrayidx2.i.prol, align 1, !tbaa !14 store i8 %31, ptr %arrayidx.i.prol, align 1, !tbaa !14 store i8 %30, ptr %arrayidx2.i.prol, align 1, !tbaa !14 %indvars.iv.next.i.prol = or i64 %indvars.iv.i.ph, 1 br label %for.body.i.prol.loopexit for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader %indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ] %32 = xor i64 %indvars.iv.i.ph, %6 %33 = icmp eq i64 %32, -1 br i1 %33, label %for.inc, label %for.body.i for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ] %arrayidx.i = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.i %arrayidx2.i = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.i %34 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %35 = load i8, ptr %arrayidx2.i, align 1, !tbaa !14 store i8 %35, ptr %arrayidx.i, align 1, !tbaa !14 store i8 %34, ptr %arrayidx2.i, align 1, !tbaa !14 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv.next.i %arrayidx2.i.1 = getelementptr inbounds i8, ptr %arrayidx5, i64 %indvars.iv.next.i %36 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14 %37 = load i8, ptr %arrayidx2.i.1, align 1, !tbaa !14 store i8 %37, ptr %arrayidx.i.1, align 1, !tbaa !14 store i8 %36, ptr %arrayidx2.i.1, align 1, !tbaa !14 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %38 = icmp eq i64 %indvars.iv.next.i.1, %0 br i1 %38, label %for.inc, label %for.body.i, !llvm.loop !89 for.inc: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %for.body3 %indvars.iv.next35 = add nsw i64 %indvars.iv34, 1 %cmp2.not.not = icmp slt i64 %indvars.iv34, %1 %indvar.next42 = add i64 %indvar41, 1 br i1 %cmp2.not.not, label %for.body3, label %for.cond.loopexit, !llvm.loop !90 for.end14: ; preds = %for.cond.loopexit, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @max_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %idxprom = sext i32 %min to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not9 = icmp slt i32 %min, %max br i1 %cmp.not.not9, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count, %idxprom %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom 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> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14) %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 !91 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ] %answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %spec.select.i = tail call i32 @llvm.smax.i32(i32 %answer.011, i32 %8) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !92 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @max_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #15 { entry: %idxprom.i = sext i32 %min to i64 %arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i %0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.not.not9.i = icmp slt i32 %min, %max br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %max_int_array.exit for.body.preheader.i: ; preds = %entry %wide.trip.count.i = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count.i, %idxprom.i %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom.i %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i 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> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27) %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 !93 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %max_int_array.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ] %answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i %8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %spec.select.i.i = tail call i32 @llvm.smax.i32(i32 %answer.011.i, i32 %8) %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %max_int_array.exit, label %for.body.i, !llvm.loop !94 max_int_array.exit: ; preds = %for.body.i, %middle.block, %entry %answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ] %sub = sub nsw i32 %max, %min %cmp.not4.i = icmp slt i32 %sub, 0 br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16 for.body.preheader.i16: ; preds = %max_int_array.exit %9 = add nuw i32 %sub, 1 %10 = zext i32 %9 to i64 %11 = shl nuw nsw i64 %10, 2 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5 br label %fill_int.exit fill_int.exit: ; preds = %for.body.preheader.i16, %max_int_array.exit %cmp.not22 = icmp sgt i32 %min, %max br i1 %cmp.not22, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_int.exit %12 = add i32 %max, 1 %13 = sub i32 %12, %min %xtraiter = and i32 %13, 1 %14 = icmp eq i32 %max, %min br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %13, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %15 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %15, %answer.0.lcssa.i br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %idxprom2 = sext i32 %count.023 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2 %16 = trunc i64 %indvars.iv to i32 store i32 %16, ptr %arrayidx3, align 4, !tbaa !5 %add = add nsw i32 %count.023, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %idxprom2.1 = sext i32 %count.1 to i64 %arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1 %18 = trunc i64 %indvars.iv.next to i32 store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5 %add.1 = add nsw i32 %count.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ] %indvars.iv.next.1 = add nsw i64 %indvars.iv, 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.loopexit, label %for.body, !llvm.loop !95 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1 %19 = sext i32 %count.1.1 to i64 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ] %count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ] %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 %arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr %20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr %21 = trunc i64 %indvars.iv.unr to i32 store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @min_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %idxprom = sext i32 %min to i64 %arrayidx = getelementptr inbounds i32, ptr %array, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not.not9 = icmp slt i32 %min, %max br i1 %cmp.not.not9, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count, %idxprom %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom 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> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi13 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load14 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi13, <4 x i32> %wide.load14) %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 !96 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %idxprom, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.011.ph = phi i32 [ %0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader15, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ] %answer.011 = phi i32 [ %spec.select.i, %for.body ], [ %answer.011.ph, %for.body.preheader15 ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %spec.select.i = tail call i32 @llvm.smin.i32(i32 %answer.011, i32 %8) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !97 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @min_int_array_num(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef writeonly %answer) local_unnamed_addr #15 { entry: %idxprom.i = sext i32 %min to i64 %arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %idxprom.i %0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.not.not9.i = icmp slt i32 %min, %max br i1 %cmp.not.not9.i, label %for.body.preheader.i, label %min_int_array.exit for.body.preheader.i: ; preds = %entry %wide.trip.count.i = sext i32 %max to i64 %1 = sub nsw i64 %wide.trip.count.i, %idxprom.i %min.iters.check = icmp ult i64 %1, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %1, -8 %ind.end = add nsw i64 %n.vec, %idxprom.i %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %idxprom.i 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> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ] %vec.phi26 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %5, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %2 = getelementptr i32, ptr %gep, i64 1 %wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5 %3 = getelementptr i32, ptr %gep, i64 5 %wide.load27 = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %5 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi26, <4 x i32> %wide.load27) %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 !98 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %4, <4 x i32> %5) %7 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %1, %n.vec br i1 %cmp.n, label %min_int_array.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ %idxprom.i, %for.body.preheader.i ], [ %ind.end, %middle.block ] %answer.011.i.ph = phi i32 [ %0, %for.body.preheader.i ], [ %7, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %answer.011.i = phi i32 [ %spec.select.i.i, %for.body.i ], [ %answer.011.i.ph, %for.body.i.preheader ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next.i %8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %spec.select.i.i = tail call i32 @llvm.smin.i32(i32 %answer.011.i, i32 %8) %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %min_int_array.exit, label %for.body.i, !llvm.loop !99 min_int_array.exit: ; preds = %for.body.i, %middle.block, %entry %answer.0.lcssa.i = phi i32 [ %0, %entry ], [ %7, %middle.block ], [ %spec.select.i.i, %for.body.i ] %sub = sub nsw i32 %max, %min %cmp.not4.i = icmp slt i32 %sub, 0 br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i16 for.body.preheader.i16: ; preds = %min_int_array.exit %9 = add nuw i32 %sub, 1 %10 = zext i32 %9 to i64 %11 = shl nuw nsw i64 %10, 2 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %answer, i8 -1, i64 %11, i1 false), !tbaa !5 br label %fill_int.exit fill_int.exit: ; preds = %for.body.preheader.i16, %min_int_array.exit %cmp.not22 = icmp sgt i32 %min, %max br i1 %cmp.not22, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_int.exit %12 = add i32 %max, 1 %13 = sub i32 %12, %min %xtraiter = and i32 %13, 1 %14 = icmp eq i32 %max, %min br i1 %14, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %13, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ %idxprom.i, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %count.023 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %15 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %15, %answer.0.lcssa.i br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %idxprom2 = sext i32 %count.023 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2 %16 = trunc i64 %indvars.iv to i32 store i32 %16, ptr %arrayidx3, align 4, !tbaa !5 %add = add nsw i32 %count.023, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then %count.1 = phi i32 [ %add, %if.then ], [ %count.023, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.next %17 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %cmp1.1 = icmp eq i32 %17, %answer.0.lcssa.i br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %idxprom2.1 = sext i32 %count.1 to i64 %arrayidx3.1 = getelementptr inbounds i32, ptr %answer, i64 %idxprom2.1 %18 = trunc i64 %indvars.iv.next to i32 store i32 %18, ptr %arrayidx3.1, align 4, !tbaa !5 %add.1 = add nsw i32 %count.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %count.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %count.1, %for.inc ] %indvars.iv.next.1 = add nsw i64 %indvars.iv, 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.loopexit, label %for.body, !llvm.loop !100 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1 %19 = sext i32 %count.1.1 to i64 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %indvars.iv.unr = phi i64 [ %idxprom.i, %for.body.preheader ], [ %indvars.iv.next.1, %for.end.loopexit.unr-lcssa.loopexit ] %count.023.unr = phi i64 [ 0, %for.body.preheader ], [ %19, %for.end.loopexit.unr-lcssa.loopexit ] %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 %arrayidx.epil = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.unr %20 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %cmp1.epil = icmp eq i32 %20, %answer.0.lcssa.i br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %arrayidx3.epil = getelementptr inbounds i32, ptr %answer, i64 %count.023.unr %21 = trunc i64 %indvars.iv.unr to i32 store i32 %21, ptr %arrayidx3.epil, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %fill_int.exit ret void } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @max_char_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 { entry: %0 = zext i32 %size to i64 %cmp.not.not11 = icmp slt i32 %min, %max br i1 %cmp.not.not11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %1 = sext i32 %min to i64 %wide.trip.count = sext i32 %max to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %idxprom = sext i32 %answer.013 to i64 %2 = mul nsw i64 %idxprom, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %2 %3 = mul nsw i64 %indvars.iv.next, %0 %arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #24 %cmp3 = icmp slt i32 %call, 0 %4 = trunc i64 %indvars.iv.next to i32 %spec.select = select i1 %cmp3, i32 %4, i32 %answer.013 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !101 for.end: ; preds = %for.body, %entry %answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @min_char_dic(i32 noundef %size, ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #18 { entry: %0 = zext i32 %size to i64 %cmp.not.not11 = icmp slt i32 %min, %max br i1 %cmp.not.not11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %1 = sext i32 %min to i64 %wide.trip.count = sext i32 %max to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %answer.013 = phi i32 [ %min, %for.body.preheader ], [ %spec.select, %for.body ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %idxprom = sext i32 %answer.013 to i64 %2 = mul nsw i64 %idxprom, %0 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %2 %3 = mul nsw i64 %indvars.iv.next, %0 %arrayidx2 = getelementptr inbounds i8, ptr %array, i64 %3 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #24 %cmp3 = icmp sgt i32 %call, 0 %4 = trunc i64 %indvars.iv.next to i32 %spec.select = select i1 %cmp3, i32 %4, i32 %answer.013 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !102 for.end: ; preds = %for.body, %entry %answer.0.lcssa = phi i32 [ %min, %entry ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @sum_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #19 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = add <4 x i32> %wide.load, %vec.phi %7 = add <4 x i32> %wide.load11, %vec.phi10 %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 !103 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader12 for.body.preheader12: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader12, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ] %answer.08 = phi i32 [ %add, %for.body ], [ %answer.08.ph, %for.body.preheader12 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %10 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %10, %answer.08 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !104 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local zeroext i1 @detect_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #19 { entry: %cmp.not10 = icmp sgt i32 %min, %max br i1 %cmp.not10, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %2, %element br i1 %cmp1, label %for.end.loopexit.split.loop.exit, label %for.inc for.inc: ; preds = %for.body %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !105 for.end.loopexit.split.loop.exit: ; preds = %for.body %3 = trunc i64 %indvars.iv to i32 br label %for.end for.end: ; preds = %for.inc, %for.end.loopexit.split.loop.exit, %entry %i.0.lcssa = phi i32 [ %min, %entry ], [ %3, %for.end.loopexit.split.loop.exit ], [ %1, %for.inc ] %cmp3.not = icmp sle i32 %i.0.lcssa, %max ret i1 %cmp3.not } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local zeroext i1 @detect_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, ptr nocapture noundef readonly %element, i32 noundef %start, i32 noundef %goal) local_unnamed_addr #19 { entry: %sub = sub nsw i32 %goal, %start %sub1 = sub nsw i32 %max, %min %cmp.not = icmp sgt i32 %sub, %sub1 br i1 %cmp.not, label %if.end24, label %for.cond.preheader for.cond.preheader: ; preds = %entry %sub3 = sub nsw i32 %max, %sub %cmp4.not42 = icmp slt i32 %sub3, %min br i1 %cmp4.not42, label %if.end24, label %for.cond5.preheader.lr.ph for.cond5.preheader.lr.ph: ; preds = %for.cond.preheader %cmp6.not39 = icmp sgt i32 %start, %goal %add16 = add i32 %goal, 1 br i1 %cmp6.not39, label %for.cond5.preheader.lr.ph.split.us, label %for.cond5.preheader.preheader for.cond5.preheader.preheader: ; preds = %for.cond5.preheader.lr.ph %0 = sext i32 %start to i64 br label %for.cond5.preheader for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph %cmp17.us = icmp eq i32 %add16, %start br label %if.end24 for.cond5.preheader: ; preds = %for.end, %for.cond5.preheader.preheader %i.043 = phi i32 [ %min, %for.cond5.preheader.preheader ], [ %add22, %for.end ] %add = sub i32 %i.043, %start br label %for.body7 for.body7: ; preds = %for.cond5.preheader, %for.inc %indvars.iv = phi i64 [ %0, %for.cond5.preheader ], [ %indvars.iv.next, %for.inc ] %1 = trunc i64 %indvars.iv to i32 %sub8 = add i32 %add, %1 %idxprom = sext i32 %sub8 to i64 %arrayidx = getelementptr inbounds i8, ptr %array, i64 %idxprom %2 = load i8, ptr %arrayidx, align 1, !tbaa !14 %arrayidx10 = getelementptr inbounds i8, ptr %element, i64 %indvars.iv %3 = load i8, ptr %arrayidx10, align 1, !tbaa !14 %cmp12 = icmp eq i8 %2, %3 br i1 %cmp12, label %for.inc, label %for.end for.inc: ; preds = %for.body7 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %add16, %lftr.wideiv br i1 %exitcond.not, label %if.end24, label %for.body7, !llvm.loop !106 for.end: ; preds = %for.body7 %cmp17 = icmp eq i32 %add16, %1 %add22 = add nsw i32 %i.043, 1 %cmp4.not.not = icmp sge i32 %i.043, %sub3 %or.cond.not = or i1 %cmp4.not.not, %cmp17 br i1 %or.cond.not, label %if.end24, label %for.cond5.preheader, !llvm.loop !107 if.end24: ; preds = %for.end, %for.inc, %for.cond5.preheader.lr.ph.split.us, %for.cond.preheader, %entry %answer.0 = phi i1 [ false, %entry ], [ false, %for.cond.preheader ], [ %cmp17.us, %for.cond5.preheader.lr.ph.split.us ], [ true, %for.inc ], [ %cmp17, %for.end ] ret i1 %answer.0 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_differentelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %0 = zext i32 %max to i64 %vla = alloca i32, i64 %0, align 16 %cmp.not4.i = icmp slt i32 %max, 0 br i1 %cmp.not4.i, label %fill_int.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %entry %1 = add nuw i32 %max, 1 %2 = zext i32 %1 to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %3, i1 false), !tbaa !5 br label %fill_int.exit fill_int.exit: ; preds = %for.body.preheader.i, %entry %cmp.not28 = icmp sgt i32 %min, %max br i1 %cmp.not28, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_int.exit %4 = sext i32 %min to i64 %5 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ %4, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %answer.030 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp.not10.i = icmp slt i32 %answer.030, 1 br i1 %cmp.not10.i, label %detect_int.exit, label %for.body.i19.preheader for.body.i19.preheader: ; preds = %for.body %zext = zext i32 %answer.030 to i64 br label %for.body.i19 for.body.i19: ; preds = %for.body.i19.preheader, %for.inc.i %indvars.iv.i20 = phi i64 [ %indvars.iv.next.i22, %for.inc.i ], [ 0, %for.body.i19.preheader ] %arrayidx.i21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i20 %7 = load i32, ptr %arrayidx.i21, align 4, !tbaa !5 %cmp1.i = icmp eq i32 %7, %6 br i1 %cmp1.i, label %for.end.loopexit.split.loop.exit.i, label %for.inc.i for.inc.i: ; preds = %for.body.i19 %indvars.iv.next.i22 = add nuw nsw i64 %indvars.iv.i20, 1 %8 = icmp eq i64 %indvars.iv.next.i22, %zext br i1 %8, label %if.then, label %for.body.i19, !llvm.loop !105 for.end.loopexit.split.loop.exit.i: ; preds = %for.body.i19 %9 = trunc i64 %indvars.iv.i20 to i32 br label %detect_int.exit detect_int.exit: ; preds = %for.body, %for.end.loopexit.split.loop.exit.i %i.0.lcssa.i = phi i32 [ 0, %for.body ], [ %9, %for.end.loopexit.split.loop.exit.i ] %cmp3.not.i.not.not = icmp slt i32 %i.0.lcssa.i, %answer.030 br i1 %cmp3.not.i.not.not, label %for.inc, label %if.then if.then: ; preds = %for.inc.i, %detect_int.exit %idxprom5 = sext i32 %answer.030 to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5 store i32 %6, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %answer.030, 1 br label %for.inc for.inc: ; preds = %detect_int.exit, %if.then %answer.1 = phi i32 [ %add, %if.then ], [ %answer.030, %detect_int.exit ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %5, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !108 for.end: ; preds = %for.inc, %fill_int.exit %answer.0.lcssa = phi i32 [ 0, %fill_int.exit ], [ %answer.1, %for.inc ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_differentelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #17 { entry: %0 = zext i32 %max to i64 %vla = alloca i8, i64 %0, align 16 %cmp.not4.i = icmp slt i32 %max, 0 br i1 %cmp.not4.i, label %fill_char.exit, label %for.body.preheader.i for.body.preheader.i: ; preds = %entry %1 = add nuw nsw i64 %0, 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %1, i1 false), !tbaa !14 br label %fill_char.exit fill_char.exit: ; preds = %entry, %for.body.preheader.i %cmp.not20 = icmp sgt i32 %min, %max br i1 %cmp.not20, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %fill_char.exit %2 = sext i32 %min to i64 %3 = add i32 %max, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv26 = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next27, %for.inc ] %answer.022 = phi i32 [ 0, %for.body.preheader ], [ %answer.1, %for.inc ] %cmp.not.i = icmp slt i32 %answer.022, 1 br i1 %cmp.not.i, label %for.body.if.then_crit_edge, label %for.cond5.preheader.lr.ph.i for.body.if.then_crit_edge: ; preds = %for.body %arrayidx.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26 %.pre30 = load i8, ptr %arrayidx.phi.trans.insert, align 1, !tbaa !14 br label %if.then for.cond5.preheader.lr.ph.i: ; preds = %for.body %4 = zext i32 %answer.022 to i64 %arrayidx10.i.phi.trans.insert = getelementptr inbounds i8, ptr %array, i64 %indvars.iv26 %.pre = load i8, ptr %arrayidx10.i.phi.trans.insert, align 1, !tbaa !14 br label %for.cond5.preheader.i for.cond.i: ; preds = %for.cond5.preheader.i %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %4 br i1 %exitcond.not, label %if.then, label %for.cond5.preheader.i, !llvm.loop !107 for.cond5.preheader.i: ; preds = %for.cond.i, %for.cond5.preheader.lr.ph.i %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond.i ], [ 0, %for.cond5.preheader.lr.ph.i ] %arrayidx.i = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv %5 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %cmp12.i = icmp eq i8 %5, %.pre br i1 %cmp12.i, label %for.inc, label %for.cond.i if.then: ; preds = %for.cond.i, %for.body.if.then_crit_edge %6 = phi i8 [ %.pre30, %for.body.if.then_crit_edge ], [ %.pre, %for.cond.i ] %idxprom3 = sext i32 %answer.022 to i64 %arrayidx4 = getelementptr inbounds i8, ptr %vla, i64 %idxprom3 store i8 %6, ptr %arrayidx4, align 1, !tbaa !14 %add = add nsw i32 %answer.022, 1 br label %for.inc for.inc: ; preds = %for.cond5.preheader.i, %if.then %answer.1 = phi i32 [ %add, %if.then ], [ %answer.022, %for.cond5.preheader.i ] %indvars.iv.next27 = add nsw i64 %indvars.iv26, 1 %lftr.wideiv = trunc i64 %indvars.iv.next27 to i32 %exitcond29.not = icmp eq i32 %3, %lftr.wideiv br i1 %exitcond29.not, label %for.end, label %for.body, !llvm.loop !109 for.end: ; preds = %for.inc, %fill_char.exit %answer.0.lcssa = phi i32 [ 0, %fill_char.exit ], [ %answer.1, %for.inc ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_equalelement_int(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i32 noundef %element) local_unnamed_addr #19 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader12, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %element, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i32, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi10 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !5 %5 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load11 = load <4 x i32>, ptr %5, align 4, !tbaa !5 %6 = icmp eq <4 x i32> %wide.load, %broadcast.splat %7 = icmp eq <4 x i32> %wide.load11, %broadcast.splat %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi10, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !110 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader12 for.body.preheader12: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.08.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader12, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader12 ] %answer.08 = phi i32 [ %spec.select, %for.body ], [ %answer.08.ph, %for.body.preheader12 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %14 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp eq i32 %14, %element %add = zext i1 %cmp1 to i32 %spec.select = add nuw nsw i32 %answer.08, %add %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !111 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @count_equalelement_char(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max, i8 noundef signext %element) local_unnamed_addr #19 { entry: %cmp.not8 = icmp sgt i32 %min, %max br i1 %cmp.not8, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 %2 = sub i32 %max, %min %3 = zext i32 %2 to i64 %4 = add nuw nsw i64 %3, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, 8589934584 %ind.end = add nsw i64 %n.vec, %0 %broadcast.splatinsert = insertelement <4 x i8> poison, i8 %element, i64 0 %broadcast.splat = shufflevector <4 x i8> %broadcast.splatinsert, <4 x i8> poison, <4 x i32> zeroinitializer %invariant.gep = getelementptr i8, ptr %array, i64 %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi12 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %gep = getelementptr i8, ptr %invariant.gep, i64 %index %wide.load = load <4 x i8>, ptr %gep, align 1, !tbaa !14 %5 = getelementptr inbounds i8, ptr %gep, i64 4 %wide.load13 = load <4 x i8>, ptr %5, align 1, !tbaa !14 %6 = icmp eq <4 x i8> %wide.load, %broadcast.splat %7 = icmp eq <4 x i8> %wide.load13, %broadcast.splat %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi12, %9 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !112 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader14 for.body.preheader14: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %answer.010.ph = phi i32 [ 0, %for.body.preheader ], [ %13, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader14, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader14 ] %answer.010 = phi i32 [ %spec.select, %for.body ], [ %answer.010.ph, %for.body.preheader14 ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %14 = load i8, ptr %arrayidx, align 1, !tbaa !14 %cmp2 = icmp eq i8 %14, %element %add = zext i1 %cmp2 to i32 %spec.select = add nuw nsw i32 %answer.010, %add %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !113 for.end: ; preds = %for.body, %middle.block, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body ] ret i32 %answer.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_int_array(ptr noundef %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not3 = icmp sgt i32 %min, %max br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !114 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #20 ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_int_array_2(ptr noundef %array1, ptr noundef %array2, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not6 = icmp sgt i32 %min, %max br i1 %cmp.not6, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 ] %arrayidx = getelementptr inbounds i32, ptr %array1, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef %arrayidx2) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !115 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_int_array_3(ptr noundef %array1, ptr noundef %array2, ptr noundef %array3, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not9 = icmp sgt i32 %min, %max br i1 %cmp.not9, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 ] %arrayidx = getelementptr inbounds i32, ptr %array1, i64 %indvars.iv %arrayidx2 = getelementptr inbounds i32, ptr %array2, i64 %indvars.iv %arrayidx4 = getelementptr inbounds i32, ptr %array3, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx, ptr noundef %arrayidx2, ptr noundef %arrayidx4) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !116 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @scanf_char_array(ptr noundef %array, i32 noundef %num) local_unnamed_addr #10 { entry: %array8 = ptrtoint ptr %array to i64 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %array) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %array) #24 %0 = trunc i64 %call1 to i32 %conv = add i32 %0, -1 %cmp.not24.i = icmp slt i32 %conv, 0 br i1 %cmp.not24.i, label %for.cond3.preheader.i, label %iter.check iter.check: ; preds = %entry %1 = zext i32 %conv to i64 %2 = sext i32 %num to i64 %invariant.gep.i = getelementptr i8, ptr %array, i64 %2 %3 = add nuw nsw i64 %1, 1 %min.iters.check = icmp ult i32 %conv, 3 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %4 = getelementptr i8, ptr %array, i64 %2 %scevgep = getelementptr i8, ptr %4, i64 %1 %5 = icmp ugt ptr %4, %scevgep %scevgep4 = getelementptr i8, ptr %array, i64 %1 %6 = icmp ult ptr %scevgep4, %array %7 = or i1 %5, %6 br i1 %7, label %for.body.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %8 = add i64 %array8, %1 %9 = add i64 %array8, %2 %10 = add i64 %9, %1 %11 = sub i64 %8, %10 %diff.check = icmp ult i64 %11, 16 br i1 %diff.check, label %for.body.i.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check9 = icmp ult i32 %conv, 15 br i1 %min.iters.check9, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %3, 8589934576 %invariant.gep = getelementptr i8, ptr %array, i64 -15 %invariant.gep21 = getelementptr i8, ptr %invariant.gep.i, i64 -15 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %1, %index %gep = getelementptr i8, ptr %invariant.gep, i64 %offset.idx %wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !14 %gep22 = getelementptr i8, ptr %invariant.gep21, i64 %offset.idx store <16 x i8> %wide.load, ptr %gep22, align 1, !tbaa !14 %index.next = add nuw i64 %index, 16 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !117 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.cond3.preheader.i, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end13 = sub nsw i64 %1, %n.vec %n.vec.remaining = and i64 %3, 12 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.i.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec12 = and i64 %3, 8589934588 %ind.end = sub nsw i64 %1, %n.vec12 %invariant.gep23 = getelementptr i8, ptr %array, i64 -3 %invariant.gep25 = getelementptr i8, ptr %invariant.gep.i, i64 -3 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index15 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next20, %vec.epilog.vector.body ] %offset.idx16 = sub i64 %1, %index15 %gep24 = getelementptr i8, ptr %invariant.gep23, i64 %offset.idx16 %wide.load17 = load <4 x i8>, ptr %gep24, align 1, !tbaa !14 %gep26 = getelementptr i8, ptr %invariant.gep25, i64 %offset.idx16 store <4 x i8> %wide.load17, ptr %gep26, align 1, !tbaa !14 %index.next20 = add nuw i64 %index15, 4 %13 = icmp eq i64 %index.next20, %n.vec12 br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !118 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n14 = icmp eq i64 %3, %n.vec12 br i1 %cmp.n14, label %for.cond3.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.i.ph = phi i64 [ %1, %iter.check ], [ %1, %vector.memcheck ], [ %1, %vector.scevcheck ], [ %ind.end13, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %14 = add nsw i64 %indvars.iv.i.ph, 1 %xtraiter = and i64 %14, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol %indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ] %arrayidx.i.prol = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i.prol %15 = load i8, ptr %arrayidx.i.prol, align 1, !tbaa !14 %gep.i.prol = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i.prol store i8 %15, ptr %gep.i.prol, align 1, !tbaa !14 %indvars.iv.next.i.prol = add nsw i64 %indvars.iv.i.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !119 for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader %indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ] %16 = icmp ult i64 %indvars.iv.i.ph, 3 br i1 %16, label %for.cond3.preheader.i, label %for.body.i for.cond3.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %vec.epilog.middle.block, %entry %cmp6.not.not26.i = icmp sgt i32 %num, 0 br i1 %cmp6.not.not26.i, label %for.body7.preheader.i, label %shift_char.exit for.body7.preheader.i: ; preds = %for.cond3.preheader.i %17 = zext i32 %num to i64 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %array, i8 0, i64 %17, i1 false), !tbaa !14 br label %shift_char.exit for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ] %arrayidx.i = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.i %18 = load i8, ptr %arrayidx.i, align 1, !tbaa !14 %gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.i store i8 %18, ptr %gep.i, align 1, !tbaa !14 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i %19 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !14 %gep.i.1 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i store i8 %19, ptr %gep.i.1, align 1, !tbaa !14 %indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, -2 %arrayidx.i.2 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.1 %20 = load i8, ptr %arrayidx.i.2, align 1, !tbaa !14 %gep.i.2 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1 store i8 %20, ptr %gep.i.2, align 1, !tbaa !14 %indvars.iv.next.i.2 = add nsw i64 %indvars.iv.i, -3 %arrayidx.i.3 = getelementptr inbounds i8, ptr %array, i64 %indvars.iv.next.i.2 %21 = load i8, ptr %arrayidx.i.3, align 1, !tbaa !14 %gep.i.3 = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2 store i8 %21, ptr %gep.i.3, align 1, !tbaa !14 %indvars.iv.next.i.3 = add nsw i64 %indvars.iv.i, -4 %cmp.not.not.i.not.3 = icmp eq i64 %indvars.iv.next.i.2, 0 br i1 %cmp.not.not.i.not.3, label %for.cond3.preheader.i, label %for.body.i, !llvm.loop !120 shift_char.exit: ; preds = %for.cond3.preheader.i, %for.body7.preheader.i ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printf_int_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not3 = icmp sgt i32 %min, %max br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 ] %arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %2) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !121 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #20 ; Function Attrs: nofree nounwind uwtable define dso_local void @printf_char_array(ptr nocapture noundef readonly %array, i32 noundef %min, i32 noundef %max) local_unnamed_addr #10 { entry: %cmp.not3 = icmp sgt i32 %min, %max br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = sext i32 %min to i64 %1 = add i32 %max, 1 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 ] %arrayidx = getelementptr inbounds i8, ptr %array, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !14 %conv = sext i8 %2 to i32 %putchar = tail call i32 @putchar(i32 %conv) %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %1, %lftr.wideiv br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !122 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #10 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #23 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #23 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #23 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #23 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %D, align 4, !tbaa !5 %spec.select.i = call i32 @llvm.smin.i32(i32 %0, i32 %1) %2 = load i32, ptr %A, align 4, !tbaa !5 %3 = load i32, ptr %C, align 4, !tbaa !5 %spec.select.i5 = call i32 @llvm.smax.i32(i32 %2, i32 %3) %sub = sub nsw i32 %spec.select.i, %spec.select.i5 %spec.select.i6 = call i32 @llvm.smax.i32(i32 %sub, i32 0) %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %spec.select.i6) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #23 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #23 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #23 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #23 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #21 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #22 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #22 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(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 #7 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { 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 #9 = { 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 #10 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #13 = { 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 #14 = { 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 #15 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { nofree 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 #17 = { 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 #18 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #19 = { 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 #20 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #21 = { nofree nounwind } attributes #22 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #23 = { nounwind } attributes #24 = { 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, !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 = !{!7, !7, i64 0} !15 = !{!16} !16 = distinct !{!16, !17} !17 = distinct !{!17, !"LVerDomain"} !18 = !{!19} !19 = distinct !{!19, !17} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !10, !11} !22 = !{!23} !23 = distinct !{!23, !24} !24 = distinct !{!24, !"LVerDomain"} !25 = !{!26} !26 = distinct !{!26, !24} !27 = distinct !{!27, !10, !11, !12} !28 = !{!29} !29 = distinct !{!29, !30} !30 = distinct !{!30, !"LVerDomain"} !31 = !{!32} !32 = distinct !{!32, !30} !33 = distinct !{!33, !10, !11, !12} !34 = distinct !{!34, !10, !11} !35 = distinct !{!35, !10} !36 = distinct !{!36, !10} !37 = distinct !{!37, !10} !38 = distinct !{!38, !39} !39 = !{!"llvm.loop.unroll.disable"} !40 = distinct !{!40, !10} !41 = distinct !{!41, !10} !42 = distinct !{!42, !39} !43 = distinct !{!43, !10} !44 = distinct !{!44, !39} !45 = distinct !{!45, !10} !46 = distinct !{!46, !10} !47 = distinct !{!47, !10} !48 = distinct !{!48, !10} !49 = distinct !{!49, !10, !11, !12} !50 = distinct !{!50, !10, !11} !51 = distinct !{!51, !10, !11, !12} !52 = distinct !{!52, !10, !11, !12} !53 = distinct !{!53, !10, !11} !54 = distinct !{!54, !10, !11, !12} !55 = distinct !{!55, !10, !11, !12} !56 = distinct !{!56, !10, !12, !11} !57 = distinct !{!57, !10} !58 = distinct !{!58, !10} !59 = distinct !{!59, !10} !60 = distinct !{!60, !10} !61 = distinct !{!61, !10} !62 = !{!63} !63 = distinct !{!63, !64} !64 = distinct !{!64, !"LVerDomain"} !65 = !{!66} !66 = distinct !{!66, !64} !67 = distinct !{!67, !10, !11, !12} !68 = !{!69} !69 = distinct !{!69, !70} !70 = distinct !{!70, !"LVerDomain"} !71 = !{!72} !72 = distinct !{!72, !70} !73 = distinct !{!73, !10, !11, !12} !74 = distinct !{!74, !10, !11} !75 = distinct !{!75, !10} !76 = distinct !{!76, !10} !77 = !{!78} !78 = distinct !{!78, !79} !79 = distinct !{!79, !"LVerDomain"} !80 = !{!81} !81 = distinct !{!81, !79} !82 = distinct !{!82, !10, !11, !12} !83 = !{!84} !84 = distinct !{!84, !85} !85 = distinct !{!85, !"LVerDomain"} !86 = !{!87} !87 = distinct !{!87, !85} !88 = distinct !{!88, !10, !11, !12} !89 = distinct !{!89, !10, !11} !90 = distinct !{!90, !10} !91 = distinct !{!91, !10, !11, !12} !92 = distinct !{!92, !10, !12, !11} !93 = distinct !{!93, !10, !11, !12} !94 = distinct !{!94, !10, !12, !11} !95 = distinct !{!95, !10} !96 = distinct !{!96, !10, !11, !12} !97 = distinct !{!97, !10, !12, !11} !98 = distinct !{!98, !10, !11, !12} !99 = distinct !{!99, !10, !12, !11} !100 = distinct !{!100, !10} !101 = distinct !{!101, !10} !102 = distinct !{!102, !10} !103 = distinct !{!103, !10, !11, !12} !104 = distinct !{!104, !10, !12, !11} !105 = distinct !{!105, !10} !106 = distinct !{!106, !10} !107 = distinct !{!107, !10} !108 = distinct !{!108, !10} !109 = distinct !{!109, !10} !110 = distinct !{!110, !10, !11, !12} !111 = distinct !{!111, !10, !12, !11} !112 = distinct !{!112, !10, !11, !12} !113 = distinct !{!113, !10, !12, !11} !114 = distinct !{!114, !10} !115 = distinct !{!115, !10} !116 = distinct !{!116, !10} !117 = distinct !{!117, !10, !11, !12} !118 = distinct !{!118, !10, !11, !12} !119 = distinct !{!119, !39} !120 = distinct !{!120, !10, !11} !121 = distinct !{!121, !10} !122 = distinct !{!122, !10}
#include <stdio.h> int main(){ int A, B, C, D; scanf("%d%d%d%d", &A, &B, &C, &D); if(B < C){ printf("%d\n", 0); }else if(A < C){ if(B < D){ printf("%d\n", B - C); }else{ printf("%d\n", D - C); } }else{ if(B < D){ printf("%d\n", B - A); }else if(A < D){ printf("%d\n", D - A); }else{ printf("%d\n", 0); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165755/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165755/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) %0 = load i32, ptr %B, align 4, !tbaa !5 %1 = load i32, ptr %C, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.end25, label %if.else if.else: ; preds = %entry %2 = load i32, ptr %A, align 4, !tbaa !5 %cmp2 = icmp slt i32 %2, %1 %3 = load i32, ptr %D, align 4, !tbaa !5 %cmp4 = icmp slt i32 %0, %3 br i1 %cmp2, label %if.then3, label %if.else10 if.then3: ; preds = %if.else br i1 %cmp4, label %if.then5, label %if.else7 if.then5: ; preds = %if.then3 %sub = sub nsw i32 %0, %1 br label %if.end25 if.else7: ; preds = %if.then3 %sub8 = sub nsw i32 %3, %1 br label %if.end25 if.else10: ; preds = %if.else br i1 %cmp4, label %if.then12, label %if.else15 if.then12: ; preds = %if.else10 %sub13 = sub nsw i32 %0, %2 br label %if.end25 if.else15: ; preds = %if.else10 %cmp16 = icmp slt i32 %2, %3 %sub18 = sub nsw i32 %3, %2 %spec.select = select i1 %cmp16, i32 %sub18, i32 0 br label %if.end25 if.end25: ; preds = %if.else15, %entry, %if.else7, %if.then5, %if.then12 %sub8.sink = phi i32 [ %sub8, %if.else7 ], [ %sub, %if.then5 ], [ %sub13, %if.then12 ], [ 0, %entry ], [ %spec.select, %if.else15 ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub8.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main () { int a,b,c,d; while ( scanf("%d%d%d%d",&a,&b,&c,&d)!= EOF ) { if(b<c|| d < a) printf("0\n"); else if(d>b) { if(a>c)printf("%d\n",b-a); else printf("%d\n",b-c); } else { if(a>c) printf("%d\n",d-a); else printf("%d\n",d-c); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165799/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165799/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %cmp.not27 = icmp eq i32 %call26, -1 br i1 %cmp.not27, label %while.end, label %while.body while.body: ; preds = %entry, %if.end22 %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp slt i32 %0, %1 br i1 %cmp1, label %if.then, label %lor.lhs.false lor.lhs.false: ; preds = %while.body %2 = load i32, ptr %d, align 4, !tbaa !5 %3 = load i32, ptr %a, align 4, !tbaa !5 %cmp2 = icmp slt i32 %2, %3 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %lor.lhs.false, %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end22 if.else: ; preds = %lor.lhs.false %cmp4 = icmp sgt i32 %2, %0 %cmp6 = icmp sgt i32 %3, %1 br i1 %cmp4, label %if.then5, label %if.else12 if.then5: ; preds = %if.else br i1 %cmp6, label %if.then7, label %if.else9 if.then7: ; preds = %if.then5 %sub = sub nsw i32 %0, %3 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub) br label %if.end22 if.else9: ; preds = %if.then5 %sub10 = sub nsw i32 %0, %1 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub10) br label %if.end22 if.else12: ; preds = %if.else br i1 %cmp6, label %if.then14, label %if.else17 if.then14: ; preds = %if.else12 %sub15 = sub nsw i32 %2, %3 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub15) br label %if.end22 if.else17: ; preds = %if.else12 %sub18 = sub nsw i32 %2, %1 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub18) br label %if.end22 if.end22: ; preds = %if.else9, %if.then7, %if.else17, %if.then14, %if.then %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end22, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); if(a<c) a=c; if(b>d) b=d; printf("%d\n",(b-a)<1 ? 0 : b-a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165841/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165841/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = load i32, ptr %b, align 4 %4 = load i32, ptr %d, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %sub = sub nsw i32 %5, %2 %cond = call i32 @llvm.smax.i32(i32 %sub, i32 0) %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #define max(m,n) ((m)>(n)?(m):(n)) #define min(m,n) ((m)>(n)?(n):(m)) int main() { int a,b,c,d,e,f; while(scanf("%d%d%d%d",&a,&b,&c,&d)!=EOF) { if(a<b&&c<d) { e=max(a,c); f=min(b,d); if(f-e>0) printf("%d\n",f-e); else printf("0\n"); } else printf("0\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165885/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165885/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 %call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %cmp.not24 = icmp eq i32 %call23, -1 br i1 %cmp.not24, label %while.end, label %while.body while.body: ; preds = %entry, %if.end16 %0 = load i32, ptr %a, align 4 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %0, %1 br i1 %cmp1, label %land.lhs.true, label %if.else14 land.lhs.true: ; preds = %while.body %2 = load i32, ptr %c, align 4 %3 = load i32, ptr %d, align 4 %cmp2 = icmp slt i32 %2, %3 br i1 %cmp2, label %if.then, label %if.else14 if.then: ; preds = %land.lhs.true %cond = call i32 @llvm.smax.i32(i32 %0, i32 %2) %cond8 = call i32 @llvm.smin.i32(i32 %1, i32 %3) %sub = sub nsw i32 %cond8, %cond %cmp9 = icmp sgt i32 %sub, 0 br i1 %cmp9, label %if.then10, label %if.else if.then10: ; preds = %if.then %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) br label %if.end16 if.else: ; preds = %if.then %puts22 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %if.end16 if.else14: ; preds = %land.lhs.true, %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %if.end16 if.end16: ; preds = %if.then10, %if.else, %if.else14 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end16, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); int max=a,min=b; if(max<=c) { max=c; } if(min>=d) { min=d; } int res=min-max; if(res<0) { res=0; } printf("%d\n",res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165935/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165935/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %2) %3 = load i32, ptr %d, align 4, !tbaa !5 %min.0 = call i32 @llvm.smin.i32(i32 %1, i32 %3) %sub = sub nsw i32 %min.0, %spec.select %spec.store.select = call i32 @llvm.smax.i32(i32 %sub, i32 0) %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.store.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int r=100000; int n; scanf("%d",&n); for(int i = 0; i<n; i++){ r = r*1.05; if(r%1000 > 0){ r=r/1000*1000+1000; } } printf("%d\n",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_165979/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_165979/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa.loopexit: ; preds = %for.body %2 = sitofp i32 %r.1.1 to double %3 = fmul double %2, 1.050000e+00 %4 = fptosi double %3 to i32 %5 = freeze i32 %4 br label %for.cond.cleanup.loopexit.unr-lcssa for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.cond.cleanup.loopexit.unr-lcssa.loopexit, %for.body.preheader %r.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %r.1.1, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ] %r.011.unr = phi i32 [ 105000, %for.body.preheader ], [ %5, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ] %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 %rem.epil = srem i32 %r.011.unr, 1000 %cmp2.epil = icmp sgt i32 %rem.epil, 0 %mul4.epil = add i32 %r.011.unr, 1000 %add.epil = sub i32 %mul4.epil, %rem.epil %r.1.epil = select i1 %cmp2.epil, i32 %add.epil, i32 %r.011.unr br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 100000, %entry ], [ %r.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %r.1.epil, %for.body.epil ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %for.body, %for.body.preheader.new %r.011 = phi i32 [ 100000, %for.body.preheader.new ], [ %r.1.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %r.011 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %conv1.fr = freeze i32 %conv1 %rem = srem i32 %conv1.fr, 1000 %cmp2 = icmp sgt i32 %rem, 0 %mul4 = add i32 %conv1.fr, 1000 %add = sub i32 %mul4, %rem %r.1 = select i1 %cmp2, i32 %add, i32 %conv1.fr %conv.1 = sitofp i32 %r.1 to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %conv1.fr.1 = freeze i32 %conv1.1 %rem.1 = srem i32 %conv1.fr.1, 1000 %cmp2.1 = icmp sgt i32 %rem.1, 0 %mul4.1 = add i32 %conv1.fr.1, 1000 %add.1 = sub i32 %mul4.1, %rem.1 %r.1.1 = select i1 %cmp2.1, i32 %add.1, i32 %conv1.fr.1 %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.cond.cleanup.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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() { unsigned long s = 100000; int n, i; scanf("%d", &n); for (i = 0; i < n; i ++) { s += s / 20; if (s % 1000 != 0) s = (s / 1000 + 1) * 1000; } printf("%lu\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166020/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166020/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"%lu\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %s.011 = phi i64 [ %s.1, %for.body ], [ 100000, %entry ] %div = udiv i64 %s.011, 20 %add = add i64 %div, %s.011 %rem = urem i64 %add, 1000 %cmp1.not = icmp eq i64 %rem, 0 %1 = add i64 %add, 1000 %mul = sub i64 %1, %rem %s.1 = select i1 %cmp1.not, i64 %add, i64 %mul %inc = add nuw nsw i32 %i.012, 1 %exitcond.not = icmp eq i32 %inc, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry %s.0.lcssa = phi i64 [ 100000, %entry ], [ %s.1, %for.body ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %s.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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<math.h> int main(){ int i,j,n; int kane = 100000; double money; scanf("%d",&n); for(i=0;i<n;i++){ kane += kane * 0.05; money = ceil((double)kane / 1000); kane = money * 1000; } printf("%d\n",kane); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166071/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166071/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %kane.011 = phi i32 [ 100000, %for.body.preheader.new ], [ %conv4.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %kane.011 to double %2 = call double @llvm.fmuladd.f64(double %conv, double 5.000000e-02, double %conv) %conv2 = fptosi double %2 to i32 %conv3 = sitofp i32 %conv2 to double %div = fdiv double %conv3, 1.000000e+03 %3 = call double @llvm.ceil.f64(double %div) %mul = fmul double %3, 1.000000e+03 %conv4 = fptosi double %mul to i32 %conv.1 = sitofp i32 %conv4 to double %4 = call double @llvm.fmuladd.f64(double %conv.1, double 5.000000e-02, double %conv.1) %conv2.1 = fptosi double %4 to i32 %conv3.1 = sitofp i32 %conv2.1 to double %div.1 = fdiv double %conv3.1, 1.000000e+03 %5 = call double @llvm.ceil.f64(double %div.1) %mul.1 = fmul double %5, 1.000000e+03 %conv4.1 = fptosi double %mul.1 to i32 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %6 = sitofp i32 %conv4.1 to double br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %conv4.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %conv4.1, %for.end.loopexit.unr-lcssa.loopexit ] %kane.011.unr = phi double [ 1.000000e+05, %for.body.preheader ], [ %6, %for.end.loopexit.unr-lcssa.loopexit ] %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 %7 = call double @llvm.fmuladd.f64(double %kane.011.unr, double 5.000000e-02, double %kane.011.unr) %conv2.epil = fptosi double %7 to i32 %conv3.epil = sitofp i32 %conv2.epil to double %div.epil = fdiv double %conv3.epil, 1.000000e+03 %8 = call double @llvm.ceil.f64(double %div.epil) %mul.epil = fmul double %8, 1.000000e+03 %conv4.epil = fptosi double %mul.epil to i32 br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %kane.0.lcssa = phi i32 [ 100000, %entry ], [ %conv4.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %conv4.epil, %for.body.epil ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %kane.0.lcssa) 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 speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; 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"}
#include <stdio.h> int main(){ int x = 100000; int i,n; scanf("%d",&n); for(i=0; i<n; i++){ x = x * 1.05; if(x % 1000 != 0) x = (x/1000+1) * 1000; } printf("%d\n", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166121/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166121/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %0, 0 br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %x.011 = phi i32 [ 100000, %for.body.preheader.new ], [ %x.1.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %x.011 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %conv1.fr = freeze i32 %conv1 %rem = srem i32 %conv1.fr, 1000 %cmp2.not = icmp eq i32 %rem, 0 %2 = add i32 %conv1.fr, 1000 %mul4 = sub i32 %2, %rem %x.1 = select i1 %cmp2.not, i32 %conv1.fr, i32 %mul4 %conv.1 = sitofp i32 %x.1 to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %conv1.fr.1 = freeze i32 %conv1.1 %rem.1 = srem i32 %conv1.fr.1, 1000 %cmp2.not.1 = icmp eq i32 %rem.1, 0 %3 = add i32 %conv1.fr.1, 1000 %mul4.1 = sub i32 %3, %rem.1 %x.1.1 = select i1 %cmp2.not.1, i32 %conv1.fr.1, i32 %mul4.1 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %4 = sitofp i32 %x.1.1 to double %5 = fmul double %4, 1.050000e+00 %6 = fptosi double %5 to i32 %7 = freeze i32 %6 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %x.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %x.1.1, %for.end.loopexit.unr-lcssa.loopexit ] %x.011.unr = phi i32 [ 105000, %for.body.preheader ], [ %7, %for.end.loopexit.unr-lcssa.loopexit ] %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 %rem.epil = srem i32 %x.011.unr, 1000 %cmp2.not.epil = icmp eq i32 %rem.epil, 0 %8 = add i32 %x.011.unr, 1000 %mul4.epil = sub i32 %8, %rem.epil %x.1.epil = select i1 %cmp2.not.epil, i32 %x.011.unr, i32 %mul4.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %x.0.lcssa = phi i32 [ 100000, %entry ], [ %x.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %x.1.epil, %for.body.epil ] %call5 = 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 %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 adjust(int n){ if (n % 1000 != 0) n += 1000 - n % 1000; return n; } int exec(int n){ if (n <= 0) return 100000; else return adjust(1.05 * exec(n-1)); } int main(){ int n; scanf("%d", &n); printf("%d\n", exec(n)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166172/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166172/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @adjust(i32 noundef %n) local_unnamed_addr #0 { entry: %rem = srem i32 %n, 1000 %cmp.not = icmp eq i32 %rem, 0 %reass.sub = add i32 %n, 1000 %add = sub i32 %reass.sub, %rem %n.addr.0 = select i1 %cmp.not, i32 %n, i32 %add ret i32 %n.addr.0 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @exec(i32 noundef %n) local_unnamed_addr #1 { entry: %cmp = icmp slt i32 %n, 1 br i1 %cmp, label %common.ret4, label %if.else common.ret4: ; preds = %entry, %if.else %common.ret4.op = phi i32 [ %n.addr.0.i, %if.else ], [ 100000, %entry ] ret i32 %common.ret4.op if.else: ; preds = %entry %sub = add nsw i32 %n, -1 %call = tail call i32 @exec(i32 noundef %sub) %conv = sitofp i32 %call to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %rem.i = srem i32 %conv1, 1000 %cmp.not.i = icmp eq i32 %rem.i, 0 %reass.sub.i = add i32 %conv1, 1000 %add.i = sub i32 %reass.sub.i, %rem.i %n.addr.0.i = select i1 %cmp.not.i, i32 %conv1, i32 %add.i br label %common.ret4 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %call1 = call i32 @exec(i32 noundef %0) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call1) 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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 s = 100000; int i, n; scanf("%d",&n); for(i=1; i<=n; i++){ s = s * 1.05; if(s % 1000 != 0){ s = (s/1000 + 1) * 1000; } } printf("%d\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166222/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166222/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not10 = icmp slt i32 %0, 1 br i1 %cmp.not10, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %s.011 = phi i32 [ 100000, %for.body.preheader.new ], [ %s.1.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %s.011 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %conv1.fr = freeze i32 %conv1 %rem = srem i32 %conv1.fr, 1000 %cmp2.not = icmp eq i32 %rem, 0 %2 = add i32 %conv1.fr, 1000 %mul4 = sub i32 %2, %rem %s.1 = select i1 %cmp2.not, i32 %conv1.fr, i32 %mul4 %conv.1 = sitofp i32 %s.1 to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %conv1.fr.1 = freeze i32 %conv1.1 %rem.1 = srem i32 %conv1.fr.1, 1000 %cmp2.not.1 = icmp eq i32 %rem.1, 0 %3 = add i32 %conv1.fr.1, 1000 %mul4.1 = sub i32 %3, %rem.1 %s.1.1 = select i1 %cmp2.not.1, i32 %conv1.fr.1, i32 %mul4.1 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %4 = sitofp i32 %s.1.1 to double %5 = fmul double %4, 1.050000e+00 %6 = fptosi double %5 to i32 %7 = freeze i32 %6 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %s.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %s.1.1, %for.end.loopexit.unr-lcssa.loopexit ] %s.011.unr = phi i32 [ 105000, %for.body.preheader ], [ %7, %for.end.loopexit.unr-lcssa.loopexit ] %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 %rem.epil = srem i32 %s.011.unr, 1000 %cmp2.not.epil = icmp eq i32 %rem.epil, 0 %8 = add i32 %s.011.unr, 1000 %mul4.epil = sub i32 %8, %rem.epil %s.1.epil = select i1 %cmp2.not.epil, i32 %s.011.unr, i32 %mul4.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %s.0.lcssa = phi i32 [ 100000, %entry ], [ %s.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %s.1.epil, %for.body.epil ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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> /** Application main entry point. */ int main ( int argc, char *argv[ ] ) { int res = 100000; int n; scanf ( "%d", &n ); while ( n-- ) { res += res / 20; if ( res % 1000 ) { res = ( res / 1000 ) * 1000 + 1000; } } printf ( "%d\n", res ); return ( 0 ); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166295/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166295/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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(i32 noundef %argc, ptr nocapture noundef readnone %argv) 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) %n.promoted = load i32, ptr %n, align 4, !tbaa !5 %tobool.not11 = icmp eq i32 %n.promoted, 0 br i1 %tobool.not11, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %dec13.in = phi i32 [ %dec13, %while.body ], [ %n.promoted, %entry ] %res.012 = phi i32 [ %res.1, %while.body ], [ 100000, %entry ] %dec13 = add nsw i32 %dec13.in, -1 %div = sdiv i32 %res.012, 20 %add = add i32 %div, %res.012 %rem = srem i32 %add, 1000 %tobool1.not = icmp eq i32 %rem, 0 %mul = add i32 %add, 1000 %add3 = sub i32 %mul, %rem %res.1 = select i1 %tobool1.not, i32 %add, i32 %add3 %tobool.not = icmp eq i32 %dec13, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %res.0.lcssa = phi i32 [ 100000, %entry ], [ %res.1, %while.body ] store i32 -1, ptr %n, align 4, !tbaa !5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int i,j,k,l,m,n; m=100000; scanf("%d",&n); for(i=1;i<=n;i++){ m=m*1.05; if((l=m%1000)!=0)m=m+1000-l; } printf("%d\n",m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166338/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166338/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not9 = icmp slt i32 %0, 1 br i1 %cmp.not9, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %m.011 = phi i32 [ 100000, %for.body.preheader.new ], [ %m.1.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %m.011 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %rem = srem i32 %conv1, 1000 %cmp2.not = icmp eq i32 %rem, 0 %add = add nsw i32 %conv1, 1000 %sub = sub i32 %add, %rem %m.1 = select i1 %cmp2.not, i32 %conv1, i32 %sub %conv.1 = sitofp i32 %m.1 to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %rem.1 = srem i32 %conv1.1, 1000 %cmp2.not.1 = icmp eq i32 %rem.1, 0 %add.1 = add nsw i32 %conv1.1, 1000 %sub.1 = sub i32 %add.1, %rem.1 %m.1.1 = select i1 %cmp2.not.1, i32 %conv1.1, i32 %sub.1 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %2 = sitofp i32 %m.1.1 to double %3 = fmul double %2, 1.050000e+00 %4 = fptosi double %3 to i32 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %m.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %m.1.1, %for.end.loopexit.unr-lcssa.loopexit ] %m.011.unr = phi i32 [ 105000, %for.body.preheader ], [ %4, %for.end.loopexit.unr-lcssa.loopexit ] %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 %rem.epil = srem i32 %m.011.unr, 1000 %cmp2.not.epil = icmp eq i32 %rem.epil, 0 %add.epil = add nsw i32 %m.011.unr, 1000 %sub.epil = sub i32 %add.epil, %rem.epil %m.1.epil = select i1 %cmp2.not.epil, i32 %m.011.unr, i32 %sub.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %m.0.lcssa = phi i32 [ 100000, %entry ], [ %m.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %m.1.epil, %for.body.epil ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int n,i,result=100000; scanf("%d",&n); for(i=0;i<n;i++){ result=result*1.05; if(result%1000!=0){ result=result-result%1000+1000; } } printf("%d\n",result); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166389/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166389/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %result.013 = phi i32 [ 100000, %for.body.preheader.new ], [ %result.1.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %result.013 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %rem = srem i32 %conv1, 1000 %cmp2.not = icmp eq i32 %rem, 0 %sub = add i32 %conv1, 1000 %add = sub i32 %sub, %rem %result.1 = select i1 %cmp2.not, i32 %conv1, i32 %add %conv.1 = sitofp i32 %result.1 to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %rem.1 = srem i32 %conv1.1, 1000 %cmp2.not.1 = icmp eq i32 %rem.1, 0 %sub.1 = add i32 %conv1.1, 1000 %add.1 = sub i32 %sub.1, %rem.1 %result.1.1 = select i1 %cmp2.not.1, i32 %conv1.1, i32 %add.1 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %2 = sitofp i32 %result.1.1 to double %3 = fmul double %2, 1.050000e+00 %4 = fptosi double %3 to i32 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %result.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %result.1.1, %for.end.loopexit.unr-lcssa.loopexit ] %result.013.unr = phi i32 [ 105000, %for.body.preheader ], [ %4, %for.end.loopexit.unr-lcssa.loopexit ] %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 %rem.epil = srem i32 %result.013.unr, 1000 %cmp2.not.epil = icmp eq i32 %rem.epil, 0 %sub.epil = add i32 %result.013.unr, 1000 %add.epil = sub i32 %sub.epil, %rem.epil %result.1.epil = select i1 %cmp2.not.epil, i32 %result.013.unr, i32 %add.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %result.0.lcssa = phi i32 [ 100000, %entry ], [ %result.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %result.1.epil, %for.body.epil ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int n,i,b,c,d,e,f; b=100; d=100000; scanf("%d",&n); for(i=0;i<n;i++){ c=b*1.05; e=d*1.05; if(c*1000!=e){ c=c+1; } b=c; d=c*1000; } printf("%d\n",c*1000); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166439/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166439/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %b.018 = phi i32 [ 100, %for.body.preheader.new ], [ %spec.select.1, %for.body ] %d.017 = phi i32 [ 100000, %for.body.preheader.new ], [ %mul8.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %b.018 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %conv2 = sitofp i32 %d.017 to double %mul3 = fmul double %conv2, 1.050000e+00 %conv4 = fptosi double %mul3 to i32 %mul5 = mul nsw i32 %conv1, 1000 %cmp6.not = icmp ne i32 %mul5, %conv4 %add = zext i1 %cmp6.not to i32 %spec.select = add nsw i32 %add, %conv1 %mul8 = mul nsw i32 %spec.select, 1000 %conv.1 = sitofp i32 %spec.select to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %conv2.1 = sitofp i32 %mul8 to double %mul3.1 = fmul double %conv2.1, 1.050000e+00 %conv4.1 = fptosi double %mul3.1 to i32 %mul5.1 = mul nsw i32 %conv1.1, 1000 %cmp6.not.1 = icmp ne i32 %mul5.1, %conv4.1 %add.1 = zext i1 %cmp6.not.1 to i32 %spec.select.1 = add nsw i32 %add.1, %conv1.1 %mul8.1 = mul nsw i32 %spec.select.1, 1000 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %2 = sitofp i32 %spec.select.1 to double %3 = fmul double %2, 1.050000e+00 %4 = fptosi double %3 to i32 %5 = sitofp i32 %mul8.1 to double %6 = fmul double %5, 1.050000e+00 %7 = fptosi double %6 to i32 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.end.loopexit.unr-lcssa.loopexit ] %b.018.unr = phi i32 [ 105, %for.body.preheader ], [ %4, %for.end.loopexit.unr-lcssa.loopexit ] %d.017.unr = phi i32 [ 105000, %for.body.preheader ], [ %7, %for.end.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 %mul5.epil = mul nsw i32 %b.018.unr, 1000 %cmp6.not.epil = icmp ne i32 %mul5.epil, %d.017.unr %add.epil = zext i1 %cmp6.not.epil to i32 %spec.select.epil = add nsw i32 %b.018.unr, %add.epil %spec.select.lcssa = select i1 %lcmp.mod.not, i32 %spec.select.lcssa.ph, i32 %spec.select.epil %8 = mul nsw i32 %spec.select.lcssa, 1000 br label %for.end for.end: ; preds = %entry, %for.end.loopexit.unr-lcssa %c.0.lcssa = phi i32 [ %8, %for.end.loopexit.unr-lcssa ], [ 0, %entry ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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> #define PI 3.14159265358979323 //void quick(int *,long long,long long); //int comp(char *a,char *b); int main(){ int i,j; scanf("%d",&i); j=100000; while(i>0){ j=(float)j*1.05-0.1; j=(j/1000+1)*1000; i--; } printf("%d\n",j); //for(i=0;i<=1000000000;i++); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166482/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166482/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %.pr = load i32, ptr %i, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %.pr, 0 br i1 %cmp6, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %xtraiter = and i32 %.pr, 1 %0 = icmp eq i32 %.pr, 1 br i1 %0, label %while.cond.while.end_crit_edge.unr-lcssa, label %while.body.preheader.new while.body.preheader.new: ; preds = %while.body.preheader %unroll_iter = and i32 %.pr, -2 br label %while.body while.body: ; preds = %while.body, %while.body.preheader.new %j.07 = phi i32 [ 100000, %while.body.preheader.new ], [ %mul.1, %while.body ] %niter = phi i32 [ 0, %while.body.preheader.new ], [ %niter.next.1, %while.body ] %conv = sitofp i32 %j.07 to float %conv1 = fpext float %conv to double %1 = call double @llvm.fmuladd.f64(double %conv1, double 1.050000e+00, double -1.000000e-01) %conv2 = fptosi double %1 to i32 %conv2.fr = freeze i32 %conv2 %2 = srem i32 %conv2.fr, 1000 %3 = add i32 %conv2.fr, 1000 %mul = sub i32 %3, %2 %conv.1 = sitofp i32 %mul to float %conv1.1 = fpext float %conv.1 to double %4 = call double @llvm.fmuladd.f64(double %conv1.1, double 1.050000e+00, double -1.000000e-01) %conv2.1 = fptosi double %4 to i32 %conv2.fr.1 = freeze i32 %conv2.1 %5 = srem i32 %conv2.fr.1, 1000 %6 = add i32 %conv2.fr.1, 1000 %mul.1 = sub i32 %6, %5 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1.not = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %while.cond.while.end_crit_edge.unr-lcssa.loopexit, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge.unr-lcssa.loopexit: ; preds = %while.body %7 = sitofp i32 %mul.1 to float %8 = fpext float %7 to double br label %while.cond.while.end_crit_edge.unr-lcssa while.cond.while.end_crit_edge.unr-lcssa: ; preds = %while.cond.while.end_crit_edge.unr-lcssa.loopexit, %while.body.preheader %mul.lcssa.ph = phi i32 [ undef, %while.body.preheader ], [ %mul.1, %while.cond.while.end_crit_edge.unr-lcssa.loopexit ] %j.07.unr = phi double [ 1.000000e+05, %while.body.preheader ], [ %8, %while.cond.while.end_crit_edge.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.while.end_crit_edge, label %while.body.epil while.body.epil: ; preds = %while.cond.while.end_crit_edge.unr-lcssa %9 = call double @llvm.fmuladd.f64(double %j.07.unr, double 1.050000e+00, double -1.000000e-01) %conv2.epil = fptosi double %9 to i32 %conv2.fr.epil = freeze i32 %conv2.epil %10 = srem i32 %conv2.fr.epil, 1000 %11 = add i32 %conv2.fr.epil, 1000 %mul.epil = sub i32 %11, %10 br label %while.cond.while.end_crit_edge while.cond.while.end_crit_edge: ; preds = %while.cond.while.end_crit_edge.unr-lcssa, %while.body.epil %mul.lcssa = phi i32 [ %mul.lcssa.ph, %while.cond.while.end_crit_edge.unr-lcssa ], [ %mul.epil, %while.body.epil ] store i32 0, ptr %i, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %j.0.lcssa = phi i32 [ %mul.lcssa, %while.cond.while.end_crit_edge ], [ 100000, %entry ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int f_debt(int n) { n *= 1.05; if(n % 1000 != 0) { n = n - (n%1000) + 1000; } return n; } int main() { int i,n,debt=100000; scanf("%d",&n); for(i=0;i<n;i++) { debt = f_debt(debt); } printf("%d\n",debt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166525/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166525/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @f_debt(i32 noundef %n) local_unnamed_addr #0 { entry: %conv = sitofp i32 %n to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %rem = srem i32 %conv1, 1000 %cmp.not = icmp eq i32 %rem, 0 %sub = add i32 %conv1, 1000 %add = sub i32 %sub, %rem %n.addr.0 = select i1 %cmp.not, i32 %conv1, i32 %add ret i32 %n.addr.0 } ; 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) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %0, 0 br i1 %cmp5, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %debt.07 = phi i32 [ 100000, %for.body.preheader.new ], [ %n.addr.0.i.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv.i = sitofp i32 %debt.07 to double %mul.i = fmul double %conv.i, 1.050000e+00 %conv1.i = fptosi double %mul.i to i32 %rem.i = srem i32 %conv1.i, 1000 %cmp.not.i = icmp eq i32 %rem.i, 0 %sub.i = add i32 %conv1.i, 1000 %add.i = sub i32 %sub.i, %rem.i %n.addr.0.i = select i1 %cmp.not.i, i32 %conv1.i, i32 %add.i %conv.i.1 = sitofp i32 %n.addr.0.i to double %mul.i.1 = fmul double %conv.i.1, 1.050000e+00 %conv1.i.1 = fptosi double %mul.i.1 to i32 %rem.i.1 = srem i32 %conv1.i.1, 1000 %cmp.not.i.1 = icmp eq i32 %rem.i.1, 0 %sub.i.1 = add i32 %conv1.i.1, 1000 %add.i.1 = sub i32 %sub.i.1, %rem.i.1 %n.addr.0.i.1 = select i1 %cmp.not.i.1, i32 %conv1.i.1, i32 %add.i.1 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %2 = sitofp i32 %n.addr.0.i.1 to double %3 = fmul double %2, 1.050000e+00 %4 = fptosi double %3 to i32 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %n.addr.0.i.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %n.addr.0.i.1, %for.end.loopexit.unr-lcssa.loopexit ] %debt.07.unr = phi i32 [ 105000, %for.body.preheader ], [ %4, %for.end.loopexit.unr-lcssa.loopexit ] %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 %rem.i.epil = srem i32 %debt.07.unr, 1000 %cmp.not.i.epil = icmp eq i32 %rem.i.epil, 0 %sub.i.epil = add i32 %debt.07.unr, 1000 %add.i.epil = sub i32 %sub.i.epil, %rem.i.epil %n.addr.0.i.epil = select i1 %cmp.not.i.epil, i32 %debt.07.unr, i32 %add.i.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %debt.0.lcssa = phi i32 [ 100000, %entry ], [ %n.addr.0.i.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %n.addr.0.i.epil, %for.body.epil ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %debt.0.lcssa) 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int i, n, debt = 100000; scanf("%d", &n); for (i = 0; i < n; i++) { debt *= 1.05; debt = debt % 1000 ? (debt / 1000 + 1) * 1000 : debt; } printf("%d\n", debt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166576/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166576/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %xtraiter = and i32 %0, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %0, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %debt.011 = phi i32 [ 100000, %for.body.preheader.new ], [ %cond.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %conv = sitofp i32 %debt.011 to double %mul = fmul double %conv, 1.050000e+00 %conv1 = fptosi double %mul to i32 %conv1.fr = freeze i32 %conv1 %rem = srem i32 %conv1.fr, 1000 %tobool.not = icmp eq i32 %rem, 0 %2 = add i32 %conv1.fr, 1000 %mul2 = sub i32 %2, %rem %cond = select i1 %tobool.not, i32 %conv1.fr, i32 %mul2 %conv.1 = sitofp i32 %cond to double %mul.1 = fmul double %conv.1, 1.050000e+00 %conv1.1 = fptosi double %mul.1 to i32 %conv1.fr.1 = freeze i32 %conv1.1 %rem.1 = srem i32 %conv1.fr.1, 1000 %tobool.not.1 = icmp eq i32 %rem.1, 0 %3 = add i32 %conv1.fr.1, 1000 %mul2.1 = sub i32 %3, %rem.1 %cond.1 = select i1 %tobool.not.1, i32 %conv1.fr.1, i32 %mul2.1 %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.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body %4 = sitofp i32 %cond.1 to double %5 = fmul double %4, 1.050000e+00 %6 = fptosi double %5 to i32 %7 = freeze i32 %6 br label %for.end.loopexit.unr-lcssa for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader %cond.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %cond.1, %for.end.loopexit.unr-lcssa.loopexit ] %debt.011.unr = phi i32 [ 105000, %for.body.preheader ], [ %7, %for.end.loopexit.unr-lcssa.loopexit ] %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 %rem.epil = srem i32 %debt.011.unr, 1000 %tobool.not.epil = icmp eq i32 %rem.epil, 0 %8 = add i32 %debt.011.unr, 1000 %mul2.epil = sub i32 %8, %rem.epil %cond.epil = select i1 %tobool.not.epil, i32 %debt.011.unr, i32 %mul2.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %debt.0.lcssa = phi i32 [ 100000, %entry ], [ %cond.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %cond.epil, %for.body.epil ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %debt.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void){ int answer=0,n,state=0; int i; char str[200]; while(scanf("%s",&*str)!=EOF){ state=0; n=strlen(str); for(i=0;i<n/2;i++){ if(str[i]!=str[n-1-i]){ state++; break; } } if(state==0){ answer++; } } printf("%d\n",answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166619/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166619/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %str) #4 %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %cmp.not30 = icmp eq i32 %call29, -1 br i1 %cmp.not30, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %answer.031 = phi i32 [ %spec.select, %for.end ], [ 0, %entry ] %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5 %conv = trunc i64 %call2 to i32 %cmp3.not25 = icmp slt i32 %conv, 2 br i1 %cmp3.not25, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %while.body %div3334 = lshr i32 %conv, 1 %0 = zext i32 %div3334 to i64 %wide.trip.count = zext i32 %div3334 to i64 %1 = load i8, ptr %str, align 16, !tbaa !5 %sub635 = shl i64 %call2, 32 %sext36 = add i64 %sub635, -4294967296 %idxprom737 = ashr exact i64 %sext36, 32 %arrayidx838 = getelementptr inbounds [200 x i8], ptr %str, i64 0, i64 %idxprom737 %2 = load i8, ptr %arrayidx838, align 1, !tbaa !5 %cmp10.not39 = icmp eq i8 %1, %2 br i1 %cmp10.not39, label %for.cond, label %for.end for.cond: ; preds = %for.body.preheader, %for.body %indvars.iv40 = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ] %indvars.iv.next = add nuw nsw i64 %indvars.iv40, 1 %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond, label %for.end.loopexit, label %for.body, !llvm.loop !8 for.body: ; preds = %for.cond %arrayidx = getelementptr inbounds [200 x i8], ptr %str, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx, align 1, !tbaa !5 %reass.sub = sub i64 %call2, %indvars.iv40 %sub6 = shl i64 %reass.sub, 32 %sext = add i64 %sub6, -8589934592 %idxprom7 = ashr exact i64 %sext, 32 %arrayidx8 = getelementptr inbounds [200 x i8], ptr %str, i64 0, i64 %idxprom7 %4 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %cmp10.not = icmp eq i8 %3, %4 br i1 %cmp10.not, label %for.cond, label %for.end.loopexit, !llvm.loop !8 for.end.loopexit: ; preds = %for.cond, %for.body %cmp3.not.le = icmp uge i64 %indvars.iv.next, %0 br label %for.end for.end: ; preds = %for.end.loopexit, %for.body.preheader, %while.body %cmp3.not.lcssa = phi i1 [ true, %while.body ], [ false, %for.body.preheader ], [ %cmp3.not.le, %for.end.loopexit ] %inc16 = zext i1 %cmp3.not.lcssa to i32 %spec.select = add nuw nsw i32 %answer.031, %inc16 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %for.end, %entry %answer.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.end ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %answer.0.lcssa) call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %str) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include <stdio.h> #include <string.h> int asdfdsa(char str[]); int main(void) { int cnt=0; char str[200]; while(scanf("%s",str)!=EOF) if(asdfdsa(str)) cnt++; printf("%d\n",cnt); return 0; } int asdfdsa(char str[]) { int i,size; size=strlen(str); for(i=0; i<=size/2; i++) if(str[i]!=str[size-1-i]) return 0; return 1; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166662/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166662/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %str) #5 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %while.cond %cnt.010 = phi i32 [ %4, %while.cond ], [ 0, %entry ] %call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv.i = trunc i64 %call.i to i32 %cmp.not16.i = icmp slt i32 %conv.i, -1 br i1 %cmp.not16.i, label %asdfdsa.exit.thread, label %for.body.preheader.i for.body.preheader.i: ; preds = %while.body %div.i = sdiv i32 %conv.i, 2 %0 = add nuw nsw i32 %div.i, 1 %wide.trip.count.i = zext i32 %0 to i64 br label %for.body.i for.cond.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 %asdfdsa.exit.thread, label %for.body.i, !llvm.loop !5 for.body.i: ; preds = %for.cond.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ] %arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i %1 = load i8, ptr %arrayidx.i, align 1, !tbaa !7 %2 = xor i64 %indvars.iv.i, -1 %sub3.i = add i64 %call.i, %2 %sext.i = shl i64 %sub3.i, 32 %idxprom4.i = ashr exact i64 %sext.i, 32 %arrayidx5.i = getelementptr inbounds i8, ptr %str, i64 %idxprom4.i %3 = load i8, ptr %arrayidx5.i, align 1, !tbaa !7 %cmp7.not.i = icmp eq i8 %1, %3 br i1 %cmp7.not.i, label %for.cond.i, label %while.cond asdfdsa.exit.thread: ; preds = %for.cond.i, %while.body %inc7 = add nsw i32 %cnt.010, 1 br label %while.cond while.cond: ; preds = %for.body.i, %asdfdsa.exit.thread %4 = phi i32 [ %inc7, %asdfdsa.exit.thread ], [ %cnt.010, %for.body.i ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %while.cond, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %4, %while.cond ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %str) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind memory(argmem: read) uwtable define dso_local i32 @asdfdsa(ptr nocapture noundef readonly %str) local_unnamed_addr #3 { entry: %call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %conv = trunc i64 %call to i32 %cmp.not16 = icmp slt i32 %conv, -1 br i1 %cmp.not16, label %cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %div = sdiv i32 %conv, 2 %0 = add nuw nsw i32 %div, 1 %wide.trip.count = zext i32 %0 to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !5 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !7 %2 = xor i64 %indvars.iv, -1 %sub3 = add i64 %call, %2 %sext = shl i64 %sub3, 32 %idxprom4 = ashr exact i64 %sext, 32 %arrayidx5 = getelementptr inbounds i8, ptr %str, i64 %idxprom4 %3 = load i8, ptr %arrayidx5, align 1, !tbaa !7 %cmp7.not = icmp eq i8 %1, %3 br i1 %cmp7.not, label %for.cond, label %cleanup cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn 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 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = distinct !{!10, !6}
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #define _USE_MATH_DEFINES #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define BIG 2000000007 #define VERYBIG 200000000000007LL #define MOD 1000000007 typedef uint64_t ull; typedef int64_t sll; #define N_MAX 2000 #define M_MAX 200000 ull n, m; ull a[N_MAX]; ull b[N_MAX]; bool isreached[100][100]; bool isreachable[100][100]; void set1nize (ull v, bool *array[]) { sll i, j, ki; for (i = 0; i < n; i++) { for (j = 0; j < v; j++) { for (ki = j; ki <= 50; ki += v) { if (array[i][ki]) { array[i][j] = true; break; } } } // (j-k loop) =~ 50 } return; } bool is0able (ull v) { sll i, j; bool *isreachable_ARG[100]; for (i = 0; i < n; i++) { isreachable_ARG[i] = isreachable[i]; for (j = 0; j <= 50; j++) { isreachable[i][j] = isreached[i][j]; } } while (--v) { set1nize(v, isreachable_ARG); } for (i = 0; i < n; i++) { if (!isreachable[i][b[i]]) return false; } return true; } ull solve () { sll i, j, ki; // ull result = 0; sll result = 0; // double result = 0; // ull maybe = 0; sll maybe = 0; // ull sum = 0; sll sum = 0; ull item; ull *dpcell; bool *isreached_ARG[100]; for (i = 0; i < n; i++) { isreached_ARG[i] = isreached[i]; } for (i = 0; i < n; i++) { for (j = 0; j <= 50; j++) { isreached[i][j] = false; } isreached[i][a[i]] = true; } if (!is0able(51)) goto fail; result = 0; for (i = 50; i >= 1; i--) { if (!is0able(i)) { result |= (1ULL << i); set1nize(i, isreached_ARG); } } printf("%llu\n", result); return 0; fail: puts("-1"); return 1; } int32_t main (void) { int32_t i, j; int32_t 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_166705/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166705/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i64 0, align 8 @isreachable = dso_local global [100 x [100 x i8]] zeroinitializer, align 16 @isreached = dso_local global [100 x [100 x i8]] zeroinitializer, align 16 @b = dso_local global [2000 x i64] zeroinitializer, align 16 @a = dso_local global [2000 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 [3 x i8] c"-1\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 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @set1nize(i64 noundef %v, ptr nocapture noundef readonly %array) local_unnamed_addr #0 { entry: %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp30.not = icmp eq i64 %0, 0 %cmp227.not = icmp eq i64 %v, 0 %or.cond = or i1 %cmp30.not, %cmp227.not br i1 %or.cond, label %for.end14, label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %entry, %for.cond1.for.inc12_crit_edge.us %i.031.us = phi i64 [ %inc13.us, %for.cond1.for.inc12_crit_edge.us ], [ 0, %entry ] %arrayidx.us = getelementptr inbounds ptr, ptr %array, i64 %i.031.us br label %for.cond4.preheader.us for.cond4.us: ; preds = %for.body6.us %add.us = add i64 %ki.026.us, %v %cmp5.us = icmp slt i64 %add.us, 51 br i1 %cmp5.us, label %for.body6.us, label %for.inc10.us, !llvm.loop !9 for.body6.us: ; preds = %for.body6.lr.ph.us, %for.cond4.us %ki.026.us = phi i64 [ %j.028.us, %for.body6.lr.ph.us ], [ %add.us, %for.cond4.us ] %arrayidx7.us = getelementptr inbounds i8, ptr %2, i64 %ki.026.us %1 = load i8, ptr %arrayidx7.us, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us = icmp eq i8 %1, 0 br i1 %tobool.not.us, label %for.cond4.us, label %if.then.us if.then.us: ; preds = %for.body6.us %arrayidx9.us = getelementptr inbounds i8, ptr %2, i64 %j.028.us store i8 1, ptr %arrayidx9.us, align 1, !tbaa !11 br label %for.inc10.us for.inc10.us: ; preds = %for.cond4.us, %for.cond4.preheader.us, %if.then.us %inc.us = add nuw nsw i64 %j.028.us, 1 %exitcond.not = icmp eq i64 %inc.us, %v br i1 %exitcond.not, label %for.cond1.for.inc12_crit_edge.us, label %for.cond4.preheader.us, !llvm.loop !15 for.cond4.preheader.us: ; preds = %for.cond1.preheader.us, %for.inc10.us %j.028.us = phi i64 [ 0, %for.cond1.preheader.us ], [ %inc.us, %for.inc10.us ] %cmp525.us = icmp ult i64 %j.028.us, 51 br i1 %cmp525.us, label %for.body6.lr.ph.us, label %for.inc10.us for.body6.lr.ph.us: ; preds = %for.cond4.preheader.us %2 = load ptr, ptr %arrayidx.us, align 8, !tbaa !16 br label %for.body6.us for.cond1.for.inc12_crit_edge.us: ; preds = %for.inc10.us %inc13.us = add nuw nsw i64 %i.031.us, 1 %exitcond33.not = icmp eq i64 %inc13.us, %0 br i1 %exitcond33.not, label %for.end14, label %for.cond1.preheader.us, !llvm.loop !18 for.end14: ; preds = %for.cond1.for.inc12_crit_edge.us, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local zeroext i1 @is0able(i64 noundef %v) local_unnamed_addr #2 { entry: %isreachable_ARG = alloca [100 x ptr], align 16 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %isreachable_ARG) #7 %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp40.not = icmp eq i64 %0, 0 br i1 %cmp40.not, label %cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %0, 1 %1 = icmp eq i64 %0, 1 br i1 %1, label %while.cond.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %0, -2 br label %for.body while.cond.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %i.041.unr = phi i64 [ 0, %for.body.preheader ], [ %inc10.1, %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.unr-lcssa %2 = mul nuw nsw i64 %i.041.unr, 100 %scevgep.epil = getelementptr i8, ptr @isreachable, i64 %2 %scevgep51.epil = getelementptr i8, ptr @isreached, i64 %2 %arrayidx.epil = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %i.041.unr %arrayidx1.epil = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG, i64 0, i64 %i.041.unr store ptr %arrayidx.epil, ptr %arrayidx1.epil, align 8, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.epil, ptr noundef nonnull align 4 dereferenceable(51) %scevgep51.epil, i64 51, i1 false), !tbaa !11 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.unr-lcssa, %for.body.epil %dec42 = add i64 %v, -1 %tobool12.not43 = icmp eq i64 %dec42, 0 br i1 %tobool12.not43, label %for.cond14.preheader, label %while.body.lr.ph while.body.lr.ph: ; preds = %while.cond.preheader br i1 %cmp40.not, label %cleanup, label %while.body for.body: ; preds = %for.body, %for.body.preheader.new %i.041 = phi i64 [ 0, %for.body.preheader.new ], [ %inc10.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %3 = mul nuw nsw i64 %i.041, 100 %scevgep = getelementptr i8, ptr @isreachable, i64 %3 %scevgep51 = getelementptr i8, ptr @isreached, i64 %3 %arrayidx = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %i.041 %arrayidx1 = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG, i64 0, i64 %i.041 store ptr %arrayidx, ptr %arrayidx1, align 16, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(51) %scevgep, ptr noundef nonnull align 8 dereferenceable(51) %scevgep51, i64 51, i1 false), !tbaa !11 %inc10 = or i64 %i.041, 1 %4 = mul nuw nsw i64 %inc10, 100 %scevgep.1 = getelementptr i8, ptr @isreachable, i64 %4 %scevgep51.1 = getelementptr i8, ptr @isreached, i64 %4 %arrayidx.1 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %inc10 %arrayidx1.1 = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG, i64 0, i64 %inc10 store ptr %arrayidx.1, ptr %arrayidx1.1, align 8, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.1, ptr noundef nonnull align 4 dereferenceable(51) %scevgep51.1, i64 51, i1 false), !tbaa !11 %inc10.1 = add nuw nsw i64 %i.041, 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 %while.cond.preheader.unr-lcssa, label %for.body, !llvm.loop !19 for.cond14.preheader: ; preds = %set1nize.exit.loopexit, %while.cond.preheader br i1 %cmp40.not, label %cleanup, label %for.body16.preheader for.body16.preheader: ; preds = %for.cond14.preheader %5 = load i64, ptr @b, align 16, !tbaa !5 %arrayidx1957 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 0, i64 %5 %6 = load i8, ptr %arrayidx1957, align 1, !tbaa !11, !range !13, !noundef !14 %tobool20.not58 = icmp eq i8 %6, 0 br i1 %tobool20.not58, label %cleanup, label %for.cond14 while.body: ; preds = %while.body.lr.ph, %set1nize.exit.loopexit %dec44 = phi i64 [ %dec, %set1nize.exit.loopexit ], [ %dec42, %while.body.lr.ph ] br label %for.cond1.preheader.us.i for.cond1.preheader.us.i: ; preds = %while.body, %for.cond1.for.inc12_crit_edge.us.i %i.031.us.i = phi i64 [ %inc13.us.i, %for.cond1.for.inc12_crit_edge.us.i ], [ 0, %while.body ] %arrayidx.us.i = getelementptr inbounds ptr, ptr %isreachable_ARG, i64 %i.031.us.i br label %for.cond4.preheader.us.i for.cond4.us.i: ; preds = %for.body6.us.i %add.us.i = add i64 %ki.026.us.i, %dec44 %cmp5.us.i = icmp slt i64 %add.us.i, 51 br i1 %cmp5.us.i, label %for.body6.us.i, label %for.inc10.us.i, !llvm.loop !9 for.body6.us.i: ; preds = %for.body6.lr.ph.us.i, %for.cond4.us.i %ki.026.us.i = phi i64 [ %j.028.us.i, %for.body6.lr.ph.us.i ], [ %add.us.i, %for.cond4.us.i ] %arrayidx7.us.i = getelementptr inbounds i8, ptr %8, i64 %ki.026.us.i %7 = load i8, ptr %arrayidx7.us.i, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i = icmp eq i8 %7, 0 br i1 %tobool.not.us.i, label %for.cond4.us.i, label %if.then.us.i if.then.us.i: ; preds = %for.body6.us.i %arrayidx9.us.i = getelementptr inbounds i8, ptr %8, i64 %j.028.us.i store i8 1, ptr %arrayidx9.us.i, align 1, !tbaa !11 br label %for.inc10.us.i for.inc10.us.i: ; preds = %for.cond4.us.i, %for.cond4.preheader.us.i, %if.then.us.i %inc.us.i = add nuw nsw i64 %j.028.us.i, 1 %exitcond.not.i = icmp eq i64 %inc.us.i, %dec44 br i1 %exitcond.not.i, label %for.cond1.for.inc12_crit_edge.us.i, label %for.cond4.preheader.us.i, !llvm.loop !15 for.cond4.preheader.us.i: ; preds = %for.inc10.us.i, %for.cond1.preheader.us.i %j.028.us.i = phi i64 [ 0, %for.cond1.preheader.us.i ], [ %inc.us.i, %for.inc10.us.i ] %cmp525.us.i = icmp ult i64 %j.028.us.i, 51 br i1 %cmp525.us.i, label %for.body6.lr.ph.us.i, label %for.inc10.us.i for.body6.lr.ph.us.i: ; preds = %for.cond4.preheader.us.i %8 = load ptr, ptr %arrayidx.us.i, align 8, !tbaa !16 br label %for.body6.us.i for.cond1.for.inc12_crit_edge.us.i: ; preds = %for.inc10.us.i %inc13.us.i = add nuw nsw i64 %i.031.us.i, 1 %exitcond33.not.i = icmp eq i64 %inc13.us.i, %0 br i1 %exitcond33.not.i, label %set1nize.exit.loopexit, label %for.cond1.preheader.us.i, !llvm.loop !18 set1nize.exit.loopexit: ; preds = %for.cond1.for.inc12_crit_edge.us.i %dec = add i64 %dec44, -1 %tobool12.not = icmp eq i64 %dec, 0 br i1 %tobool12.not, label %for.cond14.preheader, label %while.body, !llvm.loop !20 for.cond14: ; preds = %for.body16.preheader, %for.body16 %i.14659 = phi i64 [ %inc22, %for.body16 ], [ 0, %for.body16.preheader ] %inc22 = add nuw i64 %i.14659, 1 %exitcond52 = icmp eq i64 %inc22, %0 br i1 %exitcond52, label %cleanup.loopexit, label %for.body16, !llvm.loop !21 for.body16: ; preds = %for.cond14 %arrayidx18 = getelementptr inbounds [2000 x i64], ptr @b, i64 0, i64 %inc22 %9 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %arrayidx19 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %inc22, i64 %9 %10 = load i8, ptr %arrayidx19, align 1, !tbaa !11, !range !13, !noundef !14 %tobool20.not = icmp eq i8 %10, 0 br i1 %tobool20.not, label %cleanup.loopexit, label %for.cond14, !llvm.loop !21 cleanup.loopexit: ; preds = %for.body16, %for.cond14 %cmp15.le = icmp uge i64 %inc22, %0 br label %cleanup cleanup: ; preds = %cleanup.loopexit, %for.body16.preheader, %entry, %while.body.lr.ph, %for.cond14.preheader %cmp15.lcssa = phi i1 [ true, %for.cond14.preheader ], [ true, %while.body.lr.ph ], [ true, %entry ], [ false, %for.body16.preheader ], [ %cmp15.le, %cleanup.loopexit ] call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreachable_ARG) #7 ret i1 %cmp15.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #3 { entry: %isreachable_ARG.i54 = alloca [100 x ptr], align 16 %isreachable_ARG.i = alloca [100 x ptr], align 16 %isreached_ARG = alloca [100 x ptr], align 16 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %isreached_ARG) #7 %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp107.not = icmp eq i64 %0, 0 br i1 %cmp107.not, label %for.end18.thread, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %0, 4 br i1 %min.iters.check, label %for.body.preheader128, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2> %1 = getelementptr inbounds [100 x [100 x i8]], ptr @isreached, i64 0, <2 x i64> %vec.ind %2 = getelementptr inbounds [100 x [100 x i8]], ptr @isreached, i64 0, <2 x i64> %step.add %3 = getelementptr inbounds [100 x ptr], ptr %isreached_ARG, i64 0, i64 %index store <2 x ptr> %1, ptr %3, align 16, !tbaa !16 %4 = getelementptr inbounds ptr, ptr %3, i64 2 store <2 x ptr> %2, ptr %4, align 16, !tbaa !16 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %0, %n.vec br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader128 for.body.preheader128: ; preds = %for.body.preheader, %middle.block %i.0108.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 %cmp107.not, label %for.end18.thread, label %for.cond5.preheader.preheader for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %6 = add i64 %0, -1 %xtraiter = and i64 %0, 1 %7 = icmp eq i64 %6, 0 br i1 %7, label %for.end18.unr-lcssa, label %for.cond5.preheader.preheader.new for.cond5.preheader.preheader.new: ; preds = %for.cond5.preheader.preheader %unroll_iter = and i64 %0, -2 br label %for.cond5.preheader for.body: ; preds = %for.body.preheader128, %for.body %i.0108 = phi i64 [ %inc, %for.body ], [ %i.0108.ph, %for.body.preheader128 ] %arrayidx = getelementptr inbounds [100 x [100 x i8]], ptr @isreached, i64 0, i64 %i.0108 %arrayidx1 = getelementptr inbounds [100 x ptr], ptr %isreached_ARG, i64 0, i64 %i.0108 store ptr %arrayidx, ptr %arrayidx1, align 8, !tbaa !16 %inc = add nuw nsw i64 %i.0108, 1 %exitcond.not = icmp eq i64 %inc, %0 br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !25 for.cond5.preheader: ; preds = %for.cond5.preheader, %for.cond5.preheader.preheader.new %i.1111 = phi i64 [ 0, %for.cond5.preheader.preheader.new ], [ %inc17.1, %for.cond5.preheader ] %niter = phi i64 [ 0, %for.cond5.preheader.preheader.new ], [ %niter.next.1, %for.cond5.preheader ] %8 = mul nuw nsw i64 %i.1111, 100 %scevgep = getelementptr i8, ptr @isreached, i64 %8 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(51) %scevgep, i8 0, i64 51, i1 false), !tbaa !11 %arrayidx14 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %i.1111 %9 = load i64, ptr %arrayidx14, align 16, !tbaa !5 %arrayidx15 = getelementptr inbounds [100 x [100 x i8]], ptr @isreached, i64 0, i64 %i.1111, i64 %9 store i8 1, ptr %arrayidx15, align 1, !tbaa !11 %inc17 = or i64 %i.1111, 1 %10 = mul nuw nsw i64 %inc17, 100 %scevgep.1 = getelementptr i8, ptr @isreached, i64 %10 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.1, i8 0, i64 51, i1 false), !tbaa !11 %arrayidx14.1 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %inc17 %11 = load i64, ptr %arrayidx14.1, align 8, !tbaa !5 %arrayidx15.1 = getelementptr inbounds [100 x [100 x i8]], ptr @isreached, i64 0, i64 %inc17, i64 %11 store i8 1, ptr %arrayidx15.1, align 1, !tbaa !11 %inc17.1 = add nuw nsw i64 %i.1111, 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.end18.unr-lcssa, label %for.cond5.preheader, !llvm.loop !26 for.end18.thread: ; preds = %for.cond2.preheader, %entry call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %isreachable_ARG.i) #7 br label %for.cond19.preheader.thread for.end18.unr-lcssa: ; preds = %for.cond5.preheader, %for.cond5.preheader.preheader %i.1111.unr = phi i64 [ 0, %for.cond5.preheader.preheader ], [ %inc17.1, %for.cond5.preheader ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end18, label %for.cond5.preheader.epil for.cond5.preheader.epil: ; preds = %for.end18.unr-lcssa %12 = mul nuw nsw i64 %i.1111.unr, 100 %scevgep.epil = getelementptr i8, ptr @isreached, i64 %12 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.epil, i8 0, i64 51, i1 false), !tbaa !11 %arrayidx14.epil = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %i.1111.unr %13 = load i64, ptr %arrayidx14.epil, align 8, !tbaa !5 %arrayidx15.epil = getelementptr inbounds [100 x [100 x i8]], ptr @isreached, i64 0, i64 %i.1111.unr, i64 %13 store i8 1, ptr %arrayidx15.epil, align 1, !tbaa !11 br label %for.end18 for.end18: ; preds = %for.end18.unr-lcssa, %for.cond5.preheader.epil call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %isreachable_ARG.i) #7 br i1 %cmp107.not, label %for.cond19.preheader.thread, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.end18 %xtraiter129 = and i64 %0, 1 %14 = icmp eq i64 %6, 0 br i1 %14, label %while.body.i.preheader.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter131 = and i64 %0, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %i.041.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc10.i.1, %for.body.i ] %niter132 = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter132.next.1, %for.body.i ] %15 = mul nuw nsw i64 %i.041.i, 100 %scevgep.i = getelementptr i8, ptr @isreachable, i64 %15 %scevgep51.i = getelementptr i8, ptr @isreached, i64 %15 %arrayidx.i = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %i.041.i %arrayidx1.i = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG.i, i64 0, i64 %i.041.i store ptr %arrayidx.i, ptr %arrayidx1.i, align 16, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(51) %scevgep.i, ptr noundef nonnull align 8 dereferenceable(51) %scevgep51.i, i64 51, i1 false), !tbaa !11 %inc10.i = or i64 %i.041.i, 1 %16 = mul nuw nsw i64 %inc10.i, 100 %scevgep.i.1 = getelementptr i8, ptr @isreachable, i64 %16 %scevgep51.i.1 = getelementptr i8, ptr @isreached, i64 %16 %arrayidx.i.1 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %inc10.i %arrayidx1.i.1 = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG.i, i64 0, i64 %inc10.i store ptr %arrayidx.i.1, ptr %arrayidx1.i.1, align 8, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.i.1, ptr noundef nonnull align 4 dereferenceable(51) %scevgep51.i.1, i64 51, i1 false), !tbaa !11 %inc10.i.1 = add nuw nsw i64 %i.041.i, 2 %niter132.next.1 = add i64 %niter132, 2 %niter132.ncmp.1 = icmp eq i64 %niter132.next.1, %unroll_iter131 br i1 %niter132.ncmp.1, label %while.body.i.preheader.unr-lcssa, label %for.body.i, !llvm.loop !19 while.body.i.preheader.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %i.041.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc10.i.1, %for.body.i ] %lcmp.mod130.not = icmp eq i64 %xtraiter129, 0 br i1 %lcmp.mod130.not, label %while.body.i.preheader, label %for.body.i.epil for.body.i.epil: ; preds = %while.body.i.preheader.unr-lcssa %17 = mul nuw nsw i64 %i.041.i.unr, 100 %scevgep.i.epil = getelementptr i8, ptr @isreachable, i64 %17 %scevgep51.i.epil = getelementptr i8, ptr @isreached, i64 %17 %arrayidx.i.epil = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %i.041.i.unr %arrayidx1.i.epil = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG.i, i64 0, i64 %i.041.i.unr store ptr %arrayidx.i.epil, ptr %arrayidx1.i.epil, align 8, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.i.epil, ptr noundef nonnull align 4 dereferenceable(51) %scevgep51.i.epil, i64 51, i1 false), !tbaa !11 br label %while.body.i.preheader while.body.i.preheader: ; preds = %while.body.i.preheader.unr-lcssa, %for.body.i.epil br label %while.body.i for.body16.i.preheader: ; preds = %set1nize.exit.loopexit.i %18 = load i64, ptr @b, align 16 %arrayidx19.i112 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 0, i64 %18 %19 = load i8, ptr %arrayidx19.i112, align 1, !tbaa !11, !range !13, !noundef !14 %tobool20.not.i113 = icmp eq i8 %19, 0 br i1 %tobool20.not.i113, label %fail.critedge, label %for.cond14.i while.body.i: ; preds = %while.body.i.preheader, %set1nize.exit.loopexit.i %indvar = phi i64 [ 0, %while.body.i.preheader ], [ %indvar.next, %set1nize.exit.loopexit.i ] %dec44.i = phi i64 [ 50, %while.body.i.preheader ], [ %dec.i, %set1nize.exit.loopexit.i ] %xtraiter133 = and i64 %dec44.i, 1 %20 = icmp eq i64 %indvar, 49 %unroll_iter135 = and i64 %dec44.i, -2 %lcmp.mod134.not = icmp eq i64 %xtraiter133, 0 br label %for.cond1.preheader.us.i.i for.cond1.preheader.us.i.i: ; preds = %for.cond1.for.inc12_crit_edge.us.i.i, %while.body.i %i.031.us.i.i = phi i64 [ %inc13.us.i.i, %for.cond1.for.inc12_crit_edge.us.i.i ], [ 0, %while.body.i ] %arrayidx.us.i.i = getelementptr inbounds ptr, ptr %isreachable_ARG.i, i64 %i.031.us.i.i %21 = load ptr, ptr %arrayidx.us.i.i, align 8, !tbaa !16 br i1 %20, label %for.cond1.for.inc12_crit_edge.us.i.i.unr-lcssa, label %for.body6.lr.ph.us.i.i for.cond4.us.i.i: ; preds = %for.body6.us.i.i %add.us.i.i = add nuw nsw i64 %ki.026.us.i.i, %dec44.i %cmp5.us.i.i = icmp ult i64 %add.us.i.i, 51 br i1 %cmp5.us.i.i, label %for.body6.us.i.i, label %for.inc10.us.i.i, !llvm.loop !9 for.body6.us.i.i: ; preds = %for.body6.lr.ph.us.i.i, %for.cond4.us.i.i %ki.026.us.i.i = phi i64 [ %j.028.us.i.i, %for.body6.lr.ph.us.i.i ], [ %add.us.i.i, %for.cond4.us.i.i ] %arrayidx7.us.i.i = getelementptr inbounds i8, ptr %21, i64 %ki.026.us.i.i %22 = load i8, ptr %arrayidx7.us.i.i, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i.i = icmp eq i8 %22, 0 br i1 %tobool.not.us.i.i, label %for.cond4.us.i.i, label %if.then.us.i.i if.then.us.i.i: ; preds = %for.body6.us.i.i %arrayidx9.us.i.i = getelementptr inbounds i8, ptr %21, i64 %j.028.us.i.i store i8 1, ptr %arrayidx9.us.i.i, align 1, !tbaa !11 br label %for.inc10.us.i.i for.inc10.us.i.i: ; preds = %for.cond4.us.i.i, %if.then.us.i.i %inc.us.i.i = or i64 %j.028.us.i.i, 1 br label %for.body6.us.i.i.1 for.body6.us.i.i.1: ; preds = %for.cond4.us.i.i.1, %for.inc10.us.i.i %ki.026.us.i.i.1 = phi i64 [ %inc.us.i.i, %for.inc10.us.i.i ], [ %add.us.i.i.1, %for.cond4.us.i.i.1 ] %arrayidx7.us.i.i.1 = getelementptr inbounds i8, ptr %21, i64 %ki.026.us.i.i.1 %23 = load i8, ptr %arrayidx7.us.i.i.1, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i.i.1 = icmp eq i8 %23, 0 br i1 %tobool.not.us.i.i.1, label %for.cond4.us.i.i.1, label %if.then.us.i.i.1 if.then.us.i.i.1: ; preds = %for.body6.us.i.i.1 %arrayidx9.us.i.i.1 = getelementptr inbounds i8, ptr %21, i64 %inc.us.i.i store i8 1, ptr %arrayidx9.us.i.i.1, align 1, !tbaa !11 br label %for.inc10.us.i.i.1 for.cond4.us.i.i.1: ; preds = %for.body6.us.i.i.1 %add.us.i.i.1 = add nuw nsw i64 %ki.026.us.i.i.1, %dec44.i %cmp5.us.i.i.1 = icmp ult i64 %add.us.i.i.1, 51 br i1 %cmp5.us.i.i.1, label %for.body6.us.i.i.1, label %for.inc10.us.i.i.1, !llvm.loop !9 for.inc10.us.i.i.1: ; preds = %for.cond4.us.i.i.1, %if.then.us.i.i.1 %inc.us.i.i.1 = add nuw nsw i64 %j.028.us.i.i, 2 %niter136.next.1 = add i64 %niter136, 2 %niter136.ncmp.1 = icmp eq i64 %niter136.next.1, %unroll_iter135 br i1 %niter136.ncmp.1, label %for.cond1.for.inc12_crit_edge.us.i.i.unr-lcssa, label %for.body6.lr.ph.us.i.i, !llvm.loop !15 for.body6.lr.ph.us.i.i: ; preds = %for.cond1.preheader.us.i.i, %for.inc10.us.i.i.1 %j.028.us.i.i = phi i64 [ %inc.us.i.i.1, %for.inc10.us.i.i.1 ], [ 0, %for.cond1.preheader.us.i.i ] %niter136 = phi i64 [ %niter136.next.1, %for.inc10.us.i.i.1 ], [ 0, %for.cond1.preheader.us.i.i ] br label %for.body6.us.i.i for.cond1.for.inc12_crit_edge.us.i.i.unr-lcssa: ; preds = %for.inc10.us.i.i.1, %for.cond1.preheader.us.i.i %j.028.us.i.i.unr = phi i64 [ 0, %for.cond1.preheader.us.i.i ], [ %inc.us.i.i.1, %for.inc10.us.i.i.1 ] br i1 %lcmp.mod134.not, label %for.cond1.for.inc12_crit_edge.us.i.i, label %for.body6.us.i.i.epil for.body6.us.i.i.epil: ; preds = %for.cond1.for.inc12_crit_edge.us.i.i.unr-lcssa, %for.cond4.us.i.i.epil %ki.026.us.i.i.epil = phi i64 [ %add.us.i.i.epil, %for.cond4.us.i.i.epil ], [ %j.028.us.i.i.unr, %for.cond1.for.inc12_crit_edge.us.i.i.unr-lcssa ] %arrayidx7.us.i.i.epil = getelementptr inbounds i8, ptr %21, i64 %ki.026.us.i.i.epil %24 = load i8, ptr %arrayidx7.us.i.i.epil, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i.i.epil = icmp eq i8 %24, 0 br i1 %tobool.not.us.i.i.epil, label %for.cond4.us.i.i.epil, label %if.then.us.i.i.epil if.then.us.i.i.epil: ; preds = %for.body6.us.i.i.epil %arrayidx9.us.i.i.epil = getelementptr inbounds i8, ptr %21, i64 %j.028.us.i.i.unr store i8 1, ptr %arrayidx9.us.i.i.epil, align 1, !tbaa !11 br label %for.cond1.for.inc12_crit_edge.us.i.i for.cond4.us.i.i.epil: ; preds = %for.body6.us.i.i.epil %add.us.i.i.epil = add nuw nsw i64 %ki.026.us.i.i.epil, %dec44.i %cmp5.us.i.i.epil = icmp ult i64 %add.us.i.i.epil, 51 br i1 %cmp5.us.i.i.epil, label %for.body6.us.i.i.epil, label %for.cond1.for.inc12_crit_edge.us.i.i, !llvm.loop !9 for.cond1.for.inc12_crit_edge.us.i.i: ; preds = %if.then.us.i.i.epil, %for.cond4.us.i.i.epil, %for.cond1.for.inc12_crit_edge.us.i.i.unr-lcssa %inc13.us.i.i = add nuw nsw i64 %i.031.us.i.i, 1 %exitcond33.not.i.i = icmp eq i64 %inc13.us.i.i, %0 br i1 %exitcond33.not.i.i, label %set1nize.exit.loopexit.i, label %for.cond1.preheader.us.i.i, !llvm.loop !18 set1nize.exit.loopexit.i: ; preds = %for.cond1.for.inc12_crit_edge.us.i.i %dec.i = add nsw i64 %dec44.i, -1 %tobool12.not.i = icmp eq i64 %dec.i, 0 %indvar.next = add i64 %indvar, 1 br i1 %tobool12.not.i, label %for.body16.i.preheader, label %while.body.i, !llvm.loop !20 for.cond14.i: ; preds = %for.body16.i.preheader, %for.body16.i %i.146.i114 = phi i64 [ %inc22.i, %for.body16.i ], [ 0, %for.body16.i.preheader ] %inc22.i = add nuw i64 %i.146.i114, 1 %exitcond52.i = icmp eq i64 %inc22.i, %0 br i1 %exitcond52.i, label %is0able.exit, label %for.body16.i, !llvm.loop !21 for.body16.i: ; preds = %for.cond14.i %arrayidx18.i = getelementptr inbounds [2000 x i64], ptr @b, i64 0, i64 %inc22.i %25 = load i64, ptr %arrayidx18.i, align 8, !tbaa !5 %arrayidx19.i = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %inc22.i, i64 %25 %26 = load i8, ptr %arrayidx19.i, align 1, !tbaa !11, !range !13, !noundef !14 %tobool20.not.i = icmp eq i8 %26, 0 br i1 %tobool20.not.i, label %is0able.exit, label %for.cond14.i, !llvm.loop !21 is0able.exit: ; preds = %for.body16.i, %for.cond14.i %cmp15.i.not.le = icmp ult i64 %inc22.i, %0 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreachable_ARG.i) #7 br i1 %cmp15.i.not.le, label %fail, label %for.cond19.preheader for.cond19.preheader.thread: ; preds = %for.end18, %for.end18.thread call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreachable_ARG.i) #7 br label %for.end27 for.cond19.preheader: ; preds = %is0able.exit %arrayidx19.i87117 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 0, i64 %18 br i1 %cmp107.not, label %for.end27, label %for.body21.preheader for.body21.preheader: ; preds = %for.cond19.preheader %xtraiter137 = and i64 %0, 1 %27 = icmp eq i64 %6, 0 %unroll_iter139 = and i64 %0, -2 %lcmp.mod138.not = icmp eq i64 %xtraiter137, 0 br label %for.body21 for.body21: ; preds = %for.body21.preheader, %for.inc26 %indvar141 = phi i64 [ 0, %for.body21.preheader ], [ %indvar.next142, %for.inc26 ] %i.2123 = phi i64 [ 50, %for.body21.preheader ], [ %dec42.i, %for.inc26 ] %result.0122 = phi i64 [ 0, %for.body21.preheader ], [ %result.1, %for.inc26 ] call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %isreachable_ARG.i54) #7 br i1 %27, label %while.cond.preheader.i64.unr-lcssa, label %for.body.i56 while.cond.preheader.i64.unr-lcssa: ; preds = %for.body.i56, %for.body21 %i.041.i57.unr = phi i64 [ 0, %for.body21 ], [ %inc10.i62.1, %for.body.i56 ] br i1 %lcmp.mod138.not, label %while.cond.preheader.i64, label %for.body.i56.epil for.body.i56.epil: ; preds = %while.cond.preheader.i64.unr-lcssa %28 = mul nuw nsw i64 %i.041.i57.unr, 100 %scevgep.i58.epil = getelementptr i8, ptr @isreachable, i64 %28 %scevgep51.i59.epil = getelementptr i8, ptr @isreached, i64 %28 %arrayidx.i60.epil = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %i.041.i57.unr %arrayidx1.i61.epil = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG.i54, i64 0, i64 %i.041.i57.unr store ptr %arrayidx.i60.epil, ptr %arrayidx1.i61.epil, align 8, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.i58.epil, ptr noundef nonnull align 4 dereferenceable(51) %scevgep51.i59.epil, i64 51, i1 false), !tbaa !11 br label %while.cond.preheader.i64 while.cond.preheader.i64: ; preds = %while.cond.preheader.i64.unr-lcssa, %for.body.i56.epil %dec42.i = add nsw i64 %i.2123, -1 %tobool12.not43.i = icmp eq i64 %dec42.i, 0 br i1 %tobool12.not43.i, label %for.cond14.preheader.i82, label %while.body.i65 for.body.i56: ; preds = %for.body21, %for.body.i56 %i.041.i57 = phi i64 [ %inc10.i62.1, %for.body.i56 ], [ 0, %for.body21 ] %niter140 = phi i64 [ %niter140.next.1, %for.body.i56 ], [ 0, %for.body21 ] %29 = mul nuw nsw i64 %i.041.i57, 100 %scevgep.i58 = getelementptr i8, ptr @isreachable, i64 %29 %scevgep51.i59 = getelementptr i8, ptr @isreached, i64 %29 %arrayidx.i60 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %i.041.i57 %arrayidx1.i61 = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG.i54, i64 0, i64 %i.041.i57 store ptr %arrayidx.i60, ptr %arrayidx1.i61, align 16, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(51) %scevgep.i58, ptr noundef nonnull align 8 dereferenceable(51) %scevgep51.i59, i64 51, i1 false), !tbaa !11 %inc10.i62 = or i64 %i.041.i57, 1 %30 = mul nuw nsw i64 %inc10.i62, 100 %scevgep.i58.1 = getelementptr i8, ptr @isreachable, i64 %30 %scevgep51.i59.1 = getelementptr i8, ptr @isreached, i64 %30 %arrayidx.i60.1 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %inc10.i62 %arrayidx1.i61.1 = getelementptr inbounds [100 x ptr], ptr %isreachable_ARG.i54, i64 0, i64 %inc10.i62 store ptr %arrayidx.i60.1, ptr %arrayidx1.i61.1, align 8, !tbaa !16 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(51) %scevgep.i58.1, ptr noundef nonnull align 4 dereferenceable(51) %scevgep51.i59.1, i64 51, i1 false), !tbaa !11 %inc10.i62.1 = add nuw nsw i64 %i.041.i57, 2 %niter140.next.1 = add i64 %niter140, 2 %niter140.ncmp.1 = icmp eq i64 %niter140.next.1, %unroll_iter139 br i1 %niter140.ncmp.1, label %while.cond.preheader.i64.unr-lcssa, label %for.body.i56, !llvm.loop !19 for.cond14.preheader.i82: ; preds = %set1nize.exit.loopexit.i79, %while.cond.preheader.i64 %31 = load i8, ptr %arrayidx19.i87117, align 1, !tbaa !11, !range !13, !noundef !14 %tobool20.not.i88118 = icmp eq i8 %31, 0 br i1 %tobool20.not.i88118, label %if.then23.critedge, label %for.cond14.i89 while.body.i65: ; preds = %while.cond.preheader.i64, %set1nize.exit.loopexit.i79 %dec44.i66 = phi i64 [ %dec.i80, %set1nize.exit.loopexit.i79 ], [ %dec42.i, %while.cond.preheader.i64 ] br label %for.cond1.preheader.us.i.i67 for.cond1.preheader.us.i.i67: ; preds = %for.cond1.for.inc12_crit_edge.us.i.i76, %while.body.i65 %i.031.us.i.i68 = phi i64 [ %inc13.us.i.i77, %for.cond1.for.inc12_crit_edge.us.i.i76 ], [ 0, %while.body.i65 ] %arrayidx.us.i.i69 = getelementptr inbounds ptr, ptr %isreachable_ARG.i54, i64 %i.031.us.i.i68 br label %for.cond4.preheader.us.i.i70 for.cond4.us.i.i101: ; preds = %for.body6.us.i.i95 %add.us.i.i102 = add i64 %ki.026.us.i.i96, %dec44.i66 %cmp5.us.i.i103 = icmp slt i64 %add.us.i.i102, 51 br i1 %cmp5.us.i.i103, label %for.body6.us.i.i95, label %for.inc10.us.i.i73, !llvm.loop !9 for.body6.us.i.i95: ; preds = %for.body6.lr.ph.us.i.i94, %for.cond4.us.i.i101 %ki.026.us.i.i96 = phi i64 [ %j.028.us.i.i71, %for.body6.lr.ph.us.i.i94 ], [ %add.us.i.i102, %for.cond4.us.i.i101 ] %arrayidx7.us.i.i97 = getelementptr inbounds i8, ptr %33, i64 %ki.026.us.i.i96 %32 = load i8, ptr %arrayidx7.us.i.i97, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i.i98 = icmp eq i8 %32, 0 br i1 %tobool.not.us.i.i98, label %for.cond4.us.i.i101, label %if.then.us.i.i99 if.then.us.i.i99: ; preds = %for.body6.us.i.i95 %arrayidx9.us.i.i100 = getelementptr inbounds i8, ptr %33, i64 %j.028.us.i.i71 store i8 1, ptr %arrayidx9.us.i.i100, align 1, !tbaa !11 br label %for.inc10.us.i.i73 for.inc10.us.i.i73: ; preds = %for.cond4.us.i.i101, %for.cond4.preheader.us.i.i70, %if.then.us.i.i99 %inc.us.i.i74 = add nuw nsw i64 %j.028.us.i.i71, 1 %exitcond.not.i.i75 = icmp eq i64 %inc.us.i.i74, %dec44.i66 br i1 %exitcond.not.i.i75, label %for.cond1.for.inc12_crit_edge.us.i.i76, label %for.cond4.preheader.us.i.i70, !llvm.loop !15 for.cond4.preheader.us.i.i70: ; preds = %for.inc10.us.i.i73, %for.cond1.preheader.us.i.i67 %j.028.us.i.i71 = phi i64 [ 0, %for.cond1.preheader.us.i.i67 ], [ %inc.us.i.i74, %for.inc10.us.i.i73 ] %cmp525.us.i.i72 = icmp ult i64 %j.028.us.i.i71, 51 br i1 %cmp525.us.i.i72, label %for.body6.lr.ph.us.i.i94, label %for.inc10.us.i.i73 for.body6.lr.ph.us.i.i94: ; preds = %for.cond4.preheader.us.i.i70 %33 = load ptr, ptr %arrayidx.us.i.i69, align 8, !tbaa !16 br label %for.body6.us.i.i95 for.cond1.for.inc12_crit_edge.us.i.i76: ; preds = %for.inc10.us.i.i73 %inc13.us.i.i77 = add nuw nsw i64 %i.031.us.i.i68, 1 %exitcond33.not.i.i78 = icmp eq i64 %inc13.us.i.i77, %0 br i1 %exitcond33.not.i.i78, label %set1nize.exit.loopexit.i79, label %for.cond1.preheader.us.i.i67, !llvm.loop !18 set1nize.exit.loopexit.i79: ; preds = %for.cond1.for.inc12_crit_edge.us.i.i76 %dec.i80 = add nsw i64 %dec44.i66, -1 %tobool12.not.i81 = icmp eq i64 %dec.i80, 0 br i1 %tobool12.not.i81, label %for.cond14.preheader.i82, label %while.body.i65, !llvm.loop !20 for.cond14.i89: ; preds = %for.cond14.preheader.i82, %for.body16.i83 %i.146.i85119 = phi i64 [ %inc22.i90, %for.body16.i83 ], [ 0, %for.cond14.preheader.i82 ] %inc22.i90 = add nuw i64 %i.146.i85119, 1 %exitcond52.i92 = icmp eq i64 %inc22.i90, %0 br i1 %exitcond52.i92, label %is0able.exit104, label %for.body16.i83, !llvm.loop !21 for.body16.i83: ; preds = %for.cond14.i89 %arrayidx18.i86 = getelementptr inbounds [2000 x i64], ptr @b, i64 0, i64 %inc22.i90 %34 = load i64, ptr %arrayidx18.i86, align 8, !tbaa !5 %arrayidx19.i87 = getelementptr inbounds [100 x [100 x i8]], ptr @isreachable, i64 0, i64 %inc22.i90, i64 %34 %35 = load i8, ptr %arrayidx19.i87, align 1, !tbaa !11, !range !13, !noundef !14 %tobool20.not.i88 = icmp eq i8 %35, 0 br i1 %tobool20.not.i88, label %is0able.exit104, label %for.cond14.i89, !llvm.loop !21 is0able.exit104: ; preds = %for.body16.i83, %for.cond14.i89 %cmp15.i91.not.le = icmp ult i64 %inc22.i90, %0 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreachable_ARG.i54) #7 br i1 %cmp15.i91.not.le, label %if.then23, label %for.inc26 if.then23.critedge: ; preds = %for.cond14.preheader.i82 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreachable_ARG.i54) #7 br label %if.then23 if.then23: ; preds = %if.then23.critedge, %is0able.exit104 %shl = shl nuw i64 1, %i.2123 %xtraiter143 = and i64 %i.2123, 1 %36 = icmp eq i64 %indvar141, 49 %unroll_iter145 = and i64 %i.2123, -2 %lcmp.mod144.not = icmp eq i64 %xtraiter143, 0 br label %for.cond1.preheader.us.i for.cond1.preheader.us.i: ; preds = %if.then23, %for.cond1.for.inc12_crit_edge.us.i %i.031.us.i = phi i64 [ %inc13.us.i, %for.cond1.for.inc12_crit_edge.us.i ], [ 0, %if.then23 ] %arrayidx.us.i = getelementptr inbounds ptr, ptr %isreached_ARG, i64 %i.031.us.i %37 = load ptr, ptr %arrayidx.us.i, align 8, !tbaa !16 br i1 %36, label %for.cond1.for.inc12_crit_edge.us.i.unr-lcssa, label %for.body6.lr.ph.us.i for.cond4.us.i: ; preds = %for.body6.us.i %add.us.i = add nuw nsw i64 %ki.026.us.i, %i.2123 %cmp5.us.i = icmp ult i64 %add.us.i, 51 br i1 %cmp5.us.i, label %for.body6.us.i, label %for.inc10.us.i, !llvm.loop !9 for.body6.us.i: ; preds = %for.body6.lr.ph.us.i, %for.cond4.us.i %ki.026.us.i = phi i64 [ %j.028.us.i, %for.body6.lr.ph.us.i ], [ %add.us.i, %for.cond4.us.i ] %arrayidx7.us.i = getelementptr inbounds i8, ptr %37, i64 %ki.026.us.i %38 = load i8, ptr %arrayidx7.us.i, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i = icmp eq i8 %38, 0 br i1 %tobool.not.us.i, label %for.cond4.us.i, label %if.then.us.i if.then.us.i: ; preds = %for.body6.us.i %arrayidx9.us.i = getelementptr inbounds i8, ptr %37, i64 %j.028.us.i store i8 1, ptr %arrayidx9.us.i, align 1, !tbaa !11 br label %for.inc10.us.i for.inc10.us.i: ; preds = %for.cond4.us.i, %if.then.us.i %inc.us.i = or i64 %j.028.us.i, 1 br label %for.body6.us.i.1 for.body6.us.i.1: ; preds = %for.cond4.us.i.1, %for.inc10.us.i %ki.026.us.i.1 = phi i64 [ %inc.us.i, %for.inc10.us.i ], [ %add.us.i.1, %for.cond4.us.i.1 ] %arrayidx7.us.i.1 = getelementptr inbounds i8, ptr %37, i64 %ki.026.us.i.1 %39 = load i8, ptr %arrayidx7.us.i.1, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i.1 = icmp eq i8 %39, 0 br i1 %tobool.not.us.i.1, label %for.cond4.us.i.1, label %if.then.us.i.1 if.then.us.i.1: ; preds = %for.body6.us.i.1 %arrayidx9.us.i.1 = getelementptr inbounds i8, ptr %37, i64 %inc.us.i store i8 1, ptr %arrayidx9.us.i.1, align 1, !tbaa !11 br label %for.inc10.us.i.1 for.cond4.us.i.1: ; preds = %for.body6.us.i.1 %add.us.i.1 = add nuw nsw i64 %ki.026.us.i.1, %i.2123 %cmp5.us.i.1 = icmp ult i64 %add.us.i.1, 51 br i1 %cmp5.us.i.1, label %for.body6.us.i.1, label %for.inc10.us.i.1, !llvm.loop !9 for.inc10.us.i.1: ; preds = %for.cond4.us.i.1, %if.then.us.i.1 %inc.us.i.1 = add nuw nsw i64 %j.028.us.i, 2 %niter146.next.1 = add i64 %niter146, 2 %niter146.ncmp.1 = icmp eq i64 %niter146.next.1, %unroll_iter145 br i1 %niter146.ncmp.1, label %for.cond1.for.inc12_crit_edge.us.i.unr-lcssa, label %for.body6.lr.ph.us.i, !llvm.loop !15 for.body6.lr.ph.us.i: ; preds = %for.cond1.preheader.us.i, %for.inc10.us.i.1 %j.028.us.i = phi i64 [ %inc.us.i.1, %for.inc10.us.i.1 ], [ 0, %for.cond1.preheader.us.i ] %niter146 = phi i64 [ %niter146.next.1, %for.inc10.us.i.1 ], [ 0, %for.cond1.preheader.us.i ] br label %for.body6.us.i for.cond1.for.inc12_crit_edge.us.i.unr-lcssa: ; preds = %for.inc10.us.i.1, %for.cond1.preheader.us.i %j.028.us.i.unr = phi i64 [ 0, %for.cond1.preheader.us.i ], [ %inc.us.i.1, %for.inc10.us.i.1 ] br i1 %lcmp.mod144.not, label %for.cond1.for.inc12_crit_edge.us.i, label %for.body6.us.i.epil for.body6.us.i.epil: ; preds = %for.cond1.for.inc12_crit_edge.us.i.unr-lcssa, %for.cond4.us.i.epil %ki.026.us.i.epil = phi i64 [ %add.us.i.epil, %for.cond4.us.i.epil ], [ %j.028.us.i.unr, %for.cond1.for.inc12_crit_edge.us.i.unr-lcssa ] %arrayidx7.us.i.epil = getelementptr inbounds i8, ptr %37, i64 %ki.026.us.i.epil %40 = load i8, ptr %arrayidx7.us.i.epil, align 1, !tbaa !11, !range !13, !noundef !14 %tobool.not.us.i.epil = icmp eq i8 %40, 0 br i1 %tobool.not.us.i.epil, label %for.cond4.us.i.epil, label %if.then.us.i.epil if.then.us.i.epil: ; preds = %for.body6.us.i.epil %arrayidx9.us.i.epil = getelementptr inbounds i8, ptr %37, i64 %j.028.us.i.unr store i8 1, ptr %arrayidx9.us.i.epil, align 1, !tbaa !11 br label %for.cond1.for.inc12_crit_edge.us.i for.cond4.us.i.epil: ; preds = %for.body6.us.i.epil %add.us.i.epil = add nuw nsw i64 %ki.026.us.i.epil, %i.2123 %cmp5.us.i.epil = icmp ult i64 %add.us.i.epil, 51 br i1 %cmp5.us.i.epil, label %for.body6.us.i.epil, label %for.cond1.for.inc12_crit_edge.us.i, !llvm.loop !9 for.cond1.for.inc12_crit_edge.us.i: ; preds = %if.then.us.i.epil, %for.cond4.us.i.epil, %for.cond1.for.inc12_crit_edge.us.i.unr-lcssa %inc13.us.i = add nuw nsw i64 %i.031.us.i, 1 %exitcond33.not.i = icmp eq i64 %inc13.us.i, %0 br i1 %exitcond33.not.i, label %for.inc26.loopexit, label %for.cond1.preheader.us.i, !llvm.loop !18 for.inc26.loopexit: ; preds = %for.cond1.for.inc12_crit_edge.us.i %or = or i64 %shl, %result.0122 br label %for.inc26 for.inc26: ; preds = %for.inc26.loopexit, %is0able.exit104 %result.1 = phi i64 [ %result.0122, %is0able.exit104 ], [ %or, %for.inc26.loopexit ] %cmp20 = icmp ugt i64 %i.2123, 1 %indvar.next142 = add i64 %indvar141, 1 br i1 %cmp20, label %for.body21, label %for.end27, !llvm.loop !27 for.end27: ; preds = %for.inc26, %for.cond19.preheader, %for.cond19.preheader.thread %.us-phi = phi i64 [ 0, %for.cond19.preheader.thread ], [ 0, %for.cond19.preheader ], [ %result.1, %for.inc26 ] %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.us-phi) br label %cleanup fail.critedge: ; preds = %for.body16.i.preheader call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreachable_ARG.i) #7 br label %fail fail: ; preds = %fail.critedge, %is0able.exit %call29 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %cleanup cleanup: ; preds = %fail, %for.end27 %retval.0 = phi i64 [ 0, %for.end27 ], [ 1, %fail ] call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %isreached_ARG) #7 ret i64 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { 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 [2000 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 !28 for.body7: ; preds = %for.cond3.preheader, %for.body7 %indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ 0, %for.cond3.preheader ] %arrayidx9 = getelementptr inbounds [2000 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 !29 for.end13: ; preds = %for.body7, %entry, %for.cond3.preheader %call14 = tail call i64 @solve(), !range !30 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"_Bool", !7, i64 0} !13 = !{i8 0, i8 2} !14 = !{} !15 = distinct !{!15, !10} !16 = !{!17, !17, i64 0} !17 = !{!"any pointer", !7, i64 0} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !23, !24} !23 = !{!"llvm.loop.isvectorized", i32 1} !24 = !{!"llvm.loop.unroll.runtime.disable"} !25 = distinct !{!25, !10, !24, !23} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10} !28 = distinct !{!28, !10} !29 = distinct !{!29, !10} !30 = !{i64 0, i64 2}
#include<stdio.h> #include<math.h> int main() { int n; scanf("%d",&n); int ans=0; ans= ans+pow(n,3); printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166749/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166749/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv1 = sitofp i32 %0 to double %call2 = call double @pow(double noundef %conv1, double noundef 3.000000e+00) #4 %add = fadd double %call2, 0.000000e+00 %conv3 = fptosi double %add to i32 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a; scanf("%d",&a); printf("%d",a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166792/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166792/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { int N; scanf("%d",&N); int pd=pow(N,3); printf("%d",pd); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166835/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166835/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %call1 = call double @pow(double noundef %conv, double noundef 3.000000e+00) #4 %conv2 = fptosi double %call1 to i32 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n,nm; while(~scanf("%d",&n)) { printf("%d\n",n*n*n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166879/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166879/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool.not4 = icmp eq i32 %call3, -1 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool.not = icmp eq i32 %call, -1 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 n; scanf("%d", &n); printf("%d\n", n * n * n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166921/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166921/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define REP(i,n) for(i=0;i<n;i++) #define ll long long int main(void){ int N; scanf("%d",&N); printf("%d",N*N*N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166965/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166965/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int n,m; scanf("%d",&n); m=n*n*n; printf("%d",m); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167007/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167007/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a; scanf("%d",&a); printf("%d",a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167050/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167050/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int N,r; scanf("%d",&N); r=N*N*N; printf("%d\n",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167094/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167094/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int N; scanf("%i", &N); printf("%i", N*N*N); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167137/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167137/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%i\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n; scanf("%d",&n); printf("%d\n",n*n*n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167180/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167180/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul1 = mul nsw i32 %mul, %0 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#if 0 cat <<EOF >mistaken-paste #endif // thx Ebi-chan! #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" #define _USE_MATH_DEFINES #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> #include <time.h> #define BIG 2000000007 #define VERYBIG 2000000000000007LL #define MOD 1000000007 #define FOD 998244353 typedef uint64_t ull; typedef int64_t sll; #define N_MAX 1048576 #ifdef __cplusplus #include <queue> #include <stack> #include <tuple> #include <set> #include <map> #include <string> #include <algorithm> #include <functional> #include <array> using std::queue; using std::priority_queue; using std::stack; using std::tuple; using std::set; using std::map; using std::vector; using std::greater; using std::pair; using std::string; using std::get; template <typename T, typename U> pair<T, U> operator+(pair<T, U> l, pair<T, U> r) { return pair<T, U>(l.first + r.first, l.second + r.second); } #endif typedef struct { sll a; sll b; } hwll; typedef struct { sll a; sll b; sll c; } hwllc; typedef struct { hwll a; hwll b; } linell; typedef struct { double a; double b; } hwreal; ull n, m; ull h, w; ull k; ull q; sll va, vb, vc, vd, ve, vf; ull ua, ub, uc, ud, ue, uf; long double vra, vrb, vrc; double vda, vdb, vdc; char ch, dh; ull umin (ull x, ull y) { return (x < y) ? x : y; } ull umax (ull x, ull y) { return (x > y) ? x : y; } sll smin (sll x, sll y) { return (x < y) ? x : y; } sll smax (sll x, sll y) { return (x > y) ? x : y; } ull gcd (ull x, ull y) { if (x < y) { return gcd(y, x); } else if (y == 0) { return x; } else { return gcd(y, x % y); } } ull bitpow (ull a, ull x, ull modulo) { ull result = 1; while (x) { if (x & 1) { result *= a; result %= modulo; } x /= 2; a = (a * a) % modulo; } return result; } ull divide (ull a, ull b, ull modulo) { return (a * bitpow(b, modulo - 2, modulo)) % modulo; } ull udiff (ull a, ull b) { if (a >= b) { return a - b; } else { return b - a; } } sll sdiff (sll a, sll b) { if (a >= b) { return a - b; } else { return b - a; } } int bitcount (ull n) { int result = 0; while (n) { if (n & 1) result++; n /= 2; } return result; } #define BEGCMP(NAME) int32_t NAME (const void *left, const void *right) #define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right #define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1 // int32_t pullcomp (const void *left, const void *right) { // ull l = *(ull*)left; // ull r = *(ull*)right; // if (l < r) { // return -1; // } // if (l > r) { // return +1; // } // return 0; // } BEGCMP(pullcomp){ DEFLR(ull); CMPRET(l, r); return 0; } BEGCMP(prevcomp){ DEFLR(sll); CMPRET(r, l); return 0; } BEGCMP(psllcomp){ DEFLR(sll); CMPRET(l, r); return 0; } BEGCMP(pcharcomp){ DEFLR(char); CMPRET(l, r); return 0; } BEGCMP(pdoublecomp){ DEFLR(double); CMPRET(l, r); return 0; } int32_t pstrcomp (const void *left, const void *right) { char* l = *(char**)left; char* r = *(char**)right; return strcmp(l, r); } BEGCMP(phwllABcomp){ DEFLR(hwll); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } BEGCMP(phwllREVcomp){ DEFLR(hwll); CMPRET(l.b, r.b); CMPRET(l.a, r.a); return 0; } BEGCMP(ptriplecomp){ DEFLR(hwllc); CMPRET(l.a, r.a); CMPRET(l.b, r.b); CMPRET(l.c, r.c); return 0; } BEGCMP(ptripleREVcomp){ DEFLR(hwllc); CMPRET(l.b, r.b); CMPRET(l.a, r.a); CMPRET(l.c, r.c); return 0; } BEGCMP(phwrealcomp){ DEFLR(hwreal); CMPRET(l.a, r.a); CMPRET(l.b, r.b); return 0; } int32_t pquadcomp (const void *left, const void *right) { linell l = *(linell*)left; linell r = *(linell*)right; sll ac = phwllABcomp(&(l.a), &(r.a)); if (ac) return ac; sll bc = phwllABcomp(&(l.b), &(r.b)); if (bc) return bc; return 0; } bool isinrange (sll left, sll x, sll right) { return (left <= x && x <= right); } bool isinrange_soft (sll left, sll x, sll right) { return (left <= x && x <= right) || (left >= x && x >= right); } sll a[N_MAX + 5]; // ull a[N_MAX + 5]; // sll a[3001][3001]; sll b[N_MAX + 5]; // ull b[N_MAX + 5]; // sll b[3001][3001]; sll c[N_MAX + 5]; sll d[N_MAX + 5]; sll e[N_MAX]; // char s[N_MAX + 1]; char s[3010][3010]; char t[N_MAX + 1]; // char t[3010][3010]; char u[N_MAX + 1]; hwll xy[N_MAX + 5]; hwllc tup[N_MAX + 5]; // sll table[3005][3005]; ull gin[N_MAX]; // here we go bool g (ull v, ull x) { for (sll i = 0; i < n - v; i++) { if (a[v * 2 + i] + a[n * 2 - 1 - i] > m + x) return false; } return true; } bool g2 (ull v, ull x) { for (sll i = 0; i < n - v; i++) { if (a[v * 2 + i] + a[n * 2 - 1 - i] < m) return false; } return true; } bool g3 (ull v, ull x) { for (sll i = 0; i < v; i++) { if (a[i] + a[v * 2 - 1 - i] > x) return false; } return true; } bool f (ull x) { sll ok = n, ng = -1; while (ng + 1 < ok) { sll med = (ok + ng) / 2; if (g2(med, x)) { ok = med; } else { ng = med; } } // printf("%lld: %lld\n", x, ok); if (!g(ok, x) || !g3(ok, x)) return false; return true; } ull solve () { sll i, j, ki, li; // ull result = 0; sll result = 0; double dresult = 0; // ull maybe = 0; sll maybe = 0; // ull sum = 0; sll sum = 0; sll item; sll *dpcell; qsort(a, n * 2, sizeof(ull), pullcomp); sll ok = m, ng = -1; while (ng + 1 < ok) { sll med = (ok + ng) / 2; if (f(med)) { ok = med; } else { ng = med; } } result = ok; printf("%lld\n", result); // printf("%.15lf\n", dresult); // puts(s); return 0; success: // puts("YES"); puts("Yes"); // printf("%llu\n", result); // puts("0"); // puts("Hanako"); return 0; fail: // puts("NO"); puts("No"); // puts("0"); // puts("-1"); // puts("-1 -1 -1"); // puts("Jiro"); return 1; } int32_t main (int argc, char *argv[]) { int32_t i, j; n = 3; m = 0; // scanf("%llu%llu", &h, &w); scanf("%llu%llu", &n, &m); // scanf("%llu", &k, &n, &m); // scanf("%llu%llu", &h, &w); // scanf("%llu", &q); // scanf("%s", s); // scanf("%lld%lld", &va, &vb, &vc, &vd); // scanf("%llu%llu%llu", &ua, &ub, &uc, &ud, &ue); // scanf("%s", t); // scanf("%s", u); // scanf("%llu", &k); // scanf("%lld", &m); // for (i = 0; i < n; i++) { // scanf("%lld", &a[i]); // // scanf("%lld", &d[i]); // } // scanf("%llu", &q); for (i = 0; i < n * 2; i++) { // scanf("%lld%lld", &xy[i].a, &xy[i].b); // scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c); // scanf("%lld", &c[i]); scanf("%lld", &a[i]); // scanf("%lld", &b[i]); // scanf("%lld", &c[i]); // scanf("%lld", &d[i]); // a[i]--; // b[i]--; // c[i]--; // d[i]--; // xy[i].a--; // xy[i].b--; // tup[i].a--; // tup[i].b--; } // for (i = 0; i < k; i++) { // // scanf("%lld%lld", &a[i], &b[i]); // // scanf("%lld", &b[i]); // // a[i]--; // // b[i]--; // scanf("%lld", &d[i]); // d[i]--; // } // for (i = 0; i < q; i++) { // // scanf("%lld%lld", &xy[i].a, &xy[i].b); // scanf("%lld", &c[i]); // // xy[i].a--; // // xy[i].b--; // } // for (i = 0; i < n; i++) { // for (j = 0; j < m; j++) { // scanf("%lld", &table[i][j]); // // table[i][j]--; // } // } // for (i = 0; i < n; i++) { // scanf("%s", s[i]); // } // scanf("%llu", &q); solve(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167223/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167223/source.c" target datalayout = "e-m:e-p270: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.hwll = type { i64, i64 } %struct.hwllc = type { i64, i64, i64 } @n = dso_local global i64 0, align 8 @a = dso_local global [1048581 x i64] zeroinitializer, align 16 @m = dso_local global i64 0, align 8 @.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1 @.str.4 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @h = dso_local local_unnamed_addr global i64 0, align 8 @w = dso_local local_unnamed_addr global i64 0, align 8 @k = dso_local local_unnamed_addr global i64 0, align 8 @q = 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 @ua = dso_local local_unnamed_addr global i64 0, align 8 @ub = dso_local local_unnamed_addr global i64 0, align 8 @uc = dso_local local_unnamed_addr global i64 0, align 8 @ud = dso_local local_unnamed_addr global i64 0, align 8 @ue = dso_local local_unnamed_addr global i64 0, align 8 @uf = dso_local local_unnamed_addr global i64 0, align 8 @vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16 @vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @ch = dso_local local_unnamed_addr global i8 0, align 1 @dh = dso_local local_unnamed_addr global i8 0, align 1 @b = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16 @e = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 @s = dso_local local_unnamed_addr global [3010 x [3010 x i8]] zeroinitializer, align 16 @t = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16 @u = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16 @xy = dso_local local_unnamed_addr global [1048581 x %struct.hwll] zeroinitializer, align 16 @tup = dso_local local_unnamed_addr global [1048581 x %struct.hwllc] zeroinitializer, align 16 @gin = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ] %y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ] %cmp = icmp ult i64 %x.tr, %y.tr br i1 %cmp, label %tailrecurse.backedge, label %if.else if.else: ; preds = %tailrecurse %cmp1 = icmp eq i64 %y.tr, 0 br i1 %cmp1, label %return, label %if.else3 if.else3: ; preds = %if.else %rem = urem i64 %x.tr, %y.tr br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %if.else3, %tailrecurse %y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ] br label %tailrecurse return: ; preds = %if.else ret i64 %x.tr } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 { entry: %tobool.not12 = icmp eq i64 %x, 0 br i1 %tobool.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ] %a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ] %x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ] %and = and i64 %x.addr.013, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul i64 %result.015, %a.addr.014 %rem = urem i64 %mul, %modulo br label %if.end if.end: ; preds = %if.then, %while.body %result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ] %div11 = lshr i64 %x.addr.013, 1 %mul2 = mul i64 %a.addr.014, %a.addr.014 %rem3 = urem i64 %mul2, %modulo %tobool.not = icmp ult i64 %x.addr.013, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ] ret i64 %result.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 { entry: %sub = add i64 %modulo, -2 %tobool.not12.i = icmp eq i64 %sub, 0 br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i while.body.i: ; preds = %entry, %if.end.i %result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ] %a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ] %x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ] %and.i = and i64 %x.addr.013.i, 1 %tobool1.not.i = icmp eq i64 %and.i, 0 br i1 %tobool1.not.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i = mul i64 %a.addr.014.i, %result.015.i %rem.i = urem i64 %mul.i, %modulo br label %if.end.i if.end.i: ; preds = %if.then.i, %while.body.i %result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ] %div11.i = lshr i64 %x.addr.013.i, 1 %mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i %rem3.i = urem i64 %mul2.i, %modulo %tobool.not.i = icmp ult i64 %x.addr.013.i, 2 br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5 bitpow.exit: ; preds = %if.end.i, %entry %result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ] %mul = mul i64 %result.0.lcssa.i, %a %rem = urem i64 %mul, %modulo ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not = icmp ult i64 %a, %b %sub = sub i64 %a, %b %sub1 = sub i64 %b, %a %retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub ret i64 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub = sub nsw i64 %a, %b %retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true) ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 { entry: %tobool.not6 = icmp eq i64 %n, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ] %n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ] %0 = trunc i64 %n.addr.07 to i32 %1 = and i32 %0, 1 %spec.select = add i32 %1, %result.08 %div5 = lshr i64 %n.addr.07, 1 %tobool.not = icmp ult i64 %n.addr.07, 2 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ] ret i32 %result.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %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 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %cmp = icmp slt i64 %1, %0 %cmp1 = icmp sgt i64 %1, %0 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i64, ptr %left, align 8, !tbaa !8 %1 = load i64, ptr %right, align 8, !tbaa !8 %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 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load i8, ptr %left, align 1, !tbaa !12 %1 = load i8, ptr %right, align 1, !tbaa !12 %cmp = icmp slt i8 %0, %1 %cmp5 = icmp sgt i8 %0, %1 %. = zext i1 %cmp5 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %0 = load double, ptr %left, align 8, !tbaa !13 %1 = load double, ptr %right, align 8, !tbaa !13 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp ogt double %0, %1 %. = zext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 -1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 { entry: %0 = load ptr, ptr %left, align 8, !tbaa !15 %1 = load ptr, ptr %right, align 8, !tbaa !15 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #11 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 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17 %r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18 %cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp13, label %cleanup, label %if.end15 if.end15: ; preds = %if.end10 %cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload br i1 %cmp17, label %cleanup, label %if.end19 if.end19: ; preds = %if.end15 %cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload %. = zext i1 %cmp22 to i32 br label %cleanup cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @phwrealcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load double, ptr %left, align 8, !tbaa.struct !20 %l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.5.0.copyload = load double, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21 %r.sroa.0.0.copyload = load double, ptr %right, align 8, !tbaa.struct !20 %r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.5.0.copyload = load double, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21 %cmp = fcmp olt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp4 = fcmp ogt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4, label %cleanup, label %if.end6 if.end6: ; preds = %if.end %cmp8 = fcmp olt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp8, label %cleanup, label %if.end10 if.end10: ; preds = %if.end6 %cmp13 = fcmp ogt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload %. = zext i1 %cmp13 to i32 br label %cleanup cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry %retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 { entry: %l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !22 %l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8 %l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19 %l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16 %l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17 %l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24 %l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18 %r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !22 %r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8 %r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19 %r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16 %r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17 %r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24 %r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18 %cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp.i, label %cleanup10, label %if.end.i if.end.i: ; preds = %entry %cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload br i1 %cmp4.i, label %cleanup10, label %if.end6.i if.end6.i: ; preds = %if.end.i %cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit phwllABcomp.exit: ; preds = %if.end6.i %cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload br i1 %cmp13.i.not, label %cleanup10, label %if.end if.end: ; preds = %phwllABcomp.exit %cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp.i21, label %cleanup10, label %if.end.i22 if.end.i22: ; preds = %if.end %cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24 if.end6.i24: ; preds = %if.end.i22 %cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26 if.end10.i26: ; preds = %if.end6.i24 %cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload %..i28 = zext i1 %cmp13.i27 to i32 br label %cleanup10 cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit %retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ] ret i32 %retval.1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp = icmp sle i64 %left, %x %cmp1 = icmp sle i64 %x, %right %0 = and i1 %cmp, %cmp1 ret i1 %0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 { entry: %cmp.not = icmp sgt i64 %left, %x %cmp1.not = icmp sgt i64 %x, %right %or.cond = or i1 %cmp.not, %cmp1.not br i1 %or.cond, label %lor.rhs, label %lor.end lor.rhs: ; preds = %entry %cmp2 = icmp sge i64 %left, %x %cmp3 = icmp sge i64 %x, %right %0 = and i1 %cmp2, %cmp3 br label %lor.end lor.end: ; preds = %entry, %lor.rhs %1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ] ret i1 %1 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local zeroext i1 @g(i64 noundef %v, i64 noundef %x) local_unnamed_addr #6 { entry: %mul = shl i64 %v, 1 %0 = load i64, ptr @n, align 8, !tbaa !8 %sub = sub i64 %0, %v %cmp12 = icmp eq i64 %0, %v br i1 %cmp12, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %mul1 = shl i64 %0, 1 %1 = load i64, ptr @m, align 8, !tbaa !8 %add6 = add i64 %1, %x %arrayidx16 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %mul %2 = load i64, ptr %arrayidx16, align 16, !tbaa !8 %sub317 = add i64 %mul1, -1 %arrayidx418 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub317 %3 = load i64, ptr %arrayidx418, align 8, !tbaa !8 %add519 = add nsw i64 %3, %2 %cmp720 = icmp ugt i64 %add519, %add6 br i1 %cmp720, label %cleanup, label %for.cond for.cond: ; preds = %for.body.lr.ph, %for.body %i.01321 = phi i64 [ %inc, %for.body ], [ 0, %for.body.lr.ph ] %inc = add nuw i64 %i.01321, 1 %exitcond = icmp eq i64 %inc, %sub br i1 %exitcond, label %cleanup.loopexit, label %for.body, !llvm.loop !23 for.body: ; preds = %for.cond %add = add i64 %inc, %mul %arrayidx = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %add %4 = load i64, ptr %arrayidx, align 8, !tbaa !8 %reass.sub = sub i64 %mul1, %i.01321 %sub3 = add i64 %reass.sub, -2 %arrayidx4 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !8 %add5 = add nsw i64 %5, %4 %cmp7 = icmp ugt i64 %add5, %add6 br i1 %cmp7, label %cleanup.loopexit, label %for.cond, !llvm.loop !23 cleanup.loopexit: ; preds = %for.cond, %for.body %cmp.le = icmp uge i64 %inc, %sub br label %cleanup cleanup: ; preds = %cleanup.loopexit, %for.body.lr.ph, %entry %cmp.lcssa = phi i1 [ true, %entry ], [ false, %for.body.lr.ph ], [ %cmp.le, %cleanup.loopexit ] ret i1 %cmp.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local zeroext i1 @g2(i64 noundef %v, i64 noundef %x) local_unnamed_addr #6 { entry: %mul = shl i64 %v, 1 %0 = load i64, ptr @n, align 8, !tbaa !8 %sub = sub i64 %0, %v %cmp11 = icmp eq i64 %0, %v br i1 %cmp11, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %mul1 = shl i64 %0, 1 %1 = load i64, ptr @m, align 8, !tbaa !8 %arrayidx15 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %mul %2 = load i64, ptr %arrayidx15, align 16, !tbaa !8 %sub316 = add i64 %mul1, -1 %arrayidx417 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub316 %3 = load i64, ptr %arrayidx417, align 8, !tbaa !8 %add518 = add nsw i64 %3, %2 %cmp619 = icmp ult i64 %add518, %1 br i1 %cmp619, label %cleanup, label %for.cond for.cond: ; preds = %for.body.lr.ph, %for.body %i.01220 = phi i64 [ %inc, %for.body ], [ 0, %for.body.lr.ph ] %inc = add nuw i64 %i.01220, 1 %exitcond = icmp eq i64 %inc, %sub br i1 %exitcond, label %cleanup.loopexit, label %for.body, !llvm.loop !24 for.body: ; preds = %for.cond %add = add i64 %inc, %mul %arrayidx = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %add %4 = load i64, ptr %arrayidx, align 8, !tbaa !8 %reass.sub = sub i64 %mul1, %i.01220 %sub3 = add i64 %reass.sub, -2 %arrayidx4 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub3 %5 = load i64, ptr %arrayidx4, align 8, !tbaa !8 %add5 = add nsw i64 %5, %4 %cmp6 = icmp ult i64 %add5, %1 br i1 %cmp6, label %cleanup.loopexit, label %for.cond, !llvm.loop !24 cleanup.loopexit: ; preds = %for.cond, %for.body %cmp.le = icmp uge i64 %inc, %sub br label %cleanup cleanup: ; preds = %cleanup.loopexit, %for.body.lr.ph, %entry %cmp.lcssa = phi i1 [ true, %entry ], [ false, %for.body.lr.ph ], [ %cmp.le, %cleanup.loopexit ] ret i1 %cmp.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local zeroext i1 @g3(i64 noundef %v, i64 noundef %x) local_unnamed_addr #6 { entry: %cmp8 = icmp eq i64 %v, 0 br i1 %cmp8, label %cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %mul = shl i64 %v, 1 %0 = load i64, ptr @a, align 16, !tbaa !8 %sub112 = add i64 %mul, -1 %arrayidx213 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub112 %1 = load i64, ptr %arrayidx213, align 8, !tbaa !8 %add14 = add nsw i64 %1, %0 %cmp315 = icmp ugt i64 %add14, %x br i1 %cmp315, label %cleanup, label %for.cond for.cond: ; preds = %for.body.lr.ph, %for.body %i.0916 = phi i64 [ %inc, %for.body ], [ 0, %for.body.lr.ph ] %inc = add nuw i64 %i.0916, 1 %exitcond = icmp eq i64 %inc, %v br i1 %exitcond, label %cleanup.loopexit, label %for.body, !llvm.loop !25 for.body: ; preds = %for.cond %arrayidx = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %inc %2 = load i64, ptr %arrayidx, align 8, !tbaa !8 %reass.sub = sub i64 %mul, %i.0916 %sub1 = add i64 %reass.sub, -2 %arrayidx2 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub1 %3 = load i64, ptr %arrayidx2, align 8, !tbaa !8 %add = add nsw i64 %3, %2 %cmp3 = icmp ugt i64 %add, %x br i1 %cmp3, label %cleanup.loopexit, label %for.cond, !llvm.loop !25 cleanup.loopexit: ; preds = %for.cond, %for.body %cmp.le = icmp uge i64 %inc, %v br label %cleanup cleanup: ; preds = %cleanup.loopexit, %for.body.lr.ph, %entry %cmp.lcssa = phi i1 [ true, %entry ], [ false, %for.body.lr.ph ], [ %cmp.le, %cleanup.loopexit ] ret i1 %cmp.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local zeroext i1 @f(i64 noundef %x) local_unnamed_addr #6 { entry: %0 = load i64, ptr @n, align 8, !tbaa !8 %cmp52 = icmp sgt i64 %0, 0 %mul1.i = shl i64 %0, 1 br i1 %cmp52, label %while.body.lr.ph, label %lor.lhs.false while.body.lr.ph: ; preds = %entry %1 = load i64, ptr @m, align 8 %sub3.i46 = add i64 %mul1.i, -1 %arrayidx4.i47 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub3.i46 br label %while.body while.body: ; preds = %while.body.lr.ph, %while.cond %ng.054 = phi i64 [ -1, %while.body.lr.ph ], [ %cmp.lcssa.i42, %while.cond ] %ok.053 = phi i64 [ %0, %while.body.lr.ph ], [ %6, %while.cond ] %add1 = add nsw i64 %ng.054, %ok.053 %div = sdiv i64 %add1, 2 %mul.i = shl nsw i64 %div, 1 %sub.i = sub i64 %0, %div %cmp11.i = icmp eq i64 %0, %div br i1 %cmp11.i, label %g2.exit.thread, label %for.body.lr.ph.i for.body.lr.ph.i: ; preds = %while.body %arrayidx.i45 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %mul.i %2 = load i64, ptr %arrayidx.i45, align 16, !tbaa !8 %3 = load i64, ptr %arrayidx4.i47, align 8, !tbaa !8 %add5.i48 = add nsw i64 %3, %2 %cmp6.i49 = icmp ult i64 %add5.i48, %1 br i1 %cmp6.i49, label %while.cond, label %for.cond.i for.cond.i: ; preds = %for.body.lr.ph.i, %for.body.i %i.012.i50 = phi i64 [ %inc.i, %for.body.i ], [ 0, %for.body.lr.ph.i ] %inc.i = add nuw i64 %i.012.i50, 1 %exitcond.i = icmp eq i64 %inc.i, %sub.i br i1 %exitcond.i, label %g2.exit, label %for.body.i, !llvm.loop !24 for.body.i: ; preds = %for.cond.i %add.i = add i64 %inc.i, %mul.i %arrayidx.i = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %add.i %4 = load i64, ptr %arrayidx.i, align 8, !tbaa !8 %reass.sub = sub i64 %mul1.i, %i.012.i50 %sub3.i = add i64 %reass.sub, -2 %arrayidx4.i = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub3.i %5 = load i64, ptr %arrayidx4.i, align 8, !tbaa !8 %add5.i = add nsw i64 %5, %4 %cmp6.i = icmp ult i64 %add5.i, %1 br i1 %cmp6.i, label %g2.exit, label %for.cond.i, !llvm.loop !24 g2.exit: ; preds = %for.body.i, %for.cond.i %cmp.i.le = icmp uge i64 %inc.i, %sub.i %cond.fr = freeze i1 %cmp.i.le br i1 %cond.fr, label %g2.exit.thread, label %while.cond g2.exit.thread: ; preds = %while.body, %g2.exit br label %while.cond while.cond: ; preds = %for.body.lr.ph.i, %g2.exit, %g2.exit.thread %cmp.lcssa.i42 = phi i64 [ %ng.054, %g2.exit.thread ], [ %div, %g2.exit ], [ %div, %for.body.lr.ph.i ] %6 = phi i64 [ %div, %g2.exit.thread ], [ %ok.053, %g2.exit ], [ %ok.053, %for.body.lr.ph.i ] %add = add nsw i64 %cmp.lcssa.i42, 1 %cmp = icmp slt i64 %add, %6 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !26 while.end: ; preds = %while.cond %mul.i15 = shl i64 %6, 1 %sub.i16 = sub i64 %0, %6 %cmp12.i = icmp eq i64 %0, %6 br i1 %cmp12.i, label %lor.lhs.false, label %for.body.lr.ph.i17 for.body.lr.ph.i17: ; preds = %while.end %mul1.i18 = shl i64 %0, 1 %7 = load i64, ptr @m, align 8, !tbaa !8 %add6.i = add i64 %7, %x %arrayidx.i2156 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %mul.i15 %8 = load i64, ptr %arrayidx.i2156, align 16, !tbaa !8 %sub3.i2257 = add i64 %mul1.i18, -1 %arrayidx4.i2358 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub3.i2257 %9 = load i64, ptr %arrayidx4.i2358, align 8, !tbaa !8 %add5.i2459 = add nsw i64 %9, %8 %cmp7.i60 = icmp ugt i64 %add5.i2459, %add6.i br i1 %cmp7.i60, label %cleanup, label %for.cond.i25 for.cond.i25: ; preds = %for.body.lr.ph.i17, %for.body.i19 %i.013.i61 = phi i64 [ %inc.i26, %for.body.i19 ], [ 0, %for.body.lr.ph.i17 ] %inc.i26 = add nuw i64 %i.013.i61, 1 %exitcond.i28 = icmp eq i64 %inc.i26, %sub.i16 br i1 %exitcond.i28, label %g.exit, label %for.body.i19, !llvm.loop !23 for.body.i19: ; preds = %for.cond.i25 %add.i20 = add i64 %inc.i26, %mul.i15 %arrayidx.i21 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %add.i20 %10 = load i64, ptr %arrayidx.i21, align 8, !tbaa !8 %reass.sub71 = sub i64 %mul1.i18, %i.013.i61 %sub3.i22 = add i64 %reass.sub71, -2 %arrayidx4.i23 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub3.i22 %11 = load i64, ptr %arrayidx4.i23, align 8, !tbaa !8 %add5.i24 = add nsw i64 %11, %10 %cmp7.i = icmp ugt i64 %add5.i24, %add6.i br i1 %cmp7.i, label %g.exit, label %for.cond.i25, !llvm.loop !23 g.exit: ; preds = %for.body.i19, %for.cond.i25 %cmp.i27.not.le = icmp ult i64 %inc.i26, %sub.i16 br i1 %cmp.i27.not.le, label %cleanup, label %lor.lhs.false lor.lhs.false: ; preds = %entry, %while.end, %g.exit %mul.i1581 = phi i64 [ %mul.i15, %while.end ], [ %mul.i15, %g.exit ], [ %mul1.i, %entry ] %ok.0.lcssa80 = phi i64 [ %6, %while.end ], [ %6, %g.exit ], [ %0, %entry ] %cmp8.i = icmp eq i64 %ok.0.lcssa80, 0 br i1 %cmp8.i, label %cleanup, label %for.body.i32.preheader for.body.i32.preheader: ; preds = %lor.lhs.false %12 = load i64, ptr @a, align 16, !tbaa !8 %sub1.i64 = add i64 %mul.i1581, -1 %arrayidx2.i65 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub1.i64 %13 = load i64, ptr %arrayidx2.i65, align 8, !tbaa !8 %add.i3466 = add nsw i64 %13, %12 %cmp3.i67 = icmp ugt i64 %add.i3466, %x br i1 %cmp3.i67, label %cleanup, label %for.cond.i35 for.cond.i35: ; preds = %for.body.i32.preheader, %for.body.i32 %i.09.i68 = phi i64 [ %inc.i36, %for.body.i32 ], [ 0, %for.body.i32.preheader ] %inc.i36 = add nuw i64 %i.09.i68, 1 %exitcond.i38 = icmp eq i64 %inc.i36, %ok.0.lcssa80 br i1 %exitcond.i38, label %cleanup.loopexit, label %for.body.i32, !llvm.loop !25 for.body.i32: ; preds = %for.cond.i35 %arrayidx.i33 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %inc.i36 %14 = load i64, ptr %arrayidx.i33, align 8, !tbaa !8 %reass.sub72 = sub i64 %mul.i1581, %i.09.i68 %sub1.i = add i64 %reass.sub72, -2 %arrayidx2.i = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %sub1.i %15 = load i64, ptr %arrayidx2.i, align 8, !tbaa !8 %add.i34 = add nsw i64 %15, %14 %cmp3.i = icmp ugt i64 %add.i34, %x br i1 %cmp3.i, label %cleanup.loopexit, label %for.cond.i35, !llvm.loop !25 cleanup.loopexit: ; preds = %for.body.i32, %for.cond.i35 %cmp.i37.le = icmp uge i64 %inc.i36, %ok.0.lcssa80 br label %cleanup cleanup: ; preds = %cleanup.loopexit, %for.body.lr.ph.i17, %for.body.i32.preheader, %lor.lhs.false, %g.exit %retval.0 = phi i1 [ false, %g.exit ], [ true, %lor.lhs.false ], [ false, %for.body.i32.preheader ], [ false, %for.body.lr.ph.i17 ], [ %cmp.i37.le, %cleanup.loopexit ] ret i1 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i64 @solve() local_unnamed_addr #7 { entry: %0 = load i64, ptr @n, align 8, !tbaa !8 %mul = shl i64 %0, 1 tail call void @qsort(ptr noundef nonnull @a, i64 noundef %mul, i64 noundef 8, ptr noundef nonnull @pullcomp) #12 %1 = load i64, ptr @m, align 8, !tbaa !8 %cmp21 = icmp sgt i64 %1, 0 br i1 %cmp21, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %ok.023 = phi i64 [ %div.ok.0, %while.body ], [ %1, %entry ] %ng.022 = phi i64 [ %ng.0.div, %while.body ], [ -1, %entry ] %add1 = add nsw i64 %ok.023, %ng.022 %div = sdiv i64 %add1, 2 %call = tail call zeroext i1 @f(i64 noundef %div) %ng.0.div = select i1 %call, i64 %ng.022, i64 %div %div.ok.0 = select i1 %call, i64 %div, i64 %ok.023 %add = add nsw i64 %ng.0.div, 1 %cmp = icmp slt i64 %add, %div.ok.0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !27 while.end: ; preds = %while.body, %entry %ok.0.lcssa = phi i64 [ %1, %entry ], [ %div.ok.0, %while.body ] %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ok.0.lcssa) ret i64 0 } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #7 { entry: store i64 3, ptr @n, align 8, !tbaa !8 store i64 0, ptr @m, align 8, !tbaa !8 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m) %0 = load i64, ptr @n, align 8, !tbaa !8 %mul6.mask = and i64 %0, 9223372036854775807 %cmp7.not = icmp eq i64 %mul6.mask, 0 br i1 %cmp7.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %1 = load i64, ptr @n, align 8, !tbaa !8 %mul = shl i64 %1, 1 %cmp = icmp ugt i64 %mul, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !28 for.end: ; preds = %for.body, %entry %mul.lcssa = phi i64 [ 0, %entry ], [ %mul, %for.body ] tail call void @qsort(ptr noundef nonnull @a, i64 noundef %mul.lcssa, i64 noundef 8, ptr noundef nonnull @pullcomp) #12 %2 = load i64, ptr @m, align 8, !tbaa !8 %cmp21.i = icmp sgt i64 %2, 0 br i1 %cmp21.i, label %while.body.i, label %solve.exit while.body.i: ; preds = %for.end, %while.body.i %ok.023.i = phi i64 [ %div.ok.0.i, %while.body.i ], [ %2, %for.end ] %ng.022.i = phi i64 [ %ng.0.div.i, %while.body.i ], [ -1, %for.end ] %add1.i = add nsw i64 %ng.022.i, %ok.023.i %div.i = sdiv i64 %add1.i, 2 %call.i = tail call zeroext i1 @f(i64 noundef %div.i) %ng.0.div.i = select i1 %call.i, i64 %ng.022.i, i64 %div.i %div.ok.0.i = select i1 %call.i, i64 %div.i, i64 %ok.023.i %add.i = add nsw i64 %ng.0.div.i, 1 %cmp.i = icmp slt i64 %add.i, %div.ok.0.i br i1 %cmp.i, label %while.body.i, label %solve.exit, !llvm.loop !27 solve.exit: ; preds = %while.body.i, %for.end %ok.0.lcssa.i = phi i64 [ %2, %for.end ], [ %div.ok.0.i, %while.body.i ] %call2.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ok.0.lcssa.i) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #10 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #11 = { nounwind willreturn memory(read) } attributes #12 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = !{!9, !9, i64 0} !9 = !{!"long", !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"} !12 = !{!10, !10, i64 0} !13 = !{!14, !14, i64 0} !14 = !{!"double", !10, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !10, i64 0} !17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8} !18 = !{i64 0, i64 8, !8} !19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8} !20 = !{i64 0, i64 8, !13, i64 8, i64 8, !13} !21 = !{i64 0, i64 8, !13} !22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8} !23 = distinct !{!23, !6} !24 = distinct !{!24, !6} !25 = distinct !{!25, !6} !26 = distinct !{!26, !6} !27 = distinct !{!27, !6} !28 = distinct !{!28, !6}
#include <stdio.h> #include <string.h> int main(void){ char sentence[101],abb[5]; int length,between; scanf("%s",sentence); length = strlen(sentence); between = length - 2; sprintf(abb,"%c%d%c",sentence[0],between,sentence[length-1]); printf("%s\n",abb); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167267/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167267/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [7 x i8] c"%c%d%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sentence = alloca [101 x i8], align 16 %abb = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %sentence) #5 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %abb) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sentence) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %sentence) #6 %conv = trunc i64 %call2 to i32 %sub = add nsw i32 %conv, -2 %0 = load i8, ptr %sentence, align 16, !tbaa !5 %conv4 = sext i8 %0 to i32 %sub5 = shl i64 %call2, 32 %sext = add i64 %sub5, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx6 = getelementptr inbounds [101 x i8], ptr %sentence, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %conv7 = sext i8 %1 to i32 %call8 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %abb, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv4, i32 noundef %sub, i32 noundef %conv7) #5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %abb) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %abb) #5 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %sentence) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define N 100000 #define A 1000000 int main() { static int aa[N], qu[N], kk[A + 1]; int n, h, i, j, k, yes, cnt; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &aa[i]); yes = 1, cnt = 0; for (i = j = 0, k = 0; j < n; j++) { int a = aa[j]; if (a > 0) { if (kk[a] != 0) { yes = 0; break; } kk[a]++; k++; } else { a = -a; if (kk[a] != 1) { yes = 0; break; } kk[a]++; k--; } if (k == 0) { qu[cnt++] = j - i + 1; while (i <= j) { int a = aa[i++]; if (a < 0) a = -a; kk[a] = 0; } } } if (!yes || k != 0) { printf("-1\n"); return 0; } printf("%d\n", cnt); for (h = 0; h < cnt; h++) printf("%d ", qu[h]); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16731/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16731/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.aa = internal global [100000 x i32] zeroinitializer, align 16 @main.qu = internal unnamed_addr global [100000 x i32] zeroinitializer, align 16 @main.kk = internal unnamed_addr global [1000001 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp113 = icmp sgt i32 %0, 0 br i1 %cmp113, label %for.body, label %if.end49.thread for.cond2.preheader: ; preds = %for.body %cmp3118 = icmp sgt i32 %1, 0 br i1 %cmp3118, label %for.body4.preheader, label %if.end49.thread for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.body4.outer for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 if.then: ; preds = %for.body4.outer.peel.newph %3 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10.not = icmp eq i32 %3, 0 br i1 %cmp10.not, label %if.end, label %if.then47 if.end: ; preds = %if.then store i32 1, ptr %arrayidx9, align 4, !tbaa !5 br label %for.inc43 if.else: ; preds = %for.body4.outer.peel.newph %4 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp18.not = icmp eq i32 %4, 1 br i1 %cmp18.not, label %if.end20, label %if.then47 if.end20: ; preds = %if.else store i32 2, ptr %arrayidx17, align 4, !tbaa !5 br label %for.inc43 while.body.preheader: ; preds = %if.then26.peel %5 = sub i32 %indvars.iv132.ph, %i.1119.ph %.neg = add i32 %i.1119.ph, 1 %xtraiter = and i32 %5, 1 %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 %indvars.iv.next130.prol = add nsw i64 %10, 1 %arrayidx35.prol = getelementptr inbounds [100000 x i32], ptr @main.aa, i64 0, i64 %10 %6 = load i32, ptr %arrayidx35.prol, align 4, !tbaa !5 %spec.select.prol = call i32 @llvm.abs.i32(i32 %6, i1 true) %idxprom40.prol = zext i32 %spec.select.prol to i64 %arrayidx41.prol = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom40.prol store i32 0, ptr %arrayidx41.prol, align 4, !tbaa !5 br label %while.body.prol.loopexit while.body.prol.loopexit: ; preds = %while.body.prol, %while.body.preheader %indvars.iv129.unr = phi i64 [ %10, %while.body.preheader ], [ %indvars.iv.next130.prol, %while.body.prol ] %7 = icmp eq i32 %indvars.iv132.ph, %.neg br i1 %7, label %for.inc43, label %while.body while.body: ; preds = %while.body.prol.loopexit, %while.body %indvars.iv129 = phi i64 [ %indvars.iv.next130.1, %while.body ], [ %indvars.iv129.unr, %while.body.prol.loopexit ] %indvars.iv.next130 = add nsw i64 %indvars.iv129, 1 %arrayidx35 = getelementptr inbounds [100000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv129 %8 = load i32, ptr %arrayidx35, align 4, !tbaa !5 %spec.select = call i32 @llvm.abs.i32(i32 %8, i1 true) %idxprom40 = zext i32 %spec.select to i64 %arrayidx41 = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom40 store i32 0, ptr %arrayidx41, align 4, !tbaa !5 %indvars.iv.next130.1 = add nsw i64 %indvars.iv129, 2 %arrayidx35.1 = getelementptr inbounds [100000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv.next130 %9 = load i32, ptr %arrayidx35.1, align 4, !tbaa !5 %spec.select.1 = call i32 @llvm.abs.i32(i32 %9, i1 true) %idxprom40.1 = zext i32 %spec.select.1 to i64 %arrayidx41.1 = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom40.1 store i32 0, ptr %arrayidx41.1, align 4, !tbaa !5 %lftr.wideiv.1 = trunc i64 %indvars.iv.next130.1 to i32 %exitcond.not.1 = icmp eq i32 %indvars.iv132.ph, %lftr.wideiv.1 br i1 %exitcond.not.1, label %for.inc43, label %while.body, !llvm.loop !11 for.inc43: ; preds = %if.end24.peel, %if.end, %if.end20, %while.body.prol.loopexit, %while.body %dec207 = phi i32 [ %dec.peel, %while.body ], [ %dec.peel, %while.body.prol.loopexit ], [ %dec.peel, %if.end24.peel ], [ -1, %if.end20 ], [ 1, %if.end ] %indvars.iv134204 = phi i64 [ %indvars.iv134.ph, %while.body ], [ %indvars.iv134.ph, %while.body.prol.loopexit ], [ %indvars.iv134.ph, %if.end24.peel ], [ %indvars.iv.next135150.peel, %if.end ], [ %indvars.iv.next135150.peel, %if.end20 ] %indvars.iv132200 = phi i32 [ %indvars.iv132.ph, %while.body ], [ %indvars.iv132.ph, %while.body.prol.loopexit ], [ %indvars.iv132.ph, %if.end24.peel ], [ %indvars.iv.next133151.peel, %if.end ], [ %indvars.iv.next133151.peel, %if.end20 ] %i.4.ph = phi i32 [ %indvars.iv132.ph, %while.body ], [ %indvars.iv132.ph, %while.body.prol.loopexit ], [ %i.1119.ph, %if.end20 ], [ %i.1119.ph, %if.end ], [ %i.1119.ph, %if.end24.peel ] %cnt.2.ph = phi i32 [ %inc28.peel, %while.body ], [ %inc28.peel, %while.body.prol.loopexit ], [ %cnt.0122.ph, %if.end24.peel ], [ %inc28.peel, %if.end ], [ %inc28.peel, %if.end20 ] %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134204, 1 %indvars.iv.next133 = add nuw i32 %indvars.iv132200, 1 %exitcond137.not = icmp eq i64 %indvars.iv.next135, %wide.trip.count br i1 %exitcond137.not, label %for.end45, label %for.body4.outer, !llvm.loop !12 for.body4.outer: ; preds = %for.inc43, %for.body4.preheader %indvars.iv134.ph = phi i64 [ %indvars.iv.next135, %for.inc43 ], [ 0, %for.body4.preheader ] %indvars.iv132.ph = phi i32 [ %indvars.iv.next133, %for.inc43 ], [ 1, %for.body4.preheader ] %cnt.0122.ph = phi i32 [ %cnt.2.ph, %for.inc43 ], [ 0, %for.body4.preheader ] %k.0121.ph = phi i32 [ %dec207, %for.inc43 ], [ 0, %for.body4.preheader ] %i.1119.ph = phi i32 [ %i.4.ph, %for.inc43 ], [ 0, %for.body4.preheader ] %10 = sext i32 %i.1119.ph to i64 %arrayidx6.peel = getelementptr inbounds [100000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv134.ph %11 = load i32, ptr %arrayidx6.peel, align 4, !tbaa !5 %cmp7.peel = icmp sgt i32 %11, 0 br i1 %cmp7.peel, label %if.then.peel, label %if.else.peel if.else.peel: ; preds = %for.body4.outer %sub.peel = sub nsw i32 0, %11 %idxprom16.peel = zext i32 %sub.peel to i64 %arrayidx17.peel = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom16.peel %12 = load i32, ptr %arrayidx17.peel, align 4, !tbaa !5 %cmp18.not.peel = icmp eq i32 %12, 1 br i1 %cmp18.not.peel, label %if.end20.peel, label %if.then47 if.end20.peel: ; preds = %if.else.peel store i32 2, ptr %arrayidx17.peel, align 4, !tbaa !5 br label %if.end24.peel if.then.peel: ; preds = %for.body4.outer %idxprom8.peel = zext i32 %11 to i64 %arrayidx9.peel = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom8.peel %13 = load i32, ptr %arrayidx9.peel, align 4, !tbaa !5 %cmp10.not.peel = icmp eq i32 %13, 0 br i1 %cmp10.not.peel, label %if.end.peel, label %if.then47 if.end.peel: ; preds = %if.then.peel store i32 1, ptr %arrayidx9.peel, align 4, !tbaa !5 br label %if.end24.peel if.end24.peel: ; preds = %if.end.peel, %if.end20.peel %.sink.peel = phi i32 [ -1, %if.end20.peel ], [ 1, %if.end.peel ] %dec.peel = add nsw i32 %k.0121.ph, %.sink.peel %cmp25.peel = icmp eq i32 %dec.peel, 0 br i1 %cmp25.peel, label %if.then26.peel, label %for.inc43 if.then26.peel: ; preds = %if.end24.peel %14 = trunc i64 %indvars.iv134.ph to i32 %reass.sub.peel = sub i32 %14, %i.1119.ph %add.peel = add i32 %reass.sub.peel, 1 %inc28.peel = add nsw i32 %cnt.0122.ph, 1 %idxprom29.peel = sext i32 %cnt.0122.ph to i64 %arrayidx30.peel = getelementptr inbounds [100000 x i32], ptr @main.qu, i64 0, i64 %idxprom29.peel store i32 %add.peel, ptr %arrayidx30.peel, align 4, !tbaa !5 %cmp31.not115.peel = icmp slt i64 %indvars.iv134.ph, %10 br i1 %cmp31.not115.peel, label %for.inc43.thread.peel, label %while.body.preheader for.inc43.thread.peel: ; preds = %if.then26.peel %indvars.iv.next135150.peel = add nuw nsw i64 %indvars.iv134.ph, 1 %indvars.iv.next133151.peel = add nuw i32 %indvars.iv132.ph, 1 %exitcond137.not152.peel = icmp eq i64 %indvars.iv.next135150.peel, %wide.trip.count br i1 %exitcond137.not152.peel, label %if.end49, label %for.body4.outer.peel.newph for.body4.outer.peel.newph: ; preds = %for.inc43.thread.peel %arrayidx6 = getelementptr inbounds [100000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv.next135150.peel %15 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %15, 0 %sub = sub nsw i32 0, %15 %idxprom16 = zext i32 %sub to i64 %arrayidx17 = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom16 %idxprom8 = zext i32 %15 to i64 %arrayidx9 = getelementptr inbounds [1000001 x i32], ptr @main.kk, i64 0, i64 %idxprom8 br i1 %cmp7, label %if.then, label %if.else if.end49.thread: ; preds = %entry, %for.cond2.preheader %call50157 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0) br label %for.end59 for.end45: ; preds = %for.inc43 %16 = icmp eq i32 %dec207, 0 br i1 %16, label %if.end49, label %if.then47 if.then47: ; preds = %if.else, %if.then, %if.else.peel, %if.then.peel, %for.end45 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup61 if.end49: ; preds = %for.inc43.thread.peel, %for.end45 %cnt.0.lcssa147 = phi i32 [ %cnt.2.ph, %for.end45 ], [ %inc28.peel, %for.inc43.thread.peel ] %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa147) %cmp52125 = icmp sgt i32 %cnt.0.lcssa147, 0 br i1 %cmp52125, label %for.body53.preheader, label %for.end59 for.body53.preheader: ; preds = %if.end49 %wide.trip.count141 = zext i32 %cnt.0.lcssa147 to i64 br label %for.body53 for.body53: ; preds = %for.body53.preheader, %for.body53 %indvars.iv138 = phi i64 [ 0, %for.body53.preheader ], [ %indvars.iv.next139, %for.body53 ] %arrayidx55 = getelementptr inbounds [100000 x i32], ptr @main.qu, i64 0, i64 %indvars.iv138 %17 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %17) %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %exitcond142.not = icmp eq i64 %indvars.iv.next139, %wide.trip.count141 br i1 %exitcond142.not, label %for.end59, label %for.body53, !llvm.loop !13 for.end59: ; preds = %for.body53, %if.end49.thread, %if.end49 %putchar = call i32 @putchar(i32 10) br label %cleanup61 cleanup61: ; preds = %for.end59, %if.then47 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; 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 nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, 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 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}
/* ex6_2 Rikuta */ #include <stdio.h> #include <string.h> #define LIM 101 int main(void){ char word[LIM]; scanf("%s",&word); printf("%c%d%c\n",word[0],(int)strlen(word)-2,word[strlen(word)-1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167353/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167353/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [8 x i8] c"%c%d%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %word = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %word) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %word) %0 = load i8, ptr %word, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %word) #5 %conv2 = trunc i64 %call1 to i32 %sub = add nsw i32 %conv2, -2 %sub5 = add i64 %call1, -1 %arrayidx6 = getelementptr inbounds [101 x i8], ptr %word, i64 0, i64 %sub5 %1 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %conv7 = sext i8 %1 to i32 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %sub, i32 noundef %conv7) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %word) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int i = 0, b = 0; char str[100]; scanf("%s", str); while(str[i]){ i++; } b = i-1; i = i-2; printf("%c%d%c\n", str[0], i, str[b]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167397/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167397/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [8 x i8] c"%c%d%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %tobool.not = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %tobool.not, label %while.end, label %while.cond, !llvm.loop !8 while.end: ; preds = %while.cond %1 = trunc i64 %indvars.iv to i32 %sub1 = add nsw i32 %1, -2 %2 = load i8, ptr %str, align 16, !tbaa !5 %conv = sext i8 %2 to i32 %sub = shl i64 %indvars.iv, 32 %sext = add i64 %sub, -4294967296 %idxprom3 = ashr exact i64 %sext, 32 %arrayidx4 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom3 %3 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %conv5 = sext i8 %3 to i32 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %sub1, i32 noundef %conv5) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(void){ char s[100]; int x=0; scanf("%s",s); x=strlen(s); printf("%c%d%c",s[0],x-2,s[x-1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167447/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167447/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [7 x i8] c"%c%d%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %conv = trunc i64 %call2 to i32 %0 = load i8, ptr %s, align 16, !tbaa !5 %conv3 = sext i8 %0 to i32 %sub = add nsw i32 %conv, -2 %sub4 = shl i64 %call2, 32 %sext = add i64 %sub4, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx5 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %conv6 = sext i8 %1 to i32 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3, i32 noundef %sub, i32 noundef %conv6) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> char buf[55]; int main() { scanf("%s", buf); int len = strlen(buf); printf("%c%d%c\n", buf[0], len-2, buf[len-1]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167498/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167498/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @buf = dso_local global [55 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%d%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @buf) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @buf) #3 %conv = trunc i64 %call1 to i32 %0 = load i8, ptr @buf, align 16, !tbaa !5 %conv2 = sext i8 %0 to i32 %sub = add nsw i32 %conv, -2 %sub3 = shl i64 %call1, 32 %sext = add i64 %sub3, -4294967296 %idxprom = ashr exact i64 %sext, 32 %arrayidx = getelementptr inbounds [55 x i8], ptr @buf, i64 0, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv2, i32 noundef %sub, i32 noundef %conv4) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress 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 = { 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"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <limits.h> #include <math.h> int all_1[100010]; int all_2; int main() { int t,length; scanf("%d",&t); for(int time=0;time<t;time++) { scanf("%d",&length); for(int time1=0;time1<length;time1++) { scanf("%d",&all_1[time1]); } for(int time1=0;time1<length;time1++) { scanf("%d",&all_2); all_1[time1]=all_2-all_1[time1]; } int k=0; int flag=0; for(int time1=0;time1<length;time1++) { if(all_1[time1]<0){flag=1;break;} else if(all_1[time1]>0) { if(k==0){k=all_1[time1];} else if(all_1[time1]!=k){flag=1;break;} } else if(k!=0) { k=-1; } } if(flag){printf("NO\n");} else printf("YES\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16757/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16757/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @all_1 = dso_local global [100010 x i32] zeroinitializer, align 16 @all_2 = dso_local global i32 0, align 4 @str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %length = 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 %length) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp83 = icmp sgt i32 %0, 0 br i1 %cmp83, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %if.end55, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %length) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 for.body: ; preds = %entry, %if.end55 %time.084 = phi i32 [ %inc57, %if.end55 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %length) %1 = load i32, ptr %length, align 4, !tbaa !5 %cmp376 = icmp sgt i32 %1, 0 br i1 %cmp376, label %for.body5, label %if.end55 for.cond8.preheader: ; preds = %for.body5 %cmp978 = icmp sgt i32 %2, 0 br i1 %cmp978, label %for.body11, label %if.end55 for.body5: ; preds = %for.body, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [100010 x i32], ptr @all_1, i64 0, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %length, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp3, label %for.body5, label %for.cond8.preheader, !llvm.loop !9 for.cond21.preheader: ; preds = %for.body11 %cmp22.not80 = icmp sgt i32 %6, 0 br i1 %cmp22.not80, label %for.body24.preheader, label %if.end55 for.body24.preheader: ; preds = %for.cond21.preheader %wide.trip.count = zext i32 %6 to i64 br label %for.body24 for.body11: ; preds = %for.cond8.preheader, %for.body11 %indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.body11 ], [ 0, %for.cond8.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @all_2) %4 = load i32, ptr @all_2, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds [100010 x i32], ptr @all_1, i64 0, i64 %indvars.iv87 %5 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %sub = sub nsw i32 %4, %5 store i32 %sub, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %6 = load i32, ptr %length, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp9 = icmp slt i64 %indvars.iv.next88, %7 br i1 %cmp9, label %for.body11, label %for.cond21.preheader, !llvm.loop !11 for.body24: ; preds = %for.body24.preheader, %for.inc48 %indvars.iv90 = phi i64 [ 0, %for.body24.preheader ], [ %indvars.iv.next91, %for.inc48 ] %k.081 = phi i32 [ 0, %for.body24.preheader ], [ %k.1, %for.inc48 ] %arrayidx26 = getelementptr inbounds [100010 x i32], ptr @all_1, i64 0, i64 %indvars.iv90 %8 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %cmp27 = icmp slt i32 %8, 0 br i1 %cmp27, label %if.end55, label %if.else if.else: ; preds = %for.body24 %cmp30.not = icmp eq i32 %8, 0 br i1 %cmp30.not, label %if.else42, label %if.then31 if.then31: ; preds = %if.else %cmp32 = icmp eq i32 %k.081, 0 br i1 %cmp32, label %for.inc48, label %if.else36 if.else36: ; preds = %if.then31 %cmp39.not = icmp eq i32 %8, %k.081 br i1 %cmp39.not, label %for.inc48, label %if.end55 if.else42: ; preds = %if.else %cmp43.not = icmp ne i32 %k.081, 0 %spec.store.select = sext i1 %cmp43.not to i32 br label %for.inc48 for.inc48: ; preds = %if.then31, %if.else36, %if.else42 %k.1 = phi i32 [ %k.081, %if.else36 ], [ %spec.store.select, %if.else42 ], [ %8, %if.then31 ] %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count br i1 %exitcond.not, label %if.end55, label %for.body24, !llvm.loop !12 if.end55: ; preds = %for.inc48, %if.else36, %for.body24, %for.cond21.preheader, %for.cond8.preheader, %for.body %str.sink = phi ptr [ @str, %for.body ], [ @str, %for.cond8.preheader ], [ @str, %for.cond21.preheader ], [ @str.3, %for.body24 ], [ @str.3, %if.else36 ], [ @str, %for.inc48 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) %inc57 = add nuw nsw i32 %time.084, 1 %9 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc57, %9 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void) { int a, b, c, d; scanf("%d %d %d", &a, &b, &c); while ((a>b) || (b>c)) { if (a>b) { d = a; a = b; b = d; } if (b>c) { d = b; b = c; c = d; } } printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167612/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167612/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4 %c.promoted = load i32, ptr %c, align 4 %cmp15 = icmp sgt i32 %a.promoted, %b.promoted %cmp116 = icmp sgt i32 %b.promoted, %c.promoted %0 = select i1 %cmp15, i1 true, i1 %cmp116 br i1 %0, label %while.body, label %while.end while.body: ; preds = %entry, %if.end5 %cmp17 = phi i1 [ %cmp, %if.end5 ], [ %cmp15, %entry ] %1 = phi i32 [ %5, %if.end5 ], [ %a.promoted, %entry ] %2 = phi i32 [ %7, %if.end5 ], [ %b.promoted, %entry ] %3 = phi i32 [ %6, %if.end5 ], [ %c.promoted, %entry ] br i1 %cmp17, label %if.then, label %if.end if.then: ; preds = %while.body store i32 %2, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %4 = phi i32 [ %1, %if.then ], [ %2, %while.body ] %5 = phi i32 [ %2, %if.then ], [ %1, %while.body ] %cmp3 = icmp sgt i32 %4, %3 br i1 %cmp3, label %if.then4, label %if.end5 if.then4: ; preds = %if.end store i32 %3, ptr %b, align 4, !tbaa !5 store i32 %4, ptr %c, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %if.then4, %if.end %6 = phi i32 [ %4, %if.then4 ], [ %3, %if.end ] %7 = phi i32 [ %3, %if.then4 ], [ %4, %if.end ] %cmp = icmp sgt i32 %5, %7 %cmp1 = icmp sgt i32 %7, %6 %8 = select i1 %cmp, i1 true, i1 %cmp1 br i1 %8, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %if.end5, %entry %.lcssa14 = phi i32 [ %a.promoted, %entry ], [ %5, %if.end5 ] %.lcssa13 = phi i32 [ %b.promoted, %entry ], [ %7, %if.end5 ] %.lcssa = phi i32 [ %c.promoted, %entry ], [ %6, %if.end5 ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa14, i32 noundef %.lcssa13, i32 noundef %.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int a,b,c,d; scanf("%d %d %d",&a,&b,&c); if(b<a){ d=a; a=b; b=d; } else{ } if(c<b){ d=b; b=c; c=d; } else{ } if(b<a){ d=a; a=b; b=d; } else{ } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167656/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167656/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %entry, %if.then %2 = phi i32 [ %1, %entry ], [ %0, %if.then ] %3 = phi i32 [ %0, %entry ], [ %1, %if.then ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp slt i32 %4, %3 br i1 %cmp1, label %if.then2, label %if.end4 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end4 if.end4: ; preds = %if.end, %if.then2 %5 = phi i32 [ %4, %if.end ], [ %3, %if.then2 ] %6 = phi i32 [ %3, %if.end ], [ %4, %if.then2 ] %cmp5 = icmp slt i32 %6, %2 br i1 %cmp5, label %if.then6, label %if.end8 if.then6: ; preds = %if.end4 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.end4, %if.then6 %7 = phi i32 [ %6, %if.end4 ], [ %2, %if.then6 ] %8 = phi i32 [ %2, %if.end4 ], [ %6, %if.then6 ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) 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> #include<stdlib.h> #include<math.h> #define REP(i,a,b) for(i=a;i<b;i++) #define rep(i,n) REP(i,0,n) int ab(int x){ if(x<0)return -x; return x; } int main(){ int i,j,k,l,m,n,st; int x[666], y[666]; int in[666], used[666]; int res[666]; scanf("%d%d",&n,&m); rep(i,n) scanf("%d%d",x+i,y+i); rep(i,m) scanf("%d",in+i); rep(st,2){ rep(i,n) res[i]=-1; rep(i,m) used[i]=0; for(i=st;i<n;i+=2){ k = 0; k += ab(x[i]-x[(i+n-1)%n]) + ab(y[i]-y[(i+n-1)%n]); k += ab(x[i]-x[(i+n+1)%n]) + ab(y[i]-y[(i+n+1)%n]); rep(j,m) if(in[j]==k && used[j]==0) break; if(j==m) break; res[i] = j+1; used[j]=1; } if(i>=n){ puts("YES"); rep(i,n){ if(i) putchar(' '); printf("%d",res[i]); } puts(""); return 0; } } puts("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1677/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1677/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ab(i32 noundef %x) local_unnamed_addr #0 { entry: %retval.0 = tail call i32 @llvm.abs.i32(i32 %x, i1 true) ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 %x = alloca [666 x i32], align 16 %y = alloca [666 x i32], align 16 %in = alloca [666 x i32], align 16 %used = alloca [666 x i32], align 16 %res = alloca [666 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 2664, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 2664, ptr nonnull %y) #6 call void @llvm.lifetime.start.p0(i64 2664, ptr nonnull %in) #6 call void @llvm.lifetime.start.p0(i64 2664, ptr nonnull %used) #6 call void @llvm.lifetime.start.p0(i64 2664, ptr nonnull %res) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp171 = icmp sgt i32 %0, 0 br i1 %cmp171, label %for.body, label %for.cond5.preheader for.cond5.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %3, %for.body ] %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp6173 = icmp sgt i32 %2, 0 br i1 %cmp6173, label %for.body7, label %for.cond15.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %add.ptr3 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr3) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.cond15.preheader.loopexit: ; preds = %for.body7 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.cond5.preheader %5 = phi i32 [ %1, %for.cond5.preheader ], [ %.pre, %for.cond15.preheader.loopexit ] %.lcssa170 = phi i32 [ %2, %for.cond5.preheader ], [ %10, %for.cond15.preheader.loopexit ] %cmp19175 = icmp sgt i32 %5, 0 %cmp25178 = icmp sgt i32 %.lcssa170, 0 %6 = zext i32 %5 to i64 %7 = shl nuw nsw i64 %6, 2 %8 = zext i32 %.lcssa170 to i64 %9 = shl nuw nsw i64 %8, 2 br i1 %cmp19175, label %for.body20.preheader, label %for.cond24.preheader for.body7: ; preds = %for.cond5.preheader, %for.body7 %indvars.iv191 = phi i64 [ %indvars.iv.next192, %for.body7 ], [ 0, %for.cond5.preheader ] %add.ptr10 = getelementptr inbounds i32, ptr %in, i64 %indvars.iv191 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr10) %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1 %10 = load i32, ptr %m, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp6 = icmp slt i64 %indvars.iv.next192, %11 br i1 %cmp6, label %for.body7, label %for.cond15.preheader.loopexit, !llvm.loop !11 for.body20.preheader: ; preds = %for.cond15.preheader call void @llvm.memset.p0.i64(ptr nonnull align 16 %res, i8 -1, i64 %7, i1 false), !tbaa !5 br label %for.cond24.preheader for.cond24.preheader: ; preds = %for.body20.preheader, %for.cond15.preheader br i1 %cmp25178, label %for.body26.preheader, label %for.cond32.preheader for.body26.preheader: ; preds = %for.cond24.preheader call void @llvm.memset.p0.i64(ptr nonnull align 16 %used, i8 0, i64 %9, i1 false), !tbaa !5 br label %for.cond32.preheader for.cond32.preheader: ; preds = %for.body26.preheader, %for.cond24.preheader %exitcond210.not = icmp slt i32 %5, 1 br i1 %exitcond210.not, label %if.then96, label %for.body34 for.body34: ; preds = %for.cond32.preheader, %if.end86 %indvars.iv205 = phi i64 [ %indvars.iv.next206, %if.end86 ], [ 0, %for.cond32.preheader ] %indvars207 = trunc i64 %indvars.iv205 to i32 %arrayidx36 = getelementptr inbounds [666 x i32], ptr %x, i64 0, i64 %indvars.iv205 %12 = load i32, ptr %arrayidx36, align 8, !tbaa !5 %add = add nsw i32 %5, %indvars207 %sub = add nsw i32 %add, -1 %rem = srem i32 %sub, %5 %idxprom37 = sext i32 %rem to i64 %arrayidx38 = getelementptr inbounds [666 x i32], ptr %x, i64 0, i64 %idxprom37 %13 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %sub39 = sub nsw i32 %12, %13 %retval.0.i = call i32 @llvm.abs.i32(i32 %sub39, i1 true) %arrayidx42 = getelementptr inbounds [666 x i32], ptr %y, i64 0, i64 %indvars.iv205 %14 = load i32, ptr %arrayidx42, align 8, !tbaa !5 %arrayidx47 = getelementptr inbounds [666 x i32], ptr %y, i64 0, i64 %idxprom37 %15 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %sub48 = sub nsw i32 %14, %15 %retval.0.i165 = call i32 @llvm.abs.i32(i32 %sub48, i1 true) %add55 = add nsw i32 %add, 1 %rem56 = srem i32 %add55, %5 %idxprom57 = sext i32 %rem56 to i64 %arrayidx58 = getelementptr inbounds [666 x i32], ptr %x, i64 0, i64 %idxprom57 %16 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %sub59 = sub nsw i32 %12, %16 %retval.0.i166 = call i32 @llvm.abs.i32(i32 %sub59, i1 true) %arrayidx67 = getelementptr inbounds [666 x i32], ptr %y, i64 0, i64 %idxprom57 %17 = load i32, ptr %arrayidx67, align 4, !tbaa !5 %sub68 = sub nsw i32 %14, %17 %retval.0.i167 = call i32 @llvm.abs.i32(i32 %sub68, i1 true) %add70 = add nuw i32 %retval.0.i165, %retval.0.i %add50 = add i32 %add70, %retval.0.i166 %add71 = add i32 %add50, %retval.0.i167 br i1 %cmp25178, label %for.body74, label %for.end83 for.body74: ; preds = %for.body34, %for.inc81 %indvars.iv200 = phi i64 [ %indvars.iv.next201, %for.inc81 ], [ 0, %for.body34 ] %arrayidx76 = getelementptr inbounds [666 x i32], ptr %in, i64 0, i64 %indvars.iv200 %18 = load i32, ptr %arrayidx76, align 4, !tbaa !5 %cmp77 = icmp eq i32 %18, %add71 br i1 %cmp77, label %land.lhs.true, label %for.inc81 land.lhs.true: ; preds = %for.body74 %arrayidx79 = getelementptr inbounds [666 x i32], ptr %used, i64 0, i64 %indvars.iv200 %19 = load i32, ptr %arrayidx79, align 4, !tbaa !5 %cmp80 = icmp eq i32 %19, 0 br i1 %cmp80, label %for.end83.loopexit, label %for.inc81 for.inc81: ; preds = %for.body74, %land.lhs.true %indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1 %exitcond.not = icmp eq i64 %indvars.iv.next201, %8 br i1 %exitcond.not, label %for.end94, label %for.body74, !llvm.loop !12 for.end83.loopexit: ; preds = %land.lhs.true %20 = trunc i64 %indvars.iv200 to i32 br label %for.end83 for.end83: ; preds = %for.end83.loopexit, %for.body34 %j.0.lcssa = phi i32 [ 0, %for.body34 ], [ %20, %for.end83.loopexit ] %cmp84 = icmp eq i32 %j.0.lcssa, %.lcssa170 br i1 %cmp84, label %for.end94, label %if.end86 if.end86: ; preds = %for.end83 %add87 = add nuw nsw i32 %j.0.lcssa, 1 %arrayidx89 = getelementptr inbounds [666 x i32], ptr %res, i64 0, i64 %indvars.iv205 store i32 %add87, ptr %arrayidx89, align 8, !tbaa !5 %idxprom90 = zext i32 %j.0.lcssa to i64 %arrayidx91 = getelementptr inbounds [666 x i32], ptr %used, i64 0, i64 %idxprom90 store i32 1, ptr %arrayidx91, align 4, !tbaa !5 %indvars.iv.next206 = add nuw i64 %indvars.iv205, 2 %21 = trunc i64 %indvars.iv.next206 to i32 %cmp33 = icmp sgt i32 %5, %21 br i1 %cmp33, label %for.body34, label %if.then96, !llvm.loop !13 for.end94: ; preds = %for.end83, %for.inc81 br i1 %cmp19175, label %for.body20.preheader.1, label %for.cond24.preheader.1 for.body20.preheader.1: ; preds = %for.end94 call void @llvm.memset.p0.i64(ptr nonnull align 16 %res, i8 -1, i64 %7, i1 false), !tbaa !5 br label %for.cond24.preheader.1 for.cond24.preheader.1: ; preds = %for.body20.preheader.1, %for.end94 br i1 %cmp25178, label %for.body26.preheader.1, label %for.cond32.preheader.1 for.body26.preheader.1: ; preds = %for.cond24.preheader.1 call void @llvm.memset.p0.i64(ptr nonnull align 16 %used, i8 0, i64 %9, i1 false), !tbaa !5 br label %for.cond32.preheader.1 for.cond32.preheader.1: ; preds = %for.body26.preheader.1, %for.cond24.preheader.1 %exitcond210.1.not = icmp eq i32 %5, 1 br i1 %exitcond210.1.not, label %if.then96, label %for.body34.1 for.body34.1: ; preds = %for.cond32.preheader.1, %if.end86.1 %indvars.iv205.1 = phi i64 [ %indvars.iv.next206.1, %if.end86.1 ], [ 1, %for.cond32.preheader.1 ] %indvars207.1 = trunc i64 %indvars.iv205.1 to i32 %arrayidx36.1 = getelementptr inbounds [666 x i32], ptr %x, i64 0, i64 %indvars.iv205.1 %22 = load i32, ptr %arrayidx36.1, align 4, !tbaa !5 %add.1 = add nsw i32 %5, %indvars207.1 %sub.1 = add nsw i32 %add.1, -1 %rem.1 = srem i32 %sub.1, %5 %idxprom37.1 = sext i32 %rem.1 to i64 %arrayidx38.1 = getelementptr inbounds [666 x i32], ptr %x, i64 0, i64 %idxprom37.1 %23 = load i32, ptr %arrayidx38.1, align 4, !tbaa !5 %sub39.1 = sub nsw i32 %22, %23 %retval.0.i.1 = call i32 @llvm.abs.i32(i32 %sub39.1, i1 true) %arrayidx42.1 = getelementptr inbounds [666 x i32], ptr %y, i64 0, i64 %indvars.iv205.1 %24 = load i32, ptr %arrayidx42.1, align 4, !tbaa !5 %arrayidx47.1 = getelementptr inbounds [666 x i32], ptr %y, i64 0, i64 %idxprom37.1 %25 = load i32, ptr %arrayidx47.1, align 4, !tbaa !5 %sub48.1 = sub nsw i32 %24, %25 %retval.0.i165.1 = call i32 @llvm.abs.i32(i32 %sub48.1, i1 true) %add55.1 = add nsw i32 %add.1, 1 %rem56.1 = srem i32 %add55.1, %5 %idxprom57.1 = sext i32 %rem56.1 to i64 %arrayidx58.1 = getelementptr inbounds [666 x i32], ptr %x, i64 0, i64 %idxprom57.1 %26 = load i32, ptr %arrayidx58.1, align 4, !tbaa !5 %sub59.1 = sub nsw i32 %22, %26 %retval.0.i166.1 = call i32 @llvm.abs.i32(i32 %sub59.1, i1 true) %arrayidx67.1 = getelementptr inbounds [666 x i32], ptr %y, i64 0, i64 %idxprom57.1 %27 = load i32, ptr %arrayidx67.1, align 4, !tbaa !5 %sub68.1 = sub nsw i32 %24, %27 %retval.0.i167.1 = call i32 @llvm.abs.i32(i32 %sub68.1, i1 true) %add70.1 = add nuw i32 %retval.0.i165.1, %retval.0.i.1 %add50.1 = add i32 %add70.1, %retval.0.i166.1 %add71.1 = add i32 %add50.1, %retval.0.i167.1 br i1 %cmp25178, label %for.body74.1, label %for.end83.1 for.body74.1: ; preds = %for.body34.1, %for.inc81.1 %indvars.iv200.1 = phi i64 [ %indvars.iv.next201.1, %for.inc81.1 ], [ 0, %for.body34.1 ] %arrayidx76.1 = getelementptr inbounds [666 x i32], ptr %in, i64 0, i64 %indvars.iv200.1 %28 = load i32, ptr %arrayidx76.1, align 4, !tbaa !5 %cmp77.1 = icmp eq i32 %28, %add71.1 br i1 %cmp77.1, label %land.lhs.true.1, label %for.inc81.1 land.lhs.true.1: ; preds = %for.body74.1 %arrayidx79.1 = getelementptr inbounds [666 x i32], ptr %used, i64 0, i64 %indvars.iv200.1 %29 = load i32, ptr %arrayidx79.1, align 4, !tbaa !5 %cmp80.1 = icmp eq i32 %29, 0 br i1 %cmp80.1, label %for.end83.1.loopexit, label %for.inc81.1 for.inc81.1: ; preds = %land.lhs.true.1, %for.body74.1 %indvars.iv.next201.1 = add nuw nsw i64 %indvars.iv200.1, 1 %exitcond.1.not = icmp eq i64 %indvars.iv.next201.1, %8 br i1 %exitcond.1.not, label %for.end94.1, label %for.body74.1, !llvm.loop !12 for.end83.1.loopexit: ; preds = %land.lhs.true.1 %30 = trunc i64 %indvars.iv200.1 to i32 br label %for.end83.1 for.end83.1: ; preds = %for.end83.1.loopexit, %for.body34.1 %j.0.lcssa.1 = phi i32 [ 0, %for.body34.1 ], [ %30, %for.end83.1.loopexit ] %cmp84.1 = icmp eq i32 %j.0.lcssa.1, %.lcssa170 br i1 %cmp84.1, label %for.end94.1, label %if.end86.1 if.end86.1: ; preds = %for.end83.1 %add87.1 = add nuw nsw i32 %j.0.lcssa.1, 1 %arrayidx89.1 = getelementptr inbounds [666 x i32], ptr %res, i64 0, i64 %indvars.iv205.1 store i32 %add87.1, ptr %arrayidx89.1, align 4, !tbaa !5 %idxprom90.1 = zext i32 %j.0.lcssa.1 to i64 %arrayidx91.1 = getelementptr inbounds [666 x i32], ptr %used, i64 0, i64 %idxprom90.1 store i32 1, ptr %arrayidx91.1, align 4, !tbaa !5 %indvars.iv.next206.1 = add nuw i64 %indvars.iv205.1, 2 %31 = trunc i64 %indvars.iv.next206.1 to i32 %cmp33.1 = icmp sgt i32 %5, %31 br i1 %cmp33.1, label %for.body34.1, label %if.then96, !llvm.loop !13 for.end94.1: ; preds = %for.end83.1, %for.inc81.1 %call115 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4) br label %cleanup if.then96: ; preds = %if.end86, %if.end86.1, %for.cond32.preheader, %for.cond32.preheader.1 %call97 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) %32 = load i32, ptr %n, align 4, !tbaa !5 %cmp99187 = icmp sgt i32 %32, 0 br i1 %cmp99187, label %if.end103.peel, label %for.end109 if.end103.peel: ; preds = %if.then96 %33 = load i32, ptr %res, align 16, !tbaa !5 %call106.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %33) %34 = load i32, ptr %n, align 4, !tbaa !5 %cmp99.peel = icmp sgt i32 %34, 1 br i1 %cmp99.peel, label %if.end103, label %for.end109 if.end103: ; preds = %if.end103.peel, %if.end103 %indvars.iv213 = phi i64 [ %indvars.iv.next214, %if.end103 ], [ 1, %if.end103.peel ] %35 = load ptr, ptr @stdout, align 8, !tbaa !14 %call.i = call noundef i32 @putc(i32 noundef 32, ptr noundef %35) %arrayidx105 = getelementptr inbounds [666 x i32], ptr %res, i64 0, i64 %indvars.iv213 %36 = load i32, ptr %arrayidx105, align 4, !tbaa !5 %call106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %36) %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1 %37 = load i32, ptr %n, align 4, !tbaa !5 %38 = sext i32 %37 to i64 %cmp99 = icmp slt i64 %indvars.iv.next214, %38 br i1 %cmp99, label %if.end103, label %for.end109, !llvm.loop !16 for.end109: ; preds = %if.end103, %if.end103.peel, %if.then96 %39 = load ptr, ptr @stdout, align 8, !tbaa !14 %call.i168 = call noundef i32 @putc(i32 noundef 10, ptr noundef %39) br label %cleanup cleanup: ; preds = %for.end94.1, %for.end109 call void @llvm.lifetime.end.p0(i64 2664, ptr nonnull %res) #6 call void @llvm.lifetime.end.p0(i64 2664, ptr nonnull %used) #6 call void @llvm.lifetime.end.p0(i64 2664, ptr nonnull %in) #6 call void @llvm.lifetime.end.p0(i64 2664, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 2664, ptr nonnull %x) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = !{!15, !15, i64 0} !15 = !{!"any pointer", !7, i64 0} !16 = distinct !{!16, !10, !17} !17 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> #include <stdlib.h> int main(void) { int n, t; int *a, *b; int flag = 0, flag2; int buf = 0; int j; scanf("%d", &t); int i = 0; for (; i < t; i++) { scanf("%d", &n); a = calloc(n, sizeof(*a)); b = calloc(n, sizeof(*b)); for (j = 0; j < n; j++) scanf("%d", a + j); for (j = 0; j < n; j++) { scanf("%d", b + j); b[j] -= a[j]; } flag = buf = flag2 = 0; for (j = 0; j < n; j++) { if (!buf) { buf = b[j]; } if (buf != b[j] && b[j]) { flag2++; } if (b[j] < 0) { flag2++; } if (buf > 0 && b[j] == 0) { flag++; } if (b[j] == buf && flag) { flag2++; } } if (flag2) printf("No\n"); else printf("Yes\n"); free(a); free(b); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16775/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16775/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: 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) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp121 = icmp sgt i32 %0, 0 br i1 %cmp121, label %for.body, label %for.end74 for.body: ; preds = %entry, %if.end71 %i.0122 = phi i32 [ %inc73, %if.end71 ], [ 0, %entry ] %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 %call2 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #7 %call4 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #7 %cmp6111 = icmp sgt i32 %1, 0 br i1 %cmp6111, label %for.body8, label %if.else for.cond10.preheader: ; preds = %for.body8 %cmp11113 = icmp sgt i32 %2, 0 br i1 %cmp11113, label %for.body13, label %if.else for.body8: ; preds = %for.body, %for.body8 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ 0, %for.body ] %add.ptr = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp6 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp6, label %for.body8, label %for.cond10.preheader, !llvm.loop !9 for.cond22.preheader: ; preds = %for.body13 %cmp23115 = icmp sgt i32 %6, 0 br i1 %cmp23115, label %for.body25.preheader, label %if.else for.body25.preheader: ; preds = %for.cond22.preheader %wide.trip.count = zext i32 %6 to i64 br label %for.body25 for.body13: ; preds = %for.cond10.preheader, %for.body13 %indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.body13 ], [ 0, %for.cond10.preheader ] %add.ptr15 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv125 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr15) %arrayidx = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv125 %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %5 = load i32, ptr %add.ptr15, align 4, !tbaa !5 %sub = sub nsw i32 %5, %4 store i32 %sub, ptr %add.ptr15, align 4, !tbaa !5 %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp11 = icmp slt i64 %indvars.iv.next126, %7 br i1 %cmp11, label %for.body13, label %for.cond22.preheader, !llvm.loop !11 for.body25: ; preds = %for.body25.preheader, %for.body25 %indvars.iv128 = phi i64 [ 0, %for.body25.preheader ], [ %indvars.iv.next129, %for.body25 ] %buf.0118 = phi i32 [ 0, %for.body25.preheader ], [ %.buf.0118, %for.body25 ] %flag2.0117 = phi i32 [ 0, %for.body25.preheader ], [ %spec.select110, %for.body25 ] %flag.0116 = phi i32 [ 0, %for.body25.preheader ], [ %flag.1, %for.body25 ] %tobool.not = icmp eq i32 %buf.0118, 0 %arrayidx27 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv128 %8 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %.buf.0118 = select i1 %tobool.not, i32 %8, i32 %buf.0118 %cmp30.not = icmp eq i32 %.buf.0118, %8 %tobool34.not = icmp eq i32 %8, 0 %or.cond109 = or i1 %cmp30.not, %tobool34.not %not.or.cond109 = xor i1 %or.cond109, true %inc36 = zext i1 %not.or.cond109 to i32 %9 = lshr i32 %8, 31 %cmp45 = icmp sgt i32 %.buf.0118, 0 %narrow = select i1 %cmp45, i1 %tobool34.not, i1 false %spec.select = zext i1 %narrow to i32 %flag.1 = add nuw nsw i32 %flag.0116, %spec.select %tobool60 = icmp ne i32 %flag.1, 0 %or.cond = select i1 %cmp30.not, i1 %tobool60, i1 false %inc62 = zext i1 %or.cond to i32 %flag2.1 = add i32 %9, %flag2.0117 %flag2.2 = add i32 %flag2.1, %inc36 %spec.select110 = add nsw i32 %flag2.2, %inc62 %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count br i1 %exitcond.not, label %for.end66, label %for.body25, !llvm.loop !12 for.end66: ; preds = %for.body25 %tobool67.not = icmp eq i32 %spec.select110, 0 br i1 %tobool67.not, label %if.else, label %if.end71 if.else: ; preds = %for.body, %for.cond10.preheader, %for.cond22.preheader, %for.end66 br label %if.end71 if.end71: ; preds = %for.end66, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end66 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @free(ptr noundef %call2) #6 call void @free(ptr noundef %call4) #6 %inc73 = add nuw nsw i32 %i.0122, 1 %10 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc73, %10 br i1 %cmp, label %for.body, label %for.end74, !llvm.loop !13 for.end74: ; preds = %if.end71, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0,1) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> void tmp(int *x, int *y){ int tmp; tmp = *x; *x = *y; *y = tmp; } int main(void){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if (b > c) tmp(&b, &c); if (a > b) tmp(&a, &b); if (b > c) tmp(&b, &c); printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167793/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167793/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @tmp(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 store i32 %1, ptr %x, align 4, !tbaa !5 store i32 %0, ptr %y, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca 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 %b, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %b, align 4, !tbaa !5 store i32 %0, ptr %c, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %a, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %4, %3 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %a, align 4, !tbaa !5 store i32 %4, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %6, %2 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %2, ptr %b, align 4, !tbaa !5 store i32 %6, ptr %c, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %8 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7) 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a[3],i,j,dum; scanf("%d %d %d",&a[0],&a[1],&a[2]); for(i=0;i<3;i++){ for(j=0;j<3;j++){ if(a[i] < a[j]){ dum = a[i]; a[i] = a[j]; a[j] = dum; } } } printf("%d %d %d\n",a[0],a[1],a[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167836/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167836/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.inc: %a = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3 %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 %cmp9.1 = icmp slt i32 %0, %1 br i1 %cmp9.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %2 = phi i32 [ %0, %if.then.1 ], [ %1, %for.inc ] %3 = phi i32 [ %1, %if.then.1 ], [ %0, %for.inc ] %4 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp9.2 = icmp slt i32 %3, %4 br i1 %cmp9.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %5 = phi i32 [ %3, %if.then.2 ], [ %4, %for.inc.1 ] %6 = phi i32 [ %4, %if.then.2 ], [ %3, %for.inc.1 ] %cmp9.138 = icmp slt i32 %2, %6 br i1 %cmp9.138, label %if.then.139, label %for.inc.1.1 if.then.139: ; preds = %for.inc.2 store i32 %6, ptr %arrayidx1, align 4, !tbaa !5 store i32 %2, ptr %a, align 4, !tbaa !5 br label %for.inc.1.1 for.inc.1.1: ; preds = %for.inc.2, %if.then.139 %7 = phi i32 [ %2, %if.then.139 ], [ %6, %for.inc.2 ] %8 = phi i32 [ %6, %if.then.139 ], [ %2, %for.inc.2 ] %cmp9.2.1 = icmp slt i32 %8, %5 br i1 %cmp9.2.1, label %if.then.2.1, label %for.inc.2.1 if.then.2.1: ; preds = %for.inc.1.1 store i32 %5, ptr %arrayidx1, align 4, !tbaa !5 store i32 %8, ptr %arrayidx2, align 4, !tbaa !5 br label %for.inc.2.1 for.inc.2.1: ; preds = %if.then.2.1, %for.inc.1.1 %9 = phi i32 [ %5, %if.then.2.1 ], [ %8, %for.inc.1.1 ] %10 = phi i32 [ %8, %if.then.2.1 ], [ %5, %for.inc.1.1 ] %cmp9.241 = icmp slt i32 %10, %7 br i1 %cmp9.241, label %if.then.242, label %for.inc.243 if.then.242: ; preds = %for.inc.2.1 store i32 %7, ptr %arrayidx2, align 4, !tbaa !5 store i32 %10, ptr %a, align 4, !tbaa !5 br label %for.inc.243 for.inc.243: ; preds = %if.then.242, %for.inc.2.1 %11 = phi i32 [ %10, %if.then.242 ], [ %7, %for.inc.2.1 ] %12 = phi i32 [ %7, %if.then.242 ], [ %10, %for.inc.2.1 ] %cmp9.1.2 = icmp slt i32 %12, %9 br i1 %cmp9.1.2, label %if.then.1.2, label %for.inc.2.2 if.then.1.2: ; preds = %for.inc.243 store i32 %9, ptr %arrayidx2, align 4, !tbaa !5 store i32 %12, ptr %arrayidx1, align 4, !tbaa !5 br label %for.inc.2.2 for.inc.2.2: ; preds = %for.inc.243, %if.then.1.2 %13 = phi i32 [ %12, %if.then.1.2 ], [ %9, %for.inc.243 ] %14 = phi i32 [ %9, %if.then.1.2 ], [ %12, %for.inc.243 ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11, i32 noundef %13, i32 noundef %14) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define N 1000 int main() { int t; scanf("%d", &t); while (t--) { static int ii0[N * 2], ii1[N * 2]; int n, h, i, cnt0, cnt1; scanf("%d", &n); cnt0 = cnt1 = 0; for (i = 0; i < n * 2; i++) { int a; scanf("%d", &a); if (a % 2 == 0) ii0[cnt0++] = i; else ii1[cnt1++] = i; } if (cnt0 % 2 == 1) cnt0--, cnt1--; else if (cnt0 > 0) cnt0 -= 2; else cnt1 -= 2; for (h = 0; h < cnt0; h += 2) printf("%d %d\n", ii0[h] + 1, ii0[h + 1] + 1); for (h = 0; h < cnt1; h += 2) printf("%d %d\n", ii1[h] + 1, ii1[h + 1] + 1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16788/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16788/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @main.ii0 = internal unnamed_addr global [2000 x i32] zeroinitializer, align 16 @main.ii1 = internal unnamed_addr global [2000 x i32] zeroinitializer, align 16 @.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: %t = alloca i32, align 4 %n = alloca i32, align 4 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec75 = add nsw i32 %0, -1 store i32 %dec75, ptr %t, align 4, !tbaa !5 %tobool.not76 = icmp eq i32 %0, 0 br i1 %tobool.not76, label %while.end, label %while.body while.body: ; preds = %entry, %for.end46 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp66 = icmp sgt i32 %1, 0 br i1 %cmp66, label %for.body, label %if.end19.thread for.body: ; preds = %while.body, %if.end %cnt1.069 = phi i32 [ %cnt1.1, %if.end ], [ 0, %while.body ] %cnt0.068 = phi i32 [ %cnt0.1, %if.end ], [ 0, %while.body ] %i.067 = phi i32 [ %inc7, %if.end ], [ 0, %while.body ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = and i32 %2, 1 %cmp3 = icmp eq i32 %3, 0 br i1 %cmp3, label %if.then, label %if.else if.then: ; preds = %for.body %inc = add nsw i32 %cnt0.068, 1 br label %if.end if.else: ; preds = %for.body %inc4 = add nsw i32 %cnt1.069, 1 br label %if.end if.end: ; preds = %if.else, %if.then %cnt1.069.sink = phi i32 [ %cnt1.069, %if.else ], [ %cnt0.068, %if.then ] %main.ii1.sink = phi ptr [ @main.ii1, %if.else ], [ @main.ii0, %if.then ] %cnt0.1 = phi i32 [ %cnt0.068, %if.else ], [ %inc, %if.then ] %cnt1.1 = phi i32 [ %inc4, %if.else ], [ %cnt1.069, %if.then ] %idxprom5 = sext i32 %cnt1.069.sink to i64 %arrayidx6 = getelementptr inbounds [2000 x i32], ptr %main.ii1.sink, i64 0, i64 %idxprom5 store i32 %i.067, ptr %arrayidx6, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 %inc7 = add nuw nsw i32 %i.067, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %mul = shl nsw i32 %4, 1 %cmp = icmp slt i32 %inc7, %mul br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %if.end %5 = and i32 %cnt0.1, -2147483647 %cmp9 = icmp eq i32 %5, 1 br i1 %cmp9, label %if.then10, label %if.else13 if.then10: ; preds = %for.end %dec11 = add nsw i32 %cnt0.1, -1 %dec12 = add nsw i32 %cnt1.1, -1 br label %if.end19 if.else13: ; preds = %for.end %cmp14 = icmp sgt i32 %cnt0.1, 0 br i1 %cmp14, label %if.then15, label %if.end19.thread if.then15: ; preds = %if.else13 %sub = add nsw i32 %cnt0.1, -2 br label %if.end19 if.end19.thread: ; preds = %if.else13, %while.body %cnt1.0.lcssa8791 = phi i32 [ %cnt1.1, %if.else13 ], [ 0, %while.body ] %sub17 = add nsw i32 %cnt1.0.lcssa8791, -2 br label %for.cond33.preheader if.end19: ; preds = %if.then15, %if.then10 %cnt0.2 = phi i32 [ %dec11, %if.then10 ], [ %sub, %if.then15 ] %cnt1.2 = phi i32 [ %dec12, %if.then10 ], [ %cnt1.1, %if.then15 ] %cmp2171 = icmp sgt i32 %cnt0.2, 0 br i1 %cmp2171, label %for.body22, label %for.cond33.preheader for.cond33.preheader: ; preds = %for.body22, %if.end19.thread, %if.end19 %cnt1.296 = phi i32 [ %sub17, %if.end19.thread ], [ %cnt1.2, %if.end19 ], [ %cnt1.2, %for.body22 ] %cmp3473 = icmp sgt i32 %cnt1.296, 0 br i1 %cmp3473, label %for.body35, label %for.end46 for.body22: ; preds = %if.end19, %for.body22 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body22 ], [ 0, %if.end19 ] %arrayidx24 = getelementptr inbounds [2000 x i32], ptr @main.ii0, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx24, align 8, !tbaa !5 %add = add nsw i32 %6, 1 %7 = or i64 %indvars.iv, 1 %arrayidx27 = getelementptr inbounds [2000 x i32], ptr @main.ii0, i64 0, i64 %7 %8 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %add28 = add nsw i32 %8, 1 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add, i32 noundef %add28) %indvars.iv.next = add nuw i64 %indvars.iv, 2 %9 = trunc i64 %indvars.iv.next to i32 %cmp21 = icmp sgt i32 %cnt0.2, %9 br i1 %cmp21, label %for.body22, label %for.cond33.preheader, !llvm.loop !11 for.body35: ; preds = %for.cond33.preheader, %for.body35 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body35 ], [ 0, %for.cond33.preheader ] %arrayidx37 = getelementptr inbounds [2000 x i32], ptr @main.ii1, i64 0, i64 %indvars.iv79 %10 = load i32, ptr %arrayidx37, align 8, !tbaa !5 %add38 = add nsw i32 %10, 1 %11 = or i64 %indvars.iv79, 1 %arrayidx41 = getelementptr inbounds [2000 x i32], ptr @main.ii1, i64 0, i64 %11 %12 = load i32, ptr %arrayidx41, align 4, !tbaa !5 %add42 = add nsw i32 %12, 1 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add38, i32 noundef %add42) %indvars.iv.next80 = add nuw i64 %indvars.iv79, 2 %13 = trunc i64 %indvars.iv.next80 to i32 %cmp34 = icmp sgt i32 %cnt1.296, %13 br i1 %cmp34, label %for.body35, label %for.end46, !llvm.loop !12 for.end46: ; preds = %for.body35, %for.cond33.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 %14 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %14, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %14, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %for.end46, %entry 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void){ int a,b,c,d; scanf("%d %d %d",&a,&b,&c); if(a>b){ d=b; b=a; a=d; } if(a>c){ d=c; c=a; a=d; } if(b>c){ d=c; c=b; b=d; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167937/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167937/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %c, align 4, !tbaa !5 store i32 %4, ptr %a, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %2, ptr %c, align 4, !tbaa !5 store i32 %6, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b,c,d; scanf("%d %d %d",&a,&b,&c); if(a>c){ d=c; c=a; a=d; } if(b>c){ d=b; b=c; c=d; } if(a>b){ d=a; a=b; b=d; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167980/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167980/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %c, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %b, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %4, %3 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %b, align 4, !tbaa !5 store i32 %4, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(c>b&&b>a){ printf("%d %d %d\n",a,b,c); } if(b>c&&c>a){ printf("%d %d %d\n",a,c,b); } if(a>c&&c>b){ printf("%d %d %d\n",b,c,a); } if(c>a&&a>b){ printf("%d %d %d\n",b,a,c); } if(b>a&&a>c){ printf("%d %d %d\n",c,a,b); } if(a>b&&b>c){ printf("%d %d %d\n",c,b,a); } if(a==b&&b==c){ printf("%d %d %d\n",a,a,a); } if(a==b&&b>c){ printf("%d %d %d\n",c,a,a); } if(a==b&&c>b){ printf("%d %d %d\n",a,a,c); } if(a>c&&b==c){ printf("%d %d %d\n",b,b,a); } if(c>a&&b==c){ printf("%d %d %d\n",a,b,b); } if(a<b&&a==c) { printf ("%d %d %d\n",a,a,b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168022/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168022/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %.pre105.pre131 = load i32, ptr %a, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %1, %.pre105.pre131 %or.cond148 = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond148, label %if.then, label %if.end if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre105.pre131, i32 noundef %1, i32 noundef %0) %.pre = load i32, ptr %b, align 4, !tbaa !5 %.pre103 = load i32, ptr %c, align 4 %.pre105.pre = load i32, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %.pre105 = phi i32 [ %.pre105.pre, %if.then ], [ %.pre105.pre131, %entry ] %2 = phi i32 [ %.pre103, %if.then ], [ %0, %entry ] %3 = phi i32 [ %.pre, %if.then ], [ %1, %entry ] %cmp3 = icmp sgt i32 %3, %2 %cmp5 = icmp sgt i32 %2, %.pre105 %or.cond149 = select i1 %cmp3, i1 %cmp5, i1 false br i1 %or.cond149, label %if.then6, label %if.end8 if.then6: ; preds = %if.end %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre105, i32 noundef %2, i32 noundef %3) %.pre104 = load i32, ptr %a, align 4, !tbaa !5 %.pre106 = load i32, ptr %c, align 4 %.pre110.pre133.pre = load i32, ptr %b, align 4, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.then6, %if.end %.pre110.pre133 = phi i32 [ %.pre110.pre133.pre, %if.then6 ], [ %3, %if.end ] %4 = phi i32 [ %.pre106, %if.then6 ], [ %2, %if.end ] %5 = phi i32 [ %.pre104, %if.then6 ], [ %.pre105, %if.end ] %cmp9 = icmp sgt i32 %5, %4 %cmp11 = icmp sgt i32 %4, %.pre110.pre133 %or.cond150 = select i1 %cmp9, i1 %cmp11, i1 false br i1 %or.cond150, label %if.then12, label %if.end14 if.then12: ; preds = %if.end8 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre110.pre133, i32 noundef %4, i32 noundef %5) %.pre107 = load i32, ptr %c, align 4 %.pre108 = load i32, ptr %a, align 4, !tbaa !5 %.pre110.pre = load i32, ptr %b, align 4, !tbaa !5 br label %if.end14 if.end14: ; preds = %if.then12, %if.end8 %.pre110 = phi i32 [ %.pre110.pre, %if.then12 ], [ %.pre110.pre133, %if.end8 ] %6 = phi i32 [ %.pre108, %if.then12 ], [ %5, %if.end8 ] %7 = phi i32 [ %.pre107, %if.then12 ], [ %4, %if.end8 ] %cmp15 = icmp sgt i32 %7, %6 %cmp17 = icmp sgt i32 %6, %.pre110 %or.cond151 = select i1 %cmp15, i1 %cmp17, i1 false br i1 %or.cond151, label %if.then18, label %if.end20 if.then18: ; preds = %if.end14 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre110, i32 noundef %6, i32 noundef %7) %.pre109 = load i32, ptr %b, align 4, !tbaa !5 %.pre111 = load i32, ptr %a, align 4, !tbaa !5 %.pre117.pre135.pre = load i32, ptr %c, align 4 br label %if.end20 if.end20: ; preds = %if.then18, %if.end14 %.pre117.pre135 = phi i32 [ %.pre117.pre135.pre, %if.then18 ], [ %7, %if.end14 ] %8 = phi i32 [ %.pre111, %if.then18 ], [ %6, %if.end14 ] %9 = phi i32 [ %.pre109, %if.then18 ], [ %.pre110, %if.end14 ] %cmp21 = icmp sgt i32 %9, %8 %cmp23 = icmp sgt i32 %8, %.pre117.pre135 %or.cond152 = select i1 %cmp21, i1 %cmp23, i1 false br i1 %or.cond152, label %if.then24, label %if.end26 if.then24: ; preds = %if.end20 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre117.pre135, i32 noundef %8, i32 noundef %9) %.pre112 = load i32, ptr %a, align 4, !tbaa !5 %.pre113 = load i32, ptr %b, align 4, !tbaa !5 %.pre117.pre = load i32, ptr %c, align 4 br label %if.end26 if.end26: ; preds = %if.then24, %if.end20 %.pre117 = phi i32 [ %.pre117.pre, %if.then24 ], [ %.pre117.pre135, %if.end20 ] %10 = phi i32 [ %.pre113, %if.then24 ], [ %9, %if.end20 ] %11 = phi i32 [ %.pre112, %if.then24 ], [ %8, %if.end20 ] %cmp27 = icmp sgt i32 %11, %10 %cmp29 = icmp sgt i32 %10, %.pre117 %or.cond153 = select i1 %cmp27, i1 %cmp29, i1 false br i1 %or.cond153, label %if.then30, label %if.end32 if.then30: ; preds = %if.end26 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre117, i32 noundef %10, i32 noundef %11) %.pre114 = load i32, ptr %a, align 4, !tbaa !5 %.pre115 = load i32, ptr %b, align 4, !tbaa !5 %.pre116 = load i32, ptr %c, align 4 br label %if.end32 if.end32: ; preds = %if.then30, %if.end26 %12 = phi i32 [ %.pre116, %if.then30 ], [ %.pre117, %if.end26 ] %13 = phi i32 [ %.pre115, %if.then30 ], [ %10, %if.end26 ] %14 = phi i32 [ %.pre114, %if.then30 ], [ %11, %if.end26 ] %cmp33 = icmp eq i32 %14, %13 %cmp35 = icmp eq i32 %13, %12 %or.cond = select i1 %cmp33, i1 %cmp35, i1 false br i1 %or.cond, label %if.then36, label %if.end38 if.then36: ; preds = %if.end32 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12, i32 noundef %12, i32 noundef %12) %.pre118 = load i32, ptr %a, align 4, !tbaa !5 %.pre119 = load i32, ptr %b, align 4, !tbaa !5 %.pre124.pre137.pre = load i32, ptr %c, align 4 br label %if.end38 if.end38: ; preds = %if.then36, %if.end32 %.pre124.pre137 = phi i32 [ %.pre124.pre137.pre, %if.then36 ], [ %12, %if.end32 ] %15 = phi i32 [ %.pre119, %if.then36 ], [ %13, %if.end32 ] %16 = phi i32 [ %.pre118, %if.then36 ], [ %14, %if.end32 ] %cmp39 = icmp eq i32 %16, %15 br i1 %cmp39, label %land.lhs.true40, label %if.end44 land.lhs.true40: ; preds = %if.end38 %cmp41 = icmp sgt i32 %15, %.pre124.pre137 br i1 %cmp41, label %if.then42, label %land.lhs.true46 if.then42: ; preds = %land.lhs.true40 %call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre124.pre137, i32 noundef %15, i32 noundef %15) %.pre120 = load i32, ptr %a, align 4, !tbaa !5 %.pre121 = load i32, ptr %b, align 4, !tbaa !5 %.pre124.pre = load i32, ptr %c, align 4 br label %if.end44 if.end44: ; preds = %if.then42, %if.end38 %.pre124 = phi i32 [ %.pre124.pre, %if.then42 ], [ %.pre124.pre137, %if.end38 ] %17 = phi i32 [ %.pre121, %if.then42 ], [ %15, %if.end38 ] %18 = phi i32 [ %.pre120, %if.then42 ], [ %16, %if.end38 ] %cmp45 = icmp eq i32 %18, %17 br i1 %cmp45, label %land.lhs.true46, label %if.end50 land.lhs.true46: ; preds = %land.lhs.true40, %if.end44 %19 = phi i32 [ %17, %if.end44 ], [ %15, %land.lhs.true40 ] %.pre124147 = phi i32 [ %.pre124, %if.end44 ], [ %.pre124.pre137, %land.lhs.true40 ] %cmp47 = icmp sgt i32 %.pre124147, %19 br i1 %cmp47, label %if.then48, label %if.end50 if.then48: ; preds = %land.lhs.true46 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19, i32 noundef %19, i32 noundef %.pre124147) %.pre122 = load i32, ptr %a, align 4, !tbaa !5 %.pre123 = load i32, ptr %c, align 4 %.pre129.pre139.pre = load i32, ptr %b, align 4, !tbaa !5 br label %if.end50 if.end50: ; preds = %if.then48, %land.lhs.true46, %if.end44 %.pre129.pre139 = phi i32 [ %.pre129.pre139.pre, %if.then48 ], [ %19, %land.lhs.true46 ], [ %17, %if.end44 ] %20 = phi i32 [ %.pre123, %if.then48 ], [ %.pre124147, %land.lhs.true46 ], [ %.pre124, %if.end44 ] %21 = phi i32 [ %.pre122, %if.then48 ], [ %19, %land.lhs.true46 ], [ %18, %if.end44 ] %cmp51 = icmp sgt i32 %21, %20 %cmp53 = icmp eq i32 %.pre129.pre139, %20 %or.cond154 = select i1 %cmp51, i1 %cmp53, i1 false br i1 %or.cond154, label %if.then54, label %if.end56 if.then54: ; preds = %if.end50 %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre129.pre139, i32 noundef %.pre129.pre139, i32 noundef %21) %.pre125 = load i32, ptr %c, align 4 %.pre126 = load i32, ptr %a, align 4, !tbaa !5 %.pre129.pre = load i32, ptr %b, align 4, !tbaa !5 br label %if.end56 if.end56: ; preds = %if.then54, %if.end50 %.pre129 = phi i32 [ %.pre129.pre, %if.then54 ], [ %.pre129.pre139, %if.end50 ] %22 = phi i32 [ %.pre126, %if.then54 ], [ %21, %if.end50 ] %23 = phi i32 [ %.pre125, %if.then54 ], [ %20, %if.end50 ] %cmp57 = icmp sgt i32 %23, %22 %cmp59 = icmp eq i32 %.pre129, %23 %or.cond155 = select i1 %cmp57, i1 %cmp59, i1 false br i1 %or.cond155, label %if.then60, label %if.end62 if.then60: ; preds = %if.end56 %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %22, i32 noundef %.pre129, i32 noundef %.pre129) %.pre127 = load i32, ptr %a, align 4, !tbaa !5 %.pre128 = load i32, ptr %b, align 4, !tbaa !5 %.pre130 = load i32, ptr %c, align 4 br label %if.end62 if.end62: ; preds = %if.then60, %if.end56 %24 = phi i32 [ %.pre130, %if.then60 ], [ %23, %if.end56 ] %25 = phi i32 [ %.pre128, %if.then60 ], [ %.pre129, %if.end56 ] %26 = phi i32 [ %.pre127, %if.then60 ], [ %22, %if.end56 ] %cmp63 = icmp slt i32 %26, %25 %cmp65 = icmp eq i32 %26, %24 %or.cond102 = select i1 %cmp63, i1 %cmp65, i1 false br i1 %or.cond102, label %if.then66, label %if.end68 if.then66: ; preds = %if.end62 %call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %24, i32 noundef %24, i32 noundef %25) br label %if.end68 if.end68: ; preds = %if.then66, %if.end62 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,c,x; scanf("%d %d %d",&a,&b,&c); if(a>b){ x=b; b=a; a=x; } if(b>c){ x=c; c=b; b=x; } if(a>b){ x=a; a=b; b=x; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168073/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168073/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %c, align 4, !tbaa !5 store i32 %4, ptr %b, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d %d %d",&a,&b,&c); if (a>b && a>c) { if(b<c) { printf("%d %d %d\n",b,c,a); } else { printf("%d %d %d\n",c,b,a); } } else if(b>a&&b>c) { if(a>c) { printf("%d %d %d\n",c,a,b); } else { printf("%d %d %d\n",a,c,b); } } else { if(a>b) { printf("%d %d %d\n",b,a,c); } else { printf("%d %d %d\n",a,b,c); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168116/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168116/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %land.lhs.true, label %if.else6 land.lhs.true: ; preds = %entry %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %0, %2 br i1 %cmp1, label %if.then, label %if.else6 if.then: ; preds = %land.lhs.true %cmp2 = icmp slt i32 %1, %2 br i1 %cmp2, label %if.then3, label %if.else if.then3: ; preds = %if.then %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %2, i32 noundef %0) br label %if.end25 if.else: ; preds = %if.then %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %1, i32 noundef %0) br label %if.end25 if.else6: ; preds = %land.lhs.true, %entry %cmp7 = icmp sgt i32 %1, %0 br i1 %cmp7, label %land.lhs.true8, label %if.else17 land.lhs.true8: ; preds = %if.else6 %3 = load i32, ptr %c, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %1, %3 br i1 %cmp9, label %if.then10, label %if.else17 if.then10: ; preds = %land.lhs.true8 %cmp11 = icmp sgt i32 %0, %3 br i1 %cmp11, label %if.then12, label %if.else14 if.then12: ; preds = %if.then10 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %0, i32 noundef %1) br label %if.end25 if.else14: ; preds = %if.then10 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %3, i32 noundef %1) br label %if.end25 if.else17: ; preds = %land.lhs.true8, %if.else6 %4 = load i32, ptr %c, align 4, !tbaa !5 br i1 %cmp, label %if.then19, label %if.else21 if.then19: ; preds = %if.else17 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %4) br label %if.end25 if.else21: ; preds = %if.else17 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %4) br label %if.end25 if.end25: ; preds = %if.else14, %if.then12, %if.else21, %if.then19, %if.then3, %if.else 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> #include<stdlib.h> #include<string.h> #include<math.h> int main() { // variable in description int T; int N; //int A[2001]; // variable to support int odd[2001]; int even[2001]; int dummy; int ans_1; int ans_2; // variable to judge int i; int j; int k; int L_o; int L_e; int times; scanf("%d",&T); for(i=0;i<T;i++) { scanf("%d",&N); L_o = 0; L_e = 0; for(j=0;j<2*N;j++) { scanf("%d",&dummy); if(dummy%2) { odd[L_o] = j+1; L_o++; } else { even[L_e] = j+1; L_e++; } } times = 0; for(j=0;j+1<L_o;j+=2) { printf("%d %d\n",odd[j],odd[j+1]); times++; if(times == N-1) { break; } } for(j=0;j+1<L_e;j+=2) { if(times == N-1) { break; } printf("%d %d\n",even[j],even[j+1]); times++; if(times == N-1) { break; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16816/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16816/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca i32, align 4 %N = alloca i32, align 4 %odd = alloca [2001 x i32], align 16 %even = alloca [2001 x i32], align 16 %dummy = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %odd) #3 call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %even) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %dummy) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %cmp89 = icmp sgt i32 %0, 0 br i1 %cmp89, label %for.body, label %for.end52 for.body: ; preds = %entry, %for.inc50 %i.090 = phi i32 [ %inc51, %for.inc50 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %1 = load i32, ptr %N, align 4, !tbaa !5 %cmp374 = icmp sgt i32 %1, 0 br i1 %cmp374, label %for.body4, label %for.inc50 for.cond11.preheader: ; preds = %for.inc %cmp1379 = icmp sgt i32 %L_o.1, 1 br i1 %cmp1379, label %for.body14, label %for.end27 for.body4: ; preds = %for.body, %for.inc %L_e.077 = phi i32 [ %L_e.1, %for.inc ], [ 0, %for.body ] %L_o.076 = phi i32 [ %L_o.1, %for.inc ], [ 0, %for.body ] %j.075 = phi i32 [ %add6, %for.inc ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dummy) %2 = load i32, ptr %dummy, align 4, !tbaa !5 %3 = and i32 %2, 1 %tobool.not = icmp eq i32 %3, 0 %add6 = add nuw nsw i32 %j.075, 1 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %for.body4 %idxprom = sext i32 %L_o.076 to i64 %arrayidx = getelementptr inbounds [2001 x i32], ptr %odd, i64 0, i64 %idxprom store i32 %add6, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %L_o.076, 1 br label %for.inc if.else: ; preds = %for.body4 %idxprom7 = sext i32 %L_e.077 to i64 %arrayidx8 = getelementptr inbounds [2001 x i32], ptr %even, i64 0, i64 %idxprom7 store i32 %add6, ptr %arrayidx8, align 4, !tbaa !5 %inc9 = add nsw i32 %L_e.077, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else %L_o.1 = phi i32 [ %inc, %if.then ], [ %L_o.076, %if.else ] %L_e.1 = phi i32 [ %L_e.077, %if.then ], [ %inc9, %if.else ] %4 = load i32, ptr %N, align 4, !tbaa !5 %mul = shl nsw i32 %4, 1 %cmp3 = icmp slt i32 %add6, %mul br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !9 for.body14: ; preds = %for.cond11.preheader, %for.body14 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body14 ], [ 0, %for.cond11.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14 ], [ 1, %for.cond11.preheader ] %times.081 = phi i32 [ %inc21, %for.body14 ], [ 0, %for.cond11.preheader ] %arrayidx16 = getelementptr inbounds [2001 x i32], ptr %odd, i64 0, i64 %indvars.iv91 %5 = load i32, ptr %arrayidx16, align 8, !tbaa !5 %arrayidx19 = getelementptr inbounds [2001 x i32], ptr %odd, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %6) %inc21 = add nuw nsw i32 %times.081, 1 %7 = load i32, ptr %N, align 4, !tbaa !5 %8 = add i32 %7, -2 %cmp22 = icmp ne i32 %times.081, %8 %indvars.iv.next92 = add nuw i64 %indvars.iv91, 2 %indvars.iv.next = add nuw i64 %indvars.iv, 2 %9 = trunc i64 %indvars.iv.next92 to i32 %10 = or i32 %9, 1 %cmp13 = icmp slt i32 %10, %L_o.1 %or.cond = select i1 %cmp22, i1 %cmp13, i1 false br i1 %or.cond, label %for.body14, label %for.end27, !llvm.loop !11 for.end27: ; preds = %for.body14, %for.cond11.preheader %11 = phi i32 [ %4, %for.cond11.preheader ], [ %7, %for.body14 ] %times.1 = phi i32 [ 0, %for.cond11.preheader ], [ %inc21, %for.body14 ] %cmp3085 = icmp sgt i32 %L_e.1, 1 br i1 %cmp3085, label %for.body31, label %for.inc50 for.body31: ; preds = %for.end27, %for.inc47 %12 = phi i32 [ %15, %for.inc47 ], [ %11, %for.end27 ] %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.inc47 ], [ 0, %for.end27 ] %indvars.iv97 = phi i64 [ %indvars.iv.next98, %for.inc47 ], [ 1, %for.end27 ] %times.287 = phi i32 [ %inc42, %for.inc47 ], [ %times.1, %for.end27 ] %sub32 = add nsw i32 %12, -1 %cmp33 = icmp eq i32 %times.287, %sub32 br i1 %cmp33, label %for.inc50, label %if.end35 if.end35: ; preds = %for.body31 %arrayidx37 = getelementptr inbounds [2001 x i32], ptr %even, i64 0, i64 %indvars.iv99 %13 = load i32, ptr %arrayidx37, align 8, !tbaa !5 %arrayidx40 = getelementptr inbounds [2001 x i32], ptr %even, i64 0, i64 %indvars.iv97 %14 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13, i32 noundef %14) %15 = load i32, ptr %N, align 4, !tbaa !5 %16 = add i32 %15, -2 %cmp44 = icmp eq i32 %times.287, %16 br i1 %cmp44, label %for.inc50, label %for.inc47 for.inc47: ; preds = %if.end35 %inc42 = add nsw i32 %times.287, 1 %indvars.iv.next100 = add nuw i64 %indvars.iv99, 2 %indvars.iv.next98 = add nuw i64 %indvars.iv97, 2 %17 = trunc i64 %indvars.iv.next100 to i32 %18 = or i32 %17, 1 %cmp30 = icmp slt i32 %18, %L_e.1 br i1 %cmp30, label %for.body31, label %for.inc50, !llvm.loop !12 for.inc50: ; preds = %if.end35, %for.body31, %for.inc47, %for.body, %for.end27 %inc51 = add nuw nsw i32 %i.090, 1 %19 = load i32, ptr %T, align 4, !tbaa !5 %cmp = icmp slt i32 %inc51, %19 br i1 %cmp, label %for.body, label %for.end52, !llvm.loop !13 for.end52: ; preds = %for.inc50, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %dummy) #3 call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %even) #3 call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %odd) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b){ if(b>c){ if(a<c){ printf("%d %d %d\n",a,c,b); }else{ printf("%d %d %d\n",c,a,b); } }else{ printf("%d %d %d\n",a,b,c); } }else{ if(a>c){ if(b<c){ printf("%d %d %d\n",b,c,a); }else{ printf("%d %d %d\n",c,b,a); } }else{ printf("%d %d %d\n",b,a,c); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168202/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168202/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4, !tbaa !5 br i1 %cmp, label %if.then, label %if.else10 if.then: ; preds = %entry %cmp1 = icmp sgt i32 %1, %2 br i1 %cmp1, label %if.then2, label %if.else7 if.then2: ; preds = %if.then %cmp3 = icmp slt i32 %0, %2 br i1 %cmp3, label %if.then4, label %if.else if.then4: ; preds = %if.then2 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %2, i32 noundef %1) br label %if.end22 if.else: ; preds = %if.then2 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %0, i32 noundef %1) br label %if.end22 if.else7: ; preds = %if.then %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %2) br label %if.end22 if.else10: ; preds = %entry %cmp11 = icmp sgt i32 %0, %2 br i1 %cmp11, label %if.then12, label %if.else19 if.then12: ; preds = %if.else10 %cmp13 = icmp slt i32 %1, %2 br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.then12 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %2, i32 noundef %0) br label %if.end22 if.else16: ; preds = %if.then12 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %1, i32 noundef %0) br label %if.end22 if.else19: ; preds = %if.else10 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %2) br label %if.end22 if.end22: ; preds = %if.else19, %if.else16, %if.then14, %if.else7, %if.else, %if.then4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b, c, d; scanf("%d %d %d", &a, &b, &c); if(b < a) { d = a; a = b; b = d; } if(c < b) { d = b; b = c; c = d; if(b < a) { d = a; a = b; b = d; } } printf("%d %d %d\n", a, b, c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168246/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168246/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp slt i32 %4, %3 br i1 %cmp1, label %if.then2, label %if.end6 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 %cmp3 = icmp slt i32 %4, %2 br i1 %cmp3, label %if.then4, label %if.end6 if.then4: ; preds = %if.then2 store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then2, %if.then4, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %3, %if.then4 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %2, %if.then4 ], [ %3, %if.end ] %7 = phi i32 [ %2, %if.then2 ], [ %4, %if.then4 ], [ %2, %if.end ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %6, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b, c, x, y, z; scanf("%d %d %d", &a, &b, &c); x=a; y=b; z=c; if(x>y){ x=b; y=a; if(y>z){ y=c; z=a; if(x>y){ x=c; y=b; } } }else if(y>z){ y=c; z=b; if(x>y){ x=c; y=a; } } printf("%d %d %d\n", x, y, z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168303/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168303/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %cmp1 = icmp sgt i32 %0, %2 br i1 %cmp1, label %if.then2, label %if.end12 if.then2: ; preds = %if.then %spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %2) %spec.select27 = call i32 @llvm.smax.i32(i32 %1, i32 %2) br label %if.end12 if.else: ; preds = %entry %cmp6 = icmp sgt i32 %1, %2 br i1 %cmp6, label %if.then7, label %if.end12 if.then7: ; preds = %if.else %spec.select28 = call i32 @llvm.smin.i32(i32 %0, i32 %2) %spec.select29 = call i32 @llvm.smax.i32(i32 %0, i32 %2) br label %if.end12 if.end12: ; preds = %if.then7, %if.then2, %if.else, %if.then %x.0 = phi i32 [ %1, %if.then ], [ %0, %if.else ], [ %spec.select, %if.then2 ], [ %spec.select28, %if.then7 ] %y.0 = phi i32 [ %0, %if.then ], [ %1, %if.else ], [ %spec.select27, %if.then2 ], [ %spec.select29, %if.then7 ] %z.0 = phi i32 [ %2, %if.then ], [ %2, %if.else ], [ %0, %if.then2 ], [ %1, %if.then7 ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0, i32 noundef %y.0, i32 noundef %z.0) 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.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> void swap(int* a, int* b) { int c; c = *a; *a = *b; *b = c; } int main() { int nums[3]; scanf("%d %d %d", nums, nums + 1, nums + 2); if(nums[0] > nums[2]) { swap(nums, nums + 2); } if(nums[1] > nums[2]) { swap(nums + 1, nums+ 2); } if(nums[0] > nums[1]) { swap(nums, nums + 1); } printf("%d %d %d\n",nums[0],nums[1],nums[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168347/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168347/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %nums = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %nums) #4 %add.ptr = getelementptr inbounds i32, ptr %nums, i64 1 %add.ptr3 = getelementptr inbounds i32, ptr %nums, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %nums, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr3) %0 = load i32, ptr %nums, align 4, !tbaa !5 %1 = load i32, ptr %add.ptr3, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %nums, align 4, !tbaa !5 store i32 %0, ptr %add.ptr3, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %add.ptr, align 4, !tbaa !5 %cmp10 = icmp sgt i32 %4, %3 br i1 %cmp10, label %if.then11, label %if.end16 if.then11: ; preds = %if.end store i32 %3, ptr %add.ptr, align 4, !tbaa !5 store i32 %4, ptr %add.ptr3, align 4, !tbaa !5 br label %if.end16 if.end16: ; preds = %if.then11, %if.end %5 = phi i32 [ %4, %if.then11 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then11 ], [ %4, %if.end ] %cmp19 = icmp sgt i32 %2, %6 br i1 %cmp19, label %if.then20, label %if.end24 if.then20: ; preds = %if.end16 store i32 %6, ptr %nums, align 4, !tbaa !5 store i32 %2, ptr %add.ptr, align 4, !tbaa !5 br label %if.end24 if.end24: ; preds = %if.then20, %if.end16 %7 = phi i32 [ %2, %if.then20 ], [ %6, %if.end16 ] %8 = phi i32 [ %6, %if.then20 ], [ %2, %if.end16 ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %nums) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,c,n1,n2,n3; scanf("%d %d %d",&a,&b,&c); if(a<=b&&b<=c){ n1=a; n2=b; n3=c; }else if(a<=c&&c<=b){ n1=a; n2=c; n3=b; }else if(b<=a&&a<=c){ n1=b; n2=a; n3=c; }else if(b<=c&&c<=a){ n1=b; n2=c; n3=a; }else if(c<=a&&a<=b){ n1=c; n2=a; n3=b; }else if(c<=b&&b<=a){ n1=c; n2=b; n3=a; } printf("%d %d %d\n",n1,n2,n3); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168390/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168390/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %1 = load i32, ptr %b, align 4 %cmp.not = icmp sgt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1.not = icmp sgt i32 %1, %2 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not br i1 %or.cond, label %if.else, label %if.end30 if.else: ; preds = %entry %cmp2.not = icmp sgt i32 %0, %2 %cmp4.not = icmp sgt i32 %2, %1 %or.cond49 = or i1 %cmp2.not, %cmp4.not br i1 %or.cond49, label %if.else6, label %if.end30 if.else6: ; preds = %if.else %cmp7.not = icmp sgt i32 %1, %0 %or.cond50 = or i1 %cmp7.not, %cmp2.not br i1 %or.cond50, label %if.else11, label %if.end30 if.else11: ; preds = %if.else6 %cmp14.not = icmp sgt i32 %2, %0 %or.cond51 = or i1 %cmp1.not, %cmp14.not br i1 %or.cond51, label %if.else16, label %if.end30 if.else16: ; preds = %if.else11 %or.cond52 = or i1 %cmp.not, %cmp14.not %spec.select = select i1 %or.cond52, i32 %1, i32 %0 %spec.select53 = select i1 %or.cond52, i32 %0, i32 %1 br label %if.end30 if.end30: ; preds = %if.else16, %if.else11, %if.else6, %if.else, %entry %n1.0 = phi i32 [ %0, %entry ], [ %0, %if.else ], [ %1, %if.else6 ], [ %1, %if.else11 ], [ %2, %if.else16 ] %n2.0 = phi i32 [ %1, %entry ], [ %2, %if.else ], [ %0, %if.else6 ], [ %2, %if.else11 ], [ %spec.select, %if.else16 ] %n3.0 = phi i32 [ %2, %entry ], [ %1, %if.else ], [ %2, %if.else6 ], [ %0, %if.else11 ], [ %spec.select53, %if.else16 ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n1.0, i32 noundef %n2.0, i32 noundef %n3.0) 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)"}
#include <stdio.h> int main(void) { int a ,b ,c ,d; scanf("%d %d %d\n" ,&a ,&b ,&c); if(a>b){ d = b; b = a; a = d; } if(a>c){ d = c; c = a; a = d; } if(b>c){ d = c; c = b; b = d; } printf("%d %d %d\n" ,a ,b ,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168433/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168433/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %0, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %3, ptr %c, align 4, !tbaa !5 store i32 %4, ptr %a, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %2, ptr %c, align 4, !tbaa !5 store i32 %6, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5, i32 noundef %8, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c,n1,n2,n3; scanf("%d%d%d",&a,&b,&c); if (a>b) {n2 = a; a = b; b = n2;} if (b>c) {n3 = b; b = c; c = n3;} if (a>b) {n2 = a; a = b; b = n2;} printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168477/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168477/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b,c; int tmp,i,j; scanf("%d %d %d",&a,&b,&c); if(a>b) { tmp = a; a = b; b = tmp; } if(a>c) { tmp = a; a = c; c = tmp; } if(b>c){ tmp = b; b = c; c = tmp; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168570/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168570/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %0, %if.then ], [ %1, %entry ] %3 = phi i32 [ %1, %if.then ], [ %0, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %a, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %b, align 4, !tbaa !5 store i32 %2, ptr %c, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a,b,c,tmp; scanf("%d%d%d",&a,&b,&c); if(a>b){ tmp = a; a = b; b = tmp; } if(b>c){ tmp = b; b = c; c = tmp; } if(a>b){ tmp = a; a = b; b = tmp; } printf("%d %d %d\n",a,b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168628/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168628/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %2 = phi i32 [ %1, %if.then ], [ %0, %entry ] %3 = phi i32 [ %0, %if.then ], [ %1, %entry ] %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %3, %4 br i1 %cmp1, label %if.then2, label %if.end3 if.then2: ; preds = %if.end store i32 %4, ptr %b, align 4, !tbaa !5 store i32 %3, ptr %c, align 4, !tbaa !5 br label %if.end3 if.end3: ; preds = %if.then2, %if.end %5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ] %6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ] %cmp4 = icmp sgt i32 %2, %6 br i1 %cmp4, label %if.then5, label %if.end6 if.then5: ; preds = %if.end3 store i32 %6, ptr %a, align 4, !tbaa !5 store i32 %2, ptr %b, align 4, !tbaa !5 br label %if.end6 if.end6: ; preds = %if.then5, %if.end3 %7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ] %8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5) 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"}