Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> int main(){ int k,s,i,j,ans=0; scanf("%d%d",&k,&s); for(i=0;i<=k;i++){ for(j=0;j<=k;j++){ if(s-i-j<=k&&s-i-j>=0) ans++; } } printf("%d",ans); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258008/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258008/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %k = alloca i32, align 4 %s = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %0, 0 br i1 %cmp.not24, label %for.end12, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %s, align 4 %2 = add i32 %0, 1 %min.iters.check = icmp ult i32 %2, 8 %n.vec = and i32 %2, -8 %broadcast.splatinsert31 = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert33 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat34 = shufflevector <4 x i32> %broadcast.splatinsert33, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %2, %n.vec br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc10_crit_edge %ans.026 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %ans.2.lcssa, %for.cond1.for.inc10_crit_edge ] %i.025 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc11, %for.cond1.for.inc10_crit_edge ] br i1 %min.iters.check, label %for.body3.preheader, label %vector.ph vector.ph: ; preds = %for.cond1.preheader %3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ans.026, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i.025, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ] %vec.phi29 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %4 = add nuw <4 x i32> %vec.ind, %broadcast.splat %5 = add nuw <4 x i32> %step.add, %broadcast.splat %6 = sub <4 x i32> %broadcast.splat32, %4 %7 = sub <4 x i32> %broadcast.splat32, %5 %8 = icmp sle <4 x i32> %6, %broadcast.splat34 %9 = icmp sle <4 x i32> %7, %broadcast.splat34 %10 = icmp sgt <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1> %11 = icmp sgt <4 x i32> %7, <i32 -1, i32 -1, i32 -1, i32 -1> %12 = and <4 x i1> %8, %10 %13 = and <4 x i1> %9, %11 %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi, %14 %17 = add <4 x i32> %vec.phi29, %15 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %18 = icmp eq i32 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond1.for.inc10_crit_edge, label %for.body3.preheader for.body3.preheader: ; preds = %for.cond1.preheader, %middle.block %ans.123.ph = phi i32 [ %ans.026, %for.cond1.preheader ], [ %19, %middle.block ] %j.022.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ] br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.body3 %ans.123 = phi i32 [ %ans.2, %for.body3 ], [ %ans.123.ph, %for.body3.preheader ] %j.022 = phi i32 [ %inc9, %for.body3 ], [ %j.022.ph, %for.body3.preheader ] %20 = add nuw i32 %j.022, %i.025 %sub4 = sub i32 %1, %20 %cmp5.not = icmp sle i32 %sub4, %0 %cmp8 = icmp sgt i32 %sub4, -1 %or.cond = and i1 %cmp5.not, %cmp8 %inc = zext i1 %or.cond to i32 %ans.2 = add nsw i32 %ans.123, %inc %inc9 = add nuw i32 %j.022, 1 %exitcond.not = icmp eq i32 %j.022, %0 br i1 %exitcond.not, label %for.cond1.for.inc10_crit_edge, label %for.body3, !llvm.loop !13 for.cond1.for.inc10_crit_edge: ; preds = %for.body3, %middle.block %ans.2.lcssa = phi i32 [ %19, %middle.block ], [ %ans.2, %for.body3 ] %inc11 = add nuw i32 %i.025, 1 %exitcond28.not = icmp eq i32 %i.025, %0 br i1 %exitcond28.not, label %for.end12, label %for.cond1.preheader, !llvm.loop !14 for.end12: ; preds = %for.cond1.for.inc10_crit_edge, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.2.lcssa, %for.cond1.for.inc10_crit_edge ] %call13 = 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) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10}
#include<stdio.h> int main(){ int x,y,z,s,k,cnt=0; scanf("%d %d",&k,&s); for(int i=0;i<=k;i++){ if(s-i<=2*k) for(int j=0;j<=k;j++) if(s-(i+j)<=k&&s-(i+j)>=0) cnt++; } printf("%d\n",cnt); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258051/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258051/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp.not30 = icmp slt i32 %0, 0 br i1 %cmp.not30, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = load i32, ptr %s, align 4, !tbaa !5 %mul = shl nuw nsw i32 %0, 1 %2 = add i32 %0, 1 %min.iters.check = icmp ult i32 %2, 8 %n.vec = and i32 %2, -8 %broadcast.splatinsert39 = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat40 = shufflevector <4 x i32> %broadcast.splatinsert39, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert41 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat42 = shufflevector <4 x i32> %broadcast.splatinsert41, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %2, %n.vec br label %for.body for.cond.cleanup: ; preds = %for.inc14, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.3, %for.inc14 ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 ret i32 0 for.body: ; preds = %for.body.preheader, %for.inc14 %i.032 = phi i32 [ %inc15, %for.inc14 ], [ 0, %for.body.preheader ] %cnt.031 = phi i32 [ %cnt.3, %for.inc14 ], [ 0, %for.body.preheader ] %sub = sub nsw i32 %1, %i.032 %cmp1.not = icmp sgt i32 %sub, %mul br i1 %cmp1.not, label %for.inc14, label %for.body5.preheader for.body5.preheader: ; preds = %for.body br i1 %min.iters.check, label %for.body5.preheader43, label %vector.ph vector.ph: ; preds = %for.body5.preheader %3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.031, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i.032, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ] %vec.phi38 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %4 = add nuw <4 x i32> %broadcast.splat, %vec.ind %5 = add nuw <4 x i32> %broadcast.splat, %step.add %6 = sub <4 x i32> %broadcast.splat40, %4 %7 = sub <4 x i32> %broadcast.splat40, %5 %8 = icmp sle <4 x i32> %6, %broadcast.splat42 %9 = icmp sle <4 x i32> %7, %broadcast.splat42 %10 = icmp sgt <4 x i32> %6, <i32 -1, i32 -1, i32 -1, i32 -1> %11 = icmp sgt <4 x i32> %7, <i32 -1, i32 -1, i32 -1, i32 -1> %12 = and <4 x i1> %8, %10 %13 = and <4 x i1> %9, %11 %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi, %14 %17 = add <4 x i32> %vec.phi38, %15 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %18 = icmp eq i32 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.inc14, label %for.body5.preheader43 for.body5.preheader43: ; preds = %for.body5.preheader, %middle.block %j.029.ph = phi i32 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ] %cnt.128.ph = phi i32 [ %cnt.031, %for.body5.preheader ], [ %19, %middle.block ] br label %for.body5 for.body5: ; preds = %for.body5.preheader43, %for.body5 %j.029 = phi i32 [ %inc12, %for.body5 ], [ %j.029.ph, %for.body5.preheader43 ] %cnt.128 = phi i32 [ %cnt.2, %for.body5 ], [ %cnt.128.ph, %for.body5.preheader43 ] %20 = add nuw i32 %i.032, %j.029 %sub6 = sub i32 %1, %20 %cmp7.not = icmp sle i32 %sub6, %0 %cmp10 = icmp sgt i32 %sub6, -1 %or.cond = and i1 %cmp7.not, %cmp10 %inc = zext i1 %or.cond to i32 %cnt.2 = add nsw i32 %cnt.128, %inc %inc12 = add nuw i32 %j.029, 1 %exitcond.not = icmp eq i32 %j.029, %0 br i1 %exitcond.not, label %for.inc14, label %for.body5, !llvm.loop !13 for.inc14: ; preds = %for.body5, %middle.block, %for.body %cnt.3 = phi i32 [ %cnt.031, %for.body ], [ %19, %middle.block ], [ %cnt.2, %for.body5 ] %inc15 = add nuw i32 %i.032, 1 %exitcond36.not = icmp eq i32 %i.032, %0 br i1 %exitcond36.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10}
#include <stdio.h> int main(void) { int l,m,n,K,S,num=0; scanf("%d%d",&K,&S); for(l=0;l<=K;l++) for(m=l;m<=K;m++) for(n=m;n<=K;n++){ if(l+m+n==S){ if(l==m&&m==n){ num++; }else if(l!=m&&l!=n&&m!=n){ num+=6; }else{ num+=3; } } } printf("%d\n",num); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258095/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258095/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 %S = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %S) %0 = load i32, ptr %K, align 4, !tbaa !5 %cmp.not58 = icmp slt i32 %0, 0 br i1 %cmp.not58, label %for.end29, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %S, align 4, !tbaa !5 %broadcast.splatinsert98 = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat99 = shufflevector <4 x i32> %broadcast.splatinsert98, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert68 = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat69 = shufflevector <4 x i32> %broadcast.splatinsert68, <4 x i32> poison, <4 x i32> zeroinitializer br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc27 %2 = phi <2 x i32> [ zeroinitializer, %for.cond1.preheader.lr.ph ], [ %48, %for.inc27 ] %3 = extractelement <2 x i32> %2, i64 0 %smax = call i32 @llvm.smax.i32(i32 %0, i32 %3) %broadcast.splat103 = shufflevector <2 x i32> %2, <2 x i32> poison, <4 x i32> zeroinitializer br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc24 %indvar = phi i32 [ 0, %for.cond1.preheader ], [ %indvar.next, %for.inc24 ] %4 = phi <2 x i32> [ %2, %for.cond1.preheader ], [ %47, %for.inc24 ] %5 = extractelement <2 x i32> %4, i64 0 %smax75 = call i32 @llvm.smax.i32(i32 %0, i32 %5) %6 = add i32 %3, %indvar %reass.sub = sub i32 %smax75, %6 %7 = add i32 %reass.sub, 1 %smax65 = call i32 @llvm.smax.i32(i32 %0, i32 %5) %8 = add i32 %3, %indvar %reass.sub111 = sub i32 %smax65, %8 %9 = add i32 %reass.sub111, 1 %add = add nuw nsw i32 %5, %3 %cmp9 = icmp eq i32 %3, %5 %cmp9.fr = freeze i1 %cmp9 br i1 %cmp9.fr, label %for.body6.preheader, label %for.body6.us.preheader for.body6.us.preheader: ; preds = %for.cond4.preheader %min.iters.check78 = icmp ult i32 %7, 8 %10 = extractelement <2 x i32> %4, i64 1 br i1 %min.iters.check78, label %for.body6.us.preheader113, label %vector.ph79 vector.ph79: ; preds = %for.body6.us.preheader %n.vec81 = and i32 %7, -8 %ind.end82 = add i32 %5, %n.vec81 %11 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 poison, i32 1, i32 poison, i32 poison> %12 = shufflevector <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, <4 x i32> %11, <4 x i32> <i32 5, i32 1, i32 2, i32 3> %.splat90 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> zeroinitializer %induction91 = add <4 x i32> %.splat90, <i32 0, i32 1, i32 2, i32 3> %broadcast.splatinsert96 = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat97 = shufflevector <4 x i32> %broadcast.splatinsert96, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body85 vector.body85: ; preds = %vector.body85, %vector.ph79 %index86 = phi i32 [ 0, %vector.ph79 ], [ %index.next108, %vector.body85 ] %vec.phi87 = phi <4 x i32> [ %12, %vector.ph79 ], [ %predphi106, %vector.body85 ] %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph79 ], [ %predphi107, %vector.body85 ] %vec.ind92 = phi <4 x i32> [ %induction91, %vector.ph79 ], [ %vec.ind.next95, %vector.body85 ] %step.add93 = add <4 x i32> %vec.ind92, <i32 4, i32 4, i32 4, i32 4> %13 = add nuw nsw <4 x i32> %broadcast.splat97, %vec.ind92 %14 = add nuw nsw <4 x i32> %broadcast.splat97, %step.add93 %15 = icmp eq <4 x i32> %13, %broadcast.splat99 %16 = icmp eq <4 x i32> %14, %broadcast.splat99 %17 = icmp eq <4 x i32> %.splat90, %vec.ind92 %18 = icmp eq <4 x i32> %.splat90, %step.add93 %19 = icmp eq <4 x i32> %broadcast.splat103, %vec.ind92 %20 = icmp eq <4 x i32> %broadcast.splat103, %step.add93 %21 = or <4 x i1> %17, %19 %22 = or <4 x i1> %18, %20 %23 = select <4 x i1> %15, <4 x i1> %21, <4 x i1> zeroinitializer %24 = select <4 x i1> %16, <4 x i1> %22, <4 x i1> zeroinitializer %predphi104.v = select <4 x i1> %23, <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32> <i32 6, i32 6, i32 6, i32 6> %predphi105.v = select <4 x i1> %24, <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32> <i32 6, i32 6, i32 6, i32 6> %predphi104 = select <4 x i1> %15, <4 x i32> %predphi104.v, <4 x i32> zeroinitializer %predphi106 = add <4 x i32> %vec.phi87, %predphi104 %predphi105 = select <4 x i1> %16, <4 x i32> %predphi105.v, <4 x i32> zeroinitializer %predphi107 = add <4 x i32> %vec.phi88, %predphi105 %index.next108 = add nuw i32 %index86, 8 %vec.ind.next95 = add <4 x i32> %vec.ind92, <i32 8, i32 8, i32 8, i32 8> %25 = icmp eq i32 %index.next108, %n.vec81 br i1 %25, label %middle.block76, label %vector.body85, !llvm.loop !9 middle.block76: ; preds = %vector.body85 %bin.rdx109 = add <4 x i32> %predphi107, %predphi106 %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx109) %cmp.n84 = icmp eq i32 %7, %n.vec81 br i1 %cmp.n84, label %for.inc24, label %for.body6.us.preheader113 for.body6.us.preheader113: ; preds = %for.body6.us.preheader, %middle.block76 %num.255.us.ph = phi i32 [ %10, %for.body6.us.preheader ], [ %26, %middle.block76 ] %n.054.us.ph = phi i32 [ %5, %for.body6.us.preheader ], [ %ind.end82, %middle.block76 ] br label %for.body6.us for.body6.preheader: ; preds = %for.cond4.preheader %min.iters.check = icmp ult i32 %9, 8 br i1 %min.iters.check, label %for.body6.preheader112, label %vector.ph vector.ph: ; preds = %for.body6.preheader %n.vec = and i32 %9, -8 %ind.end = add i32 %5, %n.vec %27 = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> <i32 poison, i32 1, i32 poison, i32 poison> %28 = shufflevector <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, <4 x i32> %27, <4 x i32> <i32 5, i32 1, i32 2, i32 3> %.splat = shufflevector <2 x i32> %4, <2 x i32> poison, <4 x i32> zeroinitializer %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %28, %vector.ph ], [ %predphi73, %vector.body ] %vec.phi66 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi74, %vector.body ] %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %29 = add nuw nsw <4 x i32> %broadcast.splat, %vec.ind %30 = add nuw nsw <4 x i32> %broadcast.splat, %step.add %31 = icmp eq <4 x i32> %29, %broadcast.splat69 %32 = icmp eq <4 x i32> %30, %broadcast.splat69 %33 = icmp ne <4 x i32> %.splat, %vec.ind %34 = icmp ne <4 x i32> %.splat, %step.add %35 = select <4 x i1> %31, <4 x i1> %33, <4 x i1> zeroinitializer %36 = select <4 x i1> %32, <4 x i1> %34, <4 x i1> zeroinitializer %predphi.v = select <4 x i1> %35, <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32> <i32 1, i32 1, i32 1, i32 1> %predphi72.v = select <4 x i1> %36, <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32> <i32 1, i32 1, i32 1, i32 1> %predphi = select <4 x i1> %31, <4 x i32> %predphi.v, <4 x i32> zeroinitializer %predphi73 = add <4 x i32> %vec.phi, %predphi %predphi72 = select <4 x i1> %32, <4 x i32> %predphi72.v, <4 x i32> zeroinitializer %predphi74 = add <4 x i32> %vec.phi66, %predphi72 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %37 = icmp eq i32 %index.next, %n.vec br i1 %37, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %predphi74, %predphi73 %38 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %9, %n.vec %39 = insertelement <2 x i32> poison, i32 %ind.end, i64 0 %40 = insertelement <2 x i32> %39, i32 %38, i64 1 br i1 %cmp.n, label %for.inc24, label %for.body6.preheader112 for.body6.preheader112: ; preds = %for.body6.preheader, %middle.block %.ph = phi <2 x i32> [ %4, %for.body6.preheader ], [ %40, %middle.block ] br label %for.body6 for.body6.us: ; preds = %for.body6.us.preheader113, %for.inc.us %num.255.us = phi i32 [ %num.3.us, %for.inc.us ], [ %num.255.us.ph, %for.body6.us.preheader113 ] %n.054.us = phi i32 [ %inc23.us, %for.inc.us ], [ %n.054.us.ph, %for.body6.us.preheader113 ] %add7.us = add nuw nsw i32 %add, %n.054.us %cmp8.us = icmp eq i32 %add7.us, %1 br i1 %cmp8.us, label %if.then.us, label %for.inc.us if.then.us: ; preds = %for.body6.us %cmp10.us = icmp eq i32 %5, %n.054.us %cmp14.not.us = icmp eq i32 %3, %n.054.us %or.cond53.us = or i1 %cmp10.us, %cmp14.not.us br i1 %or.cond53.us, label %if.else19.us, label %if.then17.us if.then17.us: ; preds = %if.then.us %add18.us = add nsw i32 %num.255.us, 6 br label %for.inc.us if.else19.us: ; preds = %if.then.us %add20.us = add nsw i32 %num.255.us, 3 br label %for.inc.us for.inc.us: ; preds = %if.else19.us, %if.then17.us, %for.body6.us %num.3.us = phi i32 [ %add18.us, %if.then17.us ], [ %add20.us, %if.else19.us ], [ %num.255.us, %for.body6.us ] %inc23.us = add nuw nsw i32 %n.054.us, 1 %cmp5.not.us.not = icmp slt i32 %n.054.us, %0 br i1 %cmp5.not.us.not, label %for.body6.us, label %for.inc24, !llvm.loop !14 for.body6: ; preds = %for.body6.preheader112, %for.inc %41 = phi <2 x i32> [ %45, %for.inc ], [ %.ph, %for.body6.preheader112 ] %42 = extractelement <2 x i32> %41, i64 0 %add7 = add nuw nsw i32 %add, %42 %cmp8 = icmp eq i32 %add7, %1 %43 = extractelement <2 x i32> %41, i64 1 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body6 %cmp10 = icmp eq i32 %5, %42 br i1 %cmp10, label %if.then11, label %if.else if.then11: ; preds = %if.then %inc = add nsw i32 %43, 1 br label %for.inc if.else: ; preds = %if.then %add20 = add nsw i32 %43, 3 br label %for.inc for.inc: ; preds = %for.body6, %if.else, %if.then11 %num.3 = phi i32 [ %inc, %if.then11 ], [ %add20, %if.else ], [ %43, %for.body6 ] %inc23 = add nuw nsw i32 %42, 1 %cmp5.not.not = icmp slt i32 %42, %0 %44 = insertelement <2 x i32> poison, i32 %inc23, i64 0 %45 = insertelement <2 x i32> %44, i32 %num.3, i64 1 br i1 %cmp5.not.not, label %for.body6, label %for.inc24, !llvm.loop !15 for.inc24: ; preds = %for.inc.us, %for.inc, %middle.block76, %middle.block %.us-phi = phi i32 [ %38, %middle.block ], [ %26, %middle.block76 ], [ %num.3, %for.inc ], [ %num.3.us, %for.inc.us ] %inc25 = add i32 %5, 1 %exitcond.not = icmp eq i32 %5, %smax %indvar.next = add i32 %indvar, 1 %46 = insertelement <2 x i32> poison, i32 %inc25, i64 0 %47 = insertelement <2 x i32> %46, i32 %.us-phi, i64 1 br i1 %exitcond.not, label %for.inc27, label %for.cond4.preheader, !llvm.loop !16 for.inc27: ; preds = %for.inc24 %inc28 = add i32 %3, 1 %exitcond62.not = icmp eq i32 %3, %0 %48 = insertelement <2 x i32> %47, i32 %inc28, i64 0 br i1 %exitcond62.not, label %for.end29, label %for.cond1.preheader, !llvm.loop !17 for.end29: ; preds = %for.inc27, %entry %num.0.lcssa = phi i32 [ 0, %entry ], [ %.us-phi, %for.inc27 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !11, !12} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> int main(){ int i,j,c=0,n,m; scanf("%d %d",&n,&m); for(i=0;i<=n;i++){ for(j=0;j<=n;j++){ if(i+j<=m&&i+j+n>=m)c++; } } printf("%d\n",c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258145/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258145/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %0, 0 br i1 %cmp.not24, label %for.end11, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr %m, align 4 %2 = add i32 %0, 1 %min.iters.check = icmp ult i32 %2, 8 %n.vec = and i32 %2, -8 %broadcast.splatinsert31 = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert33 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat34 = shufflevector <4 x i32> %broadcast.splatinsert33, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %2, %n.vec br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc9_crit_edge %c.026 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %c.2.lcssa, %for.cond1.for.inc9_crit_edge ] %i.025 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc10, %for.cond1.for.inc9_crit_edge ] br i1 %min.iters.check, label %for.body3.preheader, label %vector.ph vector.ph: ; preds = %for.cond1.preheader %3 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %c.026, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i.025, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %3, %vector.ph ], [ %16, %vector.body ] %vec.phi29 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %4 = add nuw nsw <4 x i32> %vec.ind, %broadcast.splat %5 = add nuw nsw <4 x i32> %step.add, %broadcast.splat %6 = icmp sle <4 x i32> %4, %broadcast.splat32 %7 = icmp sle <4 x i32> %5, %broadcast.splat32 %8 = add nsw <4 x i32> %4, %broadcast.splat34 %9 = add nsw <4 x i32> %5, %broadcast.splat34 %10 = icmp sge <4 x i32> %8, %broadcast.splat32 %11 = icmp sge <4 x i32> %9, %broadcast.splat32 %12 = select <4 x i1> %6, <4 x i1> %10, <4 x i1> zeroinitializer %13 = select <4 x i1> %7, <4 x i1> %11, <4 x i1> zeroinitializer %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi, %14 %17 = add <4 x i32> %vec.phi29, %15 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %18 = icmp eq i32 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond1.for.inc9_crit_edge, label %for.body3.preheader for.body3.preheader: ; preds = %for.cond1.preheader, %middle.block %c.123.ph = phi i32 [ %c.026, %for.cond1.preheader ], [ %19, %middle.block ] %j.022.ph = phi i32 [ 0, %for.cond1.preheader ], [ %n.vec, %middle.block ] br label %for.body3 for.body3: ; preds = %for.body3.preheader, %for.body3 %c.123 = phi i32 [ %c.2, %for.body3 ], [ %c.123.ph, %for.body3.preheader ] %j.022 = phi i32 [ %inc8, %for.body3 ], [ %j.022.ph, %for.body3.preheader ] %add = add nuw nsw i32 %j.022, %i.025 %cmp4.not = icmp sle i32 %add, %1 %add6 = add nsw i32 %add, %0 %cmp7.not = icmp sge i32 %add6, %1 %or.cond.not = select i1 %cmp4.not, i1 %cmp7.not, i1 false %inc = zext i1 %or.cond.not to i32 %c.2 = add nsw i32 %c.123, %inc %inc8 = add nuw i32 %j.022, 1 %exitcond.not = icmp eq i32 %j.022, %0 br i1 %exitcond.not, label %for.cond1.for.inc9_crit_edge, label %for.body3, !llvm.loop !13 for.cond1.for.inc9_crit_edge: ; preds = %for.body3, %middle.block %c.2.lcssa = phi i32 [ %19, %middle.block ], [ %c.2, %for.body3 ] %inc10 = add nuw i32 %i.025, 1 %exitcond28.not = icmp eq i32 %i.025, %0 br i1 %exitcond28.not, label %for.end11, label %for.cond1.preheader, !llvm.loop !14 for.end11: ; preds = %for.cond1.for.inc9_crit_edge, %entry %c.0.lcssa = phi i32 [ 0, %entry ], [ %c.2.lcssa, %for.cond1.for.inc9_crit_edge ] %call12 = 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 %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10}
#include <stdio.h> void depot(int *train, int x, int *out_train); int main(void) { int i; static int train[11]; static int out_train[10]; int array; while (scanf("%d", &array) != EOF){ depot(train, array, out_train); } /* for (i = 0; i < 10; i++){ if (out_train[i] != 0){ printf("%d\n", out_train[i]); } } */ return (0); } void depot(int *train, int x, int *out_train) { static int out = 0; int i; if (x != 0){ for (i = 10; i > 0; i--){ train[i] = train[i - 1]; } train[1] = x; } if (x == 0){ out_train[out] = train[1]; printf("%d\n", out_train[out]); out++; for (i = 1; i < 11; i++){ train[i] = train[i + 1]; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258202/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258202/source.c" target datalayout = "e-m:e-p270: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.train = internal unnamed_addr global [11 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @depot.out = internal 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: %array = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %array) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %array) %cmp.not2 = icmp eq i32 %call1, -1 br i1 %cmp.not2, label %while.end, label %while.body while.body: ; preds = %entry, %depot.exit %0 = load i32, ptr %array, align 4, !tbaa !5 %cond.i = icmp eq i32 %0, 0 br i1 %cond.i, label %if.then6.i, label %for.body.preheader.i for.body.preheader.i: ; preds = %while.body call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) getelementptr inbounds ([11 x i32], ptr @main.train, i64 0, i64 1), ptr noundef nonnull align 16 dereferenceable(40) @main.train, i64 40, i1 false), !tbaa !5 store i32 %0, ptr getelementptr inbounds ([11 x i32], ptr @main.train, i64 0, i64 1), align 4, !tbaa !5 br label %depot.exit if.then6.i: ; preds = %while.body %1 = load i32, ptr getelementptr inbounds ([11 x i32], ptr @main.train, i64 0, i64 1), align 4, !tbaa !5 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) %2 = load i32, ptr @depot.out, align 4, !tbaa !5 %inc.i = add nsw i32 %2, 1 store i32 %inc.i, ptr @depot.out, align 4, !tbaa !5 call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) getelementptr inbounds ([11 x i32], ptr @main.train, i64 0, i64 1), ptr noundef nonnull align 8 dereferenceable(40) getelementptr inbounds ([11 x i32], ptr @main.train, i64 0, i64 2), i64 40, i1 false), !tbaa !5 br label %depot.exit depot.exit: ; preds = %for.body.preheader.i, %if.then6.i %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %array) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %depot.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %array) #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 uwtable define dso_local void @depot(ptr nocapture noundef %train, i32 noundef %x, ptr nocapture noundef writeonly %out_train) local_unnamed_addr #0 { entry: %cond = icmp eq i32 %x, 0 br i1 %cond, label %if.then6, label %for.body.preheader for.body.preheader: ; preds = %entry %scevgep = getelementptr i8, ptr %train, i64 4 tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %scevgep, ptr noundef nonnull align 4 dereferenceable(40) %train, i64 40, i1 false), !tbaa !5 store i32 %x, ptr %scevgep, align 4, !tbaa !5 br label %if.end22 if.then6: ; preds = %entry %arrayidx7 = getelementptr i32, ptr %train, i64 1 %0 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %1 = load i32, ptr @depot.out, align 4, !tbaa !5 %idxprom8 = sext i32 %1 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %out_train, i64 %idxprom8 store i32 %0, ptr %arrayidx9, align 4, !tbaa !5 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0) %2 = load i32, ptr @depot.out, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr @depot.out, align 4, !tbaa !5 %scevgep42 = getelementptr i8, ptr %train, i64 8 tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %arrayidx7, ptr noundef nonnull align 4 dereferenceable(40) %scevgep42, i64 40, i1 false), !tbaa !5 br label %if.end22 if.end22: ; preds = %if.then6, %for.body.preheader ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int a; int i; int num[100]; int count = 0; while(scanf("%d", &a)!=EOF){ if(a!=0){ num[count] = a; count++; }else if(a==0){ printf("%d\n", num[count-1]); count--; } } /* printf("Hello, world\n"); */ return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258246/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258246/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %num = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %num) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end7 %count.013 = phi i32 [ %count.1, %if.end7 ], [ 0, %entry ] %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp1.not = icmp eq i32 %0, 0 br i1 %cmp1.not, label %if.then3, label %if.then if.then: ; preds = %while.body %idxprom = sext i32 %count.013 to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %count.013, 1 br label %if.end7 if.then3: ; preds = %while.body %sub = add nsw i32 %count.013, -1 %idxprom4 = sext i32 %sub to i64 %arrayidx5 = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %idxprom4 %1 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) br label %if.end7 if.end7: ; preds = %if.then3, %if.then %count.1 = phi i32 [ %inc, %if.then ], [ %sub, %if.then3 ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end7, %entry call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %num) #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 n,m,ini,flag=0,rem; scanf ("%d %d",&n,&m); rem=n%2; if (rem==0) { ini=n/2; } else { ini=(n/2)+1; } flag=0; while (ini<=n) { if (ini%m==0) { printf ("%d\n",ini); flag=1; break; } else if ((ini%m)!=0) { ini++; } } if (flag==0) printf ("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25829/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25829/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = 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 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = and i32 %0, 1 %div = sdiv i32 %0, 2 %ini.0 = add nsw i32 %div, %1 %cmp3.not23 = icmp sgt i32 %ini.0, %0 br i1 %cmp3.not23, label %if.then15, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %2 = load i32, ptr %m, align 4, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end13 %ini.124 = phi i32 [ %ini.0, %while.body.lr.ph ], [ %inc, %if.end13 ] %rem4 = srem i32 %ini.124, %2 %cmp5 = icmp eq i32 %rem4, 0 br i1 %cmp5, label %if.then6, label %if.end13 if.then6: ; preds = %while.body %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ini.124) br label %if.end17 if.end13: ; preds = %while.body %inc = add i32 %ini.124, 1 %exitcond.not = icmp eq i32 %ini.124, %0 br i1 %exitcond.not, label %if.then15, label %while.body, !llvm.loop !9 if.then15: ; preds = %if.end13, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end17 if.end17: ; preds = %if.then6, %if.then15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
/* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0013&lang=jp */ #include<stdio.h> #define MAX 100 typedef struct{ int array[MAX]; //データが格納される配列 int current; //現在の位置 }STACK; void init(STACK* pstack){ int i; for(i=0;i<MAX;i++){ pstack->array[i]=0; } pstack->current=0; } int push(STACK * pstack,int value){ if(pstack->current<MAX){ pstack->array[pstack->current]=value; pstack->current++; return 1; } return 0; } int pop(STACK* pstack,int* pvalue){ if(pstack->current>0){ pstack->current--; *pvalue=pstack->array[pstack->current]; return 1; } return 0; } int main(void) { STACK s; int value; //値 int num; int i; init(&s); while(scanf("%d",&num)!=EOF){ if(num==0){ pop(&s,&value); printf("%d\n",value); }else{ push(&s,num); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258332/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258332/source.c" target datalayout = "e-m:e-p270: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.STACK = type { [100 x i32], i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable define dso_local void @init(ptr nocapture noundef writeonly %pstack) local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %pstack, i8 0, i64 404, i1 false) 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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @push(ptr nocapture noundef %pstack, i32 noundef %value) local_unnamed_addr #2 { entry: %current = getelementptr inbounds %struct.STACK, ptr %pstack, i64 0, i32 1 %0 = load i32, ptr %current, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 100 br i1 %cmp, label %if.then, label %return if.then: ; preds = %entry %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr %pstack, i64 0, i64 %idxprom store i32 %value, ptr %arrayidx, align 4, !tbaa !10 %1 = load i32, ptr %current, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %current, align 4, !tbaa !5 br label %return return: ; preds = %entry, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @pop(ptr nocapture noundef %pstack, ptr nocapture noundef writeonly %pvalue) local_unnamed_addr #2 { entry: %current = getelementptr inbounds %struct.STACK, ptr %pstack, i64 0, i32 1 %0 = load i32, ptr %current, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 0 br i1 %cmp, label %if.then, label %return if.then: ; preds = %entry %dec = add nsw i32 %0, -1 store i32 %dec, ptr %current, align 4, !tbaa !5 %idxprom = zext i32 %dec to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr %pstack, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !10 store i32 %1, ptr %pvalue, align 4, !tbaa !10 br label %return return: ; preds = %entry, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %s = alloca %struct.STACK, align 4 %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(404) %s, i8 0, i64 404, i1 false) %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %current.i5 = getelementptr inbounds %struct.STACK, ptr %s, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %0 = phi i32 [ 0, %while.body.lr.ph ], [ %6, %if.end ] %1 = phi i32 [ 0, %while.body.lr.ph ], [ %7, %if.end ] %value.013 = phi i32 [ undef, %while.body.lr.ph ], [ %value.2, %if.end ] %2 = load i32, ptr %num, align 4, !tbaa !10 %cmp1 = icmp eq i32 %2, 0 br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %while.body %cmp.i = icmp sgt i32 %0, 0 br i1 %cmp.i, label %if.then.i, label %pop.exit if.then.i: ; preds = %if.then %dec.i = add nsw i32 %0, -1 store i32 %dec.i, ptr %current.i5, align 4, !tbaa !5 %idxprom.i = zext i32 %dec.i to i64 %arrayidx.i = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %idxprom.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !10 br label %pop.exit pop.exit: ; preds = %if.then, %if.then.i %4 = phi i32 [ %dec.i, %if.then.i ], [ %0, %if.then ] %value.1 = phi i32 [ %3, %if.then.i ], [ %value.013, %if.then ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %value.1) br label %if.end if.else: ; preds = %while.body %cmp.i6 = icmp slt i32 %1, 100 br i1 %cmp.i6, label %if.then.i8, label %if.end if.then.i8: ; preds = %if.else %idxprom.i9 = sext i32 %1 to i64 %arrayidx.i10 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %idxprom.i9 store i32 %2, ptr %arrayidx.i10, align 4, !tbaa !10 %5 = load i32, ptr %current.i5, align 4, !tbaa !5 %inc.i = add nsw i32 %5, 1 store i32 %inc.i, ptr %current.i5, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then.i8, %if.else, %pop.exit %6 = phi i32 [ %4, %pop.exit ], [ %0, %if.else ], [ %inc.i, %if.then.i8 ] %7 = phi i32 [ %4, %pop.exit ], [ %1, %if.else ], [ %inc.i, %if.then.i8 ] %value.2 = phi i32 [ %value.1, %pop.exit ], [ %value.013, %if.else ], [ %value.013, %if.then.i8 ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #6 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %s) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree 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(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 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 #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: 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, !9, i64 400} !6 = !{!"", !7, i64 0, !9, i64 400} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!"int", !7, i64 0} !10 = !{!9, !9, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int n,senro[10],i; for(i=0;i<10;i++) senro[i]=0; while(scanf("%d",&n)!=EOF) { if(n==0){ for(i=9;i>=0;i--){ if(senro[i]!=0){ printf("%d\n",senro[i]); senro[i]=0; break; } } }else{ for(i=0;i<10;i++){ if(senro[i]==0){ senro[i]=n; break; } } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258383/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258383/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %senro = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %senro) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %senro, i8 0, i64 40, i1 false), !tbaa !5 %call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp1.not47 = icmp eq i32 %call46, -1 br i1 %cmp1.not47, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %arrayidx21.1 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 1 %arrayidx21.2 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 2 %arrayidx21.3 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 3 %arrayidx21.4 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 4 %arrayidx21.5 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 5 %arrayidx21.6 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 6 %arrayidx21.7 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 7 %arrayidx21.8 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 8 %arrayidx21.9 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 9 %arrayidx7 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 9 %arrayidx7.1 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 8 %arrayidx7.2 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 7 %arrayidx7.3 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 6 %arrayidx7.4 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 5 %arrayidx7.5 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 4 %arrayidx7.6 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 3 %arrayidx7.7 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 2 %arrayidx7.8 = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 1 br label %while.body while.body: ; preds = %while.body.preheader, %if.end30 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp2 = icmp eq i32 %0, 0 br i1 %cmp2, label %for.body5.preheader, label %for.body19.preheader for.body19.preheader: ; preds = %while.body %1 = load i32, ptr %senro, align 16, !tbaa !5 %cmp22 = icmp eq i32 %1, 0 br i1 %cmp22, label %if.then23, label %for.cond17 for.body5.preheader: ; preds = %while.body %2 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8.not = icmp eq i32 %2, 0 br i1 %cmp8.not, label %for.cond3, label %if.then9 for.cond3: ; preds = %for.body5.preheader %3 = load i32, ptr %arrayidx7.1, align 16, !tbaa !5 %cmp8.not.1 = icmp eq i32 %3, 0 br i1 %cmp8.not.1, label %for.cond3.1, label %if.then9 for.cond3.1: ; preds = %for.cond3 %4 = load i32, ptr %arrayidx7.2, align 4, !tbaa !5 %cmp8.not.2 = icmp eq i32 %4, 0 br i1 %cmp8.not.2, label %for.cond3.2, label %if.then9 for.cond3.2: ; preds = %for.cond3.1 %5 = load i32, ptr %arrayidx7.3, align 8, !tbaa !5 %cmp8.not.3 = icmp eq i32 %5, 0 br i1 %cmp8.not.3, label %for.cond3.3, label %if.then9 for.cond3.3: ; preds = %for.cond3.2 %6 = load i32, ptr %arrayidx7.4, align 4, !tbaa !5 %cmp8.not.4 = icmp eq i32 %6, 0 br i1 %cmp8.not.4, label %for.cond3.4, label %if.then9 for.cond3.4: ; preds = %for.cond3.3 %7 = load i32, ptr %arrayidx7.5, align 16, !tbaa !5 %cmp8.not.5 = icmp eq i32 %7, 0 br i1 %cmp8.not.5, label %for.cond3.5, label %if.then9 for.cond3.5: ; preds = %for.cond3.4 %8 = load i32, ptr %arrayidx7.6, align 4, !tbaa !5 %cmp8.not.6 = icmp eq i32 %8, 0 br i1 %cmp8.not.6, label %for.cond3.6, label %if.then9 for.cond3.6: ; preds = %for.cond3.5 %9 = load i32, ptr %arrayidx7.7, align 8, !tbaa !5 %cmp8.not.7 = icmp eq i32 %9, 0 br i1 %cmp8.not.7, label %for.cond3.7, label %if.then9 for.cond3.7: ; preds = %for.cond3.6 %10 = load i32, ptr %arrayidx7.8, align 4, !tbaa !5 %cmp8.not.8 = icmp eq i32 %10, 0 br i1 %cmp8.not.8, label %for.cond3.8, label %if.then9 for.cond3.8: ; preds = %for.cond3.7 %11 = load i32, ptr %senro, align 16, !tbaa !5 %cmp8.not.9 = icmp eq i32 %11, 0 br i1 %cmp8.not.9, label %if.end30, label %if.then9 if.then9: ; preds = %for.cond3.8, %for.cond3.7, %for.cond3.6, %for.cond3.5, %for.cond3.4, %for.cond3.3, %for.cond3.2, %for.cond3.1, %for.cond3, %for.body5.preheader %idxprom6.lcssa = phi i64 [ 9, %for.body5.preheader ], [ 8, %for.cond3 ], [ 7, %for.cond3.1 ], [ 6, %for.cond3.2 ], [ 5, %for.cond3.3 ], [ 4, %for.cond3.4 ], [ 3, %for.cond3.5 ], [ 2, %for.cond3.6 ], [ 1, %for.cond3.7 ], [ 0, %for.cond3.8 ] %.lcssa = phi i32 [ %2, %for.body5.preheader ], [ %3, %for.cond3 ], [ %4, %for.cond3.1 ], [ %5, %for.cond3.2 ], [ %6, %for.cond3.3 ], [ %7, %for.cond3.4 ], [ %8, %for.cond3.5 ], [ %9, %for.cond3.6 ], [ %10, %for.cond3.7 ], [ %11, %for.cond3.8 ] %arrayidx7.le = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 %idxprom6.lcssa %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa) store i32 0, ptr %arrayidx7.le, align 4, !tbaa !5 br label %if.end30 for.cond17: ; preds = %for.body19.preheader %12 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5 %cmp22.1 = icmp eq i32 %12, 0 br i1 %cmp22.1, label %if.then23, label %for.cond17.1 for.cond17.1: ; preds = %for.cond17 %13 = load i32, ptr %arrayidx21.2, align 8, !tbaa !5 %cmp22.2 = icmp eq i32 %13, 0 br i1 %cmp22.2, label %if.then23, label %for.cond17.2 for.cond17.2: ; preds = %for.cond17.1 %14 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5 %cmp22.3 = icmp eq i32 %14, 0 br i1 %cmp22.3, label %if.then23, label %for.cond17.3 for.cond17.3: ; preds = %for.cond17.2 %15 = load i32, ptr %arrayidx21.4, align 16, !tbaa !5 %cmp22.4 = icmp eq i32 %15, 0 br i1 %cmp22.4, label %if.then23, label %for.cond17.4 for.cond17.4: ; preds = %for.cond17.3 %16 = load i32, ptr %arrayidx21.5, align 4, !tbaa !5 %cmp22.5 = icmp eq i32 %16, 0 br i1 %cmp22.5, label %if.then23, label %for.cond17.5 for.cond17.5: ; preds = %for.cond17.4 %17 = load i32, ptr %arrayidx21.6, align 8, !tbaa !5 %cmp22.6 = icmp eq i32 %17, 0 br i1 %cmp22.6, label %if.then23, label %for.cond17.6 for.cond17.6: ; preds = %for.cond17.5 %18 = load i32, ptr %arrayidx21.7, align 4, !tbaa !5 %cmp22.7 = icmp eq i32 %18, 0 br i1 %cmp22.7, label %if.then23, label %for.cond17.7 for.cond17.7: ; preds = %for.cond17.6 %19 = load i32, ptr %arrayidx21.8, align 16, !tbaa !5 %cmp22.8 = icmp eq i32 %19, 0 br i1 %cmp22.8, label %if.then23, label %for.cond17.8 for.cond17.8: ; preds = %for.cond17.7 %20 = load i32, ptr %arrayidx21.9, align 4, !tbaa !5 %cmp22.9 = icmp eq i32 %20, 0 br i1 %cmp22.9, label %if.then23, label %if.end30 if.then23: ; preds = %for.cond17.8, %for.cond17.7, %for.cond17.6, %for.cond17.5, %for.cond17.4, %for.cond17.3, %for.cond17.2, %for.cond17.1, %for.cond17, %for.body19.preheader %idxprom20.lcssa = phi i64 [ 0, %for.body19.preheader ], [ 1, %for.cond17 ], [ 2, %for.cond17.1 ], [ 3, %for.cond17.2 ], [ 4, %for.cond17.3 ], [ 5, %for.cond17.4 ], [ 6, %for.cond17.5 ], [ 7, %for.cond17.6 ], [ 8, %for.cond17.7 ], [ 9, %for.cond17.8 ] %arrayidx21.le = getelementptr inbounds [10 x i32], ptr %senro, i64 0, i64 %idxprom20.lcssa store i32 %0, ptr %arrayidx21.le, align 4, !tbaa !5 br label %if.end30 if.end30: ; preds = %for.cond17.8, %for.cond3.8, %if.then23, %if.then9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp1.not = icmp eq i32 %call, -1 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end30, %entry call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %senro) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdbool.h> int main(void) { int train[100]; int now_train; int tmp = 0; while (scanf("%d", &now_train) != EOF){ if (now_train != 0){ train[tmp] = now_train; tmp++; } else { printf("%d\n", train[tmp - 1]); tmp--; train[tmp] = 0; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258433/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258433/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %train = alloca [100 x i32], align 16 %now_train = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %train) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %now_train) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %now_train) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %tmp.013 = phi i32 [ %tmp.1, %if.end ], [ 0, %entry ] %0 = load i32, ptr %now_train, align 4, !tbaa !5 %cmp1.not = icmp eq i32 %0, 0 br i1 %cmp1.not, label %if.else, label %if.then if.then: ; preds = %while.body %idxprom = sext i32 %tmp.013 to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr %train, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %tmp.013, 1 br label %if.end if.else: ; preds = %while.body %sub = add nsw i32 %tmp.013, -1 %idxprom2 = sext i32 %sub to i64 %arrayidx3 = getelementptr inbounds [100 x i32], ptr %train, i64 0, i64 %idxprom2 %1 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) store i32 0, ptr %arrayidx3, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %tmp.1 = phi i32 [ %inc, %if.then ], [ %sub, %if.else ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %now_train) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %now_train) #3 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %train) #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 s[10] = {0}, n, i = 0; while (scanf("%d", &n) != -1) { if (n == 0) printf("%d\n", s[--i]); else s[i++] = n; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258491/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258491/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %s = alloca [10 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %s) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %s, i8 0, i64 40, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not7 = icmp eq i32 %call6, -1 br i1 %cmp.not7, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %i.08 = phi i32 [ %i.1, %if.end ], [ 0, %entry ] %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp eq i32 %0, 0 br i1 %cmp1, label %if.then, label %if.else if.then: ; preds = %while.body %dec = add nsw i32 %i.08, -1 %idxprom = sext i32 %dec to i64 %arrayidx = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) br label %if.end if.else: ; preds = %while.body %inc = add nsw i32 %i.08, 1 %idxprom3 = sext i32 %i.08 to i64 %arrayidx4 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 %idxprom3 store i32 %0, ptr %arrayidx4, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %i.1 = phi i32 [ %dec, %if.then ], [ %inc, %if.else ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 40, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int R[100]; int in[100]; int n, j, m, l, i; m =0; l =0; for (i=0; i<100; i++){ R[i] = 0; } i=0; while ((scanf("%d", &in[i]))!=EOF){ i++; if (i==99) break; } R[0] = in[0]; for (int k=0; k<i; k++){ if (in[k] == 0) { for ( j=0; j<100; j++){ if (R[j] == 0) break; } printf("%d\n", R[j-1]); R[j-1] = 0; }else{ for (j=0; j<100; j++){ if (R[j] == 0) break; } R[j] = in[k]; } if (R[0] == 0) break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258534/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258534/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %R = alloca [100 x i32], align 16 %in = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %R) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %in) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %R, i8 0, i64 400, i1 false), !tbaa !5 br label %while.cond while.cond: ; preds = %entry, %while.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %while.body ] %arrayidx2 = getelementptr inbounds [100 x i32], ptr %in, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2) %cmp3.not = icmp eq i32 %call, -1 br i1 %cmp3.not, label %while.end, label %while.body while.body: ; preds = %while.cond %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp5 = icmp eq i64 %indvars.iv.next, 99 br i1 %cmp5, label %while.end.thread, label %while.cond, !llvm.loop !9 while.end.thread: ; preds = %while.body %0 = load i32, ptr %in, align 16, !tbaa !5 store i32 %0, ptr %R, align 16, !tbaa !5 br label %for.body10.preheader while.end: ; preds = %while.cond %1 = load i32, ptr %in, align 16, !tbaa !5 store i32 %1, ptr %R, align 16, !tbaa !5 %2 = and i64 %indvars.iv, 4294967295 %cmp982.not = icmp eq i64 %2, 0 br i1 %cmp982.not, label %cleanup, label %for.body10.preheader for.body10.preheader: ; preds = %while.end.thread, %while.end %i.299 = phi i64 [ 99, %while.end.thread ], [ %indvars.iv, %while.end ] %wide.trip.count = and i64 %i.299, 4294967295 br label %for.body10 for.body10: ; preds = %if.end47, %for.body10.preheader %indvars.iv93 = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next94, %if.end47 ] %arrayidx12 = getelementptr inbounds [100 x i32], ptr %in, i64 0, i64 %indvars.iv93 %3 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp eq i32 %3, 0 br i1 %cmp13, label %for.body17, label %for.body34 for.body17: ; preds = %for.body10, %for.inc23.4 %indvars.iv89 = phi i64 [ %indvars.iv.next90.4, %for.inc23.4 ], [ 0, %for.body10 ] %arrayidx19 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv89 %4 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp20 = icmp eq i32 %4, 0 br i1 %cmp20, label %for.end25, label %for.inc23 for.inc23: ; preds = %for.body17 %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %arrayidx19.1 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next90 %5 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5 %cmp20.1 = icmp eq i32 %5, 0 br i1 %cmp20.1, label %for.end25, label %for.inc23.1 for.inc23.1: ; preds = %for.inc23 %indvars.iv.next90.1 = add nuw nsw i64 %indvars.iv89, 2 %arrayidx19.2 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next90.1 %6 = load i32, ptr %arrayidx19.2, align 4, !tbaa !5 %cmp20.2 = icmp eq i32 %6, 0 br i1 %cmp20.2, label %for.end25, label %for.inc23.2 for.inc23.2: ; preds = %for.inc23.1 %indvars.iv.next90.2 = add nuw nsw i64 %indvars.iv89, 3 %arrayidx19.3 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next90.2 %7 = load i32, ptr %arrayidx19.3, align 4, !tbaa !5 %cmp20.3 = icmp eq i32 %7, 0 br i1 %cmp20.3, label %for.end25, label %for.inc23.3 for.inc23.3: ; preds = %for.inc23.2 %indvars.iv.next90.3 = add nuw nsw i64 %indvars.iv89, 4 %arrayidx19.4 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next90.3 %8 = load i32, ptr %arrayidx19.4, align 4, !tbaa !5 %cmp20.4 = icmp eq i32 %8, 0 br i1 %cmp20.4, label %for.end25, label %for.inc23.4 for.inc23.4: ; preds = %for.inc23.3 %indvars.iv.next90.4 = add nuw nsw i64 %indvars.iv89, 5 %exitcond92.not.4 = icmp eq i64 %indvars.iv.next90.4, 100 br i1 %exitcond92.not.4, label %for.end25, label %for.body17, !llvm.loop !11 for.end25: ; preds = %for.inc23.4, %for.inc23.3, %for.inc23.2, %for.inc23.1, %for.inc23, %for.body17 %j.0.lcssa = phi i64 [ %indvars.iv89, %for.body17 ], [ %indvars.iv.next90, %for.inc23 ], [ %indvars.iv.next90.1, %for.inc23.1 ], [ %indvars.iv.next90.2, %for.inc23.2 ], [ %indvars.iv.next90.3, %for.inc23.3 ], [ 100, %for.inc23.4 ] %sub = shl i64 %j.0.lcssa, 32 %sext = add i64 %sub, -4294967296 %idxprom26 = ashr exact i64 %sext, 32 %arrayidx27 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %idxprom26 %9 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) store i32 0, ptr %arrayidx27, align 4, !tbaa !5 br label %if.end47 for.body34: ; preds = %for.body10, %for.inc40.4 %indvars.iv86 = phi i64 [ %indvars.iv.next87.4, %for.inc40.4 ], [ 0, %for.body10 ] %arrayidx36 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv86 %10 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %cmp37 = icmp eq i32 %10, 0 br i1 %cmp37, label %for.end42, label %for.inc40 for.inc40: ; preds = %for.body34 %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1 %arrayidx36.1 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next87 %11 = load i32, ptr %arrayidx36.1, align 4, !tbaa !5 %cmp37.1 = icmp eq i32 %11, 0 br i1 %cmp37.1, label %for.end42, label %for.inc40.1 for.inc40.1: ; preds = %for.inc40 %indvars.iv.next87.1 = add nuw nsw i64 %indvars.iv86, 2 %arrayidx36.2 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next87.1 %12 = load i32, ptr %arrayidx36.2, align 4, !tbaa !5 %cmp37.2 = icmp eq i32 %12, 0 br i1 %cmp37.2, label %for.end42, label %for.inc40.2 for.inc40.2: ; preds = %for.inc40.1 %indvars.iv.next87.2 = add nuw nsw i64 %indvars.iv86, 3 %arrayidx36.3 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next87.2 %13 = load i32, ptr %arrayidx36.3, align 4, !tbaa !5 %cmp37.3 = icmp eq i32 %13, 0 br i1 %cmp37.3, label %for.end42, label %for.inc40.3 for.inc40.3: ; preds = %for.inc40.2 %indvars.iv.next87.3 = add nuw nsw i64 %indvars.iv86, 4 %arrayidx36.4 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv.next87.3 %14 = load i32, ptr %arrayidx36.4, align 4, !tbaa !5 %cmp37.4 = icmp eq i32 %14, 0 br i1 %cmp37.4, label %for.end42, label %for.inc40.4 for.inc40.4: ; preds = %for.inc40.3 %indvars.iv.next87.4 = add nuw nsw i64 %indvars.iv86, 5 %exitcond.not.4 = icmp eq i64 %indvars.iv.next87.4, 100 br i1 %exitcond.not.4, label %for.end42, label %for.body34, !llvm.loop !12 for.end42: ; preds = %for.inc40.4, %for.inc40.3, %for.inc40.2, %for.inc40.1, %for.inc40, %for.body34 %j.1.lcssa = phi i64 [ %indvars.iv86, %for.body34 ], [ %indvars.iv.next87, %for.inc40 ], [ %indvars.iv.next87.1, %for.inc40.1 ], [ %indvars.iv.next87.2, %for.inc40.2 ], [ %indvars.iv.next87.3, %for.inc40.3 ], [ 100, %for.inc40.4 ] %idxprom45 = and i64 %j.1.lcssa, 4294967295 %arrayidx46 = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %idxprom45 store i32 %3, ptr %arrayidx46, align 4, !tbaa !5 br label %if.end47 if.end47: ; preds = %for.end42, %for.end25 %15 = load i32, ptr %R, align 16, !tbaa !5 %cmp49 = icmp eq i32 %15, 0 %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %exitcond96.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count %or.cond = select i1 %cmp49, i1 true, i1 %exitcond96.not br i1 %or.cond, label %cleanup, label %for.body10, !llvm.loop !13 cleanup: ; preds = %if.end47, %while.end call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %in) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %R) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #define MAXLEN 1024 #define MIN 3 #define MAX 6 int main(int argc, char *argv[]){ int n, f=1; char buf[MAXLEN]; n=0; while((buf[n]=getchar())!=EOF){ if(buf[n]==' ' || buf[n]==',' || buf[n]=='.'){ if(n>=MIN && n<=MAX){ if(!f) printf(" "); else f=0; buf[n]='\0', printf("%s",buf); } n=0; } else n++; } puts(""); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258585/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258585/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %buf = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %buf) #4 br label %while.cond.outer while.cond.outer: ; preds = %if.end, %entry %tobool.not = phi i1 [ true, %if.end ], [ false, %entry ] br label %while.cond while.cond: ; preds = %while.cond.backedge, %while.cond.outer %n.0 = phi i32 [ 0, %while.cond.outer ], [ %n.0.be, %while.cond.backedge ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call i32 @getc(ptr noundef %0) %conv = trunc i32 %call.i to i8 %idxprom = sext i32 %n.0 to i64 %arrayidx = getelementptr inbounds [1024 x i8], ptr %buf, i64 0, i64 %idxprom store i8 %conv, ptr %arrayidx, align 1, !tbaa !9 %sext = shl i32 %call.i, 24 switch i32 %sext, label %if.else30 [ i32 -16777216, label %while.end i32 536870912, label %if.then i32 738197504, label %if.then i32 771751936, label %if.then ] if.then: ; preds = %while.cond, %while.cond, %while.cond %1 = add i32 %n.0, -3 %or.cond = icmp ult i32 %1, 4 br i1 %or.cond, label %if.then23, label %while.cond.backedge while.cond.backedge: ; preds = %if.then, %if.else30 %n.0.be = phi i32 [ %inc, %if.else30 ], [ 0, %if.then ] br label %while.cond, !llvm.loop !10 if.then23: ; preds = %if.then %arrayidx.le = getelementptr inbounds [1024 x i8], ptr %buf, i64 0, i64 %idxprom br i1 %tobool.not, label %if.then24, label %if.end if.then24: ; preds = %if.then23 %putchar40 = call i32 @putchar(i32 32) br label %if.end if.end: ; preds = %if.then23, %if.then24 store i8 0, ptr %arrayidx.le, align 1, !tbaa !9 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %buf) br label %while.cond.outer, !llvm.loop !10 if.else30: ; preds = %while.cond %inc = add nsw i32 %n.0, 1 br label %while.cond.backedge while.end: ; preds = %while.cond %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %buf) #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 @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 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ll long long #define rep(i,l,r)for(ll i=(l);i<(r);i++) typedef struct tyouten{ll id,x,y;}V; int xsort(const void*a,const void*b){ ll p=(*(V*)a).x,q=(*(V*)b).x; return p<q?-1:p>q?1:0; } int ysort(const void*a,const void*b){ ll p=(*(V*)a).y,q=(*(V*)b).y; return p<q?-1:p>q?1:0; } //辺の情報を個別に持つタイプ typedef struct edge{ll s,g,c;}E; typedef struct graph{ ll vcnt,ecnt; E e[200010];//適宜変える ll id[100010];//適宜変える }G; int csort(const void*a,const void*b){ ll p=(*(E*)a).c,q=(*(E*)b).c; return p<q?-1:p>q?1:0; } V v[100010]; G g; void readgraph(){ ll n; scanf("%lld",&n); rep(i,0,n){ ll x,y; scanf("%lld%lld",&x,&y); v[i].id=i; v[i].x=x; v[i].y=y; } qsort(v,n,sizeof(V),xsort); rep(i,0,n-1){ g.e[i].s=v[i].id; g.e[i].g=v[i+1].id; g.e[i].c=v[i+1].x-v[i].x; } qsort(v,n,sizeof(V),ysort); rep(i,0,n-1){ g.e[n-1+i].s=v[i].id; g.e[n-1+i].g=v[i+1].id; g.e[n-1+i].c=v[i+1].y-v[i].y; } g.vcnt=n; g.ecnt=(n-1)*2; qsort(g.e,g.ecnt,sizeof(E),csort); } //union-find int uniroot[100010],unicnt[100010]; void ufinit(int n){for(int i=0;i<n;i++){uniroot[i]=i;unicnt[i]=1;}} int root(int x){return uniroot[x]!=x?uniroot[x]=root(uniroot[x]):x;} int same(int x,int y){return root(x)==root(y);} void uni(int x,int y){if((x=root(x))==(y=root(y)))return;uniroot[x]=y;unicnt[y]+=unicnt[x];} //クラスカル法 //最小全域木を構成する辺を求める //union findが必要 //O(ElogE) ll saishou[200010]; void kurasukaru(G g){ ufinit(g.vcnt); rep(i,0,g.ecnt){ if(!same(g.e[i].s,g.e[i].g)){ uni(g.e[i].s,g.e[i].g); saishou[i]=1; } } } int main(){ readgraph(); kurasukaru(g); ll ans=0; rep(i,0,g.ecnt)if(saishou[i])ans+=g.e[i].c; printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258628/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258628/source.c" target datalayout = "e-m:e-p270: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.tyouten = type { i64, i64, i64 } %struct.graph = type { i64, i64, [200010 x %struct.edge], [100010 x i64] } %struct.edge = type { i64, i64, i64 } @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @v = dso_local global [100010 x %struct.tyouten] zeroinitializer, align 16 @g = dso_local global %struct.graph zeroinitializer, align 8 @uniroot = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @unicnt = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16 @saishou = dso_local local_unnamed_addr global [200010 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 @xsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %x = getelementptr inbounds %struct.tyouten, ptr %a, i64 0, i32 1 %0 = load i64, ptr %x, align 8, !tbaa !5 %x1 = getelementptr inbounds %struct.tyouten, ptr %b, i64 0, i32 1 %1 = load i64, ptr %x1, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp2 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp2 to i32 %cond3 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond3 } ; 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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ysort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %y = getelementptr inbounds %struct.tyouten, ptr %a, i64 0, i32 2 %0 = load i64, ptr %y, align 8, !tbaa !10 %y1 = getelementptr inbounds %struct.tyouten, ptr %b, i64 0, i32 2 %1 = load i64, ptr %y1, align 8, !tbaa !10 %cmp = icmp slt i64 %0, %1 %cmp2 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp2 to i32 %cond3 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond3 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @csort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %c = getelementptr inbounds %struct.edge, ptr %a, i64 0, i32 2 %0 = load i64, ptr %c, align 8, !tbaa !11 %c1 = getelementptr inbounds %struct.edge, ptr %b, i64 0, i32 2 %1 = load i64, ptr %c1, align 8, !tbaa !11 %cmp = icmp slt i64 %0, %1 %cmp2 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp2 to i32 %cond3 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond3 } ; Function Attrs: nofree nounwind uwtable define dso_local void @readgraph() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !13 %cmp83 = icmp sgt i64 %0, 0 br i1 %cmp83, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa82 = phi i64 [ %0, %entry ], [ %5, %for.body ] call void @qsort(ptr noundef nonnull @v, i64 noundef %.lcssa82, i64 noundef 24, ptr noundef nonnull @xsort) #9 %1 = load i64, ptr %n, align 8, !tbaa !13 %cmp885 = icmp sgt i64 %1, 1 br i1 %cmp885, label %for.body10.preheader, label %for.cond.cleanup9 for.body10.preheader: ; preds = %for.cond.cleanup %.pre = load i64, ptr @v, align 16, !tbaa !14 %.pre92 = load i64, ptr getelementptr inbounds ([100010 x %struct.tyouten], ptr @v, i64 0, i64 0, i32 1), align 8, !tbaa !5 %2 = add i64 %1, -2 br label %for.body10 for.body: ; preds = %entry, %for.body %i.084 = phi i64 [ %inc, %for.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #9 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #9 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %arrayidx = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %i.084 store i64 %i.084, ptr %arrayidx, align 8, !tbaa !14 %3 = load i64, ptr %x, align 8, !tbaa !13 %x3 = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %i.084, i32 1 store i64 %3, ptr %x3, align 8, !tbaa !5 %4 = load i64, ptr %y, align 8, !tbaa !13 %y5 = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %i.084, i32 2 store i64 %4, ptr %y5, align 8, !tbaa !10 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #9 %inc = add nuw nsw i64 %i.084, 1 %5 = load i64, ptr %n, align 8, !tbaa !13 %cmp = icmp slt i64 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15 for.cond.cleanup9: ; preds = %for.body10, %for.cond.cleanup call void @qsort(ptr noundef nonnull @v, i64 noundef %1, i64 noundef 24, ptr noundef nonnull @ysort) #9 %6 = load i64, ptr %n, align 8, !tbaa !13 %sub29 = add i64 %6, -1 %cmp3088 = icmp sgt i64 %6, 1 br i1 %cmp3088, label %for.body32.preheader, label %for.cond.cleanup31 for.body32.preheader: ; preds = %for.cond.cleanup9 %.pre93 = load i64, ptr @v, align 16, !tbaa !14 %.pre94 = load i64, ptr getelementptr inbounds ([100010 x %struct.tyouten], ptr @v, i64 0, i64 0, i32 2), align 16, !tbaa !10 br label %for.body32 for.body10: ; preds = %for.body10.preheader, %for.body10 %7 = phi i64 [ %10, %for.body10 ], [ %.pre92, %for.body10.preheader ] %8 = phi i64 [ %9, %for.body10 ], [ %.pre, %for.body10.preheader ] %i6.086 = phi i64 [ %add, %for.body10 ], [ 0, %for.body10.preheader ] %arrayidx13 = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %i6.086 store i64 %8, ptr %arrayidx13, align 8, !tbaa !17 %add = add nuw nsw i64 %i6.086, 1 %arrayidx14 = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %add %9 = load i64, ptr %arrayidx14, align 8, !tbaa !14 %g = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %i6.086, i32 1 store i64 %9, ptr %g, align 8, !tbaa !18 %x19 = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %add, i32 1 %10 = load i64, ptr %x19, align 8, !tbaa !5 %sub22 = sub nsw i64 %10, %7 %c = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %i6.086, i32 2 store i64 %sub22, ptr %c, align 8, !tbaa !11 %exitcond.not = icmp eq i64 %i6.086, %2 br i1 %exitcond.not, label %for.cond.cleanup9, label %for.body10, !llvm.loop !19 for.cond.cleanup31: ; preds = %for.body32, %for.cond.cleanup9 store i64 %6, ptr @g, align 8, !tbaa !20 %sub59 = shl i64 %6, 1 %mul = add i64 %sub59, -2 store i64 %mul, ptr getelementptr inbounds (%struct.graph, ptr @g, i64 0, i32 1), align 8, !tbaa !22 call void @qsort(ptr noundef nonnull getelementptr inbounds (%struct.graph, ptr @g, i64 0, i32 2), i64 noundef %mul, i64 noundef 24, ptr noundef nonnull @csort) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #9 ret void for.body32: ; preds = %for.body32.preheader, %for.body32 %11 = phi i64 [ %14, %for.body32 ], [ %.pre94, %for.body32.preheader ] %12 = phi i64 [ %13, %for.body32 ], [ %.pre93, %for.body32.preheader ] %i27.089 = phi i64 [ %add39, %for.body32 ], [ 0, %for.body32.preheader ] %add36 = add nsw i64 %sub29, %i27.089 %arrayidx37 = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %add36 store i64 %12, ptr %arrayidx37, align 8, !tbaa !17 %add39 = add nuw nsw i64 %i27.089, 1 %arrayidx40 = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %add39 %13 = load i64, ptr %arrayidx40, align 8, !tbaa !14 %g45 = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %add36, i32 1 store i64 %13, ptr %g45, align 8, !tbaa !18 %y48 = getelementptr inbounds [100010 x %struct.tyouten], ptr @v, i64 0, i64 %add39, i32 2 %14 = load i64, ptr %y48, align 8, !tbaa !10 %sub51 = sub nsw i64 %14, %11 %c55 = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %add36, i32 2 store i64 %sub51, ptr %c55, align 8, !tbaa !11 %exitcond91.not = icmp eq i64 %add39, %sub29 br i1 %exitcond91.not, label %for.cond.cleanup31, label %for.body32, !llvm.loop !23 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @ufinit(i32 noundef %n) local_unnamed_addr #5 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader11, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !24 %1 = getelementptr inbounds i32, ptr %0, i64 4 store <4 x i32> %step.add, ptr %1, align 16, !tbaa !24 %2 = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 16, !tbaa !24 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 16, !tbaa !24 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !26 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader11 for.body.preheader11: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry ret void for.body: ; preds = %for.body.preheader11, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader11 ] %arrayidx = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %indvars.iv %5 = trunc i64 %indvars.iv to i32 store i32 %5, ptr %arrayidx, align 4, !tbaa !24 %arrayidx2 = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx2, align 4, !tbaa !24 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !29 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @root(i32 noundef %x) local_unnamed_addr #6 { entry: %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !24 %cmp.not = icmp eq i32 %0, %x br i1 %cmp.not, label %common.ret9, label %cond.true common.ret9: ; preds = %entry, %cond.true %common.ret9.op = phi i32 [ %call, %cond.true ], [ %x, %entry ] ret i32 %common.ret9.op cond.true: ; preds = %entry %call = tail call i32 @root(i32 noundef %0) store i32 %call, ptr %arrayidx, align 4, !tbaa !24 br label %common.ret9 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @same(i32 noundef %x, i32 noundef %y) local_unnamed_addr #7 { entry: %call = tail call i32 @root(i32 noundef %x) %call1 = tail call i32 @root(i32 noundef %y) %cmp = icmp eq i32 %call, %call1 %conv = zext i1 %cmp to i32 ret i32 %conv } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @uni(i32 noundef %x, i32 noundef %y) local_unnamed_addr #7 { entry: %call = tail call i32 @root(i32 noundef %x) %call1 = tail call i32 @root(i32 noundef %y) %cmp = icmp eq i32 %call, %call1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %idxprom = sext i32 %call to i64 %arrayidx = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %idxprom store i32 %call1, ptr %arrayidx, align 4, !tbaa !24 %arrayidx3 = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx3, align 4, !tbaa !24 %idxprom4 = sext i32 %call1 to i64 %arrayidx5 = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %idxprom4 %1 = load i32, ptr %arrayidx5, align 4, !tbaa !24 %add = add nsw i32 %1, %0 store i32 %add, ptr %arrayidx5, align 4, !tbaa !24 br label %return return: ; preds = %entry, %if.end ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @kurasukaru(ptr nocapture noundef readonly byval(%struct.graph) align 8 %g) local_unnamed_addr #7 { entry: %0 = load i64, ptr %g, align 8, !tbaa !20 %conv = trunc i64 %0 to i32 %cmp7.i = icmp sgt i32 %conv, 0 br i1 %cmp7.i, label %for.body.preheader.i, label %ufinit.exit for.body.preheader.i: ; preds = %entry %wide.trip.count.i = and i64 %0, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.mod.vf = and i64 %0, 7 %n.vec = sub nsw i64 %wide.trip.count.i, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %1 = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %1, align 16, !tbaa !24 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> %step.add, ptr %2, align 16, !tbaa !24 %3 = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 16, !tbaa !24 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 16, !tbaa !24 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !30 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %ufinit.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %indvars.iv.i %6 = trunc i64 %indvars.iv.i to i32 store i32 %6, ptr %arrayidx.i, align 4, !tbaa !24 %arrayidx2.i = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %indvars.iv.i store i32 1, ptr %arrayidx2.i, align 4, !tbaa !24 %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 %ufinit.exit, label %for.body.i, !llvm.loop !31 ufinit.exit: ; preds = %for.body.i, %middle.block, %entry %ecnt = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 1 %7 = load i64, ptr %ecnt, align 8, !tbaa !22 %cmp26 = icmp sgt i64 %7, 0 br i1 %cmp26, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.inc, %ufinit.exit ret void for.body: ; preds = %ufinit.exit, %for.inc %i.027 = phi i64 [ %inc, %for.inc ], [ 0, %ufinit.exit ] %arrayidx = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2, i64 %i.027 %8 = load i64, ptr %arrayidx, align 8, !tbaa !17 %conv2 = trunc i64 %8 to i32 %g5 = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2, i64 %i.027, i32 1 %9 = load i64, ptr %g5, align 8, !tbaa !18 %conv6 = trunc i64 %9 to i32 %call.i = tail call i32 @root(i32 noundef %conv2) %call1.i = tail call i32 @root(i32 noundef %conv6) %cmp.i.not = icmp eq i32 %call.i, %call1.i br i1 %cmp.i.not, label %for.inc, label %if.then if.then: ; preds = %for.body %call.i22 = tail call i32 @root(i32 noundef %conv2) %call1.i23 = tail call i32 @root(i32 noundef %conv6) %cmp.i24 = icmp eq i32 %call.i22, %call1.i23 br i1 %cmp.i24, label %uni.exit, label %if.end.i if.end.i: ; preds = %if.then %idxprom.i = sext i32 %call.i22 to i64 %arrayidx.i25 = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %idxprom.i store i32 %call1.i23, ptr %arrayidx.i25, align 4, !tbaa !24 %arrayidx3.i = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %idxprom.i %10 = load i32, ptr %arrayidx3.i, align 4, !tbaa !24 %idxprom4.i = sext i32 %call1.i23 to i64 %arrayidx5.i = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %idxprom4.i %11 = load i32, ptr %arrayidx5.i, align 4, !tbaa !24 %add.i = add nsw i32 %11, %10 store i32 %add.i, ptr %arrayidx5.i, align 4, !tbaa !24 br label %uni.exit uni.exit: ; preds = %if.then, %if.end.i %arrayidx15 = getelementptr inbounds [200010 x i64], ptr @saishou, i64 0, i64 %i.027 store i64 1, ptr %arrayidx15, align 8, !tbaa !13 br label %for.inc for.inc: ; preds = %for.body, %uni.exit %inc = add nuw nsw i64 %i.027, 1 %exitcond.not = icmp eq i64 %inc, %7 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !32 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %g = alloca %struct.graph, align 8 tail call void @readgraph() call void @llvm.lifetime.start.p0(i64 5600336, ptr nonnull %g) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(5600336) %g, ptr noundef nonnull align 8 dereferenceable(5600336) @g, i64 5600336, i1 false) %0 = load i64, ptr %g, align 8, !tbaa !20 %conv.i = trunc i64 %0 to i32 %cmp7.i.i = icmp sgt i32 %conv.i, 0 br i1 %cmp7.i.i, label %for.body.preheader.i.i, label %ufinit.exit.i for.body.preheader.i.i: ; preds = %entry %wide.trip.count.i.i = and i64 %0, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count.i.i, 8 br i1 %min.iters.check, label %for.body.i.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i.i %n.mod.vf = and i64 %0, 7 %n.vec = sub nsw i64 %wide.trip.count.i.i, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %1 = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %1, align 16, !tbaa !24 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> %step.add, ptr %2, align 16, !tbaa !24 %3 = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 16, !tbaa !24 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 16, !tbaa !24 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !33 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %ufinit.exit.i, label %for.body.i.i.preheader for.body.i.i.preheader: ; preds = %for.body.preheader.i.i, %middle.block %indvars.iv.i.i.ph = phi i64 [ 0, %for.body.preheader.i.i ], [ %n.vec, %middle.block ] br label %for.body.i.i for.body.i.i: ; preds = %for.body.i.i.preheader, %for.body.i.i %indvars.iv.i.i = phi i64 [ %indvars.iv.next.i.i, %for.body.i.i ], [ %indvars.iv.i.i.ph, %for.body.i.i.preheader ] %arrayidx.i.i = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %indvars.iv.i.i %6 = trunc i64 %indvars.iv.i.i to i32 store i32 %6, ptr %arrayidx.i.i, align 4, !tbaa !24 %arrayidx2.i.i = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %indvars.iv.i.i store i32 1, ptr %arrayidx2.i.i, align 4, !tbaa !24 %indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1 %exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i br i1 %exitcond.not.i.i, label %ufinit.exit.i, label %for.body.i.i, !llvm.loop !34 ufinit.exit.i: ; preds = %for.body.i.i, %middle.block, %entry %ecnt.i = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 1 %7 = load i64, ptr %ecnt.i, align 8, !tbaa !22 %cmp26.i = icmp sgt i64 %7, 0 br i1 %cmp26.i, label %for.body.i, label %kurasukaru.exit for.body.i: ; preds = %ufinit.exit.i, %for.inc.i %i.027.i = phi i64 [ %inc.i, %for.inc.i ], [ 0, %ufinit.exit.i ] %arrayidx.i = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2, i64 %i.027.i %8 = load i64, ptr %arrayidx.i, align 8, !tbaa !17 %conv2.i = trunc i64 %8 to i32 %g5.i = getelementptr inbounds %struct.graph, ptr %g, i64 0, i32 2, i64 %i.027.i, i32 1 %9 = load i64, ptr %g5.i, align 8, !tbaa !18 %conv6.i = trunc i64 %9 to i32 %call.i.i = tail call i32 @root(i32 noundef %conv2.i) %call1.i.i = tail call i32 @root(i32 noundef %conv6.i) %cmp.i.not.i = icmp eq i32 %call.i.i, %call1.i.i br i1 %cmp.i.not.i, label %for.inc.i, label %if.then.i if.then.i: ; preds = %for.body.i %call.i22.i = tail call i32 @root(i32 noundef %conv2.i) %call1.i23.i = tail call i32 @root(i32 noundef %conv6.i) %cmp.i24.i = icmp eq i32 %call.i22.i, %call1.i23.i br i1 %cmp.i24.i, label %uni.exit.i, label %if.end.i.i if.end.i.i: ; preds = %if.then.i %idxprom.i.i = sext i32 %call.i22.i to i64 %arrayidx.i25.i = getelementptr inbounds [100010 x i32], ptr @uniroot, i64 0, i64 %idxprom.i.i store i32 %call1.i23.i, ptr %arrayidx.i25.i, align 4, !tbaa !24 %arrayidx3.i.i = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %idxprom.i.i %10 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !24 %idxprom4.i.i = sext i32 %call1.i23.i to i64 %arrayidx5.i.i = getelementptr inbounds [100010 x i32], ptr @unicnt, i64 0, i64 %idxprom4.i.i %11 = load i32, ptr %arrayidx5.i.i, align 4, !tbaa !24 %add.i.i = add nsw i32 %11, %10 store i32 %add.i.i, ptr %arrayidx5.i.i, align 4, !tbaa !24 br label %uni.exit.i uni.exit.i: ; preds = %if.end.i.i, %if.then.i %arrayidx15.i = getelementptr inbounds [200010 x i64], ptr @saishou, i64 0, i64 %i.027.i store i64 1, ptr %arrayidx15.i, align 8, !tbaa !13 br label %for.inc.i for.inc.i: ; preds = %uni.exit.i, %for.body.i %inc.i = add nuw nsw i64 %i.027.i, 1 %exitcond.not.i = icmp eq i64 %inc.i, %7 br i1 %exitcond.not.i, label %kurasukaru.exit, label %for.body.i, !llvm.loop !32 kurasukaru.exit: ; preds = %for.inc.i, %ufinit.exit.i call void @llvm.lifetime.end.p0(i64 5600336, ptr nonnull %g) %12 = load i64, ptr getelementptr inbounds (%struct.graph, ptr @g, i64 0, i32 1), align 8, !tbaa !22 %cmp6 = icmp sgt i64 %12, 0 br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %kurasukaru.exit %xtraiter = and i64 %12, 1 %13 = icmp eq i64 %12, 1 br i1 %13, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %12, -2 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %ans.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %ans.1.1, %for.inc.1 ] %i.08.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %for.inc.1 ] %ans.07.unr = phi i64 [ 0, %for.body.preheader ], [ %ans.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [200010 x i64], ptr @saishou, i64 0, i64 %i.08.unr %14 = load i64, ptr %arrayidx.epil, align 8, !tbaa !13 %tobool.not.epil = icmp eq i64 %14, 0 br i1 %tobool.not.epil, label %for.cond.cleanup, label %if.then.epil if.then.epil: ; preds = %for.body.epil %c.epil = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %i.08.unr, i32 2 %15 = load i64, ptr %c.epil, align 8, !tbaa !11 %add.epil = add nsw i64 %15, %ans.07.unr br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %kurasukaru.exit %ans.0.lcssa = phi i64 [ 0, %kurasukaru.exit ], [ %ans.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %add.epil, %if.then.epil ], [ %ans.07.unr, %for.body.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) ret i32 0 for.body: ; preds = %for.inc.1, %for.body.preheader.new %i.08 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %for.inc.1 ] %ans.07 = phi i64 [ 0, %for.body.preheader.new ], [ %ans.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [200010 x i64], ptr @saishou, i64 0, i64 %i.08 %16 = load i64, ptr %arrayidx, align 16, !tbaa !13 %tobool.not = icmp eq i64 %16, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.body %c = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %i.08, i32 2 %17 = load i64, ptr %c, align 8, !tbaa !11 %add = add nsw i64 %17, %ans.07 br label %for.inc for.inc: ; preds = %for.body, %if.then %ans.1 = phi i64 [ %add, %if.then ], [ %ans.07, %for.body ] %inc = or i64 %i.08, 1 %arrayidx.1 = getelementptr inbounds [200010 x i64], ptr @saishou, i64 0, i64 %inc %18 = load i64, ptr %arrayidx.1, align 8, !tbaa !13 %tobool.not.1 = icmp eq i64 %18, 0 br i1 %tobool.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc %c.1 = getelementptr inbounds %struct.graph, ptr @g, i64 0, i32 2, i64 %inc, i32 2 %19 = load i64, ptr %c.1, align 8, !tbaa !11 %add.1 = add nsw i64 %19, %ans.1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %ans.1.1 = phi i64 [ %add.1, %if.then.1 ], [ %ans.1, %for.inc ] %inc.1 = add nuw nsw i64 %i.08, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !35 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 8} !6 = !{!"tyouten", !7, i64 0, !7, i64 8, !7, i64 16} !7 = !{!"long long", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 16} !11 = !{!12, !7, i64 16} !12 = !{!"edge", !7, i64 0, !7, i64 8, !7, i64 16} !13 = !{!7, !7, i64 0} !14 = !{!6, !7, i64 0} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = !{!12, !7, i64 0} !18 = !{!12, !7, i64 8} !19 = distinct !{!19, !16} !20 = !{!21, !7, i64 0} !21 = !{!"graph", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 4800256} !22 = !{!21, !7, i64 8} !23 = distinct !{!23, !16} !24 = !{!25, !25, i64 0} !25 = !{!"int", !8, i64 0} !26 = distinct !{!26, !16, !27, !28} !27 = !{!"llvm.loop.isvectorized", i32 1} !28 = !{!"llvm.loop.unroll.runtime.disable"} !29 = distinct !{!29, !16, !28, !27} !30 = distinct !{!30, !16, !27, !28} !31 = distinct !{!31, !16, !28, !27} !32 = distinct !{!32, !16} !33 = distinct !{!33, !16, !27, !28} !34 = distinct !{!34, !16, !28, !27} !35 = distinct !{!35, !16}
#include <stdio.h> int main(void) { int k; scanf("%d",&k); for(int i=0;i<k;i++) { printf("ACL"); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258671/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258671/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ACL\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %k, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 for.body: ; preds = %entry, %for.body %i.05 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %inc = add nuw nsw i32 %i.05, 1 %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %for.cond.cleanup, !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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main( void ) { int a,K; scanf("%d",&K); for(a=0;a<K;a++){ printf("ACL"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258714/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258714/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ACL\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K) %0 = load i32, ptr %K, align 4, !tbaa !5 %cmp3 = icmp sgt i32 %0, 0 br i1 %cmp3, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %a.04 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %inc = add nuw nsw i32 %a.04, 1 %1 = load i32, ptr %K, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define ll long long #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define INF ((1LL<<62)-(1LL<<31)) #define max(p,q)((p)>(q)?(p):(q)) #define min(p,q)((p)<(q)?(p):(q)) #define bit(n,m)(((n)>>(m))&1) int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;} //#define MOD 998244353 #define MOD 1000000007 #define invp(a,p)pom(a,p-2,p) int n; int main(){ scanf("%d",&n); rep(i,0,n)printf("ACL"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258758/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258758/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"ACL\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #5 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #5 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @pom(i64 noundef %a, i64 noundef %n, i32 noundef %m) local_unnamed_addr #3 { entry: %conv = sext i32 %m to i64 %tobool.not16 = icmp eq i64 %n, 0 br i1 %tobool.not16, label %for.end, label %for.body for.body: ; preds = %entry, %cond.end %mul4.pn = phi i64 [ %mul4, %cond.end ], [ %a, %entry ] %x.018 = phi i64 [ %x.1, %cond.end ], [ 1, %entry ] %n.addr.017 = phi i64 [ %div, %cond.end ], [ %n, %entry ] %a.addr.019 = srem i64 %mul4.pn, %conv %and = and i64 %n.addr.017, 1 %tobool1.not = icmp eq i64 %and, 0 br i1 %tobool1.not, label %cond.end, label %cond.true cond.true: ; preds = %for.body %mul = mul nsw i64 %a.addr.019, %x.018 %rem3 = srem i64 %mul, %conv br label %cond.end cond.end: ; preds = %for.body, %cond.true %x.1 = phi i64 [ %rem3, %cond.true ], [ %x.018, %for.body ] %mul4 = mul nsw i64 %a.addr.019, %a.addr.019 %div = sdiv i64 %n.addr.017, 2 %n.addr.017.off = add i64 %n.addr.017, 1 %tobool.not = icmp ult i64 %n.addr.017.off, 3 br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %cond.end, %entry %x.0.lcssa = phi i64 [ 1, %entry ], [ %x.1, %cond.end ] ret i64 %x.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !11 %cmp5 = icmp sgt i32 %0, 0 br i1 %cmp5, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry ret i32 0 for.body: ; preds = %entry, %for.body %i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) %inc = add nuw nsw i64 %i.06, 1 %1 = load i32, ptr @n, align 4, !tbaa !11 %conv = sext i32 %1 to i64 %cmp = icmp slt i64 %inc, %conv br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { 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 #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-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 = !{!"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}
#include<stdio.h> #include <stdlib.h> int main(){ int n,a[500000],i; long long ans,m,sum=0; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d",&a[i]); sum+=a[i]; } m=ans=2*a[1]-sum; ans=llabs(ans); for(i=2;i<n;i++){ m+=2*a[i]; if(m>=0){ if(m<ans)ans=m; }else{ if(ans>0-m)ans=0-m; } } printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258822/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [500000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not47 = icmp slt i32 %0, 1 br i1 %cmp.not47, label %for.end29, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %sum.049 = phi i64 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [500000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %conv = sext i32 %1 to i64 %add = add nsw i64 %sum.049, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %arrayidx4.phi.trans.insert = getelementptr inbounds [500000 x i32], ptr %a, i64 0, i64 1 %.pre = load i32, ptr %arrayidx4.phi.trans.insert, align 4, !tbaa !5 %4 = shl nsw i32 %.pre, 1 %5 = sext i32 %4 to i64 %6 = sub nsw i64 %5, %add %7 = call i64 @llvm.abs.i64(i64 %6, i1 true) %cmp751 = icmp sgt i32 %2, 2 br i1 %cmp751, label %for.body9.preheader, label %for.end29 for.body9.preheader: ; preds = %for.end %wide.trip.count = zext i32 %2 to i64 br label %for.body9 for.body9: ; preds = %for.body9.preheader, %for.inc27 %indvars.iv58 = phi i64 [ 2, %for.body9.preheader ], [ %indvars.iv.next59, %for.inc27 ] %m.054 = phi i64 [ %6, %for.body9.preheader ], [ %add14, %for.inc27 ] %ans.053 = phi i64 [ %7, %for.body9.preheader ], [ %ans.1, %for.inc27 ] %arrayidx11 = getelementptr inbounds [500000 x i32], ptr %a, i64 0, i64 %indvars.iv58 %8 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %mul12 = shl nsw i32 %8, 1 %conv13 = sext i32 %mul12 to i64 %add14 = add nsw i64 %m.054, %conv13 %cmp15 = icmp sgt i64 %add14, -1 br i1 %cmp15, label %if.then, label %if.else if.then: ; preds = %for.body9 %spec.select = call i64 @llvm.smin.i64(i64 %add14, i64 %ans.053) br label %for.inc27 if.else: ; preds = %for.body9 %sub20 = sub nsw i64 0, %add14 %spec.select46 = call i64 @llvm.smin.i64(i64 %ans.053, i64 %sub20) br label %for.inc27 for.inc27: ; preds = %if.else, %if.then %ans.1 = phi i64 [ %spec.select, %if.then ], [ %spec.select46, %if.else ] %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count br i1 %exitcond.not, label %for.end29, label %for.body9, !llvm.loop !11 for.end29: ; preds = %for.inc27, %entry, %for.end %ans.0.lcssa = phi i64 [ %7, %for.end ], [ 0, %entry ], [ %ans.1, %for.inc27 ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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}
#include <stdio.h> int main(void){ int n, i, hour, minute; double sub; scanf("%d",&n); for(i = 0;i < n;i++){ scanf("%d %*c %d",&hour,&minute); sub = (hour + minute / 60.0) * 30.0 - minute * 6.0; if(sub < 0) sub *= -1; if(360 - sub < sub) sub = 360 - sub; if(0 <= sub && sub < 30) printf("alert\n"); else if(90 <= sub && sub <= 180) printf("safe\n"); else printf("warning\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258873/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258873/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %*c %d\00", align 1 @str = private unnamed_addr constant [8 x i8] c"warning\00", align 1 @str.5 = private unnamed_addr constant [5 x i8] c"safe\00", align 1 @str.6 = private unnamed_addr constant [6 x i8] c"alert\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %hour = alloca i32, align 4 %minute = 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 %hour) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %minute) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp42 = icmp sgt i32 %0, 0 br i1 %cmp42, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.043 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %hour, ptr noundef nonnull %minute) %1 = load i32, ptr %hour, align 4, !tbaa !5 %conv = sitofp i32 %1 to double %2 = load i32, ptr %minute, align 4, !tbaa !5 %conv2 = sitofp i32 %2 to double %div = fdiv double %conv2, 6.000000e+01 %add = fadd double %div, %conv %neg = fmul double %conv2, -6.000000e+00 %3 = call double @llvm.fmuladd.f64(double %add, double 3.000000e+01, double %neg) %cmp5 = fcmp olt double %3, 0.000000e+00 %mul = fneg double %3 %sub.0 = select i1 %cmp5, double %mul, double %3 %sub7 = fsub double 3.600000e+02, %sub.0 %cmp8 = fcmp olt double %sub7, %sub.0 %sub.1 = select i1 %cmp8, double %sub7, double %sub.0 %cmp13 = fcmp oge double %sub.1, 0.000000e+00 %cmp15 = fcmp olt double %sub.1, 3.000000e+01 %or.cond = and i1 %cmp13, %cmp15 %cmp19 = fcmp oge double %sub.1, 9.000000e+01 %cmp22 = fcmp ole double %sub.1, 1.800000e+02 %or.cond30 = and i1 %cmp19, %cmp22 %str.5.str = select i1 %or.cond30, ptr @str.5, ptr @str %str.6.sink = select i1 %or.cond, ptr @str.6, ptr %str.5.str %puts41 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) %inc = add nuw nsw i32 %i.043, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %minute) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hour) #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 speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { int n,i,j,k,p,q,check,e; int ind[1001]={0}; int po[1001]={0}; while(scanf("%d",&n)) { if(n==0) break; k = 0; for(i=0;i<n;i++) { check = 0; scanf("%d %d %d",&e,&p,&q); for(j=0;j<k;j++) { if(ind[j]==e) { po[j]+=p*q; check = 1; break; } } if(check==0) { ind[k] = e; po[k] = p*q; k++; } } check = 0; for(i=0;i<k;i++) { if(po[i]>=1000000) { printf("%d\n",ind[i]); check = 1; } } if(check==0) printf("NA\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258923/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258923/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%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 [3 x i8] c"NA\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %p = alloca i32, align 4 %q = alloca i32, align 4 %e = alloca i32, align 4 %ind = alloca [1001 x i32], align 16 %po = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %ind) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %ind, i8 0, i64 4004, i1 false) call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %po) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %po, i8 0, i64 4004, i1 false) %call63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool64 = icmp eq i32 %call63, 0 %0 = load i32, ptr %n, align 4 %cmp65 = icmp eq i32 %0, 0 %or.cond66 = select i1 %tobool64, i1 true, i1 %cmp65 br i1 %or.cond66, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %if.end40 %1 = phi i32 [ %11, %if.end40 ], [ %0, %entry ] %cmp156 = icmp sgt i32 %1, 0 br i1 %cmp156, label %for.body, label %if.then38 for.cond23.preheader: ; preds = %for.inc20 %cmp2459 = icmp sgt i32 %k.1, 0 br i1 %cmp2459, label %for.body25.preheader, label %if.then38 for.body25.preheader: ; preds = %for.cond23.preheader %wide.trip.count72 = zext i32 %k.1 to i64 br label %for.body25 for.body: ; preds = %for.cond.preheader, %for.inc20 %k.058 = phi i32 [ %k.1, %for.inc20 ], [ 0, %for.cond.preheader ] %i.057 = phi i32 [ %inc21, %for.inc20 ], [ 0, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e, ptr noundef nonnull %p, ptr noundef nonnull %q) %cmp4.not54 = icmp sgt i32 %k.058, 0 %.pre = load i32, ptr %e, align 4, !tbaa !5 br i1 %cmp4.not54, label %for.body5.lr.ph, label %if.then12 for.body5.lr.ph: ; preds = %for.body %wide.trip.count = zext i32 %k.058 to i64 br label %for.body5 for.cond3: ; preds = %for.body5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %if.then12, label %for.body5, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.cond3 %indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.cond3 ] %arrayidx = getelementptr inbounds [1001 x i32], ptr %ind, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp6 = icmp eq i32 %2, %.pre br i1 %cmp6, label %if.then7, label %for.cond3 if.then7: ; preds = %for.body5 %3 = load i32, ptr %p, align 4, !tbaa !5 %4 = load i32, ptr %q, align 4, !tbaa !5 %mul = mul nsw i32 %4, %3 %arrayidx9 = getelementptr inbounds [1001 x i32], ptr %po, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %add = add nsw i32 %5, %mul store i32 %add, ptr %arrayidx9, align 4, !tbaa !5 br label %for.inc20 if.then12: ; preds = %for.cond3, %for.body %idxprom13 = sext i32 %k.058 to i64 %arrayidx14 = getelementptr inbounds [1001 x i32], ptr %ind, i64 0, i64 %idxprom13 store i32 %.pre, ptr %arrayidx14, align 4, !tbaa !5 %6 = load i32, ptr %p, align 4, !tbaa !5 %7 = load i32, ptr %q, align 4, !tbaa !5 %mul15 = mul nsw i32 %7, %6 %arrayidx17 = getelementptr inbounds [1001 x i32], ptr %po, i64 0, i64 %idxprom13 store i32 %mul15, ptr %arrayidx17, align 4, !tbaa !5 %inc18 = add nsw i32 %k.058, 1 br label %for.inc20 for.inc20: ; preds = %if.then7, %if.then12 %k.1 = phi i32 [ %inc18, %if.then12 ], [ %k.058, %if.then7 ] %inc21 = add nuw nsw i32 %i.057, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc21, %8 br i1 %cmp1, label %for.body, label %for.cond23.preheader, !llvm.loop !11 for.body25: ; preds = %for.body25.preheader, %for.inc34 %indvars.iv69 = phi i64 [ 0, %for.body25.preheader ], [ %indvars.iv.next70, %for.inc34 ] %check.161 = phi i32 [ 0, %for.body25.preheader ], [ %check.2, %for.inc34 ] %arrayidx27 = getelementptr inbounds [1001 x i32], ptr %po, i64 0, i64 %indvars.iv69 %9 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %cmp28 = icmp sgt i32 %9, 999999 br i1 %cmp28, label %if.then29, label %for.inc34 if.then29: ; preds = %for.body25 %arrayidx31 = getelementptr inbounds [1001 x i32], ptr %ind, i64 0, i64 %indvars.iv69 %10 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) br label %for.inc34 for.inc34: ; preds = %for.body25, %if.then29 %check.2 = phi i32 [ 1, %if.then29 ], [ %check.161, %for.body25 ] %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1 %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72 br i1 %exitcond73.not, label %for.end36, label %for.body25, !llvm.loop !12 for.end36: ; preds = %for.inc34 %cmp37 = icmp eq i32 %check.2, 0 br i1 %cmp37, label %if.then38, label %if.end40 if.then38: ; preds = %for.cond.preheader, %for.cond23.preheader, %for.end36 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end40 if.end40: ; preds = %if.then38, %for.end36 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %tobool = icmp eq i32 %call, 0 %11 = load i32, ptr %n, align 4 %cmp = icmp eq i32 %11, 0 %or.cond = select i1 %tobool, i1 true, i1 %cmp br i1 %or.cond, label %while.end, label %for.cond.preheader, !llvm.loop !13 while.end: ; preds = %if.end40, %entry call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %po) #5 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %ind) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define TREE_MAX 1000 typedef struct { int key; int data; int isred; int parent; int left; int right; } rbt_node_t; int rbt_node_used[52]; rbt_node_t rbt_node[52][TREE_MAX+1]; void rbt_init(void) { int i; memset(rbt_node,0,sizeof(rbt_node)); for(i=0;i<52;i++) { rbt_node_used[i]=1; rbt_node[i][0].key=-0x7fffffff; } } int rbt_search(int id,int searchfor) { int pos=rbt_node[id][0].right; while(pos>0) { if(rbt_node[id][pos].key==searchfor) { return rbt_node[id][pos].data; } else if(rbt_node[id][pos].key<searchfor) { pos=rbt_node[id][pos].right; } else { pos=rbt_node[id][pos].left; } } return -1; } int rbt_insert(int id,int key,int data) { int pos=0; int parent,p_parent,p_left,p_right; int pp_parent,pp_left,pp_right; while(1) { if(rbt_node[id][pos].key==key) { rbt_node[id][pos].data=data; return 1; } else if(rbt_node[id][pos].key<key) { if(rbt_node[id][pos].right==0)break; pos=rbt_node[id][pos].right; } else { if(rbt_node[id][pos].left==0)break; pos=rbt_node[id][pos].left; } } if(rbt_node_used[id]>TREE_MAX)return 0; rbt_node[id][rbt_node_used[id]].key=key; rbt_node[id][rbt_node_used[id]].data=data; rbt_node[id][rbt_node_used[id]].isred=1; rbt_node[id][rbt_node_used[id]].parent=pos; rbt_node[id][rbt_node_used[id]].left=0; rbt_node[id][rbt_node_used[id]].right=0; if(rbt_node[id][pos].key<key) { rbt_node[id][pos].right=rbt_node_used[id]; } else { rbt_node[id][pos].left=rbt_node_used[id]; } pos=rbt_node_used[id]; rbt_node_used[id]++; while(pos>0) { if(rbt_node[id][pos].parent==0) { rbt_node[id][pos].isred=0; break; } parent=rbt_node[id][pos].parent; p_parent=rbt_node[id][parent].parent; p_left=rbt_node[id][parent].left; p_right=rbt_node[id][parent].right; if(!rbt_node[id][parent].isred) { break; } pp_parent=rbt_node[id][p_parent].parent; pp_left=rbt_node[id][p_parent].left; pp_right=rbt_node[id][p_parent].right; if(rbt_node[id][pp_left].isred && rbt_node[id][pp_right].isred) { rbt_node[id][pp_left].isred=0; rbt_node[id][pp_right].isred=0; rbt_node[id][p_parent].isred=1; pos=p_parent; } else { if(pos==p_right && parent==pp_left) { rbt_node[id][parent].right=rbt_node[id][pos].left; rbt_node[id][parent].parent=pos; rbt_node[id][pos].left=parent; rbt_node[id][pos].parent=p_parent; rbt_node[id][p_parent].left=pos; pos=parent; } else if(pos==p_left && parent==pp_right) { rbt_node[id][parent].left=rbt_node[id][pos].right; rbt_node[id][parent].parent=pos; rbt_node[id][pos].right=parent; rbt_node[id][pos].parent=p_parent; rbt_node[id][p_parent].right=pos; pos=parent; } else if(pos==p_left && parent==pp_left) { if(rbt_node[id][pp_parent].left==p_parent) { rbt_node[id][pp_parent].left=parent; } else if(rbt_node[id][pp_parent].right==p_parent) { rbt_node[id][pp_parent].right=parent; } else { /* error! bug! */ return 0; } rbt_node[id][p_parent].left=rbt_node[id][parent].right; rbt_node[id][p_parent].parent=parent; rbt_node[id][parent].right=p_parent; rbt_node[id][parent].parent=pp_parent; rbt_node[id][p_parent].isred=1; rbt_node[id][parent].isred=0; break; } else if(pos==p_right && parent==pp_right) { if(rbt_node[id][pp_parent].left==p_parent) { rbt_node[id][pp_parent].left=parent; } else if(rbt_node[id][pp_parent].right==p_parent) { rbt_node[id][pp_parent].right=parent; } else { /* error! bug! */ return 0; } rbt_node[id][p_parent].right=rbt_node[id][parent].left; rbt_node[id][p_parent].parent=parent; rbt_node[id][parent].left=p_parent; rbt_node[id][parent].parent=pp_parent; rbt_node[id][p_parent].isred=1; rbt_node[id][parent].isred=0; break; } else { /* error! bug! */ return 0; } } } rbt_node[id][0].parent=0; rbt_node[id][0].left=0; rbt_node[id][0].isred=0; return 1; } int array_max[52]; int get_arr_no(char c) { if(c>='a' && c<='z')return c-'a'; else if(c>='A' && c<='Z')return c-'A'+26; return -1; } int get_array(char c,int index) { int arr_no; if(c>='a' && c<='z')arr_no=c-'a'; else if(c>='A' && c<='Z')arr_no=c-'A'+26; else return -1; if(index>=array_max[arr_no] || index<0)return -1; return rbt_search(arr_no,index); } int getvalue_from_str(const char* input,int start,int end) { int result,i; int kakko_nest; if(isdigit(input[start])) { result=0; for(i=start;i<end;i++) { if(!isdigit(input[i]))return -1; result=result*10+(input[i]-'0'); } } else { if(input[start+1]!='[')return -1; kakko_nest=1; for(i=start+2;i<end;i++) { if(input[i]=='[')kakko_nest++; if(input[i]==']')kakko_nest--; if(kakko_nest<=0)break; } if(kakko_nest>0)return -1; result=getvalue_from_str(input,start+2,i); result=get_array(input[start],result); } return result; } int main(void) { char input[100]; char *cptr1,*cptr2; int line=1; int bug_line=0; int atai; int arr_no,arr_index; memset(array_max,0,sizeof(array_max)); rbt_init(); while(1) { scanf("%s",input); if(strcmp(input,".")==0) { if(line>1)printf("%d\n",bug_line); else break; line=1; bug_line=0; memset(array_max,0,sizeof(array_max)); rbt_init(); continue; } if(bug_line>0)continue; cptr1=strchr(input,'='); if(cptr1==NULL) { cptr1=strchr(input,'['); cptr2=strchr(input,']'); if(cptr1==NULL || cptr2==NULL)return 1; *cptr2=0; array_max[get_arr_no(input[0])]=atoi(cptr1+1); } else { *cptr1=0; atai=getvalue_from_str(cptr1+1,0,strlen(cptr1+1)); if(atai<0)bug_line=line; else { cptr1=strchr(input,'['); cptr2=strrchr(input,']'); if(cptr1==NULL || cptr2==NULL)return 1; *cptr2=0; arr_no=get_arr_no(input[0]); arr_index=getvalue_from_str(cptr1+1,0,strlen(cptr1+1)); if(arr_index>=array_max[arr_no] || arr_index<0)bug_line=line; else rbt_insert(arr_no,arr_index,atai); } } line++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258981/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258981/source.c" target datalayout = "e-m:e-p270: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.rbt_node_t = type { i32, i32, i32, i32, i32, i32 } @rbt_node = dso_local local_unnamed_addr global [52 x [1001 x %struct.rbt_node_t]] zeroinitializer, align 16 @rbt_node_used = dso_local local_unnamed_addr global [52 x i32] zeroinitializer, align 16 @array_max = dso_local local_unnamed_addr global [52 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable define dso_local void @rbt_init() local_unnamed_addr #0 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1249248) @rbt_node, i8 0, i64 1249248, i1 false) br label %for.body for.body: ; preds = %for.body, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.body ] %arrayidx = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx, align 8, !tbaa !5 %arrayidx2 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %indvars.iv store i32 -2147483647, ptr %arrayidx2, align 16, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %indvars.iv.next store i32 1, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx2.1 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %indvars.iv.next store i32 -2147483647, ptr %arrayidx2.1, align 8, !tbaa !9 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 52 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body 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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, 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: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @rbt_search(i32 noundef %id, i32 noundef %searchfor) local_unnamed_addr #3 { entry: %idxprom = sext i32 %id to i64 %right = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 0, i32 5 %pos.040 = load i32, ptr %right, align 4, !tbaa !5 %cmp41 = icmp sgt i32 %pos.040, 0 br i1 %cmp41, label %while.body, label %cleanup while.body: ; preds = %entry, %if.else %pos.042 = phi i32 [ %pos.0, %if.else ], [ %pos.040, %entry ] %idxprom4 = zext i32 %pos.042 to i64 %arrayidx5 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom4 %0 = load i32, ptr %arrayidx5, align 8, !tbaa !9 %cmp6 = icmp eq i32 %0, %searchfor br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %while.body %data = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom4, i32 1 %1 = load i32, ptr %data, align 4, !tbaa !13 br label %cleanup if.else: ; preds = %while.body %cmp16 = icmp slt i32 %0, %searchfor %right22 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom4, i32 5 %left = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom4, i32 4 %pos.1.in = select i1 %cmp16, ptr %right22, ptr %left %pos.0 = load i32, ptr %pos.1.in, align 4, !tbaa !5 %cmp = icmp sgt i32 %pos.0, 0 br i1 %cmp, label %while.body, label %cleanup, !llvm.loop !14 cleanup: ; preds = %if.else, %entry, %if.then %retval.0 = phi i32 [ %1, %if.then ], [ -1, %entry ], [ -1, %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @rbt_insert(i32 noundef %id, i32 noundef %key, i32 noundef %data) local_unnamed_addr #4 { entry: %idxprom = sext i32 %id to i64 %arrayidx2625 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 0 %0 = load i32, ptr %arrayidx2625, align 8, !tbaa !9 %cmp626 = icmp eq i32 %0, %key br i1 %cmp626, label %if.then, label %if.else if.then: ; preds = %if.end41, %entry %idxprom1.lcssa = phi i64 [ 0, %entry ], [ %idxprom1, %if.end41 ] %data8 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom1.lcssa, i32 1 store i32 %data, ptr %data8, align 4, !tbaa !13 br label %cleanup if.else: ; preds = %entry, %if.end41 %1 = phi i32 [ %4, %if.end41 ], [ %0, %entry ] %arrayidx2629 = phi ptr [ %arrayidx2, %if.end41 ], [ %arrayidx2625, %entry ] %idxprom1628 = phi i64 [ %idxprom1, %if.end41 ], [ 0, %entry ] %pos.0627 = phi i32 [ %pos.1, %if.end41 ], [ 0, %entry ] %cmp14 = icmp slt i32 %1, %key br i1 %cmp14, label %if.then15, label %if.else27 if.then15: ; preds = %if.else %right = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom1628, i32 5 %2 = load i32, ptr %right, align 4, !tbaa !15 %cmp20 = icmp eq i32 %2, 0 br i1 %cmp20, label %while.end, label %if.end41 if.else27: ; preds = %if.else %left = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom1628, i32 4 %3 = load i32, ptr %left, align 8, !tbaa !16 %cmp32 = icmp eq i32 %3, 0 br i1 %cmp32, label %while.end, label %if.end41 if.end41: ; preds = %if.else27, %if.then15 %pos.1 = phi i32 [ %2, %if.then15 ], [ %3, %if.else27 ] %idxprom1 = sext i32 %pos.1 to i64 %arrayidx2 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom1 %4 = load i32, ptr %arrayidx2, align 8, !tbaa !9 %cmp = icmp eq i32 %4, %key br i1 %cmp, label %if.then, label %if.else while.end: ; preds = %if.else27, %if.then15 %arrayidx43 = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %idxprom %5 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %cmp44 = icmp sgt i32 %5, 1000 br i1 %cmp44, label %cleanup, label %if.end46 if.end46: ; preds = %while.end %idxprom51 = sext i32 %5 to i64 %arrayidx52 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom51 store i32 %key, ptr %arrayidx52, align 8, !tbaa !9 %data60 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom51, i32 1 store i32 %data, ptr %data60, align 4, !tbaa !13 %isred = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom51, i32 2 store i32 1, ptr %isred, align 8, !tbaa !17 %parent73 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom51, i32 3 store i32 %pos.0627, ptr %parent73, align 4, !tbaa !18 %left80 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom51, i32 4 store i32 0, ptr %left80, align 8, !tbaa !16 %right87 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom51, i32 5 store i32 0, ptr %right87, align 4, !tbaa !15 %6 = load i32, ptr %arrayidx2629, align 8, !tbaa !9 %cmp93 = icmp slt i32 %6, %key br i1 %cmp93, label %if.then94, label %if.else102 if.then94: ; preds = %if.end46 %right101 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom1628, i32 5 store i32 %5, ptr %right101, align 4, !tbaa !15 br label %if.end110 if.else102: ; preds = %if.end46 %left109 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom1628, i32 4 store i32 %5, ptr %left109, align 8, !tbaa !16 br label %if.end110 if.end110: ; preds = %if.else102, %if.then94 %inc = add nsw i32 %5, 1 store i32 %inc, ptr %arrayidx43, align 4, !tbaa !5 %cmp116631 = icmp sgt i32 %5, 0 br i1 %cmp116631, label %while.body117, label %while.end411 while.body117: ; preds = %if.end110, %if.end410 %pos.2632 = phi i32 [ %pos.3, %if.end410 ], [ %5, %if.end110 ] %idxprom120 = zext i32 %pos.2632 to i64 %parent122 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom120, i32 3 %7 = load i32, ptr %parent122, align 4, !tbaa !18 %cmp123 = icmp eq i32 %7, 0 br i1 %cmp123, label %if.then124, label %if.end130 if.then124: ; preds = %while.body117 %isred129 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom120, i32 2 br label %while.end411.sink.split if.end130: ; preds = %while.body117 %idxprom138 = sext i32 %7 to i64 %parent140 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom138, i32 3 %8 = load i32, ptr %parent140, align 4, !tbaa !18 %left145 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom138, i32 4 %9 = load i32, ptr %left145, align 8, !tbaa !16 %right150 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom138, i32 5 %10 = load i32, ptr %right150, align 4, !tbaa !15 %isred155 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom138, i32 2 %11 = load i32, ptr %isred155, align 8, !tbaa !17 %tobool.not = icmp eq i32 %11, 0 br i1 %tobool.not, label %while.end411, label %if.end157 if.end157: ; preds = %if.end130 %idxprom160 = sext i32 %8 to i64 %parent162 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom160, i32 3 %12 = load i32, ptr %parent162, align 4, !tbaa !18 %left167 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom160, i32 4 %13 = load i32, ptr %left167, align 8, !tbaa !16 %right172 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom160, i32 5 %14 = load i32, ptr %right172, align 4, !tbaa !15 %idxprom175 = sext i32 %13 to i64 %isred177 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom175, i32 2 %15 = load i32, ptr %isred177, align 8, !tbaa !17 %tobool178.not = icmp eq i32 %15, 0 br i1 %tobool178.not, label %if.else201, label %land.lhs.true land.lhs.true: ; preds = %if.end157 %idxprom181 = sext i32 %14 to i64 %isred183 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom181, i32 2 %16 = load i32, ptr %isred183, align 8, !tbaa !17 %tobool184.not = icmp eq i32 %16, 0 br i1 %tobool184.not, label %if.else201, label %if.then185 if.then185: ; preds = %land.lhs.true store i32 0, ptr %isred177, align 8, !tbaa !17 store i32 0, ptr %isred183, align 8, !tbaa !17 %isred200 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom160, i32 2 store i32 1, ptr %isred200, align 8, !tbaa !17 br label %if.end410 if.else201: ; preds = %land.lhs.true, %if.end157 %cmp202 = icmp eq i32 %pos.2632, %10 %cmp204 = icmp eq i32 %7, %13 %or.cond = and i1 %cmp202, %cmp204 br i1 %or.cond, label %if.then205, label %if.else236 if.then205: ; preds = %if.else201 %left210 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom120, i32 4 %17 = load i32, ptr %left210, align 8, !tbaa !16 store i32 %17, ptr %right150, align 4, !tbaa !15 store i32 %pos.2632, ptr %parent140, align 4, !tbaa !18 store i32 %7, ptr %left210, align 8, !tbaa !16 store i32 %8, ptr %parent122, align 4, !tbaa !18 store i32 %pos.2632, ptr %left167, align 8, !tbaa !16 br label %if.end410 if.else236: ; preds = %if.else201 %cmp237 = icmp eq i32 %pos.2632, %9 %cmp239 = icmp eq i32 %7, %14 %or.cond612 = select i1 %cmp237, i1 %cmp239, i1 false br i1 %or.cond612, label %if.then240, label %if.else271 if.then240: ; preds = %if.else236 %right245 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom120, i32 5 %18 = load i32, ptr %right245, align 4, !tbaa !15 store i32 %18, ptr %left145, align 8, !tbaa !16 store i32 %pos.2632, ptr %parent140, align 4, !tbaa !18 store i32 %7, ptr %right245, align 4, !tbaa !15 store i32 %8, ptr %parent122, align 4, !tbaa !18 store i32 %pos.2632, ptr %right172, align 4, !tbaa !15 br label %if.end410 if.else271: ; preds = %if.else236 %or.cond613 = and i1 %cmp237, %cmp204 br i1 %or.cond613, label %if.then275, label %if.else339 if.then275: ; preds = %if.else271 %idxprom278 = sext i32 %12 to i64 %left280 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom278, i32 4 %19 = load i32, ptr %left280, align 8, !tbaa !16 %cmp281 = icmp eq i32 %19, %8 br i1 %cmp281, label %if.then282, label %if.else288 if.then282: ; preds = %if.then275 store i32 %7, ptr %left280, align 8, !tbaa !16 br label %if.end303 if.else288: ; preds = %if.then275 %right293 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom278, i32 5 %20 = load i32, ptr %right293, align 4, !tbaa !15 %cmp294 = icmp eq i32 %20, %8 br i1 %cmp294, label %if.then295, label %cleanup if.then295: ; preds = %if.else288 store i32 %7, ptr %right293, align 4, !tbaa !15 %.pre648 = load i32, ptr %right150, align 4, !tbaa !15 br label %if.end303 if.end303: ; preds = %if.then295, %if.then282 %21 = phi i32 [ %.pre648, %if.then295 ], [ %10, %if.then282 ] store i32 %21, ptr %left167, align 8, !tbaa !16 store i32 %7, ptr %parent162, align 4, !tbaa !18 store i32 %8, ptr %right150, align 4, !tbaa !15 store i32 %12, ptr %parent140, align 4, !tbaa !18 %isred333 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom160, i32 2 store i32 1, ptr %isred333, align 8, !tbaa !17 br label %while.end411.sink.split if.else339: ; preds = %if.else271 %or.cond614 = select i1 %cmp202, i1 %cmp239, i1 false br i1 %or.cond614, label %if.then343, label %cleanup if.then343: ; preds = %if.else339 %idxprom346 = sext i32 %12 to i64 %left348 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom346, i32 4 %22 = load i32, ptr %left348, align 8, !tbaa !16 %cmp349 = icmp eq i32 %22, %8 br i1 %cmp349, label %if.then350, label %if.else356 if.then350: ; preds = %if.then343 store i32 %7, ptr %left348, align 8, !tbaa !16 %.pre = load i32, ptr %left145, align 8, !tbaa !16 br label %if.end371 if.else356: ; preds = %if.then343 %right361 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom346, i32 5 %23 = load i32, ptr %right361, align 4, !tbaa !15 %cmp362 = icmp eq i32 %23, %8 br i1 %cmp362, label %if.then363, label %cleanup if.then363: ; preds = %if.else356 store i32 %7, ptr %right361, align 4, !tbaa !15 br label %if.end371 if.end371: ; preds = %if.then363, %if.then350 %24 = phi i32 [ %9, %if.then363 ], [ %.pre, %if.then350 ] store i32 %24, ptr %right172, align 4, !tbaa !15 store i32 %7, ptr %parent162, align 4, !tbaa !18 store i32 %8, ptr %left145, align 8, !tbaa !16 store i32 %12, ptr %parent140, align 4, !tbaa !18 %isred401 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 %idxprom160, i32 2 store i32 1, ptr %isred401, align 8, !tbaa !17 br label %while.end411.sink.split if.end410: ; preds = %if.then205, %if.then240, %if.then185 %pos.3 = phi i32 [ %8, %if.then185 ], [ %7, %if.then205 ], [ %7, %if.then240 ] %cmp116 = icmp sgt i32 %pos.3, 0 br i1 %cmp116, label %while.body117, label %while.end411, !llvm.loop !19 while.end411.sink.split: ; preds = %if.then124, %if.end303, %if.end371 %isred155.lcssa654.sink = phi ptr [ %isred155, %if.end371 ], [ %isred155, %if.end303 ], [ %isred129, %if.then124 ] store i32 0, ptr %isred155.lcssa654.sink, align 8, !tbaa !17 br label %while.end411 while.end411: ; preds = %if.end410, %if.end130, %while.end411.sink.split, %if.end110 %parent415 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 0, i32 3 store i32 0, ptr %parent415, align 4, !tbaa !18 %left419 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 0, i32 4 store i32 0, ptr %left419, align 8, !tbaa !16 %isred423 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom, i64 0, i32 2 store i32 0, ptr %isred423, align 8, !tbaa !17 br label %cleanup cleanup: ; preds = %if.else339, %if.else356, %if.else288, %while.end, %while.end411, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ 1, %while.end411 ], [ 0, %while.end ], [ 0, %if.else288 ], [ 0, %if.else356 ], [ 0, %if.else339 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @get_arr_no(i8 noundef signext %c) local_unnamed_addr #5 { entry: %conv = sext i8 %c to i32 %0 = add i8 %c, -97 %or.cond = icmp ult i8 %0, 26 br i1 %or.cond, label %if.then, label %if.else if.then: ; preds = %entry %sub = add nsw i32 %conv, -97 br label %return if.else: ; preds = %entry %1 = add i8 %c, -65 %or.cond17 = icmp ult i8 %1, 26 %add = add nsw i32 %conv, -39 %spec.select = select i1 %or.cond17, i32 %add, i32 -1 br label %return return: ; preds = %if.else, %if.then %retval.0 = phi i32 [ %sub, %if.then ], [ %spec.select, %if.else ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @get_array(i8 noundef signext %c, i32 noundef %index) local_unnamed_addr #3 { entry: %conv = sext i8 %c to i32 %0 = add i8 %c, -97 %or.cond = icmp ult i8 %0, 26 br i1 %or.cond, label %if.end17, label %if.else if.else: ; preds = %entry %1 = add i8 %c, -65 %or.cond24 = icmp ult i8 %1, 26 br i1 %or.cond24, label %if.end17, label %cleanup if.end17: ; preds = %if.else, %entry %.sink = phi i32 [ -97, %entry ], [ -39, %if.else ] %add = add nsw i32 %.sink, %conv %idxprom = zext i32 %add to i64 %arrayidx = getelementptr inbounds [52 x i32], ptr @array_max, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp18 = icmp sle i32 %2, %index %cmp20 = icmp slt i32 %index, 0 %or.cond25 = or i1 %cmp20, %cmp18 br i1 %or.cond25, label %cleanup, label %if.end23 if.end23: ; preds = %if.end17 %idxprom.i = sext i32 %add to i64 %right.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i, i64 0, i32 5 %pos.040.i = load i32, ptr %right.i, align 4, !tbaa !5 %cmp41.i = icmp sgt i32 %pos.040.i, 0 br i1 %cmp41.i, label %while.body.i, label %cleanup while.body.i: ; preds = %if.end23, %if.else.i %pos.042.i = phi i32 [ %pos.0.i, %if.else.i ], [ %pos.040.i, %if.end23 ] %idxprom4.i = zext i32 %pos.042.i to i64 %arrayidx5.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i, i64 %idxprom4.i %3 = load i32, ptr %arrayidx5.i, align 8, !tbaa !9 %cmp6.i = icmp eq i32 %3, %index br i1 %cmp6.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %while.body.i %data.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i, i64 %idxprom4.i, i32 1 %4 = load i32, ptr %data.i, align 4, !tbaa !13 br label %cleanup if.else.i: ; preds = %while.body.i %cmp16.i = icmp slt i32 %3, %index %right22.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i, i64 %idxprom4.i, i32 5 %left.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i, i64 %idxprom4.i, i32 4 %pos.1.in.i = select i1 %cmp16.i, ptr %right22.i, ptr %left.i %pos.0.i = load i32, ptr %pos.1.in.i, align 4, !tbaa !5 %cmp.i = icmp sgt i32 %pos.0.i, 0 br i1 %cmp.i, label %while.body.i, label %cleanup, !llvm.loop !14 cleanup: ; preds = %if.else.i, %if.then.i, %if.end23, %if.end17, %if.else %retval.0 = phi i32 [ -1, %if.else ], [ -1, %if.end17 ], [ %4, %if.then.i ], [ -1, %if.end23 ], [ -1, %if.else.i ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @getvalue_from_str(ptr nocapture noundef readonly %input, i32 noundef %start, i32 noundef %end) local_unnamed_addr #6 { entry: %call = tail call ptr @__ctype_b_loc() #12 %0 = load ptr, ptr %call, align 8, !tbaa !20 %idxprom = sext i32 %start to i64 %arrayidx = getelementptr inbounds i8, ptr %input, i64 %idxprom %1 = load i8, ptr %arrayidx, align 1, !tbaa !22 %idxprom1 = sext i8 %1 to i64 %arrayidx2 = getelementptr inbounds i16, ptr %0, i64 %idxprom1 %2 = load i16, ptr %arrayidx2, align 2, !tbaa !23 %3 = and i16 %2, 2048 %tobool.not = icmp eq i16 %3, 0 br i1 %tobool.not, label %if.else, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp95 = icmp slt i32 %start, %end br i1 %cmp95, label %for.body, label %cleanup for.body: ; preds = %for.cond.preheader, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ %idxprom, %for.cond.preheader ] %result.096 = phi i32 [ %add, %if.end ], [ 0, %for.cond.preheader ] %arrayidx7 = getelementptr inbounds i8, ptr %input, i64 %indvars.iv %4 = load i8, ptr %arrayidx7, align 1, !tbaa !22 %idxprom9 = sext i8 %4 to i64 %arrayidx10 = getelementptr inbounds i16, ptr %0, i64 %idxprom9 %5 = load i16, ptr %arrayidx10, align 2, !tbaa !23 %6 = and i16 %5, 2048 %tobool13.not = icmp eq i16 %6, 0 br i1 %tobool13.not, label %cleanup, label %if.end if.end: ; preds = %for.body %conv8 = sext i8 %4 to i32 %mul = mul nsw i32 %result.096, 10 %sub = add i32 %mul, -48 %add = add i32 %sub, %conv8 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond.not = icmp eq i32 %lftr.wideiv, %end br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !25 if.else: ; preds = %entry %add18 = add nsw i32 %start, 1 %idxprom19 = sext i32 %add18 to i64 %arrayidx20 = getelementptr inbounds i8, ptr %input, i64 %idxprom19 %7 = load i8, ptr %arrayidx20, align 1, !tbaa !22 %cmp22.not = icmp eq i8 %7, 91 br i1 %cmp22.not, label %if.end25, label %cleanup if.end25: ; preds = %if.else %add26 = add nsw i32 %start, 2 %cmp28.not99 = icmp slt i32 %add26, %end br i1 %cmp28.not99, label %for.body30.preheader, label %cleanup for.body30.preheader: ; preds = %if.end25 %8 = sext i32 %add26 to i64 br label %for.body30 for.body30: ; preds = %for.body30.preheader, %for.inc50 %indvars.iv107 = phi i64 [ %8, %for.body30.preheader ], [ %indvars.iv.next108, %for.inc50 ] %kakko_nest.0101 = phi i32 [ 1, %for.body30.preheader ], [ %kakko_nest.2, %for.inc50 ] %arrayidx32 = getelementptr inbounds i8, ptr %input, i64 %indvars.iv107 %9 = load i8, ptr %arrayidx32, align 1, !tbaa !22 %cmp34 = icmp eq i8 %9, 91 %inc37 = zext i1 %cmp34 to i32 %spec.select = add nuw nsw i32 %kakko_nest.0101, %inc37 %cmp42 = icmp eq i8 %9, 93 %dec = sext i1 %cmp42 to i32 %kakko_nest.2 = add nsw i32 %spec.select, %dec %cmp46 = icmp eq i32 %kakko_nest.2, 0 br i1 %cmp46, label %if.end56, label %for.inc50 for.inc50: ; preds = %for.body30 %indvars.iv.next108 = add nsw i64 %indvars.iv107, 1 %lftr.wideiv110 = trunc i64 %indvars.iv.next108 to i32 %exitcond111.not = icmp eq i32 %lftr.wideiv110, %end br i1 %exitcond111.not, label %cleanup, label %for.body30, !llvm.loop !26 if.end56: ; preds = %for.body30 %10 = trunc i64 %indvars.iv107 to i32 %call58 = tail call i32 @getvalue_from_str(ptr noundef nonnull %input, i32 noundef %add26, i32 noundef %10) %conv.i = sext i8 %1 to i32 %11 = add i8 %1, -97 %or.cond.i = icmp ult i8 %11, 26 br i1 %or.cond.i, label %if.end17.i, label %if.else.i if.else.i: ; preds = %if.end56 %12 = add i8 %1, -65 %or.cond24.i = icmp ult i8 %12, 26 br i1 %or.cond24.i, label %if.end17.i, label %cleanup if.end17.i: ; preds = %if.else.i, %if.end56 %.sink.i = phi i32 [ -97, %if.end56 ], [ -39, %if.else.i ] %add.i = add nsw i32 %.sink.i, %conv.i %idxprom.i = zext i32 %add.i to i64 %arrayidx.i = getelementptr inbounds [52 x i32], ptr @array_max, i64 0, i64 %idxprom.i %13 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp18.i = icmp sle i32 %13, %call58 %cmp20.i = icmp slt i32 %call58, 0 %or.cond25.i = or i1 %cmp20.i, %cmp18.i br i1 %or.cond25.i, label %cleanup, label %if.end23.i if.end23.i: ; preds = %if.end17.i %idxprom.i.i = sext i32 %add.i to i64 %right.i.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i.i, i64 0, i32 5 %pos.040.i.i = load i32, ptr %right.i.i, align 4, !tbaa !5 %cmp41.i.i = icmp sgt i32 %pos.040.i.i, 0 br i1 %cmp41.i.i, label %while.body.i.i, label %cleanup while.body.i.i: ; preds = %if.end23.i, %if.else.i.i %pos.042.i.i = phi i32 [ %pos.0.i.i, %if.else.i.i ], [ %pos.040.i.i, %if.end23.i ] %idxprom4.i.i = zext i32 %pos.042.i.i to i64 %arrayidx5.i.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i.i, i64 %idxprom4.i.i %14 = load i32, ptr %arrayidx5.i.i, align 8, !tbaa !9 %cmp6.i.i = icmp eq i32 %14, %call58 br i1 %cmp6.i.i, label %if.then.i.i, label %if.else.i.i if.then.i.i: ; preds = %while.body.i.i %data.i.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i.i, i64 %idxprom4.i.i, i32 1 %15 = load i32, ptr %data.i.i, align 4, !tbaa !13 br label %cleanup if.else.i.i: ; preds = %while.body.i.i %cmp16.i.i = icmp slt i32 %14, %call58 %right22.i.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i.i, i64 %idxprom4.i.i, i32 5 %left.i.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %idxprom.i.i, i64 %idxprom4.i.i, i32 4 %pos.1.in.i.i = select i1 %cmp16.i.i, ptr %right22.i.i, ptr %left.i.i %pos.0.i.i = load i32, ptr %pos.1.in.i.i, align 4, !tbaa !5 %cmp.i.i = icmp sgt i32 %pos.0.i.i, 0 br i1 %cmp.i.i, label %while.body.i.i, label %cleanup, !llvm.loop !14 cleanup: ; preds = %for.body, %if.end, %for.inc50, %if.else.i.i, %for.cond.preheader, %if.end25, %if.then.i.i, %if.end23.i, %if.end17.i, %if.else.i, %if.else %retval.0 = phi i32 [ -1, %if.else ], [ -1, %if.else.i ], [ -1, %if.end17.i ], [ %15, %if.then.i.i ], [ -1, %if.end23.i ], [ -1, %if.end25 ], [ 0, %for.cond.preheader ], [ -1, %if.else.i.i ], [ -1, %for.inc50 ], [ -1, %for.body ], [ %add, %if.end ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #7 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #8 { entry: %input = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %input) #13 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) @array_max, i8 0, i64 208, i1 false) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1249248) @rbt_node, i8 0, i64 1249248, i1 false) br label %for.body.i for.body.i: ; preds = %for.body.i, %entry %indvars.iv.i = phi i64 [ 0, %entry ], [ %indvars.iv.next.i.1, %for.body.i ] %arrayidx.i = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %indvars.iv.i store i32 1, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx2.i = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %indvars.iv.i store i32 -2147483647, ptr %arrayidx2.i, align 16, !tbaa !9 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %indvars.iv.next.i store i32 1, ptr %arrayidx.i.1, align 4, !tbaa !5 %arrayidx2.i.1 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %indvars.iv.next.i store i32 -2147483647, ptr %arrayidx2.i.1, align 8, !tbaa !9 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, 52 br i1 %exitcond.not.i.1, label %while.cond.outer, label %for.body.i, !llvm.loop !11 while.cond.outer: ; preds = %for.body.i, %while.cond.outer.backedge %line.0.ph = phi i32 [ %line.0.ph.be, %while.cond.outer.backedge ], [ 1, %for.body.i ] %bug_line.0.ph = phi i32 [ %bug_line.0.ph.be, %while.cond.outer.backedge ], [ 0, %for.body.i ] %cmp7 = icmp sgt i32 %bug_line.0.ph, 0 br i1 %cmp7, label %while.cond.us, label %while.cond.outer.split while.cond.us: ; preds = %while.cond.outer, %while.cond.us %call.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %lhsv.us = load i16, ptr %input, align 16 %.not.us = icmp eq i16 %lhsv.us, 46 br i1 %.not.us, label %if.then, label %while.cond.us while.cond.outer.split: ; preds = %while.cond.outer %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %lhsv = load i16, ptr %input, align 16 %.not = icmp eq i16 %lhsv, 46 br i1 %.not, label %if.then, label %if.end6 if.then: ; preds = %while.cond.us, %while.cond.outer.split %cmp3 = icmp sgt i32 %line.0.ph, 1 br i1 %cmp3, label %if.then4, label %cleanup if.then4: ; preds = %if.then %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %bug_line.0.ph) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) @array_max, i8 0, i64 208, i1 false) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1249248) @rbt_node, i8 0, i64 1249248, i1 false) br label %for.body.i94 for.body.i94: ; preds = %for.body.i94, %if.then4 %indvars.iv.i95 = phi i64 [ 0, %if.then4 ], [ %indvars.iv.next.i98.1, %for.body.i94 ] %arrayidx.i96 = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %indvars.iv.i95 store i32 1, ptr %arrayidx.i96, align 8, !tbaa !5 %arrayidx2.i97 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %indvars.iv.i95 store i32 -2147483647, ptr %arrayidx2.i97, align 16, !tbaa !9 %indvars.iv.next.i98 = or i64 %indvars.iv.i95, 1 %arrayidx.i96.1 = getelementptr inbounds [52 x i32], ptr @rbt_node_used, i64 0, i64 %indvars.iv.next.i98 store i32 1, ptr %arrayidx.i96.1, align 4, !tbaa !5 %arrayidx2.i97.1 = getelementptr inbounds [52 x [1001 x %struct.rbt_node_t]], ptr @rbt_node, i64 0, i64 %indvars.iv.next.i98 store i32 -2147483647, ptr %arrayidx2.i97.1, align 8, !tbaa !9 %indvars.iv.next.i98.1 = add nuw nsw i64 %indvars.iv.i95, 2 %exitcond.not.i99.1 = icmp eq i64 %indvars.iv.next.i98.1, 52 br i1 %exitcond.not.i99.1, label %while.cond.outer.backedge, label %for.body.i94, !llvm.loop !11 if.end6: ; preds = %while.cond.outer.split %call11 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %input, i32 noundef 61) #14 %cmp12 = icmp eq ptr %call11, null br i1 %cmp12, label %if.then13, label %if.else25 if.then13: ; preds = %if.end6 %call15 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %input, i32 noundef 91) #14 %call17 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %input, i32 noundef 93) #14 %cmp18 = icmp eq ptr %call15, null %cmp19 = icmp eq ptr %call17, null %or.cond = select i1 %cmp18, i1 true, i1 %cmp19 br i1 %or.cond, label %cleanup, label %if.end21 if.end21: ; preds = %if.then13 store i8 0, ptr %call17, align 1, !tbaa !22 %add.ptr = getelementptr inbounds i8, ptr %call15, i64 1 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %add.ptr, ptr noundef null, i32 noundef 10) #13 %conv.i = trunc i64 %call.i to i32 %0 = load i8, ptr %input, align 16, !tbaa !22 %conv.i101 = sext i8 %0 to i32 %1 = add i8 %0, -97 %or.cond.i = icmp ult i8 %1, 26 br i1 %or.cond.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %if.end21 %sub.i = add nsw i32 %conv.i101, -97 br label %get_arr_no.exit if.else.i: ; preds = %if.end21 %2 = add i8 %0, -65 %or.cond17.i = icmp ult i8 %2, 26 %add.i = add nsw i32 %conv.i101, -39 %spec.select.i = select i1 %or.cond17.i, i32 %add.i, i32 -1 br label %get_arr_no.exit get_arr_no.exit: ; preds = %if.then.i, %if.else.i %retval.0.i = phi i32 [ %sub.i, %if.then.i ], [ %spec.select.i, %if.else.i ] %idxprom = sext i32 %retval.0.i to i64 %arrayidx24 = getelementptr inbounds [52 x i32], ptr @array_max, i64 0, i64 %idxprom store i32 %conv.i, ptr %arrayidx24, align 4, !tbaa !5 br label %if.end64 if.else25: ; preds = %if.end6 store i8 0, ptr %call11, align 1, !tbaa !22 %add.ptr26 = getelementptr inbounds i8, ptr %call11, i64 1 %call28 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %add.ptr26) #14 %conv = trunc i64 %call28 to i32 %call29 = call i32 @getvalue_from_str(ptr noundef nonnull %add.ptr26, i32 noundef 0, i32 noundef %conv) %cmp30 = icmp slt i32 %call29, 0 br i1 %cmp30, label %if.end64, label %if.else33 if.else33: ; preds = %if.else25 %call35 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %input, i32 noundef 91) #14 %call37 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %input, i32 noundef 93) #14 %cmp38 = icmp eq ptr %call35, null %cmp41 = icmp eq ptr %call37, null %or.cond72 = select i1 %cmp38, i1 true, i1 %cmp41 br i1 %or.cond72, label %cleanup, label %if.end44 if.end44: ; preds = %if.else33 store i8 0, ptr %call37, align 1, !tbaa !22 %3 = load i8, ptr %input, align 16, !tbaa !22 %conv.i102 = sext i8 %3 to i32 %4 = add i8 %3, -97 %or.cond.i103 = icmp ult i8 %4, 26 br i1 %or.cond.i103, label %if.then.i109, label %if.else.i104 if.then.i109: ; preds = %if.end44 %sub.i110 = add nsw i32 %conv.i102, -97 br label %get_arr_no.exit111 if.else.i104: ; preds = %if.end44 %5 = add i8 %3, -65 %or.cond17.i105 = icmp ult i8 %5, 26 %add.i106 = add nsw i32 %conv.i102, -39 %spec.select.i107 = select i1 %or.cond17.i105, i32 %add.i106, i32 -1 br label %get_arr_no.exit111 get_arr_no.exit111: ; preds = %if.then.i109, %if.else.i104 %retval.0.i108 = phi i32 [ %sub.i110, %if.then.i109 ], [ %spec.select.i107, %if.else.i104 ] %add.ptr47 = getelementptr inbounds i8, ptr %call35, i64 1 %call49 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %add.ptr47) #14 %conv50 = trunc i64 %call49 to i32 %call51 = call i32 @getvalue_from_str(ptr noundef nonnull %add.ptr47, i32 noundef 0, i32 noundef %conv50) %idxprom52 = sext i32 %retval.0.i108 to i64 %arrayidx53 = getelementptr inbounds [52 x i32], ptr @array_max, i64 0, i64 %idxprom52 %6 = load i32, ptr %arrayidx53, align 4, !tbaa !5 %cmp54 = icmp sge i32 %call51, %6 %cmp57 = icmp slt i32 %call51, 0 %or.cond73 = or i1 %cmp57, %cmp54 br i1 %or.cond73, label %if.end64, label %if.else60 if.else60: ; preds = %get_arr_no.exit111 %call61 = call i32 @rbt_insert(i32 noundef %retval.0.i108, i32 noundef %call51, i32 noundef %call29), !range !27 br label %if.end64 if.end64: ; preds = %get_arr_no.exit111, %if.else25, %if.else60, %get_arr_no.exit %bug_line.1 = phi i32 [ %bug_line.0.ph, %get_arr_no.exit ], [ %bug_line.0.ph, %if.else60 ], [ %line.0.ph, %if.else25 ], [ %line.0.ph, %get_arr_no.exit111 ] %inc = add i32 %line.0.ph, 1 br label %while.cond.outer.backedge while.cond.outer.backedge: ; preds = %for.body.i94, %if.end64 %line.0.ph.be = phi i32 [ %inc, %if.end64 ], [ 1, %for.body.i94 ] %bug_line.0.ph.be = phi i32 [ %bug_line.1, %if.end64 ], [ 0, %for.body.i94 ] br label %while.cond.outer cleanup: ; preds = %if.then, %if.else33, %if.then13 %retval.0 = phi i32 [ 1, %if.then13 ], [ 1, %if.else33 ], [ 0, %if.then ] call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %input) #13 ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare ptr @strchr(ptr noundef, i32 noundef) local_unnamed_addr #10 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #10 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #10 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #11 attributes #0 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { 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 #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 = { nounwind willreturn memory(none) } attributes #13 = { nounwind } attributes #14 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!10, !6, i64 4} !14 = distinct !{!14, !12} !15 = !{!10, !6, i64 20} !16 = !{!10, !6, i64 16} !17 = !{!10, !6, i64 8} !18 = !{!10, !6, i64 12} !19 = distinct !{!19, !12} !20 = !{!21, !21, i64 0} !21 = !{!"any pointer", !7, i64 0} !22 = !{!7, !7, i64 0} !23 = !{!24, !24, i64 0} !24 = !{!"short", !7, i64 0} !25 = distinct !{!25, !12} !26 = distinct !{!26, !12} !27 = !{i32 0, i32 2}
#include <stdio.h> int main(void){ int d,h,i; while(EOF!=scanf("%d",&d)){ h=0; for(i=0;i<600/d;i++){ h += d*i*d*i; } printf("%d\n", h*d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259023/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259023/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp.not15 = icmp eq i32 %call14, -1 br i1 %cmp.not15, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %0 = load i32, ptr %d, align 4, !tbaa !5 %div = sdiv i32 600, %0 %cmp110 = icmp sgt i32 %div, 0 br i1 %cmp110, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %for.cond.preheader %1 = add nsw i32 %div, -1 %2 = zext i32 %1 to i33 %3 = add nsw i32 %div, -2 %4 = zext i32 %3 to i33 %5 = mul i33 %2, %4 %6 = add nsw i32 %div, -3 %7 = zext i32 %6 to i33 %8 = mul i33 %5, %7 %9 = lshr i33 %8, 1 %10 = trunc i33 %9 to i32 %11 = mul i32 %10, 1431655766 %12 = add i32 %1, %11 %13 = lshr i33 %5, 1 %14 = trunc i33 %13 to i32 %15 = mul i32 %14, 3 %16 = add i32 %12, %15 %17 = mul i32 %0, %0 %18 = mul i32 %17, %16 br label %for.end for.end: ; preds = %for.body.preheader, %for.cond.preheader %h.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %18, %for.body.preheader ] %mul4 = mul nsw i32 %0, %h.0.lcssa %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul4) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> int main () { int d, i; int area = 0; while (scanf ("%d", &d) != EOF) { area = 0; for (i = 0;i < 600;i += d) { area += d * pow (i,2); } printf ("%d\n", area); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259067/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259067/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp.not13 = icmp eq i32 %call12, -1 br i1 %cmp.not13, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %0 = load i32, ptr %d, align 4, !tbaa !5 %conv = sitofp i32 %0 to double br label %for.body for.body: ; preds = %for.cond.preheader, %for.body %area.011 = phi i32 [ 0, %for.cond.preheader ], [ %conv5, %for.body ] %i.010 = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %conv2 = sitofp i32 %i.010 to double %square = fmul double %conv2, %conv2 %conv4 = sitofp i32 %area.011 to double %1 = call double @llvm.fmuladd.f64(double %conv, double %square, double %conv4) %conv5 = fptosi double %1 to i32 %add = add nsw i32 %0, %i.010 %cmp1 = icmp slt i32 %add, 600 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv5) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { int i; printf("%d\n", 2000); for (i = 1; i <= 1000; i++) printf("%d %d %d %d\n", i, 1, i, 2); for (i = 1000; i >= 1; i--) printf("%d %d %d %d\n", i, 1, i, 2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25911/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25911/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%d %d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 2000) br label %for.body for.body: ; preds = %entry, %for.body %i.015 = phi i32 [ 1, %entry ], [ %inc, %for.body ] %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.015, i32 noundef 1, i32 noundef %i.015, i32 noundef 2) %inc = add nuw nsw i32 %i.015, 1 %exitcond.not = icmp eq i32 %inc, 1001 br i1 %exitcond.not, label %for.body4, label %for.body, !llvm.loop !5 for.body4: ; preds = %for.body, %for.body4 %i.116 = phi i32 [ %dec, %for.body4 ], [ 1000, %for.body ] %call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.116, i32 noundef 1, i32 noundef %i.116, i32 noundef 2) %dec = add nsw i32 %i.116, -1 %cmp3 = icmp ugt i32 %i.116, 1 br i1 %cmp3, label %for.body4, label %for.end7, !llvm.loop !7 for.end7: ; preds = %for.body4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"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}
#include <stdio.h> int d; int f0(int p0,int p1) { if(p1==600/d) return p0; else return f0(p0+(600-d*p1)*(600-d*p1)*d,p1+1); } int main(void) { while(scanf("%d",&d)!=EOF) printf("%d\n",f0(0,1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259168/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259168/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @d = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @f0(i32 noundef %p0, i32 noundef %p1) local_unnamed_addr #0 { entry: %0 = load i32, ptr @d, align 4, !tbaa !5 %div = sdiv i32 600, %0 %cmp10 = icmp eq i32 %div, %p1 br i1 %cmp10, label %return, label %if.else.preheader if.else.preheader: ; preds = %entry %1 = xor i32 %p1, -1 %2 = add i32 %div, %1 %3 = shl i32 %p1, 1 %4 = or i32 %3, 1 %5 = mul i32 %0, %4 %6 = add i32 %5, -1200 %7 = mul i32 %0, %6 %8 = mul i32 %0, %p1 %9 = sub i32 600, %8 %10 = mul i32 %9, %9 %11 = add i32 %7, %10 %12 = mul i32 %2, %11 %13 = zext i32 %2 to i33 %14 = add nsw i32 %div, -2 %15 = sub i32 %14, %p1 %16 = zext i32 %15 to i33 %17 = mul i33 %13, %16 %18 = add nsw i32 %div, -3 %19 = sub i32 %18, %p1 %20 = zext i32 %19 to i33 %21 = mul i33 %17, %20 %22 = lshr i33 %21, 1 %23 = trunc i33 %22 to i32 %24 = mul i32 %0, %23 %25 = mul i32 %24, 1431655766 %26 = add i32 %3, 3 %27 = mul i32 %0, %26 %28 = add i32 %27, -1200 %29 = lshr i33 %17, 1 %30 = trunc i33 %29 to i32 %31 = mul i32 %28, %30 %32 = add i32 %25, %31 %33 = mul i32 %0, %32 %34 = add i32 %12, %33 %35 = add i32 %34, %10 %36 = mul i32 %0, %35 %37 = add i32 %36, %p0 br label %return return: ; preds = %if.else.preheader, %entry %p0.tr.lcssa = phi i32 [ %p0, %entry ], [ %37, %if.else.preheader ] ret i32 %p0.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @d) %cmp.not4 = icmp eq i32 %call3, -1 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %f0.exit %0 = load i32, ptr @d, align 4, !tbaa !5 %div.i = sdiv i32 600, %0 %cmp10.i = icmp eq i32 %div.i, 1 br i1 %cmp10.i, label %f0.exit, label %if.else.preheader.i if.else.preheader.i: ; preds = %while.body %1 = add nsw i32 %div.i, -2 %2 = mul i32 %0, 3 %3 = add i32 %2, -1200 %4 = mul i32 %3, %0 %5 = sub i32 600, %0 %6 = mul i32 %5, %5 %7 = add i32 %4, %6 %8 = mul i32 %7, %1 %9 = zext i32 %1 to i33 %10 = add nsw i32 %div.i, -3 %11 = zext i32 %10 to i33 %12 = mul i33 %9, %11 %13 = add nsw i32 %div.i, -4 %14 = zext i32 %13 to i33 %15 = mul i33 %12, %14 %16 = lshr i33 %15, 1 %17 = trunc i33 %16 to i32 %18 = mul i32 %0, 1431655766 %19 = mul i32 %18, %17 %20 = mul i32 %0, 5 %21 = add i32 %20, -1200 %22 = lshr i33 %12, 1 %23 = trunc i33 %22 to i32 %24 = mul i32 %21, %23 %25 = add i32 %19, %24 %26 = mul i32 %25, %0 %27 = add i32 %8, %6 %28 = add i32 %27, %26 %29 = mul i32 %28, %0 br label %f0.exit f0.exit: ; preds = %while.body, %if.else.preheader.i %p0.tr.lcssa.i = phi i32 [ 0, %while.body ], [ %29, %if.else.preheader.i ] %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p0.tr.lcssa.i) %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 = %f0.exit, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define X_MAX 600 int main(void){ int x, sum, d; while(scanf("%d",&d)==1){ sum=0; for(x=0; x<X_MAX; x+=d) sum+=x*x*d; printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259210/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259210/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp12 = icmp eq i32 %call11, 1 br i1 %cmp12, label %for.cond.preheader, label %while.end for.cond.preheader: ; preds = %entry, %for.end %0 = load i32, ptr %d, align 4, !tbaa !5 %smax = call i32 @llvm.smax.i32(i32 %0, i32 600) %1 = add nsw i32 %smax, -1 %2 = udiv i32 %1, %0 %3 = add nuw nsw i32 %2, 1 %min.iters.check = icmp ult i32 %2, 7 br i1 %min.iters.check, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %for.cond.preheader %n.vec = and i32 %3, -8 %ind.end = mul i32 %n.vec, %0 %.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %4 = mul <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3> %5 = shl i32 %0, 2 %.splatinsert14 = insertelement <4 x i32> poison, i32 %5, i64 0 %.splat15 = shufflevector <4 x i32> %.splatinsert14, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi13 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.ind = phi <4 x i32> [ %4, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, %.splat15 %6 = mul nsw <4 x i32> %vec.ind, %vec.ind %7 = mul nsw <4 x i32> %step.add, %step.add %8 = mul nsw <4 x i32> %6, %broadcast.splat %9 = mul nsw <4 x i32> %7, %broadcast.splat %10 = add <4 x i32> %8, %vec.phi %11 = add <4 x i32> %9, %vec.phi13 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %step.add, %.splat15 %12 = icmp eq i32 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %3, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader, %middle.block %sum.010.ph = phi i32 [ 0, %for.cond.preheader ], [ %13, %middle.block ] %x.09.ph = phi i32 [ 0, %for.cond.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader, %for.body %sum.010 = phi i32 [ %add, %for.body ], [ %sum.010.ph, %for.body.preheader ] %x.09 = phi i32 [ %add3, %for.body ], [ %x.09.ph, %for.body.preheader ] %mul = mul nsw i32 %x.09, %x.09 %mul2 = mul nsw i32 %mul, %0 %add = add nsw i32 %mul2, %sum.010 %add3 = add nsw i32 %0, %x.09 %cmp1 = icmp slt i32 %add3, 600 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block %add.lcssa = phi i32 [ %13, %middle.block ], [ %add, %for.body ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp = icmp eq i32 %call, 1 br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !14 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10}
#include <stdio.h> int main() { unsigned i,d; while(-1<scanf("%d",&d)){ unsigned a=0; for(i=d;i<600;i+=d)a+=i*i*d; printf("%d\n",a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259269/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259269/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp13 = icmp sgt i32 %call12, -1 br i1 %cmp13, label %while.body, label %while.end while.body: ; preds = %entry, %for.end %0 = load i32, ptr %d, align 4, !tbaa !5 %cmp19 = icmp ult i32 %0, 600 br i1 %cmp19, label %for.body, label %for.end for.body: ; preds = %while.body, %for.body %a.011 = phi i32 [ %add, %for.body ], [ 0, %while.body ] %i.010 = phi i32 [ %add3, %for.body ], [ %0, %while.body ] %mul = mul i32 %i.010, %0 %mul2 = mul i32 %mul, %i.010 %add = add i32 %mul2, %a.011 %add3 = add i32 %i.010, %0 %cmp1 = icmp ult i32 %add3, 600 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %a.0.lcssa = phi i32 [ 0, %while.body ], [ %add, %for.body ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp = icmp sgt i32 %call, -1 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int d,s,i; while(scanf("%d",&d)!=-1){ for(s=0,i=1;i*d<600;i++){ s+=i*i*d*d*d; } printf("%d\n",s); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259319/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259319/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp.not15 = icmp eq i32 %call14, -1 br i1 %cmp.not15, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %0 = load i32, ptr %d, align 4, !tbaa !5 %cmp111 = icmp slt i32 %0, 600 br i1 %cmp111, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %i.013 = phi i32 [ %inc, %for.body ], [ 1, %for.cond.preheader ] %s.012 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %1 = mul i32 %0, %i.013 %2 = mul i32 %1, %0 %mul5 = mul i32 %2, %1 %add = add nsw i32 %mul5, %s.012 %inc = add nuw nsw i32 %i.013, 1 %mul = mul nsw i32 %0, %inc %cmp1 = icmp slt i32 %mul, 600 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %s.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { int t; scanf("%d", &t); while(t--){ int n; scanf("%d", &n); if (n % 7 == 0) printf("%d\n", n); else if (7 - (n % 7) + n % 10 < 10) printf("%d\n", n + 7 - (n % 7)); else printf("%d\n", n - (n % 7)); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25937/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25937/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %n = 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 %dec16 = add nsw i32 %0, -1 store i32 %dec16, ptr %t, align 4, !tbaa !5 %tobool.not17 = icmp eq i32 %0, 0 br i1 %tobool.not17, label %while.end, label %while.body while.body: ; preds = %entry, %if.end15 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 %rem = srem i32 %1, 7 %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %if.end15, label %if.else if.else: ; preds = %while.body %rem4 = srem i32 %1, 10 %reass.sub = sub nsw i32 %rem4, %rem %cmp5 = icmp slt i32 %reass.sub, 3 br i1 %cmp5, label %if.then6, label %if.else11 if.then6: ; preds = %if.else %add7 = add nsw i32 %1, 7 %sub9 = sub i32 %add7, %rem br label %if.end15 if.else11: ; preds = %if.else %sub13 = sub nsw i32 %1, %rem br label %if.end15 if.end15: ; preds = %while.body, %if.then6, %if.else11 %sub9.sink = phi i32 [ %sub9, %if.then6 ], [ %sub13, %if.else11 ], [ %1, %while.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub9.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end15, %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"}
#include<stdio.h> #include<stdlib.h> #include <math.h> #define M 1000000007 #define ll long long ll fact[2000003],ifact[2000003]; ll mpow(ll x,ll n){ ll ans = 1; while(n!=0){ if(n&1) ans=ans*x%M; x = x*x%M; n=n>>1; } return ans; } ll combi(ll n,ll r){ if(n==0&&r==0)return 1; if(n<r||n<0)return 0; ll tmp = ifact[r]*ifact[n-r]%M; return fact[n]*tmp%M; } int main(){ ll x,y,k,m,n; scanf("%lld %lld",&x,&y); if((2*x-y)%3!=0||(2*y-x)%3!=0||2*x<y||2*y<x){ printf("0"); return 0; } n=(2*x-y)/3; m=(2*y-x)/3; fact[0]=1; ifact[0]=1; for(ll i=0;i<2000004;i++){ fact[i+1]=fact[i]*(i+1)%M; ifact[i+1]=ifact[i]*mpow(i+1,M-2)%M; } printf("%lld\n",combi(n+m,m)%M); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259412/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259412/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ifact = dso_local local_unnamed_addr global [2000003 x i64] zeroinitializer, align 16 @fact = dso_local local_unnamed_addr global [2000003 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.2 = 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 @mpow(i64 noundef %x, i64 noundef %n) local_unnamed_addr #0 { entry: %cmp.not8 = icmp eq i64 %n, 0 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %ans.011 = phi i64 [ %ans.1, %if.end ], [ 1, %entry ] %n.addr.010 = phi i64 [ %shr, %if.end ], [ %n, %entry ] %x.addr.09 = phi i64 [ %rem2, %if.end ], [ %x, %entry ] %and = and i64 %n.addr.010, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul nsw i64 %ans.011, %x.addr.09 %rem = srem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i64 [ %rem, %if.then ], [ %ans.011, %while.body ] %mul1 = mul nsw i64 %x.addr.09, %x.addr.09 %rem2 = urem i64 %mul1, 1000000007 %shr = ashr i64 %n.addr.010, 1 %cmp.not = icmp ult i64 %n.addr.010, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1, %if.end ] ret i64 %ans.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @combi(i64 noundef %n, i64 noundef %r) local_unnamed_addr #2 { entry: %0 = or i64 %r, %n %or.cond = icmp eq i64 %0, 0 br i1 %or.cond, label %return, label %if.end if.end: ; preds = %entry %cmp2 = icmp slt i64 %n, %r %cmp3 = icmp slt i64 %n, 0 %or.cond10 = or i1 %cmp3, %cmp2 br i1 %or.cond10, label %return, label %if.end5 if.end5: ; preds = %if.end %arrayidx = getelementptr inbounds [2000003 x i64], ptr @ifact, i64 0, i64 %r %1 = load i64, ptr %arrayidx, align 8, !tbaa !7 %sub = sub nsw i64 %n, %r %arrayidx6 = getelementptr inbounds [2000003 x i64], ptr @ifact, i64 0, i64 %sub %2 = load i64, ptr %arrayidx6, align 8, !tbaa !7 %mul = mul nsw i64 %2, %1 %rem = srem i64 %mul, 1000000007 %arrayidx7 = getelementptr inbounds [2000003 x i64], ptr @fact, i64 0, i64 %n %3 = load i64, ptr %arrayidx7, align 8, !tbaa !7 %mul8 = mul nsw i64 %rem, %3 %rem9 = srem i64 %mul8, 1000000007 br label %return return: ; preds = %if.end, %entry, %if.end5 %retval.0 = phi i64 [ %rem9, %if.end5 ], [ 1, %entry ], [ 0, %if.end ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %x = alloca i64, align 8 %y = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i64, ptr %x, align 8, !tbaa !7 %mul = shl nsw i64 %0, 1 %1 = load i64, ptr %y, align 8, !tbaa !7 %sub = sub nsw i64 %mul, %1 %rem = srem i64 %sub, 3 %div = sdiv i64 %sub, 3 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %lor.lhs.false, label %if.then lor.lhs.false: ; preds = %entry %mul1 = shl nsw i64 %1, 1 %sub2 = sub nsw i64 %mul1, %0 %rem3 = srem i64 %sub2, 3 %div16 = sdiv i64 %sub2, 3 %cmp4.not = icmp ne i64 %rem3, 0 %cmp7 = icmp slt i64 %mul, %1 %or.cond = or i1 %cmp7, %cmp4.not %cmp10 = icmp slt i64 %mul1, %0 %or.cond45 = or i1 %cmp10, %or.cond br i1 %or.cond45, label %if.then, label %if.end if.then: ; preds = %lor.lhs.false, %entry %putchar = call i32 @putchar(i32 48) br label %cleanup if.end: ; preds = %lor.lhs.false store i64 1, ptr @fact, align 16, !tbaa !7 store i64 1, ptr @ifact, align 16, !tbaa !7 br label %for.body for.cond.cleanup: ; preds = %mpow.exit %add29 = add nsw i64 %div16, %div %2 = or i64 %add29, %div16 %or.cond.i = icmp eq i64 %2, 0 br i1 %or.cond.i, label %combi.exit, label %if.end.i if.end.i: ; preds = %for.cond.cleanup %cmp2.i = icmp slt i64 %sub, -2 %cmp3.i = icmp slt i64 %add29, 0 %or.cond10.i = or i1 %cmp2.i, %cmp3.i br i1 %or.cond10.i, label %combi.exit, label %if.end5.i if.end5.i: ; preds = %if.end.i %arrayidx.i = getelementptr inbounds [2000003 x i64], ptr @ifact, i64 0, i64 %div16 %3 = load i64, ptr %arrayidx.i, align 8, !tbaa !7 %arrayidx6.i = getelementptr inbounds [2000003 x i64], ptr @ifact, i64 0, i64 %div %4 = load i64, ptr %arrayidx6.i, align 8, !tbaa !7 %mul.i = mul nsw i64 %4, %3 %rem.i = srem i64 %mul.i, 1000000007 %arrayidx7.i = getelementptr inbounds [2000003 x i64], ptr @fact, i64 0, i64 %add29 %5 = load i64, ptr %arrayidx7.i, align 8, !tbaa !7 %mul8.i = mul nsw i64 %rem.i, %5 %rem9.i = srem i64 %mul8.i, 1000000007 br label %combi.exit combi.exit: ; preds = %for.cond.cleanup, %if.end.i, %if.end5.i %retval.0.i = phi i64 [ %rem9.i, %if.end5.i ], [ 1, %for.cond.cleanup ], [ 0, %if.end.i ] %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %retval.0.i) br label %cleanup for.body: ; preds = %if.end, %mpow.exit %6 = phi i64 [ 1, %if.end ], [ %rem26, %mpow.exit ] %7 = phi i64 [ 1, %if.end ], [ %rem19, %mpow.exit ] %i.049 = phi i64 [ 0, %if.end ], [ %add, %mpow.exit ] %add = add nuw nsw i64 %i.049, 1 %mul18 = mul nsw i64 %7, %add %rem19 = srem i64 %mul18, 1000000007 %arrayidx21 = getelementptr inbounds [2000003 x i64], ptr @fact, i64 0, i64 %add store i64 %rem19, ptr %arrayidx21, align 8, !tbaa !7 br label %while.body.i while.body.i: ; preds = %if.end.i48, %for.body %ans.011.i = phi i64 [ %ans.1.i, %if.end.i48 ], [ 1, %for.body ] %n.addr.010.i = phi i64 [ %shr.i, %if.end.i48 ], [ 1000000005, %for.body ] %x.addr.09.i = phi i64 [ %rem2.i, %if.end.i48 ], [ %add, %for.body ] %and.i = and i64 %n.addr.010.i, 1 %tobool.not.i = icmp eq i64 %and.i, 0 br i1 %tobool.not.i, label %if.end.i48, label %if.then.i if.then.i: ; preds = %while.body.i %mul.i46 = mul nsw i64 %x.addr.09.i, %ans.011.i %rem.i47 = srem i64 %mul.i46, 1000000007 br label %if.end.i48 if.end.i48: ; preds = %if.then.i, %while.body.i %ans.1.i = phi i64 [ %rem.i47, %if.then.i ], [ %ans.011.i, %while.body.i ] %mul1.i = mul nsw i64 %x.addr.09.i, %x.addr.09.i %rem2.i = urem i64 %mul1.i, 1000000007 %shr.i = lshr i64 %n.addr.010.i, 1 %cmp.not.i = icmp ult i64 %n.addr.010.i, 2 br i1 %cmp.not.i, label %mpow.exit, label %while.body.i, !llvm.loop !5 mpow.exit: ; preds = %if.end.i48 %mul25 = mul nsw i64 %ans.1.i, %6 %rem26 = srem i64 %mul25, 1000000007 %arrayidx28 = getelementptr inbounds [2000003 x i64], ptr @ifact, i64 0, i64 %add store i64 %rem26, ptr %arrayidx28, align 8, !tbaa !7 %exitcond.not = icmp eq i64 %add, 2000004 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11 cleanup: ; preds = %combi.exit, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = 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}
#include<stdio.h> #include <string.h> #define NMAX 393 #define max(a,b) ((a) > (b) ? (a) : (b)) int main(void ){ int i, j, n, m, s, l, p, w, dp[NMAX+1], phrase[NMAX], ans[NMAX]; scanf("%d", &n); memset(phrase, 0, sizeof(phrase)); memset(dp, 0, sizeof(dp)); for(i = 0; i < n; i++){ scanf("%d %d %d", &s, &l, &p); for(j = s; j <= l; j++) phrase[j-1] = max(phrase[j-1], p); } for(i = 1; i <= NMAX; i++) { if(phrase[i-1]){ for(j = i; j <= NMAX; j++) { dp[j] = max(dp[j], dp[j-i] + phrase[i-1]); } } } scanf("%d", &m); for(i = 0; i < m; i++){ scanf("%d", &w); if(!dp[w]){ printf("-1\n"); return 0; } ans[i] = dp[w]; } for(i = 0; i < m; i++) printf("%d\n", ans[i]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259456/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259456/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\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 %m = alloca i32, align 4 %s = alloca i32, align 4 %l = alloca i32, align 4 %p = alloca i32, align 4 %w = alloca i32, align 4 %dp = alloca [394 x i32], align 16 %phrase = alloca [393 x i32], align 16 %ans = alloca [393 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #6 call void @llvm.lifetime.start.p0(i64 1576, ptr nonnull %dp) #6 call void @llvm.lifetime.start.p0(i64 1572, ptr nonnull %phrase) #6 call void @llvm.lifetime.start.p0(i64 1572, ptr nonnull %ans) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1572) %phrase, i8 0, i64 1572, i1 false) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1576) %dp, i8 0, i64 1576, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp123 = icmp sgt i32 %0, 0 br i1 %cmp123, label %for.body, label %for.body18.preheader for.body: ; preds = %entry, %for.inc13 %i.0124 = phi i32 [ %inc14, %for.inc13 ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %l, ptr noundef nonnull %p) %1 = load i32, ptr %s, align 4, !tbaa !5 %2 = load i32, ptr %l, align 4, !tbaa !5 %cmp4.not121 = icmp sgt i32 %1, %2 br i1 %cmp4.not121, label %for.inc13, label %for.body5.lr.ph for.body5.lr.ph: ; preds = %for.body %3 = load i32, ptr %p, align 4, !tbaa !5 %4 = sext i32 %1 to i64 %5 = add i32 %2, 1 %6 = sub i32 %2, %1 %7 = zext i32 %6 to i64 %8 = add nuw nsw i64 %7, 1 %min.iters.check = icmp ult i32 %6, 7 br i1 %min.iters.check, label %for.body5.preheader, label %vector.ph vector.ph: ; preds = %for.body5.lr.ph %n.vec = and i64 %8, 8589934584 %ind.end = add nsw i64 %n.vec, %4 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %3, 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 ] %offset.idx = add i64 %index, %4 %9 = add nsw i64 %offset.idx, -1 %10 = getelementptr inbounds [393 x i32], ptr %phrase, i64 0, i64 %9 %wide.load = load <4 x i32>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load152 = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %broadcast.splat) %13 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load152, <4 x i32> %broadcast.splat) store <4 x i32> %12, ptr %10, align 4, !tbaa !5 store <4 x i32> %13, ptr %11, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %8, %n.vec br i1 %cmp.n, label %for.inc13, label %for.body5.preheader for.body5.preheader: ; preds = %for.body5.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ %4, %for.body5.lr.ph ], [ %ind.end, %middle.block ] br label %for.body5 for.body5: ; preds = %for.body5.preheader, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ %indvars.iv.ph, %for.body5.preheader ] %15 = add nsw i64 %indvars.iv, -1 %arrayidx = getelementptr inbounds [393 x i32], ptr %phrase, i64 0, i64 %15 %16 = load i32, ptr %arrayidx, align 4, !tbaa !5 %. = call i32 @llvm.smax.i32(i32 %16, i32 %3) store i32 %., 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 %5, %lftr.wideiv br i1 %exitcond.not, label %for.inc13, label %for.body5, !llvm.loop !13 for.inc13: ; preds = %for.body5, %middle.block, %for.body %inc14 = add nuw nsw i32 %i.0124, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc14, %17 br i1 %cmp, label %for.body, label %for.body18.preheader, !llvm.loop !14 for.body18.preheader: ; preds = %for.inc13, %entry %invariant.gep = getelementptr i8, ptr %dp, i64 4 br label %for.body18 for.body18: ; preds = %for.body18.preheader, %for.inc52 %indvar = phi i64 [ %indvar.next, %for.inc52 ], [ 0, %for.body18.preheader ] %indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.inc52 ], [ 1, %for.body18.preheader ] %18 = sub i64 393, %indvar %19 = add nsw i64 %indvars.iv135, -1 %arrayidx21 = getelementptr inbounds [393 x i32], ptr %phrase, i64 0, i64 %19 %20 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %tobool.not.not = icmp eq i32 %20, 0 br i1 %tobool.not.not, label %for.inc52, label %for.body24.preheader for.body24.preheader: ; preds = %for.body18 %21 = shl i64 %indvar, 2 %22 = sub i64 1572, %21 %scevgep154 = getelementptr i8, ptr %dp, i64 %22 %23 = shl nuw nsw i64 %indvar, 2 %gep = getelementptr i8, ptr %invariant.gep, i64 %23 %min.iters.check157 = icmp ult i64 %18, 8 %bound0 = icmp ult ptr %gep, %scevgep154 %or.cond = select i1 %min.iters.check157, i1 true, i1 %bound0 br i1 %or.cond, label %for.body24.preheader174, label %vector.ph158 vector.ph158: ; preds = %for.body24.preheader %n.vec160 = and i64 %18, -8 %ind.end161 = add i64 %indvars.iv135, %n.vec160 %broadcast.splatinsert171 = insertelement <4 x i32> poison, i32 %20, i64 0 %broadcast.splat172 = shufflevector <4 x i32> %broadcast.splatinsert171, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body164 vector.body164: ; preds = %vector.body164, %vector.ph158 %index165 = phi i64 [ 0, %vector.ph158 ], [ %index.next173, %vector.body164 ] %offset.idx166 = add i64 %indvars.iv135, %index165 %24 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %offset.idx166 %wide.load167 = load <4 x i32>, ptr %24, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load168 = load <4 x i32>, ptr %25, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %26 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %index165 %wide.load169 = load <4 x i32>, ptr %26, align 16, !tbaa !5, !alias.scope !18 %27 = getelementptr inbounds i32, ptr %26, i64 4 %wide.load170 = load <4 x i32>, ptr %27, align 16, !tbaa !5, !alias.scope !18 %28 = add nsw <4 x i32> %wide.load169, %broadcast.splat172 %29 = add nsw <4 x i32> %wide.load170, %broadcast.splat172 %30 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load167, <4 x i32> %28) %31 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load168, <4 x i32> %29) store <4 x i32> %30, ptr %24, align 4, !tbaa !5, !alias.scope !15, !noalias !18 store <4 x i32> %31, ptr %25, align 4, !tbaa !5, !alias.scope !15, !noalias !18 %index.next173 = add nuw i64 %index165, 8 %32 = icmp eq i64 %index.next173, %n.vec160 br i1 %32, label %middle.block155, label %vector.body164, !llvm.loop !20 middle.block155: ; preds = %vector.body164 %cmp.n163 = icmp eq i64 %18, %n.vec160 br i1 %cmp.n163, label %for.inc52, label %for.body24.preheader174 for.body24.preheader174: ; preds = %for.body24.preheader, %middle.block155 %indvars.iv137.ph = phi i64 [ %indvars.iv135, %for.body24.preheader ], [ %ind.end161, %middle.block155 ] %xtraiter = and i64 %indvars.iv137.ph, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body24.prol.loopexit, label %for.body24.prol for.body24.prol: ; preds = %for.body24.preheader174 %arrayidx26.prol = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %indvars.iv137.ph %33 = load i32, ptr %arrayidx26.prol, align 4, !tbaa !5 %34 = sub nuw nsw i64 %indvars.iv137.ph, %indvars.iv135 %arrayidx29.prol = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %34 %35 = load i32, ptr %arrayidx29.prol, align 4, !tbaa !5 %add.prol = add nsw i32 %35, %20 %.add.prol = call i32 @llvm.smax.i32(i32 %33, i32 %add.prol) store i32 %.add.prol, ptr %arrayidx26.prol, align 4, !tbaa !5 %indvars.iv.next138.prol = add nuw nsw i64 %indvars.iv137.ph, 1 br label %for.body24.prol.loopexit for.body24.prol.loopexit: ; preds = %for.body24.prol, %for.body24.preheader174 %indvars.iv137.unr = phi i64 [ %indvars.iv137.ph, %for.body24.preheader174 ], [ %indvars.iv.next138.prol, %for.body24.prol ] %36 = icmp eq i64 %indvars.iv137.ph, 393 br i1 %36, label %for.inc52, label %for.body24 for.body24: ; preds = %for.body24.prol.loopexit, %for.body24 %indvars.iv137 = phi i64 [ %indvars.iv.next138.1, %for.body24 ], [ %indvars.iv137.unr, %for.body24.prol.loopexit ] %arrayidx26 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %indvars.iv137 %37 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %38 = sub nuw nsw i64 %indvars.iv137, %indvars.iv135 %arrayidx29 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %38 %39 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %add = add nsw i32 %39, %20 %.add = call i32 @llvm.smax.i32(i32 %37, i32 %add) store i32 %.add, ptr %arrayidx26, align 4, !tbaa !5 %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %arrayidx26.1 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %indvars.iv.next138 %40 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5 %41 = sub nuw nsw i64 %indvars.iv.next138, %indvars.iv135 %arrayidx29.1 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %41 %42 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5 %add.1 = add nsw i32 %42, %20 %.add.1 = call i32 @llvm.smax.i32(i32 %40, i32 %add.1) store i32 %.add.1, ptr %arrayidx26.1, align 4, !tbaa !5 %indvars.iv.next138.1 = add nuw nsw i64 %indvars.iv137, 2 %exitcond141.not.1 = icmp eq i64 %indvars.iv.next138.1, 394 br i1 %exitcond141.not.1, label %for.inc52, label %for.body24, !llvm.loop !21 for.inc52: ; preds = %for.body24.prol.loopexit, %for.body24, %middle.block155, %for.body18 %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %exitcond144.not = icmp eq i64 %indvars.iv.next136, 394 %indvar.next = add i64 %indvar, 1 br i1 %exitcond144.not, label %for.end54, label %for.body18, !llvm.loop !22 for.end54: ; preds = %for.inc52 %call55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %43 = load i32, ptr %m, align 4, !tbaa !5 %cmp57129 = icmp sgt i32 %43, 0 br i1 %cmp57129, label %for.body58, label %cleanup for.cond73.preheader: ; preds = %if.end65 %44 = icmp sgt i32 %47, 0 br i1 %44, label %for.body75, label %cleanup for.body58: ; preds = %for.end54, %if.end65 %indvars.iv145 = phi i64 [ %indvars.iv.next146, %if.end65 ], [ 0, %for.end54 ] %call59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %45 = load i32, ptr %w, align 4, !tbaa !5 %idxprom60 = sext i32 %45 to i64 %arrayidx61 = getelementptr inbounds [394 x i32], ptr %dp, i64 0, i64 %idxprom60 %46 = load i32, ptr %arrayidx61, align 4, !tbaa !5 %tobool62.not = icmp eq i32 %46, 0 br i1 %tobool62.not, label %if.then63, label %if.end65 if.then63: ; preds = %for.body58 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup if.end65: ; preds = %for.body58 %arrayidx69 = getelementptr inbounds [393 x i32], ptr %ans, i64 0, i64 %indvars.iv145 store i32 %46, ptr %arrayidx69, align 4, !tbaa !5 %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1 %47 = load i32, ptr %m, align 4, !tbaa !5 %48 = sext i32 %47 to i64 %cmp57 = icmp slt i64 %indvars.iv.next146, %48 br i1 %cmp57, label %for.body58, label %for.cond73.preheader, !llvm.loop !23 for.body75: ; preds = %for.cond73.preheader, %for.body75 %indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.body75 ], [ 0, %for.cond73.preheader ] %arrayidx77 = getelementptr inbounds [393 x i32], ptr %ans, i64 0, i64 %indvars.iv148 %49 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %49) %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %50 = load i32, ptr %m, align 4, !tbaa !5 %51 = sext i32 %50 to i64 %cmp74 = icmp slt i64 %indvars.iv.next149, %51 br i1 %cmp74, label %for.body75, label %cleanup, !llvm.loop !24 cleanup: ; preds = %for.body75, %for.end54, %for.cond73.preheader, %if.then63 call void @llvm.lifetime.end.p0(i64 1572, ptr nonnull %ans) #6 call void @llvm.lifetime.end.p0(i64 1572, ptr nonnull %phrase) #6 call void @llvm.lifetime.end.p0(i64 1576, ptr nonnull %dp) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <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 nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !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 = distinct !{!22, !10} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10}
#include<stdio.h> int bits(int i) { i = i - ((i >> 1) & 0x55555555); i = (i & 0x33333333) + ((i >> 2) & 0x33333333); return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; } int main() { unsigned int x; scanf("%u",&x); int cnt=0; printf("%d",bits(x)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2595/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2595/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%u\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @bits(i32 noundef %i) local_unnamed_addr #0 { entry: %0 = tail call i32 @llvm.ctpop.i32(i32 %i), !range !5 ret i32 %0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !6 %1 = call i32 @llvm.ctpop.i32(i32 %0), !range !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.ctpop.i32(i32) #4 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{i32 0, i32 33} !6 = !{!7, !7, i64 0} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"}
/* ex4_3 moka223711 */ #include <stdio.h> int snow(int h_west, int h_east); // 積雪量を求める関数のプロトタイプ宣言 int main(void){ // 高さがn(n+1)/2[m](n=1,2,…,999)の999本の塔が西から順に立っている // 雪に埋もれていない塔の高さから雪が何m積もっているか求める // 雪に埋もれていない西側の塔の高さをh_west、東側の塔の高さをh_eastとする int h_west, h_east; scanf("%d %d", &h_west, &h_east); // 積雪量を求める関数snow()から返り値を受け取って出力 printf("%d\n", snow(h_west, h_east)); return 0; } // 積雪量を求める関数の定義 int snow(int h_west, int h_east){ int dif, ans; // 東側の塔の高さから西側の塔の高さを引き、差difを求める dif = h_east - h_west; // ここでdifは東側の塔がdif番目の塔であることを表す // 差difから東側の塔の高さを求めて、雪に埋もれていない塔の高さを引くことで // 雪が何m積もっているかを求める ans = dif * (dif + 1) / 2 - h_east; // ansを返り値として返す return ans; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259542/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259542/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h_west = alloca i32, align 4 %h_east = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h_west) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h_east) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h_west, ptr noundef nonnull %h_east) %0 = load i32, ptr %h_west, align 4, !tbaa !5 %1 = load i32, ptr %h_east, align 4, !tbaa !5 %sub.i = sub nsw i32 %1, %0 %add.i = add nsw i32 %sub.i, 1 %mul.i = mul nsw i32 %add.i, %sub.i %div.i = sdiv i32 %mul.i, 2 %sub1.i = sub nsw i32 %div.i, %1 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h_east) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h_west) #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 norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @snow(i32 noundef %h_west, i32 noundef %h_east) local_unnamed_addr #3 { entry: %sub = sub nsw i32 %h_east, %h_west %add = add nsw i32 %sub, 1 %mul = mul nsw i32 %add, %sub %div = sdiv i32 %mul, 2 %sub1 = sub nsw i32 %div, %h_east ret i32 %sub1 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* ex 4_3 cy_an */ #include <stdio.h> #include <math.h> int main(void){ // 変数宣言 int len_a, len_b, deff, depth, i; // 入力 scanf("%d %d", &len_a, &len_b); // deffの計算 deff = len_b - len_a; // depthの計算 depth = -len_a; for(i = 1; i < deff; i++){ depth += i; } // depthの出力 printf("%d\n", depth); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259586/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259586/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %len_a = alloca i32, align 4 %len_b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %len_a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %len_b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len_a, ptr noundef nonnull %len_b) %0 = load i32, ptr %len_b, align 4, !tbaa !5 %1 = load i32, ptr %len_a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %sub1 = sub nsw i32 0, %1 %cmp6 = icmp sgt i32 %sub, 1 br i1 %cmp6, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %2 = shl i32 %0, 1 %3 = add i32 %0, -2 %4 = sub i32 %3, %1 %5 = zext i32 %4 to i33 %6 = add i32 %0, -3 %7 = sub i32 %6, %1 %8 = zext i32 %7 to i33 %9 = mul i33 %5, %8 %10 = lshr i33 %9, 1 %11 = trunc i33 %10 to i32 %12 = add i32 %2, %11 %.neg = mul i32 %1, -3 %13 = add i32 %12, -3 %14 = add i32 %.neg, %13 br label %for.end for.end: ; preds = %for.body.preheader, %entry %depth.0.lcssa = phi i32 [ %sub1, %entry ], [ %14, %for.body.preheader ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %depth.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %len_b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %len_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 sigma(int k) { if (k == 1) return 1; else return k + sigma(k-1); } int main() { int a, b; scanf("%d%d", &a, &b); int depth = 0; int i; for (i = 1; i <= 999; i++) { if (sigma(i) - a == sigma(i+1) - b) break; } printf("%d\n", sigma(i) - a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259629/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259629/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @sigma(i32 noundef %k) local_unnamed_addr #0 { entry: %cmp3 = icmp eq i32 %k, 1 br i1 %cmp3, label %return, label %if.else.preheader if.else.preheader: ; preds = %entry %0 = add i32 %k, -1 %1 = add i32 %k, -2 %2 = mul i32 %0, %1 %3 = zext i32 %1 to i33 %4 = add i32 %k, -3 %5 = zext i32 %4 to i33 %6 = mul i33 %3, %5 %7 = lshr i33 %6, 1 %8 = trunc i33 %7 to i32 %9 = add i32 %2, %k %10 = sub i32 %9, %8 %11 = add nsw i32 %10, 1 br label %return return: ; preds = %if.else.preheader, %entry %accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %11, %if.else.preheader ] ret i32 %accumulator.tr.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { sigma.exit.peel: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub.peel = sub nsw i32 1, %0 %sub3.peel = sub i32 3, %1 %cmp4.peel = icmp eq i32 %sub.peel, %sub3.peel br i1 %cmp4.peel, label %sigma.exit17, label %for.cond for.cond: ; preds = %sigma.exit.peel, %sigma.exit %i.0 = phi i32 [ %2, %sigma.exit ], [ 2, %sigma.exit.peel ] %exitcond.not = icmp eq i32 %i.0, 1000 br i1 %exitcond.not, label %if.else.preheader.i15, label %sigma.exit sigma.exit: ; preds = %for.cond %2 = add nuw nsw i32 %i.0, 1 %3 = add nsw i32 %i.0, -1 %4 = add nsw i32 %i.0, -2 %5 = mul nsw i32 %3, %4 %6 = add i32 %2, %5 %7 = zext i32 %4 to i33 %8 = add nsw i32 %i.0, -3 %9 = zext i32 %8 to i33 %10 = mul i33 %7, %9 %11 = lshr i33 %10, 1 %12 = trunc i33 %11 to i32 %13 = add i32 %0, %12 %sub = sub i32 %6, %13 %14 = mul nsw i32 %3, %i.0 %15 = zext i32 %3 to i33 %16 = mul i33 %15, %7 %17 = lshr i33 %16, 1 %18 = trunc i33 %17 to i32 %.neg21 = add nuw nsw i32 %i.0, 2 %19 = add i32 %.neg21, %14 %20 = add i32 %1, %18 %sub3 = sub i32 %19, %20 %cmp4 = icmp eq i32 %sub, %sub3 br i1 %cmp4, label %if.else.preheader.i15, label %for.cond, !llvm.loop !9 if.else.preheader.i15: ; preds = %for.cond, %sigma.exit %21 = add nsw i32 %i.0, -1 %22 = add nsw i32 %i.0, -2 %23 = mul i32 %21, %22 %24 = zext i32 %22 to i33 %25 = add nsw i32 %i.0, -3 %26 = zext i32 %25 to i33 %27 = mul i33 %24, %26 %28 = lshr i33 %27, 1 %29 = trunc i33 %28 to i32 %30 = add nuw i32 %i.0, 1 %31 = add i32 %30, %23 %32 = add i32 %0, %29 %.pre = sub i32 %31, %32 br label %sigma.exit17 sigma.exit17: ; preds = %sigma.exit.peel, %if.else.preheader.i15 %sub6.pre-phi = phi i32 [ %.pre, %if.else.preheader.i15 ], [ %sub.peel, %sigma.exit.peel ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub6.pre-phi) 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) #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, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> #include<string.h> int main() { int t; scanf("%d",&t); while(t--) { int n_z=0,n_o=0; char arr[200001]; scanf("%s",arr); int length = strlen(arr); for(int i=0;i<length;i++) { if('0'==arr[i]) n_z++; else n_o++; } if(n_z==n_o) printf("%d\n",n_z-1); else { if(n_z>n_o) printf("%d\n",n_o); else printf("%d\n",n_z); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [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 %arr = alloca [200001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec37 = add nsw i32 %0, -1 store i32 %dec37, ptr %t, align 4, !tbaa !5 %tobool.not38 = icmp eq i32 %0, 0 br i1 %tobool.not38, label %while.end, label %while.body while.body: ; preds = %entry, %if.end22 call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %arr) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arr) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arr) #6 %conv = trunc i64 %call3 to i32 %cmp32 = icmp sgt i32 %conv, 0 br i1 %cmp32, label %for.body.preheader, label %if.then12 for.body.preheader: ; preds = %while.body %wide.trip.count = and i64 %call3, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader50, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call3, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ] %vec.phi44 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %vec.phi45 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %1 = getelementptr inbounds [200001 x i8], ptr %arr, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !9 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load47 = load <4 x i8>, ptr %2, align 4, !tbaa !9 %3 = icmp ne <4 x i8> %wide.load, <i8 48, i8 48, i8 48, i8 48> %4 = icmp ne <4 x i8> %wide.load47, <i8 48, i8 48, i8 48, i8 48> %5 = zext <4 x i1> %3 to <4 x i32> %6 = zext <4 x i1> %4 to <4 x i32> %7 = add <4 x i32> %vec.phi45, %5 %8 = add <4 x i32> %vec.phi46, %6 %9 = xor <4 x i1> %3, <i1 true, i1 true, i1 true, i1 true> %10 = xor <4 x i1> %4, <i1 true, i1 true, i1 true, i1 true> %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.phi44, %12 %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 !10 middle.block: ; preds = %vector.body %bin.rdx48 = add <4 x i32> %8, %7 %16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx48) %bin.rdx = add <4 x i32> %14, %13 %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader50 for.body.preheader50: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %n_z.034.ph = phi i32 [ 0, %for.body.preheader ], [ %17, %middle.block ] %n_o.033.ph = phi i32 [ 0, %for.body.preheader ], [ %16, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block %n_o.1.lcssa = phi i32 [ %16, %middle.block ], [ %n_o.1, %for.body ] %n_z.1.lcssa = phi i32 [ %17, %middle.block ], [ %n_z.1, %for.body ] %cmp10 = icmp eq i32 %n_z.1.lcssa, %n_o.1.lcssa br i1 %cmp10, label %if.then12, label %if.else14 for.body: ; preds = %for.body.preheader50, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader50 ] %n_z.034 = phi i32 [ %n_z.1, %for.body ], [ %n_z.034.ph, %for.body.preheader50 ] %n_o.033 = phi i32 [ %n_o.1, %for.body ], [ %n_o.033.ph, %for.body.preheader50 ] %arrayidx = getelementptr inbounds [200001 x i8], ptr %arr, i64 0, i64 %indvars.iv %18 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp6 = icmp ne i8 %18, 48 %inc8 = zext i1 %cmp6 to i32 %n_o.1 = add nuw nsw i32 %n_o.033, %inc8 %not.cmp6 = xor i1 %cmp6, true %inc = zext i1 %not.cmp6 to i32 %n_z.1 = add nuw nsw i32 %n_z.034, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14 if.then12: ; preds = %while.body, %for.cond.cleanup %n_o.0.lcssa43 = phi i32 [ %n_o.1.lcssa, %for.cond.cleanup ], [ 0, %while.body ] %sub = add nsw i32 %n_o.0.lcssa43, -1 br label %if.end22 if.else14: ; preds = %for.cond.cleanup %n_o.1.lcssa.n_z.1.lcssa = call i32 @llvm.umin.i32(i32 %n_z.1.lcssa, i32 %n_o.1.lcssa) br label %if.end22 if.end22: ; preds = %if.else14, %if.then12 %n_o.1.lcssa.sink = phi i32 [ %sub, %if.then12 ], [ %n_o.1.lcssa.n_z.1.lcssa, %if.else14 ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %n_o.1.lcssa.sink) call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %arr) #5 %19 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %19, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %19, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %if.end22, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12} !15 = distinct !{!15, !11}
#include <stdio.h> int main(void) { int x,y; scanf("%d%d",&x,&y); printf("%d",(y-x)*(y-x+1)/2-y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259722/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259722/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %y, align 4, !tbaa !5 %1 = load i32, ptr %x, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %add = add nsw i32 %sub, 1 %mul = mul nsw i32 %add, %sub %div = sdiv i32 %mul, 2 %sub2 = sub nsw i32 %div, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a, b, i, dif, sum; scanf("%d%d", &a, &b); dif = b-a; sum = 0; for(i = 1; i <= 999; i++) { sum += i; if(i >= dif){ printf("%d\n", sum-b); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259766/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259766/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %smax = call i32 @llvm.smax.i32(i32 %sub, i32 1) %min.iters.check = icmp ult i32 %smax, 9 br i1 %min.iters.check, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %entry %2 = add nsw i32 %smax, -1 %umin = call i32 @llvm.umin.i32(i32 %2, i32 998) %3 = add nuw nsw i32 %umin, 1 %n.mod.vf = and i32 %3, 7 %4 = icmp eq i32 %n.mod.vf, 0 %5 = select i1 %4, i32 8, i32 %n.mod.vf %n.vec = sub nsw i32 %3, %5 %ind.end = add nsw i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %vec.phi14 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %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> %6 = add <4 x i32> %vec.phi, %vec.ind %7 = add <4 x i32> %vec.phi14, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %8 = icmp eq i32 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %7, %6 %9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br label %for.body.preheader for.body.preheader: ; preds = %entry, %middle.block %sum.09.ph = phi i32 [ 0, %entry ], [ %9, %middle.block ] %i.08.ph = phi i32 [ 1, %entry ], [ %ind.end, %middle.block ] br label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.08, 1 %exitcond11.not = icmp eq i32 %inc, 1000 br i1 %exitcond11.not, label %for.end, label %for.body, !llvm.loop !13 for.body: ; preds = %for.body.preheader, %for.cond %sum.09 = phi i32 [ %add, %for.cond ], [ %sum.09.ph, %for.body.preheader ] %i.08 = phi i32 [ %inc, %for.cond ], [ %i.08.ph, %for.body.preheader ] %add = add nuw nsw i32 %sum.09, %i.08 %exitcond.not = icmp eq i32 %i.08, %smax br i1 %exitcond.not, label %if.then, label %for.cond if.then: ; preds = %for.body %sub2 = sub nsw i32 %add, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2) br label %for.end for.end: ; preds = %for.cond, %if.then 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.umin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11}
#include <stdio.h> int main(void) { int a,b,c,d,e,f; scanf("%d", &a); scanf("%d", &b); c = b - a; d = 0; for (e = 1; e <= c; e++) { d = d + e; } f = d - b; printf("%d", f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259809/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259809/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not7.not = icmp sgt i32 %0, %1 br i1 %cmp.not7.not, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %2 = shl i32 %0, 1 %3 = xor i32 %1, -1 %4 = add i32 %0, %3 %5 = zext i32 %4 to i33 %6 = add i32 %0, -2 %7 = sub i32 %6, %1 %8 = zext i32 %7 to i33 %9 = mul i33 %5, %8 %10 = lshr i33 %9, 1 %11 = trunc i33 %10 to i32 %12 = add i32 %2, %11 %13 = shl i32 %1, 1 %14 = xor i32 %13, -1 %15 = add i32 %12, %14 br label %for.end for.end: ; preds = %for.body.preheader, %entry %d.0.lcssa = phi i32 [ 0, %entry ], [ %15, %for.body.preheader ] %sub2 = sub nsw i32 %d.0.lcssa, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main() { int t; scanf("%d", &t); while(t--){ int a = 0; int b = 0; int min; char s[200001]; scanf("%s", &s); if(strlen(s) <= 2){ printf("0\n"); continue; } for(int i = 0; i < strlen(s); i++){ if(s[i]=='0') a++; else if(s[i]=='1') b++; } if(a == b) printf("%d\n", a - 1); else { min = (a > b) ? b : a; printf("%d\n", min); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25986/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25986/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %s = alloca [200001 x i8], align 16 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 %dec49 = add nsw i32 %0, -1 store i32 %dec49, ptr %t, align 4, !tbaa !5 %tobool.not50 = icmp eq i32 %0, 0 br i1 %tobool.not50, label %while.end, label %while.body while.body: ; preds = %entry, %cleanup call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %s) #6 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 %cmp = icmp ult i64 %call2, 3 br i1 %cmp, label %if.then, label %for.body.preheader for.body.preheader: ; preds = %while.body %xtraiter = and i64 %call2, 1 %unroll_iter = and i64 %call2, -2 br label %for.body if.then: ; preds = %while.body %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup, !llvm.loop !9 for.cond.cleanup.unr-lcssa: ; preds = %for.inc.1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa %arrayidx.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv.next.1 %1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !11 switch i8 %1, label %for.cond.cleanup [ i8 48, label %if.then11.epil i8 49, label %if.then17.epil ] if.then17.epil: ; preds = %for.body.epil %inc18.epil = add nsw i32 %b.1.1, 1 br label %for.cond.cleanup if.then11.epil: ; preds = %for.body.epil %inc.epil = add nsw i32 %a.1.1, 1 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %if.then17.epil, %if.then11.epil, %for.cond.cleanup.unr-lcssa %a.1.lcssa = phi i32 [ %a.1.1, %for.cond.cleanup.unr-lcssa ], [ %inc.epil, %if.then11.epil ], [ %a.1.1, %if.then17.epil ], [ %a.1.1, %for.body.epil ] %b.1.lcssa = phi i32 [ %b.1.1, %for.cond.cleanup.unr-lcssa ], [ %b.1.1, %if.then11.epil ], [ %inc18.epil, %if.then17.epil ], [ %b.1.1, %for.body.epil ] %cmp22 = icmp eq i32 %a.1.lcssa, %b.1.lcssa br i1 %cmp22, label %if.then24, label %if.else26 for.body: ; preds = %for.inc.1, %for.body.preheader %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %b.046 = phi i32 [ 0, %for.body.preheader ], [ %b.1.1, %for.inc.1 ] %a.045 = phi i32 [ 0, %for.body.preheader ], [ %a.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 2, !tbaa !11 switch i8 %2, label %for.inc [ i8 48, label %if.then11 i8 49, label %if.then17 ] if.then11: ; preds = %for.body %inc = add nsw i32 %a.045, 1 br label %for.inc if.then17: ; preds = %for.body %inc18 = add nsw i32 %b.046, 1 br label %for.inc for.inc: ; preds = %for.body, %if.then11, %if.then17 %a.1 = phi i32 [ %inc, %if.then11 ], [ %a.045, %if.then17 ], [ %a.045, %for.body ] %b.1 = phi i32 [ %b.046, %if.then11 ], [ %inc18, %if.then17 ], [ %b.046, %for.body ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx.1, align 1, !tbaa !11 switch i8 %3, label %for.inc.1 [ i8 48, label %if.then11.1 i8 49, label %if.then17.1 ] if.then17.1: ; preds = %for.inc %inc18.1 = add nsw i32 %b.1, 1 br label %for.inc.1 if.then11.1: ; preds = %for.inc %inc.1 = add nsw i32 %a.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then11.1, %if.then17.1, %for.inc %a.1.1 = phi i32 [ %inc.1, %if.then11.1 ], [ %a.1, %if.then17.1 ], [ %a.1, %for.inc ] %b.1.1 = phi i32 [ %b.1, %if.then11.1 ], [ %inc18.1, %if.then17.1 ], [ %b.1, %for.inc ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add nuw i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !12 if.then24: ; preds = %for.cond.cleanup %sub = add nsw i32 %a.1.lcssa, -1 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub) br label %cleanup if.else26: ; preds = %for.cond.cleanup %cond = call i32 @llvm.smin.i32(i32 %a.1.lcssa, i32 %b.1.lcssa) %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cond) br label %cleanup cleanup: ; preds = %if.then24, %if.else26, %if.then call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %s) #6 %4 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %4, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %4, 0 br i1 %tobool.not, label %while.end, label %while.body while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void){ long long n,a,b,ans=0; scanf("%lld%lld%lld",&n,&a,&b); long long x[n]; for (int i=0; i<n; i++){ scanf("%lld",&x[i]); } for (int i=0; i<n-1; i++){ if ((x[i+1]-x[i])*a<b){ ans+=(x[i+1]-x[i])*a; } else { ans+=b; } } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259924/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259924/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp39 = icmp sgt i64 %2, 0 br i1 %cmp39, label %for.body, label %for.cond.cleanup8 for.cond4.preheader: ; preds = %for.body %cmp642 = icmp sgt i64 %7, 1 br i1 %cmp642, label %for.body9.lr.ph, label %for.cond.cleanup8 for.body9.lr.ph: ; preds = %for.cond4.preheader %3 = load i64, ptr %a, align 8, !tbaa !5 %4 = load i64, ptr %b, align 8, !tbaa !5 %.pre = load i64, ptr %vla, align 16, !tbaa !5 %5 = add i64 %7, -1 %xtraiter = and i64 %5, 1 %6 = icmp eq i64 %7, 2 br i1 %6, label %for.cond.cleanup8.loopexit.unr-lcssa, label %for.body9.lr.ph.new for.body9.lr.ph.new: ; preds = %for.body9.lr.ph %unroll_iter = and i64 %5, -2 br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, 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 %7 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp sgt i64 %7, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.cond.cleanup8.loopexit.unr-lcssa.loopexit: ; preds = %for.body9 %8 = add nuw nsw i64 %indvars.iv49, 3 br label %for.cond.cleanup8.loopexit.unr-lcssa for.cond.cleanup8.loopexit.unr-lcssa: ; preds = %for.cond.cleanup8.loopexit.unr-lcssa.loopexit, %for.body9.lr.ph %ans.1.lcssa.ph = phi i64 [ undef, %for.body9.lr.ph ], [ %ans.1.1, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %.unr = phi i64 [ %.pre, %for.body9.lr.ph ], [ %12, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %indvars.iv49.unr = phi i64 [ 1, %for.body9.lr.ph ], [ %8, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %ans.043.unr = phi i64 [ 0, %for.body9.lr.ph ], [ %ans.1.1, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup8, label %for.body9.epil for.body9.epil: ; preds = %for.cond.cleanup8.loopexit.unr-lcssa %arrayidx11.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv49.unr %9 = load i64, ptr %arrayidx11.epil, align 8, !tbaa !5 %sub14.epil = sub nsw i64 %9, %.unr %mul.epil = mul nsw i64 %sub14.epil, %3 %mul..epil = call i64 @llvm.smin.i64(i64 %mul.epil, i64 %4) %ans.1.epil = add nsw i64 %mul..epil, %ans.043.unr br label %for.cond.cleanup8 for.cond.cleanup8: ; preds = %for.body9.epil, %for.cond.cleanup8.loopexit.unr-lcssa, %entry, %for.cond4.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %ans.1.lcssa.ph, %for.cond.cleanup8.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body9.epil ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 for.body9: ; preds = %for.body9, %for.body9.lr.ph.new %10 = phi i64 [ %.pre, %for.body9.lr.ph.new ], [ %12, %for.body9 ] %indvars.iv49 = phi i64 [ 0, %for.body9.lr.ph.new ], [ %indvars.iv.next50.1, %for.body9 ] %ans.043 = phi i64 [ 0, %for.body9.lr.ph.new ], [ %ans.1.1, %for.body9 ] %niter = phi i64 [ 0, %for.body9.lr.ph.new ], [ %niter.next.1, %for.body9 ] %indvars.iv.next50 = or i64 %indvars.iv49, 1 %arrayidx11 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next50 %11 = load i64, ptr %arrayidx11, align 8, !tbaa !5 %sub14 = sub nsw i64 %11, %10 %mul = mul nsw i64 %sub14, %3 %mul. = call i64 @llvm.smin.i64(i64 %mul, i64 %4) %ans.1 = add nsw i64 %mul., %ans.043 %indvars.iv.next50.1 = add nuw nsw i64 %indvars.iv49, 2 %arrayidx11.1 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next50.1 %12 = load i64, ptr %arrayidx11.1, align 16, !tbaa !5 %sub14.1 = sub nsw i64 %12, %11 %mul.1 = mul nsw i64 %sub14.1, %3 %mul..1 = call i64 @llvm.smin.i64(i64 %mul.1, i64 %4) %ans.1.1 = add nsw i64 %mul..1, %ans.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.cond.cleanup8.loopexit.unr-lcssa.loopexit, label %for.body9, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <ctype.h> int main() { char firstLetter; char secondLetter; firstLetter = getc( stdin ); if ( isalpha(firstLetter) && tolower(firstLetter) != 'z' ) { secondLetter = firstLetter + 1; printf( "%c", secondLetter ); } else { printf( "Invalid letter\n" ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259968/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259968/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @str = private unnamed_addr constant [15 x i8] c"Invalid letter\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call i32 @getc(ptr noundef %0) %call1 = tail call ptr @__ctype_b_loc() #4 %1 = load ptr, ptr %call1, align 8, !tbaa !5 %sext = shl i32 %call, 24 %conv2 = ashr exact i32 %sext, 24 %idxprom = sext i32 %conv2 to i64 %arrayidx = getelementptr inbounds i16, ptr %1, i64 %idxprom %2 = load i16, ptr %arrayidx, align 2, !tbaa !9 %3 = and i16 %2, 1024 %tobool.not = icmp eq i16 %3, 0 br i1 %tobool.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %entry %call4 = tail call ptr @__ctype_tolower_loc() #4 %4 = load ptr, ptr %call4, align 8, !tbaa !5 %arrayidx7 = getelementptr inbounds i32, ptr %4, i64 %idxprom %5 = load i32, ptr %arrayidx7, align 4, !tbaa !11 %cmp.not = icmp eq i32 %5, 122 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %land.lhs.true %sext16 = add i32 %sext, 16777216 %conv11 = ashr exact i32 %sext16, 24 %putchar = tail call i32 @putchar(i32 %conv11) br label %if.end if.else: ; preds = %land.lhs.true, %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="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 willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"short", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"int", !7, i64 0}
#include<stdio.h> int main() { char c; scanf("%c",&c); printf("%c\n",c+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260009/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260009/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { char a; scanf("%c",&a); printf("%c",a+1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260052/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260052/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %putchar = call i32 @putchar(i32 %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ char c; scanf("%c",&c); printf("%c",c+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260096/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260096/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %putchar = call i32 @putchar(i32 %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { char c; scanf("%c",&c); printf("%c",c+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260139/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260139/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %putchar = call i32 @putchar(i32 %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { char c; scanf("%c", &c); printf("%c\n", c + 1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260182/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260182/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main(void){ char C; scanf("%c",&C); C++; printf("%c",C); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260225/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260225/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %C = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %C) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %0 = load i8, ptr %C, align 1, !tbaa !5 %inc = add i8 %0, 1 store i8 %inc, ptr %C, align 1, !tbaa !5 %conv = sext i8 %inc to i32 %putchar = call i32 @putchar(i32 %conv) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %C) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main (void){ char c,d; scanf("%c",&c); d = c + 1; printf("%c\n",d); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260269/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260269/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %add = add i8 %0, 1 %conv2 = sext i8 %add to i32 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv2) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ char moji; scanf("%c", &moji); printf("%c", moji+0x01); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260311/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260311/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %moji = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %moji) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %moji) %0 = load i8, ptr %moji, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %putchar = call i32 @putchar(i32 %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %moji) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> int main() { char a; int i,x; scanf("%c",&a); int l=(int)a; for(i=0;i<1;i++) { l++; } printf("%c\n",l); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260355/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260355/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %1 = add nsw i32 %conv, 1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char moji; scanf("%c", &moji); moji = moji + 1; printf("%c", moji); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260399/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260399/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %moji = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %moji) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %moji) %0 = load i8, ptr %moji, align 1, !tbaa !5 %add = add i8 %0, 1 store i8 %add, ptr %moji, align 1, !tbaa !5 %conv2 = sext i8 %add to i32 %putchar = call i32 @putchar(i32 %conv2) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %moji) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> #include<stdlib.h> int main(void){ char c; scanf("%c", &c); printf("%c", c+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260441/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260441/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %add = add nsw i32 %conv, 1 %putchar = call i32 @putchar(i32 %add) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> #include <string.h> #include <stdlib.h> int main(void){ char str[30]; long int x,i,N,sum; fgets(str,sizeof(str),stdin); N=atol(str); if(N%2==1){ printf("0"); }else{ N=N/2; sum=0; for(i=1;(long int)powl(5,i)<=N;i++){ x=(long int)powl(5,i); sum+=N/x; } printf("%ld\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260485/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260485/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [30 x i8], align 16 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %str) #6 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 30, ptr noundef %0) %call.i = call i64 @strtol(ptr nocapture noundef nonnull %str, ptr noundef null, i32 noundef 10) #6 %1 = and i64 %call.i, -9223372036854775807 %cmp = icmp eq i64 %1, 1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %putchar = call i32 @putchar(i32 48) br label %if.end if.else: ; preds = %entry %div = sdiv i64 %call.i, 2 %cmp6.not21 = icmp slt i64 %call.i, 10 br i1 %cmp6.not21, label %for.end, label %for.body for.body: ; preds = %if.else, %for.body %conv24 = phi x86_fp80 [ %conv, %for.body ], [ 0xK3FFF8000000000000000, %if.else ] %sum.023 = phi i64 [ %add, %for.body ], [ 0, %if.else ] %i.022 = phi i64 [ %inc, %for.body ], [ 1, %if.else ] %call9 = call x86_fp80 @powl(x86_fp80 noundef 0xK4001A000000000000000, x86_fp80 noundef %conv24) #6 %conv10 = fptosi x86_fp80 %call9 to i64 %div11 = sdiv i64 %div, %conv10 %add = add nsw i64 %div11, %sum.023 %inc = add nuw nsw i64 %i.022, 1 %conv = sitofp i64 %inc to x86_fp80 %call4 = call x86_fp80 @powl(x86_fp80 noundef 0xK4001A000000000000000, x86_fp80 noundef %conv) #6 %conv5 = fptosi x86_fp80 %call4 to i64 %cmp6.not = icmp slt i64 %div, %conv5 br i1 %cmp6.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %if.else %sum.0.lcssa = phi i64 [ 0, %if.else ], [ %add, %for.body ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa) br label %if.end if.end: ; preds = %for.end, %if.then call void @llvm.lifetime.end.p0(i64 30, ptr nonnull %str) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare x86_fp80 @powl(x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(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 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { long long N, x, p, i, j; scanf("%lld", &N); if (N%2==1) { printf("0"); return 0; } x=0; j=1; while (1) { p=2; for (i=1; i<=j; i++) p*=5; if (N/p!=0) x+=N/p; else break; j++; } printf("%lld", x); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260528/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260528/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i64, ptr %N, align 8, !tbaa !5 %1 = and i64 %0, -9223372036854775807 %cmp = icmp eq i64 %1, 1 br i1 %cmp, label %if.then, label %while.cond if.then: ; preds = %entry %putchar = call i32 @putchar(i32 48) br label %cleanup while.cond: ; preds = %entry, %if.then4 %indvar = phi i64 [ %indvar.next, %if.then4 ], [ 0, %entry ] %x.0 = phi i64 [ %add, %if.then4 ], [ 0, %entry ] %2 = add i64 %indvar, 1 %xtraiter = and i64 %2, 7 %3 = icmp ult i64 %indvar, 7 br i1 %3, label %for.end.unr-lcssa, label %while.cond.new while.cond.new: ; preds = %while.cond %unroll_iter = and i64 %2, -8 br label %for.body for.body: ; preds = %for.body, %while.cond.new %p.018 = phi i64 [ 2, %while.cond.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %while.cond.new ], [ %niter.next.7, %for.body ] %mul.7 = mul i64 %p.018, 390625 %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.unr-lcssa, label %for.body, !llvm.loop !9 for.end.unr-lcssa: ; preds = %for.body, %while.cond %mul.lcssa.ph = phi i64 [ undef, %while.cond ], [ %mul.7, %for.body ] %p.018.unr = phi i64 [ 2, %while.cond ], [ %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.unr-lcssa, %for.body.epil %p.018.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %p.018.unr, %for.end.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.unr-lcssa ] %mul.epil = mul nsw i64 %p.018.epil, 5 %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 !11 for.end: ; preds = %for.body.epil, %for.end.unr-lcssa %mul.lcssa = phi i64 [ %mul.lcssa.ph, %for.end.unr-lcssa ], [ %mul.epil, %for.body.epil ] %div = sdiv i64 %0, %mul.lcssa %cmp3.not = icmp eq i64 %div, 0 br i1 %cmp3.not, label %while.end, label %if.then4 if.then4: ; preds = %for.end %add = add nsw i64 %div, %x.0 %indvar.next = add i64 %indvar, 1 br label %while.cond while.end: ; preds = %for.end %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %x.0) br label %cleanup cleanup: ; preds = %while.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> int main(){ char a,b; scanf ("%c %c",&a,&b); if(b=='H') printf("%c",a); else if(b=='D'&&a=='H') printf("D"); else if(b=='D'&&a=='D') printf("H"); else printf("%c",b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260571/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260571/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %b, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %cmp = icmp eq i8 %0, 72 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %1 = load i8, ptr %a, align 1, !tbaa !5 %conv2 = sext i8 %1 to i32 br label %if.end26 if.else: ; preds = %entry %cmp5 = icmp eq i8 %0, 68 %2 = load i8, ptr %a, align 1 %cmp8 = icmp eq i8 %2, 72 %or.cond = select i1 %cmp5, i1 %cmp8, i1 false br i1 %or.cond, label %if.end26, label %if.else12 if.else12: ; preds = %if.else %cmp18 = icmp eq i8 %2, 68 %or.cond27 = select i1 %cmp5, i1 %cmp18, i1 false %.conv = select i1 %or.cond27, i32 72, i32 %conv br label %if.end26 if.end26: ; preds = %if.else12, %if.else, %if.then %.sink = phi i32 [ %conv2, %if.then ], [ 68, %if.else ], [ %.conv, %if.else12 ] %putchar29 = call i32 @putchar(i32 %.sink) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { char a,b; scanf("%c %c",&a,&b); if(a=='D'|a=='H',b=='H'|b=='D') { if(a=='H'&&b=='H') { printf("H"); } else if(a=='D'&&b=='H') { printf("D"); } else if(a=='H'&&b=='D') { printf("D"); } else if(a=='D'&&b=='D') { printf("H"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260614/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260614/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 68 %cmp3 = icmp eq i8 %0, 72 %1 = load i8, ptr %b, align 1 %cmp6 = icmp eq i8 %1, 72 %cmp9 = icmp eq i8 %1, 68 switch i8 %1, label %if.end52 [ i8 72, label %if.then i8 68, label %if.then ] if.then: ; preds = %entry, %entry %or.cond = and i1 %cmp3, %cmp6 br i1 %or.cond, label %if.end52.sink.split, label %if.else if.else: ; preds = %if.then %or.cond53 = and i1 %cmp, %cmp6 %or.cond54 = and i1 %cmp3, %cmp9 %or.cond60 = or i1 %or.cond53, %or.cond54 br i1 %or.cond60, label %if.end52.sink.split, label %if.else39 if.else39: ; preds = %if.else %or.cond55 = and i1 %cmp, %cmp9 br i1 %or.cond55, label %if.end52.sink.split, label %if.end52 if.end52.sink.split: ; preds = %if.else39, %if.else, %if.then %.sink = phi i32 [ 72, %if.then ], [ 68, %if.else ], [ 72, %if.else39 ] %putchar59 = call i32 @putchar(i32 %.sink) br label %if.end52 if.end52: ; preds = %if.end52.sink.split, %entry, %if.else39 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include<string.h> int main() { int flag,i,str1=0,str2=0; char a,b; scanf("%c %c",&a,&b); if(a==b) { printf("H"); } else{ printf("D"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260658/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260658/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %. = select i1 %cmp, i32 72, i32 68 %putchar = call i32 @putchar(i32 %.) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(void) { char a, b; int tbl[256]={0}; tbl['H']=+1; tbl['D']=-1; scanf("%c %c",&a, &b); printf("%c\n",tbl[a]*tbl[b]<0?'D':'H'); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260700/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260700/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 %tbl = alloca [256 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %tbl) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %tbl, i8 0, i64 1024, i1 false) %arrayidx = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 72 store i32 1, ptr %arrayidx, align 16, !tbaa !5 %arrayidx1 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 68 store i32 -1, ptr %arrayidx1, align 16, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !9 %idxprom = sext i8 %0 to i64 %arrayidx2 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %2 = load i8, ptr %b, align 1, !tbaa !9 %idxprom3 = sext i8 %2 to i64 %arrayidx4 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %idxprom3 %3 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %mul = mul nsw i32 %3, %1 %cmp = icmp slt i32 %mul, 0 %cond = select i1 %cmp, i32 68, i32 72 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %tbl) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0}
#include <stdio.h> int main(){ char a, b; scanf("%c %c", &a, &b); if(a == 'H'){ printf("%c\n", b); }else{ if(b == 'H'){ printf("%c\n", a); }else{ a = 'H'; printf("%c\n", a); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260751/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260751/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 72 %1 = load i8, ptr %b, align 1, !tbaa !5 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %conv2 = sext i8 %1 to i32 br label %if.end13 if.else: ; preds = %entry %conv = sext i8 %0 to i32 %cmp5 = icmp eq i8 %1, 72 br i1 %cmp5, label %if.end13, label %if.else10 if.else10: ; preds = %if.else store i8 72, ptr %a, align 1, !tbaa !5 br label %if.end13 if.end13: ; preds = %if.else, %if.else10, %if.then %conv.sink = phi i32 [ 72, %if.else10 ], [ %conv2, %if.then ], [ %conv, %if.else ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv.sink) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char a, b; int flag = 0; scanf(" %c %c", &a, &b); if(a == 'H') { if(b == 'H') flag = 1; } else { if(b == 'D') flag = 1; } if(flag) printf("H\n"); else printf("D\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260795/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260795/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c %c\00", align 1 @str = private unnamed_addr constant [2 x i8] c"D\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"H\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i8, ptr %a, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 72 %1 = load i8, ptr %b, align 1, !tbaa !5 br i1 %cmp, label %if.then, label %if.end11 if.then: ; preds = %entry %cmp3.not = icmp eq i8 %1, 72 br i1 %cmp3.not, label %if.end16, label %if.else14 if.end11: ; preds = %entry %cmp7.not = icmp eq i8 %1, 68 br i1 %cmp7.not, label %if.end16, label %if.else14 if.else14: ; preds = %if.then, %if.end11 br label %if.end16 if.end16: ; preds = %if.end11, %if.then, %if.else14 %str.sink = phi ptr [ @str, %if.else14 ], [ @str.3, %if.then ], [ @str.3, %if.end11 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <limits.h> #include <string.h> #define ll long long int int main() { char ch[10]; int res = 753; scanf("%s",ch); int min = INT_MAX; char sub1[3]={'\0'}; for (int i = 0;i<strlen(ch);i++) { if (i+2<strlen(ch)) { strncpy(sub1, ch+i, 3); int ERG = atoi(sub1); int resultat = abs(res-ERG); if (resultat<min)min=resultat; } } printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260838/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca [10 x i8], align 1 %sub1 = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %ch) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %sub1) #9 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %sub1, i8 0, i64 3, i1 false) %call224 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %ch) #10 %cmp25.not = icmp eq i64 %call224, 0 br i1 %cmp25.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.inc, %entry %min.0.lcssa = phi i32 [ 2147483647, %entry ], [ %min.2, %for.inc ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %sub1) #9 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %ch) #9 ret i32 0 for.body: ; preds = %entry, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %call229 = phi i64 [ %call2, %for.inc ], [ %call224, %entry ] %min.027 = phi i32 [ %min.2, %for.inc ], [ 2147483647, %entry ] %0 = add nuw nsw i64 %indvars.iv, 2 %cmp7 = icmp ugt i64 %call229, %0 br i1 %cmp7, label %if.then, label %for.inc if.then: ; preds = %for.body %add.ptr = getelementptr inbounds i8, ptr %ch, i64 %indvars.iv %call11 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %sub1, ptr noundef nonnull dereferenceable(1) %add.ptr, i64 noundef 3) #9 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %sub1, ptr noundef null, i32 noundef 10) #9 %conv.i = trunc i64 %call.i to i32 %sub = sub nsw i32 753, %conv.i %1 = call i32 @llvm.abs.i32(i32 %sub, i1 true) %spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %min.027) br label %for.inc for.inc: ; preds = %for.body, %if.then %min.2 = phi i32 [ %spec.select, %if.then ], [ %min.027, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %ch) #10 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !5 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #6 ; 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 nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } 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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind } attributes #10 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 10 int main() { static char s[N + 1]; int n, i, a, b, c, d, min; scanf("%s", s); n = strlen(s); min = 123456; for (i = 0; i < n - 2; i++) { a = s[i] - '0'; b = s[i + 1] - '0'; c = s[i + 2] - '0'; d = a * 100 + b * 10 + c; if (min > abs(d - 753)) min = abs(d - 753); } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260881/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260881/source.c" target datalayout = "e-m:e-p270: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.s = internal global [11 x i8] zeroinitializer, align 1 @.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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @main.s) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @main.s) #5 %conv = trunc i64 %call1 to i32 %cmp28 = icmp sgt i32 %conv, 2 br i1 %cmp28, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %sub = add i64 %call1, 4294967294 %wide.trip.count = and i64 %sub, 4294967295 %.pre = load i8, ptr @main.s, align 1, !tbaa !5 %.pre33 = load i8, ptr getelementptr inbounds ([11 x i8], ptr @main.s, i64 0, i64 1), align 1, !tbaa !5 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader41, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %sub, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf %vector.recur.init = insertelement <4 x i8> poison, i8 %.pre33, i64 3 %vector.recur.init34 = insertelement <4 x i8> poison, i8 %.pre, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load37, %vector.body ] %vector.recur35 = phi <4 x i8> [ %vector.recur.init34, %vector.ph ], [ %4, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 123456, i32 123456, i32 123456, i32 123456>, %vector.ph ], [ %25, %vector.body ] %vec.phi36 = phi <4 x i32> [ <i32 123456, i32 123456, i32 123456, i32 123456>, %vector.ph ], [ %26, %vector.body ] %0 = or i64 %index, 2 %1 = getelementptr inbounds [11 x i8], ptr @main.s, i64 0, i64 %0 %wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load37 = load <4 x i8>, ptr %2, align 1, !tbaa !5 %3 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %4 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load37, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %5 = shufflevector <4 x i8> %vector.recur35, <4 x i8> %3, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %6 = shufflevector <4 x i8> %3, <4 x i8> %4, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %7 = sext <4 x i8> %5 to <4 x i32> %8 = sext <4 x i8> %6 to <4 x i32> %9 = sext <4 x i8> %3 to <4 x i32> %10 = sext <4 x i8> %4 to <4 x i32> %11 = sext <4 x i8> %wide.load to <4 x i32> %12 = sext <4 x i8> %wide.load37 to <4 x i32> %13 = mul nsw <4 x i32> %7, <i32 100, i32 100, i32 100, i32 100> %14 = mul nsw <4 x i32> %8, <i32 100, i32 100, i32 100, i32 100> %15 = mul nsw <4 x i32> %9, <i32 10, i32 10, i32 10, i32 10> %16 = mul nsw <4 x i32> %10, <i32 10, i32 10, i32 10, i32 10> %17 = add nsw <4 x i32> %13, <i32 -6081, i32 -6081, i32 -6081, i32 -6081> %18 = add nsw <4 x i32> %14, <i32 -6081, i32 -6081, i32 -6081, i32 -6081> %19 = add nsw <4 x i32> %17, %15 %20 = add nsw <4 x i32> %18, %16 %21 = add nsw <4 x i32> %19, %11 %22 = add nsw <4 x i32> %20, %12 %23 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %21, i1 true) %24 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %22, i1 true) %25 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %23) %26 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi36, <4 x i32> %24) %index.next = add nuw i64 %index, 8 %27 = icmp eq i64 %index.next, %n.vec br i1 %27, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %25, <4 x i32> %26) %28 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.mod.vf, 0 %vector.recur.extract = extractelement <4 x i8> %wide.load37, i64 3 %vector.recur.extract38 = extractelement <4 x i8> %wide.load37, i64 2 br i1 %cmp.n, label %for.end, label %for.body.preheader41 for.body.preheader41: ; preds = %for.body.preheader, %middle.block %scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %.pre33, %for.body.preheader ] %scalar.recur40.ph = phi i8 [ %vector.recur.extract38, %middle.block ], [ %.pre, %for.body.preheader ] %indvars.iv.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body.preheader ] %min.030.ph = phi i32 [ %28, %middle.block ], [ 123456, %for.body.preheader ] br label %for.body for.body: ; preds = %for.body.preheader41, %for.body %scalar.recur = phi i8 [ %30, %for.body ], [ %scalar.recur.ph, %for.body.preheader41 ] %scalar.recur40 = phi i8 [ %scalar.recur, %for.body ], [ %scalar.recur40.ph, %for.body.preheader41 ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader41 ] %min.030 = phi i32 [ %spec.select, %for.body ], [ %min.030.ph, %for.body.preheader41 ] %conv3 = sext i8 %scalar.recur40 to i32 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %conv7 = sext i8 %scalar.recur to i32 %29 = add nuw nsw i64 %indvars.iv, 2 %arrayidx11 = getelementptr inbounds [11 x i8], ptr @main.s, i64 0, i64 %29 %30 = load i8, ptr %arrayidx11, align 1, !tbaa !5 %conv12 = sext i8 %30 to i32 %31 = mul nsw i32 %conv3, 100 %32 = mul nsw i32 %conv7, 10 %mul14 = add nsw i32 %31, -6081 %sub13 = add nsw i32 %mul14, %32 %sub17 = add nsw i32 %sub13, %conv12 %33 = tail call i32 @llvm.abs.i32(i32 %sub17, i1 true) %spec.select = tail call i32 @llvm.smin.i32(i32 %min.030, i32 %33) %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.body, %middle.block, %entry %min.0.lcssa = phi i32 [ 123456, %entry ], [ %28, %middle.block ], [ %spec.select, %for.body ] %call21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ char s[11]; scanf("%s",s); int n=0; for(int i=0;i<12;i++){ if(s[i]!='\0') n++; else break; } int a[n]; for(int i=0;i<n;i++){ a[i]=(int)(s[i])-'0'; } int min=1000; int error; for(int i=0;i<n-2;i++){ error=abs(753-(100*a[i]+10*a[i+1]+a[i+2])); if(min>error){ min=error; } } printf("%d\n",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260924/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260924/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %cmp1.not = icmp eq i8 %0, 0 br i1 %cmp1.not, label %for.cond20.preheader.thread, label %if.then if.then: ; preds = %entry %arrayidx.1 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp1.not.1 = icmp eq i8 %1, 0 br i1 %cmp1.not.1, label %for.body9.preheader, label %if.then.1 if.then.1: ; preds = %if.then %arrayidx.2 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %cmp1.not.2 = icmp eq i8 %2, 0 br i1 %cmp1.not.2, label %for.body9.preheader, label %if.then.2 if.then.2: ; preds = %if.then.1 %arrayidx.3 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %cmp1.not.3 = icmp eq i8 %3, 0 br i1 %cmp1.not.3, label %for.body9.preheader, label %if.then.3 if.then.3: ; preds = %if.then.2 %arrayidx.4 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 4 %4 = load i8, ptr %arrayidx.4, align 1, !tbaa !5 %cmp1.not.4 = icmp eq i8 %4, 0 br i1 %cmp1.not.4, label %for.body9.preheader, label %if.then.4 if.then.4: ; preds = %if.then.3 %arrayidx.5 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 5 %5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5 %cmp1.not.5 = icmp eq i8 %5, 0 br i1 %cmp1.not.5, label %for.body9.preheader, label %if.then.5 if.then.5: ; preds = %if.then.4 %arrayidx.6 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 6 %6 = load i8, ptr %arrayidx.6, align 1, !tbaa !5 %cmp1.not.6 = icmp eq i8 %6, 0 br i1 %cmp1.not.6, label %for.body9.preheader, label %if.then.6 if.then.6: ; preds = %if.then.5 %arrayidx.7 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 7 %7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5 %cmp1.not.7 = icmp eq i8 %7, 0 br i1 %cmp1.not.7, label %for.body9.preheader, label %if.then.7 if.then.7: ; preds = %if.then.6 %arrayidx.8 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 8 %8 = load i8, ptr %arrayidx.8, align 1, !tbaa !5 %cmp1.not.8 = icmp eq i8 %8, 0 br i1 %cmp1.not.8, label %for.body9.preheader, label %if.then.8 if.then.8: ; preds = %if.then.7 %arrayidx.9 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 9 %9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5 %cmp1.not.9 = icmp eq i8 %9, 0 br i1 %cmp1.not.9, label %for.body9.preheader, label %if.then.9 if.then.9: ; preds = %if.then.8 %arrayidx.10 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 10 %10 = load i8, ptr %arrayidx.10, align 1, !tbaa !5 %cmp1.not.10 = icmp eq i8 %10, 0 br i1 %cmp1.not.10, label %for.body9.preheader, label %if.then.10 if.then.10: ; preds = %if.then.9 %arrayidx.11 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 11 %11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5 %cmp1.not.11 = icmp eq i8 %11, 0 %spec.select95 = select i1 %cmp1.not.11, i32 11, i32 12 br label %for.body9.preheader for.cond20.preheader.thread: ; preds = %entry %12 = call ptr @llvm.stacksave.p0() br label %for.cond.cleanup24 for.body9.preheader: ; preds = %if.then.10, %if.then.9, %if.then.8, %if.then.7, %if.then.6, %if.then.5, %if.then.4, %if.then.3, %if.then.2, %if.then.1, %if.then %cmp2269.ph = phi i1 [ true, %if.then.9 ], [ true, %if.then.8 ], [ true, %if.then.7 ], [ true, %if.then.6 ], [ true, %if.then.5 ], [ true, %if.then.4 ], [ true, %if.then.3 ], [ true, %if.then.2 ], [ false, %if.then.1 ], [ false, %if.then ], [ true, %if.then.10 ] %n.0.lcssa.ph = phi i32 [ 10, %if.then.9 ], [ 9, %if.then.8 ], [ 8, %if.then.7 ], [ 7, %if.then.6 ], [ 6, %if.then.5 ], [ 5, %if.then.4 ], [ 4, %if.then.3 ], [ 3, %if.then.2 ], [ 2, %if.then.1 ], [ 1, %if.then ], [ %spec.select95, %if.then.10 ] %13 = zext i32 %n.0.lcssa.ph to i64 %14 = call ptr @llvm.stacksave.p0() %vla85 = alloca i32, i64 %13, align 16 %xtraiter = and i64 %13, 3 %15 = icmp ult i32 %n.0.lcssa.ph, 4 br i1 %15, label %for.cond20.preheader.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = and i64 %13, 12 br label %for.body9 for.cond20.preheader.unr-lcssa: ; preds = %for.body9, %for.body9.preheader %indvars.iv.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next.3, %for.body9 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond20.preheader, label %for.body9.epil for.body9.epil: ; preds = %for.cond20.preheader.unr-lcssa, %for.body9.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body9.epil ], [ %indvars.iv.unr, %for.cond20.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.cond20.preheader.unr-lcssa ] %arrayidx11.epil = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv.epil %16 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !5 %conv12.epil = sext i8 %16 to i32 %sub.epil = add nsw i32 %conv12.epil, -48 %arrayidx14.epil = getelementptr inbounds i32, ptr %vla85, i64 %indvars.iv.epil store i32 %sub.epil, ptr %arrayidx14.epil, align 4, !tbaa !8 %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.cond20.preheader, label %for.body9.epil, !llvm.loop !10 for.cond20.preheader: ; preds = %for.body9.epil, %for.cond20.preheader.unr-lcssa br i1 %cmp2269.ph, label %for.body25.preheader, label %for.cond.cleanup24 for.body25.preheader: ; preds = %for.cond20.preheader %sub21 = add nsw i32 %n.0.lcssa.ph, -2 %wide.trip.count80 = zext i32 %sub21 to i64 %.pre = load i32, ptr %vla85, align 16, !tbaa !8 %arrayidx29.phi.trans.insert = getelementptr inbounds i32, ptr %vla85, i64 1 %.pre82 = load i32, ptr %arrayidx29.phi.trans.insert, align 4, !tbaa !8 %invariant.gep = getelementptr i32, ptr %vla85, i64 2 %min.iters.check = icmp ult i32 %sub21, 8 br i1 %min.iters.check, label %for.body25.preheader103, label %vector.ph vector.ph: ; preds = %for.body25.preheader %n.vec = and i64 %wide.trip.count80, 4294967288 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre82, i64 3 %vector.recur.init96 = insertelement <4 x i32> poison, i32 %.pre, i64 3 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load99, %vector.body ] %vector.recur97 = phi <4 x i32> [ %vector.recur.init96, %vector.ph ], [ %20, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %35, %vector.body ] %vec.phi98 = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %36, %vector.body ] %17 = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %17, align 8, !tbaa !8 %18 = getelementptr i32, ptr %17, i64 4 %wide.load99 = load <4 x i32>, ptr %18, align 8, !tbaa !8 %19 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %20 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load99, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %21 = shufflevector <4 x i32> %vector.recur97, <4 x i32> %19, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %22 = shufflevector <4 x i32> %19, <4 x i32> %20, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %23 = mul <4 x i32> %21, <i32 -100, i32 -100, i32 -100, i32 -100> %24 = mul <4 x i32> %22, <i32 -100, i32 -100, i32 -100, i32 -100> %25 = mul <4 x i32> %19, <i32 -10, i32 -10, i32 -10, i32 -10> %26 = mul <4 x i32> %20, <i32 -10, i32 -10, i32 -10, i32 -10> %27 = add <4 x i32> %23, <i32 753, i32 753, i32 753, i32 753> %28 = add <4 x i32> %24, <i32 753, i32 753, i32 753, i32 753> %29 = add <4 x i32> %27, %25 %30 = add <4 x i32> %28, %26 %31 = sub <4 x i32> %29, %wide.load %32 = sub <4 x i32> %30, %wide.load99 %33 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %31, i1 true) %34 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %32, i1 true) %35 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %33) %36 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi98, <4 x i32> %34) %index.next = add nuw i64 %index, 8 %37 = icmp eq i64 %index.next, %n.vec br i1 %37, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %35, <4 x i32> %36) %38 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count80 %vector.recur.extract = extractelement <4 x i32> %wide.load99, i64 3 %vector.recur.extract100 = extractelement <4 x i32> %wide.load99, i64 2 br i1 %cmp.n, label %for.cond.cleanup24, label %for.body25.preheader103 for.body25.preheader103: ; preds = %for.body25.preheader, %middle.block %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre82, %for.body25.preheader ] %scalar.recur102.ph = phi i32 [ %vector.recur.extract100, %middle.block ], [ %.pre, %for.body25.preheader ] %indvars.iv76.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body25.preheader ] %min.070.ph = phi i32 [ %38, %middle.block ], [ 1000, %for.body25.preheader ] br label %for.body25 for.body9: ; preds = %for.body9, %for.body9.preheader.new %indvars.iv = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next.3, %for.body9 ] %niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ] %arrayidx11 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv %39 = load i8, ptr %arrayidx11, align 1, !tbaa !5 %conv12 = sext i8 %39 to i32 %sub = add nsw i32 %conv12, -48 %arrayidx14 = getelementptr inbounds i32, ptr %vla85, i64 %indvars.iv store i32 %sub, ptr %arrayidx14, align 16, !tbaa !8 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx11.1 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv.next %40 = load i8, ptr %arrayidx11.1, align 1, !tbaa !5 %conv12.1 = sext i8 %40 to i32 %sub.1 = add nsw i32 %conv12.1, -48 %arrayidx14.1 = getelementptr inbounds i32, ptr %vla85, i64 %indvars.iv.next store i32 %sub.1, ptr %arrayidx14.1, align 4, !tbaa !8 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx11.2 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv.next.1 %41 = load i8, ptr %arrayidx11.2, align 1, !tbaa !5 %conv12.2 = sext i8 %41 to i32 %sub.2 = add nsw i32 %conv12.2, -48 %arrayidx14.2 = getelementptr inbounds i32, ptr %vla85, i64 %indvars.iv.next.1 store i32 %sub.2, ptr %arrayidx14.2, align 8, !tbaa !8 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx11.3 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv.next.2 %42 = load i8, ptr %arrayidx11.3, align 1, !tbaa !5 %conv12.3 = sext i8 %42 to i32 %sub.3 = add nsw i32 %conv12.3, -48 %arrayidx14.3 = getelementptr inbounds i32, ptr %vla85, i64 %indvars.iv.next.2 store i32 %sub.3, ptr %arrayidx14.3, align 4, !tbaa !8 %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.cond20.preheader.unr-lcssa, label %for.body9, !llvm.loop !16 for.cond.cleanup24: ; preds = %for.body25, %middle.block, %for.cond20.preheader.thread, %for.cond20.preheader %43 = phi ptr [ %14, %for.cond20.preheader ], [ %12, %for.cond20.preheader.thread ], [ %14, %middle.block ], [ %14, %for.body25 ] %min.0.lcssa = phi i32 [ 1000, %for.cond20.preheader ], [ 1000, %for.cond20.preheader.thread ], [ %38, %middle.block ], [ %spec.select, %for.body25 ] %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.stackrestore.p0(ptr %43) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #6 ret i32 0 for.body25: ; preds = %for.body25.preheader103, %for.body25 %scalar.recur = phi i32 [ %44, %for.body25 ], [ %scalar.recur.ph, %for.body25.preheader103 ] %scalar.recur102 = phi i32 [ %scalar.recur, %for.body25 ], [ %scalar.recur102.ph, %for.body25.preheader103 ] %indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body25 ], [ %indvars.iv76.ph, %for.body25.preheader103 ] %min.070 = phi i32 [ %spec.select, %for.body25 ], [ %min.070.ph, %for.body25.preheader103 ] %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv76 %44 = load i32, ptr %gep, align 4, !tbaa !8 %mul.neg = mul i32 %scalar.recur102, -100 %mul30.neg = mul i32 %scalar.recur, -10 %add31.neg = add i32 %mul.neg, 753 %add35.neg = add i32 %add31.neg, %mul30.neg %sub36 = sub i32 %add35.neg, %44 %45 = call i32 @llvm.abs.i32(i32 %sub36, i1 true) %spec.select = call i32 @llvm.smin.i32(i32 %min.070, i32 %45) %exitcond81.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count80 br i1 %exitcond81.not, label %for.cond.cleanup24, label %for.body25, !llvm.loop !17 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; 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 <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.unroll.disable"} !12 = distinct !{!12, !13, !14, !15} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !13} !17 = distinct !{!17, !13, !15, !14}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void){ char s[15] = {}; int num[15] = {}; int N;//文字列sの長さ int X; int min;//abs(X - 753)の最小値 int i;//カウンタ scanf("%s", s); N = strlen(s); for(i = 0; i < N; i++){ num[i] = s[i] - '0'; } X = num[0]*100 + num[1]*10 + num[2]; min = abs(X - 753); for(i = 1; i < N-2; i++){ X = num[i]*100 + num[i+1]*10 + num[i+2]; if(abs(X - 753) < min){ min = abs(X - 753); } } printf("%d\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260975/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260975/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [15 x i8], align 1 %num = alloca [15 x i32], align 16 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %s) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %s, i8 0, i64 15, i1 false) call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %num) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) %num, i8 0, i64 60, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #8 %conv = trunc i64 %call2 to i32 %cmp50 = icmp sgt i32 %conv, 0 br i1 %cmp50, label %for.body.preheader, label %for.end36 for.body.preheader: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader95, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %call2, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %0 = getelementptr inbounds [15 x i8], ptr %s, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %0, align 1, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 4 %wide.load73 = load <4 x i8>, ptr %1, align 1, !tbaa !5 %2 = sext <4 x i8> %wide.load to <4 x i32> %3 = sext <4 x i8> %wide.load73 to <4 x i32> %4 = add nsw <4 x i32> %2, <i32 -48, i32 -48, i32 -48, i32 -48> %5 = add nsw <4 x i32> %3, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = getelementptr inbounds [15 x i32], ptr %num, i64 0, i64 %index store <4 x i32> %4, ptr %6, align 16, !tbaa !8 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> %5, ptr %7, align 16, !tbaa !8 %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 !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.end, label %for.body.preheader95 for.body.preheader95: ; 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.preheader95, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader95 ] %arrayidx = getelementptr inbounds [15 x i8], ptr %s, i64 0, i64 %indvars.iv %9 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv4 = sext i8 %9 to i32 %sub = add nsw i32 %conv4, -48 %arrayidx6 = getelementptr inbounds [15 x i32], ptr %num, i64 0, i64 %indvars.iv store i32 %sub, ptr %arrayidx6, align 4, !tbaa !8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block %.pre = load i32, ptr %num, align 16, !tbaa !8 %arrayidx8.phi.trans.insert = getelementptr inbounds [15 x i32], ptr %num, i64 0, i64 1 %.pre62 = load i32, ptr %arrayidx8.phi.trans.insert, align 4, !tbaa !8 %arrayidx10.phi.trans.insert = getelementptr inbounds [15 x i32], ptr %num, i64 0, i64 2 %.pre63 = load i32, ptr %arrayidx10.phi.trans.insert, align 8, !tbaa !8 %10 = mul nsw i32 %.pre, 100 %11 = add i32 %10, -753 %mul9 = mul nsw i32 %.pre62, 10 %add11 = add i32 %11, %mul9 %sub12 = add i32 %add11, %.pre63 %12 = call i32 @llvm.abs.i32(i32 %sub12, i1 true) %cmp1552 = icmp sgt i32 %conv, 3 br i1 %cmp1552, label %for.body17.preheader, label %for.end36 for.body17.preheader: ; preds = %for.end %sub14 = add i64 %call2, 4294967294 %wide.trip.count60 = and i64 %sub14, 4294967295 %13 = add nsw i64 %wide.trip.count60, -1 %min.iters.check76 = icmp ult i64 %13, 8 br i1 %min.iters.check76, label %for.body17.preheader93, label %vector.ph77 vector.ph77: ; preds = %for.body17.preheader %n.vec79 = and i64 %13, -8 %ind.end = or i64 %n.vec79, 1 %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre63, i64 3 %vector.recur.init84 = insertelement <4 x i32> poison, i32 %.pre62, i64 3 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %12, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body82 vector.body82: ; preds = %vector.body82, %vector.ph77 %index83 = phi i64 [ 0, %vector.ph77 ], [ %index.next89, %vector.body82 ] %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph77 ], [ %wide.load88, %vector.body82 ] %vector.recur85 = phi <4 x i32> [ %vector.recur.init84, %vector.ph77 ], [ %18, %vector.body82 ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph77 ], [ %33, %vector.body82 ] %vec.phi86 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph77 ], [ %34, %vector.body82 ] %14 = or i64 %index83, 3 %15 = getelementptr inbounds [15 x i32], ptr %num, i64 0, i64 %14 %wide.load87 = load <4 x i32>, ptr %15, align 4, !tbaa !8 %16 = getelementptr inbounds i32, ptr %15, i64 4 %wide.load88 = load <4 x i32>, ptr %16, align 4, !tbaa !8 %17 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load87, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %18 = shufflevector <4 x i32> %wide.load87, <4 x i32> %wide.load88, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %19 = shufflevector <4 x i32> %vector.recur85, <4 x i32> %17, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %20 = shufflevector <4 x i32> %17, <4 x i32> %18, <4 x i32> <i32 3, i32 4, i32 5, i32 6> %21 = mul nsw <4 x i32> %19, <i32 100, i32 100, i32 100, i32 100> %22 = mul nsw <4 x i32> %20, <i32 100, i32 100, i32 100, i32 100> %23 = mul nsw <4 x i32> %17, <i32 10, i32 10, i32 10, i32 10> %24 = mul nsw <4 x i32> %18, <i32 10, i32 10, i32 10, i32 10> %25 = add <4 x i32> %21, <i32 -753, i32 -753, i32 -753, i32 -753> %26 = add <4 x i32> %22, <i32 -753, i32 -753, i32 -753, i32 -753> %27 = add <4 x i32> %25, %23 %28 = add <4 x i32> %26, %24 %29 = add <4 x i32> %27, %wide.load87 %30 = add <4 x i32> %28, %wide.load88 %31 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %29, i1 true) %32 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %30, i1 true) %33 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %31, <4 x i32> %vec.phi) %34 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %32, <4 x i32> %vec.phi86) %index.next89 = add nuw i64 %index83, 8 %35 = icmp eq i64 %index.next89, %n.vec79 br i1 %35, label %middle.block74, label %vector.body82, !llvm.loop !15 middle.block74: ; preds = %vector.body82 %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %33, <4 x i32> %34) %36 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n81 = icmp eq i64 %13, %n.vec79 %vector.recur.extract = extractelement <4 x i32> %wide.load88, i64 3 %vector.recur.extract90 = extractelement <4 x i32> %wide.load88, i64 2 br i1 %cmp.n81, label %for.end36, label %for.body17.preheader93 for.body17.preheader93: ; preds = %for.body17.preheader, %middle.block74 %scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block74 ], [ %.pre63, %for.body17.preheader ] %scalar.recur92.ph = phi i32 [ %vector.recur.extract90, %middle.block74 ], [ %.pre62, %for.body17.preheader ] %indvars.iv56.ph = phi i64 [ %ind.end, %middle.block74 ], [ 1, %for.body17.preheader ] %min.053.ph = phi i32 [ %36, %middle.block74 ], [ %12, %for.body17.preheader ] br label %for.body17 for.body17: ; preds = %for.body17.preheader93, %for.body17 %scalar.recur = phi i32 [ %38, %for.body17 ], [ %scalar.recur.ph, %for.body17.preheader93 ] %scalar.recur92 = phi i32 [ %scalar.recur, %for.body17 ], [ %scalar.recur92.ph, %for.body17.preheader93 ] %indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body17 ], [ %indvars.iv56.ph, %for.body17.preheader93 ] %min.053 = phi i32 [ %spec.select, %for.body17 ], [ %min.053.ph, %for.body17.preheader93 ] %mul20 = mul nsw i32 %scalar.recur92, 100 %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1 %mul24 = mul nsw i32 %scalar.recur, 10 %37 = add nuw nsw i64 %indvars.iv56, 2 %arrayidx28 = getelementptr inbounds [15 x i32], ptr %num, i64 0, i64 %37 %38 = load i32, ptr %arrayidx28, align 4, !tbaa !8 %add25 = add i32 %mul20, -753 %add29 = add i32 %add25, %mul24 %sub30 = add i32 %add29, %38 %39 = call i32 @llvm.abs.i32(i32 %sub30, i1 true) %spec.select = call i32 @llvm.smin.i32(i32 %39, i32 %min.053) %exitcond61.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count60 br i1 %exitcond61.not, label %for.end36, label %for.body17, !llvm.loop !16 for.end36: ; preds = %for.body17, %middle.block74, %entry, %for.end %min.0.lcssa = phi i32 [ %12, %for.end ], [ 753, %entry ], [ %36, %middle.block74 ], [ %spec.select, %for.body17 ] %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %num) #7 call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %s) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !13, !12} !15 = distinct !{!15, !11, !12, !13} !16 = distinct !{!16, !11, !13, !12}
#include <stdio.h> #include <stdlib.h> int main(int argc, char const *argv[]) { int n, k=0, ans; char s[11], s1[4]; scanf("%s", s); s1[0]=s[0]; s1[1]=s[1]; s1[2]=s[2]; s1[3]='\0'; n=atoi(s1); ans=abs(n-753); while (s[k] != '\0') k++; for (int i = 1; i < k-2; ++i) { s1[0]=s[i]; s1[1]=s[i+1]; s1[2]=s[i+2]; s1[3]='\0'; n=atoi(s1); if (ans>abs(n-753)) ans=abs(n-753); } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261024/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261024/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %s = alloca [11 x i8], align 1 %s1 = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s1) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 store i8 %0, ptr %s1, align 1, !tbaa !5 %arrayidx2 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %arrayidx3 = getelementptr inbounds [4 x i8], ptr %s1, i64 0, i64 1 store i8 %1, ptr %arrayidx3, align 1, !tbaa !5 %arrayidx4 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %arrayidx5 = getelementptr inbounds [4 x i8], ptr %s1, i64 0, i64 2 store i8 %2, ptr %arrayidx5, align 1, !tbaa !5 %arrayidx6 = getelementptr inbounds [4 x i8], ptr %s1, i64 0, i64 3 store i8 0, ptr %arrayidx6, align 1, !tbaa !5 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %s1, ptr noundef null, i32 noundef 10) #6 %conv.i = trunc i64 %call.i to i32 %sub = add nsw i32 %conv.i, -753 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv52 = phi i32 [ %indvars.iv.next53, %while.cond ], [ -2, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx9 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv %3 = load i8, ptr %arrayidx9, align 1, !tbaa !5 %cmp.not = icmp eq i8 %3, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next53 = add nsw i32 %indvars.iv52, 1 br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !8 for.cond.preheader: ; preds = %while.cond %4 = call i32 @llvm.abs.i32(i32 %sub, i1 true) %5 = and i64 %indvars.iv, 4294967292 %cmp1244.not = icmp eq i64 %5, 0 br i1 %cmp1244.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %indvars.iv52 to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %for.cond.preheader %ans.0.lcssa = phi i32 [ %4, %for.cond.preheader ], [ %spec.select, %for.body ] %call32 = 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 %s1) #6 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #6 ret i32 0 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv48 = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next49, %for.body ] %ans.045 = phi i32 [ %4, %for.body.preheader ], [ %spec.select, %for.body ] %arrayidx15 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv48 %6 = load i8, ptr %arrayidx15, align 1, !tbaa !5 store i8 %6, ptr %s1, align 1, !tbaa !5 %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1 %arrayidx18 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv.next49 %7 = load i8, ptr %arrayidx18, align 1, !tbaa !5 store i8 %7, ptr %arrayidx3, align 1, !tbaa !5 %8 = add nuw nsw i64 %indvars.iv48, 2 %arrayidx22 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %8 %9 = load i8, ptr %arrayidx22, align 1, !tbaa !5 store i8 %9, ptr %arrayidx5, align 1, !tbaa !5 store i8 0, ptr %arrayidx6, align 1, !tbaa !5 %call.i42 = call i64 @strtol(ptr nocapture noundef nonnull %s1, ptr noundef null, i32 noundef 10) #6 %conv.i43 = trunc i64 %call.i42 to i32 %sub27 = add nsw i32 %conv.i43, -753 %10 = call i32 @llvm.abs.i32(i32 %sub27, i1 true) %spec.select = call i32 @llvm.smin.i32(i32 %ans.045, i32 %10) %exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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 i32 @llvm.abs.i32(i32, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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}
#pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <float.h> #pragma region 定義 #define i_cin(X) scanf("%d", &X) #define i_cin2(X,Y) scanf("%d %d",&X,&Y) #define i_cin4(X,Y,Z,W) scanf("%d %d %d %d",&X,&Y,&Z,&W) #define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z) #define l_cin(X) scanf("%ld",&X) #define f_cin(X) scanf("%f",&X) #define l_cin2(X,Y) scanf("%ld %ld",&X,&Y) #define s_cin(X) scanf("%s",&X) #define c_cin(X) scanf("%c",&X); #define ll_cin(X) scanf("%lld", &X) #define ull_cin(X) scanf("%llu", &X) #define lf_cin(X) scanf("%lf", &X) #define i_cout(X) printf("%d\n",X) #define f_cout(X) printf("%g\n",X) #define i_cout2(X,Y) printf("%d %d\n",X,Y) #define l_cout(X) printf("%ld\n",X) #define s_cout(X) printf("%s\n",X) #define s_coutc(X) printf("%s",X) #define c_cout(X) printf("%c",X) #define ll_cout(X) printf("%lld\n",X) #define ull_cout(X) printf("%llu\n",X) typedef long long ll; typedef unsigned long long ull; #define rept(x, s, n) for (int x = s; x < n; x++) #define S_RTN(S) s_cout(S);return 0 #define _itoa(A,N) sprintf(A, "%d", N); int i_cins(int n, int* A); int l_cins2(int n, long* A, long* B); int s_dsort(const void* a, const void* b); int s_asort(const void* a, const void* b); int _gcd(int a, int b); int _swp(int* a, int* b); int _cknum(char* a, int n); int _atoi(char* s, int len); int s_asorts(const void* a, const void* b); //昇順 int s_asorts(const void* a, const void* b) { return(strcmp((char*)a, (char*)b)); } int s_dsort(const void* a, const void* b) { return(*(int*)b - *(int*)a); } int s_asort(const void* a, const void* b) { return(*(int*)a - *(int*)b); } int l_cins2(int n, long* a, long* b) { int i; rept(i, 0, n) { l_cin2(*(a + i), *(b + i)); } return 0; } int i_cins(int n, int* a) { int i; for (i = 0; i < n; i++) { i_cin(*(a + i)); } return 0; } int _gcd(int a, int b) { int r, tmp; if (a < b) { tmp = a; a = b; b = tmp; } r = a % b; while (r) { if (!r) break; a = b; b = r; r = a % b; } return(b); } // puts("Yes\n") puts("No\n") // scanf("%d.%d") 浮動小数点入力を整数2つで得る //#define pai 3.1415926535 #define deg_rad(X) (X*(M_PI/180)) long _max(long a, long b) { return a > b ? a : b; } long _min(long a, long b) { return a < b ? a : b; } int _swp(int* a, int* b) { int tmp; tmp = *b; *b = *a; *a = tmp; return 0; } int _cknum(char* a, int n) { int i; char t = '0'; for (i = 0; i < n; i++) { if (a[i] < '0' || a[i]>'9') return 1; } return 0; } int _atoi(char* s, int len) { char tmp[20]; memcpy(tmp, s, len); tmp[len] = 0x00; return (atoi(tmp)); } //素因数分解 pf素数が入る pc 素数の数 ll _pfact(ll a); static ll pf[100000000]; static ll pc; ll _pfact(ll a) { long i, r; if (a % 2 == 0) { pf[pc] = 2; pc++; return(_pfact(a / 2)); } r = sqrt(a); for (i = 3; i <= r; i += 2) { if (a % i == 0) { pf[pc] = i; pc++; return(_pfact(a / i)); } } if (a != 1) { pf[pc] = a; pc++; } return 0; } #pragma endregion //150-C //169-A //ARC-091 A Flip int main(void) { long n, m, cnt,tmp; scanf("%ld %ld", &n, &m); if (!(n * m)) { puts("0\n"); return 0; } tmp = (n - 2) * (m - 2); printf("%ld",(tmp<0)?tmp*=-1:tmp); return 0; } //int main(void) { // char a[1001]; // int i, len, e=0,w=0,n=0,s=0; // // scanf("%s", a); // len = strlen(a); a[len] = 0x00; // for (i = 0; i < len; i++) { // switch (a[i]) { // case 'N':n ++; break; // case 'S':s ++; break; // case 'E':e ++; break; // case 'W':w ++; break; // } // } // if ((e == w) && (n && s)) { // printf("Yes\n"); return 0; // } // if ((n == s) && (e && w)) { // printf("Yes\n"); return 0; // } // // printf("No\n"); // // // return 0; //} //066-B //157-C //int main(void) { // int n, m; // int s, c; // int a[3] = { -1,-1,-1 }; // int i, ans=0; // // i_cin2(n, m); // // if (m == 0 && n!=1) { i_cout(-1); return 0; } //???2つ目の条件なし // // for (i = 0; i < m; i++) { // i_cin2(s, c); // if ((a[s - 1] != -1) && //矛盾はないか // (a[s - 1] != c) ) { i_cout(-1); return 0; } // switch (n) { // case 1:if (s != 3) { i_cout(-1); return 0; } // break; // case 2:if (s == 1) { i_cout(-1); return 0; } // if (s == 2 && c == 0) // {i_cout(-1); return 0;} // break; // case 3: // if (s == 1 && c == 0) // {i_cout(-1); return 0;} // break; // } // a[s - 1] = c; // } // // for (i = 0; i < 3; i++) { // if (a[i] == -1) a[i] = 0; // } // ans = a[0] * 100 + a[1] * 10 + a[2]; // // i_cout(ans); // return 0; //} //ABC-07 D 幅優先探索 //#define Q_SIZE 100000 //static struct _queue { // char *d[Q_SIZE]; // int h; // int t; //} q; // //int pushq(struct _queue* q, char *item); //int pushq(struct _queue* q, char *item) { // if (q->t == Q_SIZE) return -1; // q->d[q->t] = item; // q->t++; // return 0; //} // //char* popq(struct _queue* q); //char* popq(struct _queue* q) { // char* tmp; // if (q->h == q->t) return -1; // tmp = q->d[q->h]; // q->h--; // return tmp; //} // //static struct _p { // int x; // int y; // int cnt; //} q; //static char a[51][51]; //static struct _p p[50]; //static int pcnt; // //int _enq(struct _p *p, int x, int y, int cnt); //int _enq(struct _p *p,int x, int y, int cnt) { // p->x = x; p->y = y; p->cnt = cnt; // pushq(&q,p); pcnt++; //} //int _deq(struct _p* p); //int _deq(struct _p* p) { // p=popq(&q); // return(p == -1 ? p : 0); //} //int sqr_chk(int x, int y, int cnt) { // int tmp; // tmp = pcnt; // if (a[x - 1][y - 1] == '.') // { // _enq(&p[pcnt], x - 1, y - 1, cnt); a[x - 1][y - 1] = 'X'; // } // if (a[x - 1][y] == '.') // { // _enq(&p[pcnt], x - 1, y, cnt); a[x - 1][y] = 'X'; // } // if (a[x+1][y] == '.') // { // _enq(&p[pcnt], x + 1, y, cnt); a[x + 1][y] = 'X'; // } // if (a[x][y+1] == '.') // { // _enq(&p[pcnt], x, y + 1, cnt); a[x][y + 1] = 'X'; // } // if (pcnt == tmp) return -1; // else return 0; //} // //int main(void) { // int r, c; // int sy, sx, gy, gx; // int i = 0, j = 0, x = 0, y = 0, ans = 0; // char cnt = '0'; // // i_cin(r, c); // i_cin4(sx, sy, gx, gy); // if (sx == gx && sy == gy) { // i_cout(0); return 0; // } // for (i = 0; i < r; i++) // s_cin(a[i]); // sy--; sx--; // struct _p* pt; // pt = &p[cnt]; // p->x = sx; p->y = sy; p->cnt = cnt; // // int rc; // while (1) { // rc = sqr_chk(pt->x,pt->y,pt->cnt); // if (rc == -1) { // rc = _deq(pt); // if (rc == -1 || (pt->x == gx && pt->y == gy)) break; // } // } // // if (rc == -1) i_cout(rc); // else i_cout(ans); // return 0; //}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261103/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261103/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @pc = internal unnamed_addr global i64 0, align 8 @.str.2 = private unnamed_addr constant [3 x i8] c"0\0A\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asorts(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @l_cins2(i32 noundef %n, ptr noundef %a, ptr noundef %b) local_unnamed_addr #3 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry ret i32 0 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %add.ptr = getelementptr inbounds i64, ptr %a, i64 %indvars.iv %add.ptr3 = getelementptr inbounds i64, ptr %b, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr, ptr noundef %add.ptr3) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @i_cins(i32 noundef %n, ptr noundef %a) local_unnamed_addr #3 { entry: %cmp3 = icmp sgt i32 %n, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry ret i32 0 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @_gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #6 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %spec.select15 = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %rem = srem i32 %spec.select15, %spec.select %tobool.not16 = icmp eq i32 %rem, 0 br i1 %tobool.not16, label %while.end, label %if.end3 if.end3: ; preds = %entry, %if.end3 %r.018 = phi i32 [ %rem4, %if.end3 ], [ %rem, %entry ] %b.addr.117 = phi i32 [ %r.018, %if.end3 ], [ %spec.select, %entry ] %rem4 = srem i32 %b.addr.117, %r.018 %tobool.not = icmp eq i32 %rem4, 0 br i1 %tobool.not, label %while.end, label %if.end3, !llvm.loop !12 while.end: ; preds = %if.end3, %entry %b.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %r.018, %if.end3 ] ret i32 %b.addr.1.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #7 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #7 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @_swp(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #8 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %b, align 4, !tbaa !5 store i32 %0, ptr %a, align 4, !tbaa !5 ret i32 0 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @_cknum(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #9 { entry: %cmp13 = icmp sgt i32 %n, 0 br i1 %cmp13, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !13 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds i8, ptr %a, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !14 %1 = add i8 %0, -58 %or.cond = icmp ult i8 %1, -10 br i1 %or.cond, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn uwtable define dso_local i32 @_atoi(ptr nocapture noundef readonly %s, i32 noundef %len) local_unnamed_addr #10 { entry: %tmp = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %tmp) #17 %conv = sext i32 %len to i64 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %tmp, ptr align 1 %s, i64 %conv, i1 false) %arrayidx = getelementptr inbounds [20 x i8], ptr %tmp, i64 0, i64 %conv store i8 0, ptr %arrayidx, align 1, !tbaa !14 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmp, ptr noundef null, i32 noundef 10) #17 %conv.i = trunc i64 %call.i to i32 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) #17 ret i32 %conv.i } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #11 ; Function Attrs: nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable define dso_local i64 @_pfact(i64 noundef %a) local_unnamed_addr #12 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse.backedge ] %0 = and i64 %a.tr, 1 %cmp = icmp eq i64 %0, 0 br i1 %cmp, label %tailrecurse.backedge, label %if.end tailrecurse.backedge: ; preds = %for.body, %tailrecurse %.sink = phi i64 [ 2, %tailrecurse ], [ %i.035, %for.body ] %1 = load i64, ptr @pc, align 8, !tbaa !15 %inc = add nsw i64 %1, 1 store i64 %inc, ptr @pc, align 8, !tbaa !15 %div = sdiv i64 %a.tr, %.sink br label %tailrecurse if.end: ; preds = %tailrecurse %conv = sitofp i64 %a.tr to double %call1 = tail call double @sqrt(double noundef %conv) #17 %conv2 = fptosi double %call1 to i64 %cmp3.not34 = icmp slt i64 %conv2, 3 br i1 %cmp3.not34, label %for.end, label %for.body for.body: ; preds = %if.end, %for.inc %i.035 = phi i64 [ %add, %for.inc ], [ 3, %if.end ] %rem5 = srem i64 %a.tr, %i.035 %cmp6 = icmp eq i64 %rem5, 0 br i1 %cmp6, label %tailrecurse.backedge, label %for.inc for.inc: ; preds = %for.body %add = add nuw nsw i64 %i.035, 2 %cmp3.not = icmp sgt i64 %add, %conv2 br i1 %cmp3.not, label %for.end, label %for.body, !llvm.loop !17 for.end: ; preds = %if.end, %for.inc %cmp14.not = icmp eq i64 %a.tr, 1 br i1 %cmp14.not, label %cleanup, label %if.then16 if.then16: ; preds = %for.end %2 = load i64, ptr @pc, align 8, !tbaa !15 %inc18 = add nsw i64 %2, 1 store i64 %inc18, ptr @pc, align 8, !tbaa !15 br label %cleanup cleanup: ; preds = %for.end, %if.then16 ret i64 0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #17 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %n, align 8, !tbaa !18 %1 = load i64, ptr %m, align 8, !tbaa !18 %mul = mul nsw i64 %1, %0 %tobool.not = icmp eq i64 %mul, 0 br i1 %tobool.not, label %if.then, label %if.end if.then: ; preds = %entry %call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %cleanup if.end: ; preds = %entry %sub = add nsw i64 %0, -2 %sub2 = add nsw i64 %1, -2 %mul3 = mul nsw i64 %sub2, %sub %cond = call i64 @llvm.abs.i64(i64 %mul3, i1 true) %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %cond) br label %cleanup cleanup: ; preds = %if.end, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #17 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #17 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #14 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #15 attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-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 nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { 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 #9 = { 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 #10 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #12 = { nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: 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 #13 = { 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 #14 = { 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 #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nounwind willreturn memory(read) } attributes #17 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 = !{!7, !7, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"long long", !7, i64 0} !17 = distinct !{!17, !10} !18 = !{!19, !19, i64 0} !19 = !{!"long", !7, i64 0}
#include <stdio.h> int main(void) { int h1, h2, m1, m2, s1, s2, i; int h, m, s; for(i=0; i<3; i++) { scanf("%d%d%d%d%d%d", &h1, &m1, &s1, &h2, &m2, &s2); if(s1<=s2) { s = s2-s1; } else { s = s2+60-s1; m2--; } if(m1<=m2) { m = m2-m1; } else { m = m2+60-m1; h2--; } h = h2-h1; printf("%d %d %d\n", h, m, s); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261147/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261147/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [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: %h1 = alloca i32, align 4 %h2 = alloca i32, align 4 %m1 = alloca i32, align 4 %m2 = alloca i32, align 4 %s1 = alloca i32, align 4 %s2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s2) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2) %0 = load i32, ptr %s1, align 4, !tbaa !5 %1 = load i32, ptr %s2, align 4, !tbaa !5 %cmp1.not = icmp sgt i32 %0, %1 %.pre = load i32, ptr %m2, align 4, !tbaa !5 br i1 %cmp1.not, label %if.else, label %if.end if.else: ; preds = %entry %add = add nsw i32 %1, 60 %dec = add nsw i32 %.pre, -1 store i32 %dec, ptr %m2, align 4, !tbaa !5 br label %if.end if.end: ; preds = %entry, %if.else %2 = phi i32 [ %dec, %if.else ], [ %.pre, %entry ] %.pn = phi i32 [ %add, %if.else ], [ %1, %entry ] %s.0 = sub nsw i32 %.pn, %0 %3 = load i32, ptr %m1, align 4, !tbaa !5 %cmp3.not = icmp sgt i32 %3, %2 %.pre22 = load i32, ptr %h2, align 4, !tbaa !5 br i1 %cmp3.not, label %if.else6, label %if.end10 if.else6: ; preds = %if.end %add7 = add nsw i32 %2, 60 %dec9 = add nsw i32 %.pre22, -1 store i32 %dec9, ptr %h2, align 4, !tbaa !5 br label %if.end10 if.end10: ; preds = %if.end, %if.else6 %4 = phi i32 [ %dec9, %if.else6 ], [ %.pre22, %if.end ] %.pn20 = phi i32 [ %add7, %if.else6 ], [ %2, %if.end ] %m.0 = sub nsw i32 %.pn20, %3 %5 = load i32, ptr %h1, align 4, !tbaa !5 %sub11 = sub nsw i32 %4, %5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub11, i32 noundef %m.0, i32 noundef %s.0) %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2) %6 = load i32, ptr %s1, align 4, !tbaa !5 %7 = load i32, ptr %s2, align 4, !tbaa !5 %cmp1.not.1 = icmp sgt i32 %6, %7 %.pre23 = load i32, ptr %m2, align 4, !tbaa !5 br i1 %cmp1.not.1, label %if.else.1, label %if.end.1 if.else.1: ; preds = %if.end10 %add.1 = add nsw i32 %7, 60 %dec.1 = add nsw i32 %.pre23, -1 store i32 %dec.1, ptr %m2, align 4, !tbaa !5 br label %if.end.1 if.end.1: ; preds = %if.else.1, %if.end10 %8 = phi i32 [ %dec.1, %if.else.1 ], [ %.pre23, %if.end10 ] %.pn.1 = phi i32 [ %add.1, %if.else.1 ], [ %7, %if.end10 ] %s.0.1 = sub nsw i32 %.pn.1, %6 %9 = load i32, ptr %m1, align 4, !tbaa !5 %cmp3.not.1 = icmp sgt i32 %9, %8 %.pre24 = load i32, ptr %h2, align 4, !tbaa !5 br i1 %cmp3.not.1, label %if.else6.1, label %if.end10.1 if.else6.1: ; preds = %if.end.1 %add7.1 = add nsw i32 %8, 60 %dec9.1 = add nsw i32 %.pre24, -1 store i32 %dec9.1, ptr %h2, align 4, !tbaa !5 br label %if.end10.1 if.end10.1: ; preds = %if.else6.1, %if.end.1 %10 = phi i32 [ %dec9.1, %if.else6.1 ], [ %.pre24, %if.end.1 ] %.pn20.1 = phi i32 [ %add7.1, %if.else6.1 ], [ %8, %if.end.1 ] %m.0.1 = sub nsw i32 %.pn20.1, %9 %11 = load i32, ptr %h1, align 4, !tbaa !5 %sub11.1 = sub nsw i32 %10, %11 %call12.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub11.1, i32 noundef %m.0.1, i32 noundef %s.0.1) %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2) %12 = load i32, ptr %s1, align 4, !tbaa !5 %13 = load i32, ptr %s2, align 4, !tbaa !5 %cmp1.not.2 = icmp sgt i32 %12, %13 %.pre25 = load i32, ptr %m2, align 4, !tbaa !5 br i1 %cmp1.not.2, label %if.else.2, label %if.end.2 if.else.2: ; preds = %if.end10.1 %add.2 = add nsw i32 %13, 60 %dec.2 = add nsw i32 %.pre25, -1 store i32 %dec.2, ptr %m2, align 4, !tbaa !5 br label %if.end.2 if.end.2: ; preds = %if.else.2, %if.end10.1 %14 = phi i32 [ %dec.2, %if.else.2 ], [ %.pre25, %if.end10.1 ] %.pn.2 = phi i32 [ %add.2, %if.else.2 ], [ %13, %if.end10.1 ] %15 = load i32, ptr %m1, align 4, !tbaa !5 %cmp3.not.2 = icmp sgt i32 %15, %14 %.pre26 = load i32, ptr %h2, align 4, !tbaa !5 br i1 %cmp3.not.2, label %if.else6.2, label %if.end10.2 if.else6.2: ; preds = %if.end.2 %add7.2 = add nsw i32 %14, 60 %dec9.2 = add nsw i32 %.pre26, -1 store i32 %dec9.2, ptr %h2, align 4, !tbaa !5 br label %if.end10.2 if.end10.2: ; preds = %if.else6.2, %if.end.2 %16 = phi i32 [ %dec9.2, %if.else6.2 ], [ %.pre26, %if.end.2 ] %.pn20.2 = phi i32 [ %add7.2, %if.else6.2 ], [ %14, %if.end.2 ] %s.0.2 = sub nsw i32 %.pn.2, %12 %m.0.2 = sub nsw i32 %.pn20.2, %15 %17 = load i32, ptr %h1, align 4, !tbaa !5 %sub11.2 = sub nsw i32 %16, %17 %call12.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub11.2, i32 noundef %m.0.2, i32 noundef %s.0.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h1) #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 h1[3],m1[3],s1[3],h2[3],m2[3],s2[3],i,j,k; int sum1[3]={0},sum2[3]={0},sa[3]={0}; for(i=0;i<3;i++){ scanf("%d %d %d %d %d %d",&h1[i],&m1[i],&s1[i],&h2[i],&m2[i],&s2[i]); sum1[i]=h1[i]*3600+m1[i]*60+s1[i]; sum2[i]=h2[i]*3600+m2[i]*60+s2[i]; sa[i]=sum2[i]-sum1[i]; //printf("%d %d %d\n",sum1[i],sum2[i],sa[i]); } for(i=0;i<3;i++){ printf("%d %d %d\n",sa[i]/3600,sa[i]%3600/60,sa[i]%3600%60); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261190/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261190/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%d %d %d %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: %h1 = alloca [3 x i32], align 4 %m1 = alloca [3 x i32], align 4 %s1 = alloca [3 x i32], align 4 %h2 = alloca [3 x i32], align 4 %m2 = alloca [3 x i32], align 4 %s2 = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %h1) #3 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %m1) #3 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s1) #3 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %h2) #3 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %m2) #3 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s2) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2) %0 = load i32, ptr %h1, align 4, !tbaa !5 %1 = load i32, ptr %m1, align 4, !tbaa !5 %2 = load i32, ptr %s1, align 4, !tbaa !5 %3 = load i32, ptr %h2, align 4, !tbaa !5 %4 = load i32, ptr %m2, align 4, !tbaa !5 %5 = load i32, ptr %s2, align 4, !tbaa !5 %reass.add = sub i32 %4, %1 %reass.mul = mul i32 %reass.add, 60 %reass.add81 = sub i32 %3, %0 %reass.mul82 = mul i32 %reass.add81, 3600 %add27 = sub i32 %5, %2 %add30 = add i32 %add27, %reass.mul82 %sub = add i32 %add30, %reass.mul %arrayidx.1 = getelementptr inbounds [3 x i32], ptr %h1, i64 0, i64 1 %arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %m1, i64 0, i64 1 %arrayidx4.1 = getelementptr inbounds [3 x i32], ptr %s1, i64 0, i64 1 %arrayidx6.1 = getelementptr inbounds [3 x i32], ptr %h2, i64 0, i64 1 %arrayidx8.1 = getelementptr inbounds [3 x i32], ptr %m2, i64 0, i64 1 %arrayidx10.1 = getelementptr inbounds [3 x i32], ptr %s2, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx2.1, ptr noundef nonnull %arrayidx4.1, ptr noundef nonnull %arrayidx6.1, ptr noundef nonnull %arrayidx8.1, ptr noundef nonnull %arrayidx10.1) %6 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5 %9 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %11 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5 %reass.add.1 = sub i32 %10, %7 %reass.mul.1 = mul i32 %reass.add.1, 60 %reass.add81.1 = sub i32 %9, %6 %reass.mul82.1 = mul i32 %reass.add81.1, 3600 %add27.1 = sub i32 %11, %8 %add30.1 = add i32 %add27.1, %reass.mul82.1 %sub.1 = add i32 %add30.1, %reass.mul.1 %arrayidx.2 = getelementptr inbounds [3 x i32], ptr %h1, i64 0, i64 2 %arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %m1, i64 0, i64 2 %arrayidx4.2 = getelementptr inbounds [3 x i32], ptr %s1, i64 0, i64 2 %arrayidx6.2 = getelementptr inbounds [3 x i32], ptr %h2, i64 0, i64 2 %arrayidx8.2 = getelementptr inbounds [3 x i32], ptr %m2, i64 0, i64 2 %arrayidx10.2 = getelementptr inbounds [3 x i32], ptr %s2, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx2.2, ptr noundef nonnull %arrayidx4.2, ptr noundef nonnull %arrayidx6.2, ptr noundef nonnull %arrayidx8.2, ptr noundef nonnull %arrayidx10.2) %12 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %13 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5 %14 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %15 = load i32, ptr %arrayidx6.2, align 4, !tbaa !5 %16 = load i32, ptr %arrayidx8.2, align 4, !tbaa !5 %17 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5 %reass.add.2 = sub i32 %16, %13 %reass.mul.2 = mul i32 %reass.add.2, 60 %reass.add81.2 = sub i32 %15, %12 %reass.mul82.2 = mul i32 %reass.add81.2, 3600 %add27.2 = sub i32 %17, %14 %add30.2 = add i32 %add27.2, %reass.mul82.2 %sub.2 = add i32 %add30.2, %reass.mul.2 %div = sdiv i32 %sub, 3600 %rem = srem i32 %sub, 3600 %div46.lhs.trunc = trunc i32 %rem to i16 %div4678 = sdiv i16 %div46.lhs.trunc, 60 %div46.sext = sext i16 %div4678 to i32 %rem5079 = srem i16 %div46.lhs.trunc, 60 %rem50.sext = sext i16 %rem5079 to i32 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div46.sext, i32 noundef %rem50.sext) %div.1 = sdiv i32 %sub.1, 3600 %rem.1 = srem i32 %sub.1, 3600 %div46.lhs.trunc.1 = trunc i32 %rem.1 to i16 %div4678.1 = sdiv i16 %div46.lhs.trunc.1, 60 %div46.sext.1 = sext i16 %div4678.1 to i32 %rem5079.1 = srem i16 %div46.lhs.trunc.1, 60 %rem50.sext.1 = sext i16 %rem5079.1 to i32 %call51.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.1, i32 noundef %div46.sext.1, i32 noundef %rem50.sext.1) %div.2 = sdiv i32 %sub.2, 3600 %rem.2 = srem i32 %sub.2, 3600 %div46.lhs.trunc.2 = trunc i32 %rem.2 to i16 %div4678.2 = sdiv i16 %div46.lhs.trunc.2, 60 %div46.sext.2 = sext i16 %div4678.2 to i32 %rem5079.2 = srem i16 %div46.lhs.trunc.2, 60 %rem50.sext.2 = sext i16 %rem5079.2 to i32 %call51.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.2, i32 noundef %div46.sext.2, i32 noundef %rem50.sext.2) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s2) #3 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %m2) #3 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %h2) #3 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s1) #3 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %m1) #3 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %h1) #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 i,time,j; for(i=0; i<3; i++){ time=0; scanf("%d",&j); time-=j*3600; scanf("%d",&j); time-=j*60; scanf("%d",&j); time-=j; scanf("%d",&j); time+=j*3600; scanf("%d",&j); time+=j*60; scanf("%d",&j); time+=j; printf("%d %d %d\n",time/3600,(time%3600)/60,time%60); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %0 = load i32, ptr %j, align 4, !tbaa !5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %1 = load i32, ptr %j, align 4, !tbaa !5 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %2 = load i32, ptr %j, align 4, !tbaa !5 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %3 = load i32, ptr %j, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %4 = load i32, ptr %j, align 4, !tbaa !5 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %5 = load i32, ptr %j, align 4, !tbaa !5 %reass.add = sub i32 %4, %1 %reass.mul = mul i32 %reass.add, 60 %reass.add27 = sub i32 %3, %0 %reass.mul28 = mul i32 %reass.add27, 3600 %add = sub i32 %reass.mul28, %2 %add10 = add i32 %add, %5 %add12 = add i32 %add10, %reass.mul %div = sdiv i32 %add12, 3600 %rem = srem i32 %add12, 3600 %div13.lhs.trunc = trunc i32 %rem to i16 %div1325 = sdiv i16 %div13.lhs.trunc, 60 %div13.sext = sext i16 %div1325 to i32 %rem14 = srem i32 %add12, 60 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div13.sext, i32 noundef %rem14) %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %6 = load i32, ptr %j, align 4, !tbaa !5 %call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %7 = load i32, ptr %j, align 4, !tbaa !5 %call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %8 = load i32, ptr %j, align 4, !tbaa !5 %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %9 = load i32, ptr %j, align 4, !tbaa !5 %call8.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %10 = load i32, ptr %j, align 4, !tbaa !5 %call11.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %11 = load i32, ptr %j, align 4, !tbaa !5 %reass.add.1 = sub i32 %10, %7 %reass.mul.1 = mul i32 %reass.add.1, 60 %reass.add27.1 = sub i32 %9, %6 %reass.mul28.1 = mul i32 %reass.add27.1, 3600 %add.1 = sub i32 %reass.mul28.1, %8 %add10.1 = add i32 %add.1, %11 %add12.1 = add i32 %add10.1, %reass.mul.1 %div.1 = sdiv i32 %add12.1, 3600 %rem.1 = srem i32 %add12.1, 3600 %div13.lhs.trunc.1 = trunc i32 %rem.1 to i16 %div1325.1 = sdiv i16 %div13.lhs.trunc.1, 60 %div13.sext.1 = sext i16 %div1325.1 to i32 %rem14.1 = srem i32 %add12.1, 60 %call15.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.1, i32 noundef %div13.sext.1, i32 noundef %rem14.1) %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %12 = load i32, ptr %j, align 4, !tbaa !5 %call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %13 = load i32, ptr %j, align 4, !tbaa !5 %call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %14 = load i32, ptr %j, align 4, !tbaa !5 %call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %15 = load i32, ptr %j, align 4, !tbaa !5 %call8.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %16 = load i32, ptr %j, align 4, !tbaa !5 %call11.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %17 = load i32, ptr %j, align 4, !tbaa !5 %reass.add.2 = sub i32 %16, %13 %reass.mul.2 = mul i32 %reass.add.2, 60 %reass.add27.2 = sub i32 %15, %12 %reass.mul28.2 = mul i32 %reass.add27.2, 3600 %add.2 = sub i32 %reass.mul28.2, %14 %add10.2 = add i32 %add.2, %17 %add12.2 = add i32 %add10.2, %reass.mul.2 %div.2 = sdiv i32 %add12.2, 3600 %rem.2 = srem i32 %add12.2, 3600 %div13.lhs.trunc.2 = trunc i32 %rem.2 to i16 %div1325.2 = sdiv i16 %div13.lhs.trunc.2, 60 %div13.sext.2 = sext i16 %div1325.2 to i32 %rem14.2 = srem i32 %add12.2, 60 %call15.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.2, i32 noundef %div13.sext.2, i32 noundef %rem14.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> # int n,v,e[100001][3],i,p[10001],r=0; int c(const void *x,const void *y) { return ((int*)x)[2]-((int*)y)[2]; } int a(int x) { return p[x]==x?x:a(p[x]); } int main() { scanf("%d%d",&n,&v); for(i=0;i<=n;i++) p[i]=i; for(i=0;i<v;i++) scanf("%d%d%d",&e[i][0],&e[i][1],&e[i][2]); qsort(e,v,sizeof(int[3]),c); for(i=0;i<v;i++) if(a(e[i][0])!=a(e[i][1])) { r+=e[i][2]; p[a(e[i][0])]=p[a(e[i][1])]; } printf("%d\n",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261277/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261277/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @r = dso_local local_unnamed_addr global i32 0, align 4 @p = dso_local local_unnamed_addr global [10001 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @n = dso_local global i32 0, align 4 @v = dso_local global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @e = dso_local global [100001 x [3 x i32]] zeroinitializer, align 16 @.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 @c(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 { entry: %arrayidx = getelementptr inbounds i32, ptr %x, i64 2 %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx1 = getelementptr inbounds i32, ptr %y, i64 2 %1 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @a(i32 noundef %x) local_unnamed_addr #1 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %x.tr = phi i32 [ %x, %entry ], [ %0, %tailrecurse ] %idxprom = sext i32 %x.tr to i64 %arrayidx = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %x.tr br i1 %cmp, label %cond.end, label %tailrecurse cond.end: ; preds = %tailrecurse ret i32 %x.tr } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @v) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not74 = icmp slt i32 %0, 0 br i1 %cmp.not74, label %for.cond1.preheader, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %1 to i64 %min.iters.check = icmp ult i32 %0, 7 br i1 %min.iters.check, label %for.body.preheader93, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %2 = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> %step.add, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader93 for.body.preheader93: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond1.preheader: ; preds = %for.body, %middle.block, %entry store i32 0, ptr @i, align 4, !tbaa !5 %5 = load i32, ptr @v, align 4, !tbaa !5 %cmp276 = icmp sgt i32 %5, 0 br i1 %cmp276, label %for.body3, label %for.end16 for.body: ; preds = %for.body.preheader93, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader93 ] %arrayidx = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %indvars.iv %6 = trunc i64 %indvars.iv to i32 store i32 %6, 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.cond1.preheader, label %for.body, !llvm.loop !13 for.body3: ; preds = %for.cond1.preheader, %for.body3 %storemerge5377 = phi i32 [ %inc15, %for.body3 ], [ 0, %for.cond1.preheader ] %idxprom4 = sext i32 %storemerge5377 to i64 %arrayidx5 = getelementptr inbounds [100001 x [3 x i32]], ptr @e, i64 0, i64 %idxprom4 %arrayidx9 = getelementptr inbounds [100001 x [3 x i32]], ptr @e, i64 0, i64 %idxprom4, i64 1 %arrayidx12 = getelementptr inbounds [100001 x [3 x i32]], ptr @e, i64 0, i64 %idxprom4, i64 2 %call13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx9, ptr noundef nonnull %arrayidx12) %7 = load i32, ptr @i, align 4, !tbaa !5 %inc15 = add nsw i32 %7, 1 store i32 %inc15, ptr @i, align 4, !tbaa !5 %8 = load i32, ptr @v, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc15, %8 br i1 %cmp2, label %for.body3, label %for.end16, !llvm.loop !14 for.end16: ; preds = %for.body3, %for.cond1.preheader %.lcssa73 = phi i32 [ %5, %for.cond1.preheader ], [ %8, %for.body3 ] %conv = sext i32 %.lcssa73 to i64 tail call void @qsort(ptr noundef nonnull @e, i64 noundef %conv, i64 noundef 12, ptr noundef nonnull @c) #5 %9 = load i32, ptr @v, align 4, !tbaa !5 %r.promoted = load i32, ptr @r, align 4, !tbaa !5 %cmp1881 = icmp sgt i32 %9, 0 br i1 %cmp1881, label %for.body20.preheader, label %for.end48 for.body20.preheader: ; preds = %for.end16 %wide.trip.count90 = zext i32 %9 to i64 br label %for.body20 for.body20: ; preds = %for.body20.preheader, %for.inc46 %indvars.iv87 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next88, %for.inc46 ] %add8082 = phi i32 [ %r.promoted, %for.body20.preheader ], [ %add79, %for.inc46 ] %arrayidx22 = getelementptr inbounds [100001 x [3 x i32]], ptr @e, i64 0, i64 %indvars.iv87 %10 = load i32, ptr %arrayidx22, align 4, !tbaa !5 br label %tailrecurse.i tailrecurse.i: ; preds = %tailrecurse.i, %for.body20 %x.tr.i = phi i32 [ %10, %for.body20 ], [ %11, %tailrecurse.i ] %idxprom.i = sext i32 %x.tr.i to i64 %arrayidx.i = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %idxprom.i %11 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp.i = icmp eq i32 %11, %x.tr.i br i1 %cmp.i, label %a.exit, label %tailrecurse.i a.exit: ; preds = %tailrecurse.i %arrayidx27 = getelementptr inbounds [100001 x [3 x i32]], ptr @e, i64 0, i64 %indvars.iv87, i64 1 %12 = load i32, ptr %arrayidx27, align 4, !tbaa !5 br label %tailrecurse.i55 tailrecurse.i55: ; preds = %tailrecurse.i55, %a.exit %x.tr.i56 = phi i32 [ %12, %a.exit ], [ %13, %tailrecurse.i55 ] %idxprom.i57 = sext i32 %x.tr.i56 to i64 %arrayidx.i58 = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %idxprom.i57 %13 = load i32, ptr %arrayidx.i58, align 4, !tbaa !5 %cmp.i59 = icmp eq i32 %13, %x.tr.i56 br i1 %cmp.i59, label %a.exit60, label %tailrecurse.i55 a.exit60: ; preds = %tailrecurse.i55 %cmp29.not = icmp eq i32 %x.tr.i, %x.tr.i56 br i1 %cmp29.not, label %for.inc46, label %if.then if.then: ; preds = %a.exit60 %arrayidx33 = getelementptr inbounds [100001 x [3 x i32]], ptr @e, i64 0, i64 %indvars.iv87, i64 2 %14 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %add = add nsw i32 %add8082, %14 store i32 %add, ptr @r, align 4, !tbaa !5 br label %tailrecurse.i61 tailrecurse.i61: ; preds = %tailrecurse.i61, %if.then %x.tr.i62 = phi i32 [ %12, %if.then ], [ %15, %tailrecurse.i61 ] %idxprom.i63 = sext i32 %x.tr.i62 to i64 %arrayidx.i64 = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %idxprom.i63 %15 = load i32, ptr %arrayidx.i64, align 4, !tbaa !5 %cmp.i65 = icmp eq i32 %15, %x.tr.i62 br i1 %cmp.i65, label %tailrecurse.i67, label %tailrecurse.i61 tailrecurse.i67: ; preds = %tailrecurse.i61, %tailrecurse.i67 %x.tr.i68 = phi i32 [ %16, %tailrecurse.i67 ], [ %10, %tailrecurse.i61 ] %idxprom.i69 = sext i32 %x.tr.i68 to i64 %arrayidx.i70 = getelementptr inbounds [10001 x i32], ptr @p, i64 0, i64 %idxprom.i69 %16 = load i32, ptr %arrayidx.i70, align 4, !tbaa !5 %cmp.i71 = icmp eq i32 %16, %x.tr.i68 br i1 %cmp.i71, label %a.exit72, label %tailrecurse.i67 a.exit72: ; preds = %tailrecurse.i67 store i32 %x.tr.i62, ptr %arrayidx.i70, align 4, !tbaa !5 br label %for.inc46 for.inc46: ; preds = %a.exit60, %a.exit72 %add79 = phi i32 [ %add8082, %a.exit60 ], [ %add, %a.exit72 ] %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90 br i1 %exitcond91.not, label %for.end48, label %for.body20, !llvm.loop !15 for.end48: ; preds = %for.inc46, %for.end16 %17 = phi i32 [ %r.promoted, %for.end16 ], [ %add79, %for.inc46 ] %storemerge54.lcssa = phi i32 [ 0, %for.end16 ], [ %9, %for.inc46 ] store i32 %storemerge54.lcssa, ptr @i, align 4, !tbaa !5 %call49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 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(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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-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 = distinct !{!15, !10}
#include<stdio.h> int main(void) { char h[25],a[25]; scanf("%s %s",h,a); int n; int hm[100]={0}; int aw[100]={0}; scanf("%d",&n); while(n--) { int t,m; char ch, col; scanf("%d %c %d %c",&t, &ch, &m, &col); if(ch=='a') { if(aw[m]!=-1) { if(col=='y') { if(aw[m]==0) aw[m]++; else { printf("%s %d %d\n",a,m,t); aw[m]=-1; } } else { printf("%s %d %d\n",a,m,t); aw[m]=-1; } } } else { if(hm[m]!=-1) { if(col=='y') { if(hm[m]==0) hm[m]++; else { printf("%s %d %d\n",h,m,t); hm[m]=-1; } } else { printf("%s %d %d\n",h,m,t); hm[m]=-1; } } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26132/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26132/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [12 x i8] c"%d %c %d %c\00", align 1 @.str.3 = private unnamed_addr constant [10 x i8] c"%s %d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca [25 x i8], align 16 %a = alloca [25 x i8], align 16 %n = alloca i32, align 4 %hm = alloca [100 x i32], align 16 %aw = alloca [100 x i32], align 16 %t = alloca i32, align 4 %m = alloca i32, align 4 %ch = alloca i8, align 1 %col = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 25, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 25, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %a) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %hm) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %hm, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %aw) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %aw, i8 0, i64 400, i1 false) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %dec63 = add nsw i32 %0, -1 store i32 %dec63, ptr %n, align 4, !tbaa !5 %tobool.not64 = icmp eq i32 %0, 0 br i1 %tobool.not64, label %while.end, label %while.body while.body: ; preds = %entry, %if.end61 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %col) #4 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t, ptr noundef nonnull %ch, ptr noundef nonnull %m, ptr noundef nonnull %col) %1 = load i8, ptr %ch, align 1, !tbaa !9 %cmp = icmp eq i8 %1, 97 %2 = load i32, ptr %m, align 4, !tbaa !5 %idxprom = sext i32 %2 to i64 br i1 %cmp, label %if.then, label %if.else30 if.then: ; preds = %while.body %arrayidx = getelementptr inbounds [100 x i32], ptr %aw, i64 0, i64 %idxprom %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp5.not = icmp eq i32 %3, -1 br i1 %cmp5.not, label %if.end61, label %if.then7 if.then7: ; preds = %if.then %4 = load i8, ptr %col, align 1, !tbaa !9 %cmp9 = icmp eq i8 %4, 121 br i1 %cmp9, label %if.then11, label %if.else23 if.then11: ; preds = %if.then7 %cmp14 = icmp eq i32 %3, 0 br i1 %cmp14, label %if.then16, label %if.else if.then16: ; preds = %if.then11 store i32 1, ptr %arrayidx, align 4, !tbaa !5 br label %if.end61 if.else: ; preds = %if.then11 %5 = load i32, ptr %t, align 4, !tbaa !5 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %a, i32 noundef %2, i32 noundef %5) %6 = load i32, ptr %m, align 4, !tbaa !5 %idxprom21 = sext i32 %6 to i64 %arrayidx22 = getelementptr inbounds [100 x i32], ptr %aw, i64 0, i64 %idxprom21 store i32 -1, ptr %arrayidx22, align 4, !tbaa !5 br label %if.end61 if.else23: ; preds = %if.then7 %7 = load i32, ptr %t, align 4, !tbaa !5 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %a, i32 noundef %2, i32 noundef %7) %8 = load i32, ptr %m, align 4, !tbaa !5 %idxprom26 = sext i32 %8 to i64 %arrayidx27 = getelementptr inbounds [100 x i32], ptr %aw, i64 0, i64 %idxprom26 store i32 -1, ptr %arrayidx27, align 4, !tbaa !5 br label %if.end61 if.else30: ; preds = %while.body %arrayidx32 = getelementptr inbounds [100 x i32], ptr %hm, i64 0, i64 %idxprom %9 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %cmp33.not = icmp eq i32 %9, -1 br i1 %cmp33.not, label %if.end61, label %if.then35 if.then35: ; preds = %if.else30 %10 = load i8, ptr %col, align 1, !tbaa !9 %cmp37 = icmp eq i8 %10, 121 br i1 %cmp37, label %if.then39, label %if.else54 if.then39: ; preds = %if.then35 %cmp42 = icmp eq i32 %9, 0 br i1 %cmp42, label %if.then44, label %if.else48 if.then44: ; preds = %if.then39 store i32 1, ptr %arrayidx32, align 4, !tbaa !5 br label %if.end61 if.else48: ; preds = %if.then39 %11 = load i32, ptr %t, align 4, !tbaa !5 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %h, i32 noundef %2, i32 noundef %11) %12 = load i32, ptr %m, align 4, !tbaa !5 %idxprom51 = sext i32 %12 to i64 %arrayidx52 = getelementptr inbounds [100 x i32], ptr %hm, i64 0, i64 %idxprom51 store i32 -1, ptr %arrayidx52, align 4, !tbaa !5 br label %if.end61 if.else54: ; preds = %if.then35 %13 = load i32, ptr %t, align 4, !tbaa !5 %call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %h, i32 noundef %2, i32 noundef %13) %14 = load i32, ptr %m, align 4, !tbaa !5 %idxprom57 = sext i32 %14 to i64 %arrayidx58 = getelementptr inbounds [100 x i32], ptr %hm, i64 0, i64 %idxprom57 store i32 -1, ptr %arrayidx58, align 4, !tbaa !5 br label %if.end61 if.end61: ; preds = %if.else30, %if.then44, %if.else48, %if.else54, %if.then, %if.then16, %if.else, %if.else23 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %col) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 %15 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %15, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %15, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !10 while.end: ; preds = %if.end61, %entry call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %aw) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %hm) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 25, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 25, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int i,time,num[120000],pepnum=0; scanf("%d",&time); for(i=1;i<=time*2;i++){ scanf("%d",&num[i]); } for(i=1;i<=time*2;i++){ pepnum +=(num[i+1]-num[i]+1); i++; } printf("%d\n",pepnum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261370/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261370/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %time = alloca i32, align 4 %num = alloca [120000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %time) #4 call void @llvm.lifetime.start.p0(i64 480000, ptr nonnull %num) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %time) %0 = load i32, ptr %time, align 4, !tbaa !5 %mul25 = shl nsw i32 %0, 1 %cmp.not26 = icmp slt i32 %0, 1 br i1 %cmp.not26, label %for.cond2.preheader, label %for.body for.cond2.preheader: ; preds = %for.body, %entry %mul.lcssa = phi i32 [ %mul25, %entry ], [ %mul, %for.body ] %cmp4.not28 = icmp slt i32 %mul.lcssa, 1 br i1 %cmp4.not28, label %for.end15, label %for.body5.preheader for.body5.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %mul.lcssa to i64 %2 = or i64 %1, 1 %umax = call i64 @llvm.umax.i64(i64 %2, i64 3) %3 = add nsw i64 %umax, -2 %4 = lshr i64 %3, 1 %5 = add nuw nsw i64 %4, 1 %min.iters.check = icmp ult i64 %3, 14 br i1 %min.iters.check, label %for.body5.preheader45, label %vector.ph vector.ph: ; preds = %for.body5.preheader %n.vec = and i64 %5, 9223372036854775800 %6 = shl nuw i64 %n.vec, 1 %ind.end = or i64 %6, 1 %invariant.gep = getelementptr i32, ptr %num, i64 -1 %invariant.gep50 = getelementptr i32, ptr %num, i64 -1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ] %vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %7 = shl i64 %index, 1 %8 = or i64 %7, 2 %9 = or i64 %7, 10 %gep = getelementptr [120000 x i32], ptr %invariant.gep, i64 0, i64 %8 %gep51 = getelementptr [120000 x i32], ptr %invariant.gep50, i64 0, i64 %9 %wide.vec = load <8 x i32>, ptr %gep, align 4, !tbaa !5 %wide.vec41 = load <8 x i32>, ptr %gep51, align 4, !tbaa !5 %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec42 = shufflevector <8 x i32> %wide.vec41, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec43 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> %strided.vec44 = shufflevector <8 x i32> %wide.vec41, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> %10 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1> %11 = add <4 x i32> %vec.phi40, <i32 1, i32 1, i32 1, i32 1> %12 = add <4 x i32> %10, %strided.vec43 %13 = add <4 x i32> %11, %strided.vec44 %14 = sub <4 x i32> %12, %strided.vec %15 = sub <4 x i32> %13, %strided.vec42 %index.next = add nuw i64 %index, 8 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %15, %14 %17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %5, %n.vec br i1 %cmp.n, label %for.end15, label %for.body5.preheader45 for.body5.preheader45: ; preds = %for.body5.preheader, %middle.block %indvars.iv34.ph = phi i64 [ 1, %for.body5.preheader ], [ %ind.end, %middle.block ] %pepnum.030.ph = phi i32 [ 0, %for.body5.preheader ], [ %17, %middle.block ] br label %for.body5 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [120000 x i32], ptr %num, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %18 = load i32, ptr %time, align 4, !tbaa !5 %mul = shl nsw i32 %18, 1 %19 = sext i32 %mul to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %19 br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !13 for.body5: ; preds = %for.body5.preheader45, %for.body5 %indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.body5 ], [ %indvars.iv34.ph, %for.body5.preheader45 ] %pepnum.030 = phi i32 [ %add11, %for.body5 ], [ %pepnum.030.ph, %for.body5.preheader45 ] %20 = add nuw nsw i64 %indvars.iv34, 1 %arrayidx7 = getelementptr inbounds [120000 x i32], ptr %num, i64 0, i64 %20 %21 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %arrayidx9 = getelementptr inbounds [120000 x i32], ptr %num, i64 0, i64 %indvars.iv34 %22 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %sub = add i32 %pepnum.030, 1 %add10 = add i32 %sub, %21 %add11 = sub i32 %add10, %22 %indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 2 %cmp4.not = icmp ugt i64 %indvars.iv.next35, %1 br i1 %cmp4.not, label %for.end15, label %for.body5, !llvm.loop !14 for.end15: ; preds = %for.body5, %middle.block, %for.cond2.preheader %pepnum.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %17, %middle.block ], [ %add11, %for.body5 ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %pepnum.0.lcssa) call void @llvm.lifetime.end.p0(i64 480000, ptr nonnull %num) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %time) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include <stdio.h> int main(void) { int N; int i; int asumikana = 0; if (scanf("%d", &N) != 1) return 1; for (i = 0; i < N; i++) { int l, r; if (scanf("%d%d", &l, &r) != 2) return 1; asumikana += r - l + 1; } printf("%d\n", asumikana); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261413/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261413/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [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 %l = alloca i32, align 4 %r = 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) %cmp.not = icmp eq i32 %call, 1 br i1 %cmp.not, label %for.cond.preheader, label %cleanup9 for.cond.preheader: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp119 = icmp sgt i32 %0, 0 br i1 %cmp119, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.inc %asumikana.021 = phi i32 [ %add6, %for.inc ], [ 0, %for.cond.preheader ] %i.020 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r) %cmp3.not = icmp eq i32 %call2, 2 br i1 %cmp3.not, label %for.inc, label %cleanup cleanup: ; preds = %for.body call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 br label %cleanup9 for.inc: ; preds = %for.body %1 = load i32, ptr %r, align 4, !tbaa !5 %2 = load i32, ptr %l, align 4, !tbaa !5 %sub = add i32 %asumikana.021, 1 %add = add i32 %sub, %1 %add6 = sub i32 %add, %2 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 %inc = add nuw nsw i32 %i.020, 1 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc, %3 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.inc, %for.cond.preheader %asumikana.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add6, %for.inc ] %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %asumikana.0.lcssa) br label %cleanup9 cleanup9: ; preds = %cleanup, %entry, %for.end %retval.2 = phi i32 [ 1, %cleanup ], [ 0, %for.end ], [ 1, %entry ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 %retval.2 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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() { int number_n, start, end, i, count = 0; scanf("%d", &number_n); for(i = 0; i < number_n; i++) { scanf("%d %d", &start, &end); count = count + end - start + 1; } printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261464/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261464/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %number_n = alloca i32, align 4 %start = alloca i32, align 4 %end = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number_n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %start) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %end) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number_n) %0 = load i32, ptr %number_n, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %count.08 = phi i32 [ %add2, %for.body ], [ 0, %entry ] %i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %start, ptr noundef nonnull %end) %1 = load i32, ptr %end, align 4, !tbaa !5 %2 = load i32, ptr %start, align 4, !tbaa !5 %add = add i32 %count.08, 1 %sub = add i32 %add, %1 %add2 = sub i32 %sub, %2 %inc = add nuw nsw i32 %i.07, 1 %3 = load i32, ptr %number_n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %end) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %start) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number_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,l[1001],r[1001],i; long ans=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&l[i],&r[i]); ans+=(r[i]-l[i]+1); } printf("%ld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261507/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261507/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %l = alloca [1001 x i32], align 16 %r = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %l) #3 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %r) #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, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %ans.018 = phi i64 [ %add8, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1001 x i32], ptr %l, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [1001 x i32], ptr %r, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %sub = add i32 %1, 1 %add = sub i32 %sub, %2 %conv = sext i32 %add to i64 %add8 = add nsw i64 %ans.018, %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %add8, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %r) #3 call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %l) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main (void) { int a, b, i, N, people = 0; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d %d", &a, &b); people = people + (b - a + 1); } printf("%d\n", people); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261550/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261550/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%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 %N = 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 %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 %cmp6 = icmp sgt i32 %0, 0 br i1 %cmp6, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %people.08 = phi i32 [ %add2, %for.body ], [ 0, %entry ] %i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4, !tbaa !5 %sub = add i32 %people.08, 1 %add = add i32 %sub, %1 %add2 = sub i32 %add, %2 %inc = add nuw nsw i32 %i.07, 1 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %people.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %people.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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 N, ans = 0, i; int l[1000], r[1000]; scanf("%d", &N); getchar(); for(i = 0; i < N; i++) { scanf("%d %d", &l[i], &r[i]); getchar(); } for(i = 0; i < N; i++) { ans += r[i] - l[i] + 1; } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261615/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261615/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %l = alloca [1000 x i32], align 16 %r = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %r) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call i32 @getc(ptr noundef %0) %1 = load i32, ptr %N, align 4, !tbaa !9 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end16 for.cond6.preheader: ; preds = %for.body %cmp729 = icmp sgt i32 %15, 0 br i1 %cmp729, label %for.body8.preheader, label %for.end16 for.body8.preheader: ; preds = %for.cond6.preheader %wide.trip.count = zext i32 %15 to i64 %min.iters.check = icmp ult i32 %15, 8 br i1 %min.iters.check, label %for.body8.preheader44, label %vector.ph vector.ph: ; preds = %for.body8.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 ], [ %10, %vector.body ] %vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %2 = getelementptr inbounds [1000 x i32], ptr %r, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !9 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load41 = load <4 x i32>, ptr %3, align 16, !tbaa !9 %4 = getelementptr inbounds [1000 x i32], ptr %l, i64 0, i64 %index %wide.load42 = load <4 x i32>, ptr %4, align 16, !tbaa !9 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load43 = load <4 x i32>, ptr %5, align 16, !tbaa !9 %6 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1> %7 = add <4 x i32> %vec.phi40, <i32 1, i32 1, i32 1, i32 1> %8 = add <4 x i32> %6, %wide.load %9 = add <4 x i32> %7, %wide.load41 %10 = sub <4 x i32> %8, %wide.load42 %11 = sub <4 x i32> %9, %wide.load43 %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 !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = 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.end16, label %for.body8.preheader44 for.body8.preheader44: ; preds = %for.body8.preheader, %middle.block %indvars.iv35.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ] %ans.030.ph = phi i32 [ 0, %for.body8.preheader ], [ %13, %middle.block ] br label %for.body8 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %l, i64 0, i64 %indvars.iv %arrayidx3 = getelementptr inbounds [1000 x i32], ptr %r, i64 0, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3) %14 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i26 = call i32 @getc(ptr noundef %14) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %15 = load i32, ptr %N, align 4, !tbaa !9 %16 = sext i32 %15 to i64 %cmp = icmp slt i64 %indvars.iv.next, %16 br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !15 for.body8: ; preds = %for.body8.preheader44, %for.body8 %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.body8 ], [ %indvars.iv35.ph, %for.body8.preheader44 ] %ans.030 = phi i32 [ %add13, %for.body8 ], [ %ans.030.ph, %for.body8.preheader44 ] %arrayidx10 = getelementptr inbounds [1000 x i32], ptr %r, i64 0, i64 %indvars.iv35 %17 = load i32, ptr %arrayidx10, align 4, !tbaa !9 %arrayidx12 = getelementptr inbounds [1000 x i32], ptr %l, i64 0, i64 %indvars.iv35 %18 = load i32, ptr %arrayidx12, align 4, !tbaa !9 %sub = add i32 %ans.030, 1 %add = add i32 %sub, %17 %add13 = sub i32 %add, %18 %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1 %exitcond.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count br i1 %exitcond.not, label %for.end16, label %for.body8, !llvm.loop !16 for.end16: ; preds = %for.body8, %middle.block, %entry, %for.cond6.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond6.preheader ], [ 0, %entry ], [ %13, %middle.block ], [ %add13, %for.body8 ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12, !13, !14} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12, !14, !13}
#include <stdio.h> int main() { char c[3][3]; for (int i = 0; i < 3; i++) { scanf("%s", c[i]); } for (int i = 0; i < 3; i++) { printf("%c", c[i][i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261659/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261659/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [3 x [3 x i8]], align 1 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx.1 = getelementptr inbounds [3 x [3 x i8]], ptr %c, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [3 x [3 x i8]], ptr %c, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %putchar20 = call i32 @putchar(i32 %conv) %arrayidx9.1 = getelementptr inbounds [3 x [3 x i8]], ptr %c, i64 0, i64 1, i64 1 %1 = load i8, ptr %arrayidx9.1, align 1, !tbaa !5 %conv.1 = sext i8 %1 to i32 %putchar20.1 = call i32 @putchar(i32 %conv.1) %arrayidx9.2 = getelementptr inbounds [3 x [3 x i8]], ptr %c, i64 0, i64 2, i64 2 %2 = load i8, ptr %arrayidx9.2, align 1, !tbaa !5 %conv.2 = sext i8 %2 to i32 %putchar20.2 = call i32 @putchar(i32 %conv.2) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { char c[4][4]; scanf("%s",c[0]); scanf("%s",c[1]); scanf("%s",c[2]); printf("%c%c%c", c[0][0], c[1][1], c[2][2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261701/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261701/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%c%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [4 x [4 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx1 = getelementptr inbounds [4 x [4 x i8]], ptr %c, i64 0, i64 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1) %arrayidx4 = getelementptr inbounds [4 x [4 x i8]], ptr %c, i64 0, i64 2 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx4) %0 = load i8, ptr %c, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx10 = getelementptr inbounds [4 x [4 x i8]], ptr %c, i64 0, i64 1, i64 1 %1 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %conv11 = sext i8 %1 to i32 %arrayidx13 = getelementptr inbounds [4 x [4 x i8]], ptr %c, i64 0, i64 2, i64 2 %2 = load i8, ptr %arrayidx13, align 2, !tbaa !5 %conv14 = sext i8 %2 to i32 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv11, i32 noundef %conv14) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ char a[3], b[3], c[3]; scanf("%s%s%s",a,b,c); printf("%c%c%c\n",a[0],b[1],c[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261745/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261745/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1 @.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [3 x i8], align 1 %b = alloca [3 x i8], align 1 %c = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 3, 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 i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx3 = getelementptr inbounds [3 x i8], ptr %b, i64 0, i64 1 %1 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %conv4 = sext i8 %1 to i32 %arrayidx5 = getelementptr inbounds [3 x i8], ptr %c, i64 0, i64 2 %2 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %conv6 = sext i8 %2 to i32 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv4, i32 noundef %conv6) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 3, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char c[10][10]; scanf("%s", c[0]); scanf("%s", c[1]); scanf("%s", c[2]); printf("%c%c%c\n", c[0][0], c[1][1], c[2][2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261789/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261789/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%c%c\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [10 x [10 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx1 = getelementptr inbounds [10 x [10 x i8]], ptr %c, i64 0, i64 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1) %arrayidx4 = getelementptr inbounds [10 x [10 x i8]], ptr %c, i64 0, i64 2 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx4) %0 = load i8, ptr %c, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx10 = getelementptr inbounds [10 x [10 x i8]], ptr %c, i64 0, i64 1, i64 1 %1 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %conv11 = sext i8 %1 to i32 %arrayidx13 = getelementptr inbounds [10 x [10 x i8]], ptr %c, i64 0, i64 2, i64 2 %2 = load i8, ptr %arrayidx13, align 2, !tbaa !5 %conv14 = sext i8 %2 to i32 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv11, i32 noundef %conv14) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char c[4], s[3]; int i; for (i = 0; i < 3; i++) { scanf("%s", c); s[i] = c[i]; } printf("%s", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261831/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261831/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [4 x i8], align 1 %s = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 store i8 %0, ptr %s, align 1, !tbaa !5 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx.1 = getelementptr inbounds [4 x i8], ptr %c, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx2.1 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1 store i8 %1, ptr %arrayidx2.1, align 1, !tbaa !5 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx.2 = getelementptr inbounds [4 x i8], ptr %c, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %arrayidx2.2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2 store i8 %2, ptr %arrayidx2.2, align 1, !tbaa !5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ char c[3][4]; for(int i=0;i<3;i++){ scanf("%s",c[i]); } printf("%c%c%c",c[0][0],c[1][1],c[2][2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261875/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261875/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%c%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [3 x [4 x i8]], align 1 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx.1 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %0 = load i8, ptr %c, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %arrayidx4 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 1, i64 1 %1 = load i8, ptr %arrayidx4, align 1, !tbaa !5 %conv5 = sext i8 %1 to i32 %arrayidx7 = getelementptr inbounds [3 x [4 x i8]], ptr %c, i64 0, i64 2, i64 2 %2 = load i8, ptr %arrayidx7, align 1, !tbaa !5 %conv8 = sext i8 %2 to i32 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv5, i32 noundef %conv8) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %c) #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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #define INF 10000000 void warshall_floyd(void); int min(int,int); long long graph[101][101]; int n,c,d; int main(void){ int k,i,j,x,e,a,b; while(1){ scanf("%d %d",&n,&k); for(i=0;i<=n;i++) for(j=0;j<=n;j++) graph[i][j] = (i==j?0:INF); if(n==0 && k==0)break; for(i=0;i<k;i++){ scanf("%d",&x); if(x){ scanf("%d %d %d",&c,&d,&e); if(graph[c][d]>e){ graph[c][d]=graph[d][c]=e; warshall_floyd(); } } else{ scanf("%d %d",&a,&b); if(graph[a][b]<INF)printf("%d\n",graph[a][b]); else printf("-1\n"); } } } return 0; } void warshall_floyd(void){ int i,j; for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][c]+graph[c][d]+graph[d][j]); //graph[i][j]=graph[j][i]=min(graph[i][j],graph[i][d]+graph[d][c]+graph[c][j]); } } } int min(int x,int y){ return (x<y)?x:y; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261918/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261918/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @n = dso_local global i32 0, align 4 @graph = dso_local local_unnamed_addr global [101 x [101 x i64]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @c = dso_local global i32 0, align 4 @d = dso_local global i32 0, align 4 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\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: %k = alloca i32, align 4 %x = alloca i32, align 4 %e = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7 br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %k) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not70 = icmp slt i32 %0, 0 br i1 %cmp.not70, label %for.end9.thread, label %for.cond1.preheader.preheader for.end9.thread: ; preds = %while.cond %1 = load i32, ptr %k, align 4 br label %for.cond14.preheader for.cond1.preheader.preheader: ; preds = %while.cond %2 = add nuw i32 %0, 1 %wide.trip.count78 = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count78, 3 %3 = icmp ult i32 %0, 3 %unroll_iter = and i64 %wide.trip.count78, 4294967292 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.for.inc7_crit_edge %indvars.iv75 = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvars.iv.next76, %for.cond1.for.inc7_crit_edge ] br i1 %3, label %for.cond1.for.inc7_crit_edge.unr-lcssa, label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body3 ], [ 0, %for.cond1.preheader ] %niter = phi i64 [ %niter.next.3, %for.body3 ], [ 0, %for.cond1.preheader ] %cmp4 = icmp eq i64 %indvars.iv75, %indvars.iv %cond = select i1 %cmp4, i64 0, i64 10000000 %arrayidx6 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv75, i64 %indvars.iv store i64 %cond, ptr %arrayidx6, align 8, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %cmp4.1 = icmp eq i64 %indvars.iv75, %indvars.iv.next %cond.1 = select i1 %cmp4.1, i64 0, i64 10000000 %arrayidx6.1 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv75, i64 %indvars.iv.next store i64 %cond.1, ptr %arrayidx6.1, align 8, !tbaa !9 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %cmp4.2 = icmp eq i64 %indvars.iv75, %indvars.iv.next.1 %cond.2 = select i1 %cmp4.2, i64 0, i64 10000000 %arrayidx6.2 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv75, i64 %indvars.iv.next.1 store i64 %cond.2, ptr %arrayidx6.2, align 8, !tbaa !9 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %cmp4.3 = icmp eq i64 %indvars.iv75, %indvars.iv.next.2 %cond.3 = select i1 %cmp4.3, i64 0, i64 10000000 %arrayidx6.3 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv75, i64 %indvars.iv.next.2 store i64 %cond.3, ptr %arrayidx6.3, align 8, !tbaa !9 %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.cond1.for.inc7_crit_edge.unr-lcssa, label %for.body3, !llvm.loop !11 for.cond1.for.inc7_crit_edge.unr-lcssa: ; preds = %for.body3, %for.cond1.preheader %indvars.iv.unr = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next.3, %for.body3 ] br i1 %lcmp.mod.not, label %for.cond1.for.inc7_crit_edge, label %for.body3.epil for.body3.epil: ; preds = %for.cond1.for.inc7_crit_edge.unr-lcssa, %for.body3.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body3.epil ], [ %indvars.iv.unr, %for.cond1.for.inc7_crit_edge.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body3.epil ], [ 0, %for.cond1.for.inc7_crit_edge.unr-lcssa ] %cmp4.epil = icmp eq i64 %indvars.iv75, %indvars.iv.epil %cond.epil = select i1 %cmp4.epil, i64 0, i64 10000000 %arrayidx6.epil = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv75, i64 %indvars.iv.epil store i64 %cond.epil, ptr %arrayidx6.epil, align 8, !tbaa !9 %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.cond1.for.inc7_crit_edge, label %for.body3.epil, !llvm.loop !13 for.cond1.for.inc7_crit_edge: ; preds = %for.body3.epil, %for.cond1.for.inc7_crit_edge.unr-lcssa %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78 br i1 %exitcond79.not, label %for.end9, label %for.cond1.preheader, !llvm.loop !15 for.end9: ; preds = %for.cond1.for.inc7_crit_edge %cmp10 = icmp eq i32 %0, 0 %4 = load i32, ptr %k, align 4 %cmp12 = icmp eq i32 %4, 0 %or.cond = select i1 %cmp10, i1 %cmp12, i1 false br i1 %or.cond, label %while.end, label %for.cond14.preheader for.cond14.preheader: ; preds = %for.end9.thread, %for.end9 %5 = phi i32 [ %1, %for.end9.thread ], [ %4, %for.end9 ] %cmp1572 = icmp sgt i32 %5, 0 br i1 %cmp1572, label %for.body17, label %while.cond.backedge while.cond.backedge: ; preds = %for.inc56, %for.cond14.preheader br label %while.cond for.body17: ; preds = %for.cond14.preheader, %for.inc56 %i.173 = phi i32 [ %inc57, %for.inc56 ], [ 0, %for.cond14.preheader ] %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %6 = load i32, ptr %x, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %if.else, label %if.then19 if.then19: ; preds = %for.body17 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @c, ptr noundef nonnull @d, ptr noundef nonnull %e) %7 = load i32, ptr @c, align 4 %idxprom21 = sext i32 %7 to i64 %8 = load i32, ptr @d, align 4 %idxprom23 = sext i32 %8 to i64 %arrayidx24 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %idxprom21, i64 %idxprom23 %9 = load i64, ptr %arrayidx24, align 8, !tbaa !9 %10 = load i32, ptr %e, align 4, !tbaa !5 %conv25 = sext i32 %10 to i64 %cmp26 = icmp sgt i64 %9, %conv25 br i1 %cmp26, label %if.then28, label %for.inc56 if.then28: ; preds = %if.then19 %arrayidx33 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %idxprom23, i64 %idxprom21 store i64 %conv25, ptr %arrayidx33, align 8, !tbaa !9 store i64 %conv25, ptr %arrayidx24, align 8, !tbaa !9 %11 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not44.i = icmp slt i32 %11, 1 br i1 %cmp.not44.i, label %for.inc56, label %for.cond1.preheader.lr.ph.i for.cond1.preheader.lr.ph.i: ; preds = %if.then28 %12 = add nuw i32 %11, 1 %wide.trip.count50.i = zext i32 %12 to i64 br label %for.cond1.preheader.i for.cond1.preheader.i: ; preds = %for.cond1.for.inc29_crit_edge.i, %for.cond1.preheader.lr.ph.i %indvars.iv47.i = phi i64 [ 1, %for.cond1.preheader.lr.ph.i ], [ %indvars.iv.next48.i, %for.cond1.for.inc29_crit_edge.i ] %arrayidx9.i = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv47.i, i64 %idxprom21 br label %for.body3.i for.body3.i: ; preds = %for.body3.i, %for.cond1.preheader.i %indvars.iv.i = phi i64 [ 1, %for.cond1.preheader.i ], [ %indvars.iv.next.i, %for.body3.i ] %arrayidx5.i = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv47.i, i64 %indvars.iv.i %13 = load i64, ptr %arrayidx5.i, align 8, !tbaa !9 %conv.i = trunc i64 %13 to i32 %14 = load i64, ptr %arrayidx9.i, align 8, !tbaa !9 %15 = load i64, ptr %arrayidx24, align 8, !tbaa !9 %add.i = add nsw i64 %15, %14 %arrayidx17.i = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %idxprom23, i64 %indvars.iv.i %16 = load i64, ptr %arrayidx17.i, align 8, !tbaa !9 %add18.i = add nsw i64 %add.i, %16 %conv19.i = trunc i64 %add18.i to i32 %cond.i.i = call i32 @llvm.smin.i32(i32 %conv.i, i32 %conv19.i) %conv20.i = sext i32 %cond.i.i to i64 %arrayidx24.i = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv.i, i64 %indvars.iv47.i store i64 %conv20.i, ptr %arrayidx24.i, align 8, !tbaa !9 store i64 %conv20.i, ptr %arrayidx5.i, align 8, !tbaa !9 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count50.i br i1 %exitcond.not.i, label %for.cond1.for.inc29_crit_edge.i, label %for.body3.i, !llvm.loop !16 for.cond1.for.inc29_crit_edge.i: ; preds = %for.body3.i %indvars.iv.next48.i = add nuw nsw i64 %indvars.iv47.i, 1 %exitcond51.not.i = icmp eq i64 %indvars.iv.next48.i, %wide.trip.count50.i br i1 %exitcond51.not.i, label %for.inc56, label %for.cond1.preheader.i, !llvm.loop !17 if.else: ; preds = %for.body17 %call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %17 = load i32, ptr %a, align 4, !tbaa !5 %idxprom40 = sext i32 %17 to i64 %18 = load i32, ptr %b, align 4, !tbaa !5 %idxprom42 = sext i32 %18 to i64 %arrayidx43 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %idxprom40, i64 %idxprom42 %19 = load i64, ptr %arrayidx43, align 8, !tbaa !9 %cmp44 = icmp slt i64 %19, 10000000 br i1 %cmp44, label %if.then46, label %if.else52 if.then46: ; preds = %if.else %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %19) br label %for.inc56 if.else52: ; preds = %if.else %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc56 for.inc56: ; preds = %for.cond1.for.inc29_crit_edge.i, %if.then28, %if.then19, %if.else52, %if.then46 %inc57 = add nuw nsw i32 %i.173, 1 %20 = load i32, ptr %k, align 4, !tbaa !5 %cmp15 = icmp slt i32 %inc57, %20 br i1 %cmp15, label %for.body17, label %while.cond.backedge, !llvm.loop !18 while.end: ; preds = %for.end9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @warshall_floyd() local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not44 = icmp slt i32 %0, 1 br i1 %cmp.not44, label %for.end31, label %for.cond1.preheader.lr.ph for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr @c, align 4 %idxprom8 = sext i32 %1 to i64 %2 = load i32, ptr @d, align 4 %idxprom12 = sext i32 %2 to i64 %arrayidx13 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %idxprom8, i64 %idxprom12 %3 = add nuw i32 %0, 1 %wide.trip.count50 = zext i32 %3 to i64 br label %for.cond1.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.for.inc29_crit_edge %indvars.iv47 = phi i64 [ 1, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next48, %for.cond1.for.inc29_crit_edge ] %arrayidx9 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv47, i64 %idxprom8 br label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ 1, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] %arrayidx5 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv47, i64 %indvars.iv %4 = load i64, ptr %arrayidx5, align 8, !tbaa !9 %conv = trunc i64 %4 to i32 %5 = load i64, ptr %arrayidx9, align 8, !tbaa !9 %6 = load i64, ptr %arrayidx13, align 8, !tbaa !9 %add = add nsw i64 %6, %5 %arrayidx17 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %idxprom12, i64 %indvars.iv %7 = load i64, ptr %arrayidx17, align 8, !tbaa !9 %add18 = add nsw i64 %add, %7 %conv19 = trunc i64 %add18 to i32 %cond.i = tail call i32 @llvm.smin.i32(i32 %conv, i32 %conv19) %conv20 = sext i32 %cond.i to i64 %arrayidx24 = getelementptr inbounds [101 x [101 x i64]], ptr @graph, i64 0, i64 %indvars.iv, i64 %indvars.iv47 store i64 %conv20, ptr %arrayidx24, align 8, !tbaa !9 store i64 %conv20, ptr %arrayidx5, align 8, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count50 br i1 %exitcond.not, label %for.cond1.for.inc29_crit_edge, label %for.body3, !llvm.loop !16 for.cond1.for.inc29_crit_edge: ; preds = %for.body3 %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1 %exitcond51.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count50 br i1 %exitcond51.not, label %for.end31, label %for.cond1.preheader, !llvm.loop !17 for.end31: ; preds = %for.cond1.for.inc29_crit_edge, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %x, i32 noundef %y) local_unnamed_addr #4 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %x, i32 %y) ret i32 %cond } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = distinct !{!15, !12} !16 = distinct !{!16, !12} !17 = distinct !{!17, !12} !18 = distinct !{!18, !12}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> int main(void){ int N; scanf("%d", &N); char s[N][11]; for(int i = 0; i < N; i++){ scanf("%s", s[i]); } int M; scanf("%d", &M); char t[M][11]; for(int i = 0; i < M; i++){ scanf("%s", t[i]); } int max = 0; for(int i = 0; i < N; i++){ int m = 0; for(int j = 0; j < N; j++){ if(strcmp(s[i], s[j]) == 0){ m++; } } for(int j = 0; j < M; j++){ if(strcmp(s[i], t[j]) == 0){ m--; } } if(m > max){ max = m; } } printf("%d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261976/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261976/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #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 [11 x i8], i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp79 = icmp sgt i32 %3, 0 br i1 %cmp79, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #6 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M) %4 = load i32, ptr %M, align 4, !tbaa !5 %5 = zext i32 %4 to i64 %vla3 = alloca [11 x i8], i64 %5, align 16 %cmp681 = icmp sgt i32 %4, 0 br i1 %cmp681, label %for.body8, label %for.cond17.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [11 x i8], 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.cond.cleanup, !llvm.loop !9 for.cond17.preheader: ; preds = %for.body8, %for.cond.cleanup %.lcssa = phi i32 [ %4, %for.cond.cleanup ], [ %9, %for.body8 ] %8 = load i32, ptr %N, align 4, !tbaa !5 %cmp1891 = icmp sgt i32 %8, 0 br i1 %cmp1891, label %for.cond21.preheader.lr.ph, label %for.cond.cleanup19 for.cond21.preheader.lr.ph: ; preds = %for.cond17.preheader %cmp3987 = icmp sgt i32 %.lcssa, 0 %wide.trip.count149 = zext i32 %8 to i64 br i1 %cmp3987, label %for.cond21.preheader.us.us.preheader, label %for.cond21.preheader.us for.cond21.preheader.us.us.preheader: ; preds = %for.cond21.preheader.lr.ph %wide.trip.count144 = zext i32 %.lcssa to i64 br label %for.cond21.preheader.us.us for.cond21.preheader.us.us: ; preds = %for.cond21.preheader.us.us.preheader, %for.cond38.for.cond.cleanup40_crit_edge.us.us %indvars.iv146 = phi i64 [ 0, %for.cond21.preheader.us.us.preheader ], [ %indvars.iv.next147, %for.cond38.for.cond.cleanup40_crit_edge.us.us ] %max.092.us.us = phi i32 [ 0, %for.cond21.preheader.us.us.preheader ], [ %spec.select77.us.us, %for.cond38.for.cond.cleanup40_crit_edge.us.us ] %arrayidx26.us.us = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv146 br label %for.body24.us.us for.body41.us.us: ; preds = %for.body24.us.us, %for.body41.us.us %indvars.iv141 = phi i64 [ %indvars.iv.next142, %for.body41.us.us ], [ 0, %for.body24.us.us ] %m.288.us.us = phi i32 [ %spec.select78.us.us, %for.body41.us.us ], [ %spec.select.us.us, %for.body24.us.us ] %arrayidx46.us.us = getelementptr inbounds [11 x i8], ptr %vla3, i64 %indvars.iv141 %call48.us.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx26.us.us, ptr noundef nonnull dereferenceable(1) %arrayidx46.us.us) #7 %cmp49.us.us = icmp eq i32 %call48.us.us, 0 %dec.us.us = sext i1 %cmp49.us.us to i32 %spec.select78.us.us = add nsw i32 %m.288.us.us, %dec.us.us %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1 %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144 br i1 %exitcond145.not, label %for.cond38.for.cond.cleanup40_crit_edge.us.us, label %for.body41.us.us, !llvm.loop !11 for.body24.us.us: ; preds = %for.body24.us.us, %for.cond21.preheader.us.us %indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.body24.us.us ], [ 0, %for.cond21.preheader.us.us ] %m.084.us.us = phi i32 [ %spec.select.us.us, %for.body24.us.us ], [ 0, %for.cond21.preheader.us.us ] %arrayidx29.us.us = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv136 %call31.us.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx26.us.us, ptr noundef nonnull dereferenceable(1) %arrayidx29.us.us) #7 %cmp32.us.us = icmp eq i32 %call31.us.us, 0 %inc33.us.us = zext i1 %cmp32.us.us to i32 %spec.select.us.us = add nuw nsw i32 %m.084.us.us, %inc33.us.us %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count149 br i1 %exitcond140.not, label %for.body41.us.us, label %for.body24.us.us, !llvm.loop !12 for.cond38.for.cond.cleanup40_crit_edge.us.us: ; preds = %for.body41.us.us %spec.select77.us.us = call i32 @llvm.smax.i32(i32 %spec.select78.us.us, i32 %max.092.us.us) %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1 %exitcond150.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count149 br i1 %exitcond150.not, label %for.cond.cleanup19, label %for.cond21.preheader.us.us, !llvm.loop !13 for.cond21.preheader.us: ; preds = %for.cond21.preheader.lr.ph, %for.cond21.for.cond38.preheader_crit_edge.us %indvars.iv131 = phi i64 [ %indvars.iv.next132, %for.cond21.for.cond38.preheader_crit_edge.us ], [ 0, %for.cond21.preheader.lr.ph ] %max.092.us = phi i32 [ %spec.select77.us, %for.cond21.for.cond38.preheader_crit_edge.us ], [ 0, %for.cond21.preheader.lr.ph ] %arrayidx26.us = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv131 br label %for.body24.us for.body24.us: ; preds = %for.cond21.preheader.us, %for.body24.us %indvars.iv128 = phi i64 [ 0, %for.cond21.preheader.us ], [ %indvars.iv.next129, %for.body24.us ] %m.084.us = phi i32 [ 0, %for.cond21.preheader.us ], [ %spec.select.us, %for.body24.us ] %arrayidx29.us = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv128 %call31.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx26.us, ptr noundef nonnull dereferenceable(1) %arrayidx29.us) #7 %cmp32.us = icmp eq i32 %call31.us, 0 %inc33.us = zext i1 %cmp32.us to i32 %spec.select.us = add nuw nsw i32 %m.084.us, %inc33.us %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count149 br i1 %exitcond.not, label %for.cond21.for.cond38.preheader_crit_edge.us, label %for.body24.us, !llvm.loop !12 for.cond21.for.cond38.preheader_crit_edge.us: ; preds = %for.body24.us %spec.select77.us = call i32 @llvm.smax.i32(i32 %spec.select.us, i32 %max.092.us) %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count149 br i1 %exitcond135.not, label %for.cond.cleanup19, label %for.cond21.preheader.us, !llvm.loop !13 for.body8: ; preds = %for.cond.cleanup, %for.body8 %indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.body8 ], [ 0, %for.cond.cleanup ] %arrayidx10 = getelementptr inbounds [11 x i8], ptr %vla3, i64 %indvars.iv125 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10) %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1 %9 = load i32, ptr %M, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp6 = icmp slt i64 %indvars.iv.next126, %10 br i1 %cmp6, label %for.body8, label %for.cond17.preheader, !llvm.loop !14 for.cond.cleanup19: ; preds = %for.cond21.for.cond38.preheader_crit_edge.us, %for.cond38.for.cond.cleanup40_crit_edge.us.us, %for.cond17.preheader %max.0.lcssa = phi i32 [ 0, %for.cond17.preheader ], [ %spec.select77.us.us, %for.cond38.for.cond.cleanup40_crit_edge.us.us ], [ %spec.select77.us, %for.cond21.for.cond38.preheader_crit_edge.us ] %call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #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: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #include <string.h> int onde[200][2], stq = 0, maxi = 0; char st[200][12], read[13]; int max(int a, int b){ return a > b ? a: b; } void conta(int azul){ //strcpy(dest, sourc); for(int i = 0; i < stq; ++i){ if(strcmp(st[i], read) == 0){ onde[i][azul]++; return; } } onde[stq][azul] = 1; strcpy(st[stq++], read); return; } int main() { int n, m; scanf("%d", &n); for(int i = 0; i < n; ++i){ scanf(" %s", read); conta(0); } scanf("%d", &m); for(int i = 0; i < m; ++i){ scanf(" %s", read); conta(1); } for(int i = 0; i < stq; ++i){ maxi = max(maxi, onde[i][0]-onde[i][1]); } printf("%d\n", maxi); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262025/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262025/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stq = dso_local local_unnamed_addr global i32 0, align 4 @maxi = dso_local local_unnamed_addr global i32 0, align 4 @st = dso_local global [200 x [12 x i8]] zeroinitializer, align 16 @read = dso_local global [13 x i8] zeroinitializer, align 1 @onde = dso_local local_unnamed_addr global [200 x [2 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c" %s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @conta(i32 noundef %azul) local_unnamed_addr #1 { entry: %0 = load i32, ptr @stq, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %0, 0 br i1 %cmp24, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %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 %for.end, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds [200 x [12 x i8]], ptr @st, i64 0, i64 %indvars.iv %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) @read) #8 %cmp1 = icmp eq i32 %call, 0 br i1 %cmp1, label %cleanup, label %for.cond cleanup: ; preds = %for.body %idxprom4 = sext i32 %azul to i64 %arrayidx5 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %indvars.iv, i64 %idxprom4 %1 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %arrayidx5, align 4, !tbaa !5 br label %return for.end: ; preds = %for.cond, %entry %idxprom7 = sext i32 %0 to i64 %idxprom9 = sext i32 %azul to i64 %arrayidx10 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %idxprom7, i64 %idxprom9 store i32 1, ptr %arrayidx10, align 4, !tbaa !5 %inc11 = add nsw i32 %0, 1 store i32 %inc11, ptr @stq, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [200 x [12 x i8]], ptr @st, i64 0, i64 %idxprom7 %call15 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx13, ptr noundef nonnull dereferenceable(1) @read) #9 br label %return return: ; preds = %cleanup, %for.end 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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp54 = icmp sgt i32 %0, 0 br i1 %cmp54, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %conta.exit, %entry %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp556 = icmp sgt i32 %1, 0 br i1 %cmp556, label %for.body7, label %for.cond.cleanup.for.cond13.preheader_crit_edge for.cond.cleanup.for.cond13.preheader_crit_edge: ; preds = %for.cond.cleanup %.pre = load i32, ptr @stq, align 4, !tbaa !5 br label %for.cond13.preheader for.body: ; preds = %entry, %conta.exit %i.055 = phi i32 [ %inc, %conta.exit ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @read) %2 = load i32, ptr @stq, align 4, !tbaa !5 %cmp24.i = icmp sgt i32 %2, 0 br i1 %cmp24.i, label %for.body.preheader.i, label %for.end.i for.body.preheader.i: ; preds = %for.body %wide.trip.count.i = zext i32 %2 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 %for.end.i, label %for.body.i, !llvm.loop !9 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 [200 x [12 x i8]], ptr @st, i64 0, i64 %indvars.iv.i %call.i = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx.i, ptr noundef nonnull dereferenceable(1) @read) #8 %cmp1.i = icmp eq i32 %call.i, 0 br i1 %cmp1.i, label %cleanup.i, label %for.cond.i cleanup.i: ; preds = %for.body.i %arrayidx5.i = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %indvars.iv.i, i64 0 %3 = load i32, ptr %arrayidx5.i, align 8, !tbaa !5 %inc.i = add nsw i32 %3, 1 store i32 %inc.i, ptr %arrayidx5.i, align 8, !tbaa !5 br label %conta.exit for.end.i: ; preds = %for.cond.i, %for.body %idxprom7.i = sext i32 %2 to i64 %arrayidx10.i = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %idxprom7.i, i64 0 store i32 1, ptr %arrayidx10.i, align 8, !tbaa !5 %inc11.i = add nsw i32 %2, 1 store i32 %inc11.i, ptr @stq, align 4, !tbaa !5 %arrayidx13.i = getelementptr inbounds [200 x [12 x i8]], ptr @st, i64 0, i64 %idxprom7.i %call15.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx13.i, ptr noundef nonnull dereferenceable(1) @read) #9 br label %conta.exit conta.exit: ; preds = %cleanup.i, %for.end.i %inc = add nuw nsw i32 %i.055, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 for.cond13.preheader: ; preds = %conta.exit51, %for.cond.cleanup.for.cond13.preheader_crit_edge %5 = phi i32 [ %.pre, %for.cond.cleanup.for.cond13.preheader_crit_edge ], [ %17, %conta.exit51 ] %maxi.promoted = load i32, ptr @maxi, align 4, !tbaa !5 %cmp1459 = icmp sgt i32 %5, 0 br i1 %cmp1459, label %for.body16.preheader, label %for.cond.cleanup15 for.body16.preheader: ; preds = %for.cond13.preheader %wide.trip.count = zext i32 %5 to i64 %min.iters.check = icmp ult i32 %5, 8 br i1 %min.iters.check, label %for.body16.preheader74, label %vector.ph vector.ph: ; preds = %for.body16.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %maxi.promoted, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %11, %vector.body ] %vec.phi69 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %12, %vector.body ] %6 = or i64 %index, 4 %7 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %index %8 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %6 %wide.vec = load <8 x i32>, ptr %7, align 16, !tbaa !5 %wide.vec70 = load <8 x i32>, ptr %8, align 16, !tbaa !5 %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec71 = shufflevector <8 x i32> %wide.vec70, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6> %strided.vec72 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> %strided.vec73 = shufflevector <8 x i32> %wide.vec70, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7> %9 = sub nsw <4 x i32> %strided.vec, %strided.vec72 %10 = sub nsw <4 x i32> %strided.vec71, %strided.vec73 %11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %9) %12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi69, <4 x i32> %10) %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %11, <4 x i32> %12) %14 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond13.for.cond.cleanup15_crit_edge, label %for.body16.preheader74 for.body16.preheader74: ; preds = %for.body16.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body16.preheader ], [ %n.vec, %middle.block ] %cond.i5860.ph = phi i32 [ %maxi.promoted, %for.body16.preheader ], [ %14, %middle.block ] br label %for.body16 for.body7: ; preds = %for.cond.cleanup, %conta.exit51 %i3.057 = phi i32 [ %inc10, %conta.exit51 ], [ 0, %for.cond.cleanup ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @read) %15 = load i32, ptr @stq, align 4, !tbaa !5 %cmp24.i31 = icmp sgt i32 %15, 0 br i1 %cmp24.i31, label %for.body.preheader.i38, label %for.end.i32 for.body.preheader.i38: ; preds = %for.body7 %wide.trip.count.i39 = zext i32 %15 to i64 br label %for.body.i40 for.cond.i45: ; preds = %for.body.i40 %indvars.iv.next.i46 = add nuw nsw i64 %indvars.iv.i41, 1 %exitcond.not.i47 = icmp eq i64 %indvars.iv.next.i46, %wide.trip.count.i39 br i1 %exitcond.not.i47, label %for.end.i32, label %for.body.i40, !llvm.loop !9 for.body.i40: ; preds = %for.cond.i45, %for.body.preheader.i38 %indvars.iv.i41 = phi i64 [ 0, %for.body.preheader.i38 ], [ %indvars.iv.next.i46, %for.cond.i45 ] %arrayidx.i42 = getelementptr inbounds [200 x [12 x i8]], ptr @st, i64 0, i64 %indvars.iv.i41 %call.i43 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx.i42, ptr noundef nonnull dereferenceable(1) @read) #8 %cmp1.i44 = icmp eq i32 %call.i43, 0 br i1 %cmp1.i44, label %cleanup.i48, label %for.cond.i45 cleanup.i48: ; preds = %for.body.i40 %arrayidx5.i49 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %indvars.iv.i41, i64 1 %16 = load i32, ptr %arrayidx5.i49, align 4, !tbaa !5 %inc.i50 = add nsw i32 %16, 1 store i32 %inc.i50, ptr %arrayidx5.i49, align 4, !tbaa !5 br label %conta.exit51 for.end.i32: ; preds = %for.cond.i45, %for.body7 %idxprom7.i33 = sext i32 %15 to i64 %arrayidx10.i34 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %idxprom7.i33, i64 1 store i32 1, ptr %arrayidx10.i34, align 4, !tbaa !5 %inc11.i35 = add nsw i32 %15, 1 store i32 %inc11.i35, ptr @stq, align 4, !tbaa !5 %arrayidx13.i36 = getelementptr inbounds [200 x [12 x i8]], ptr @st, i64 0, i64 %idxprom7.i33 %call15.i37 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx13.i36, ptr noundef nonnull dereferenceable(1) @read) #9 br label %conta.exit51 conta.exit51: ; preds = %cleanup.i48, %for.end.i32 %17 = phi i32 [ %15, %cleanup.i48 ], [ %inc11.i35, %for.end.i32 ] %inc10 = add nuw nsw i32 %i3.057, 1 %18 = load i32, ptr %m, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc10, %18 br i1 %cmp5, label %for.body7, label %for.cond13.preheader, !llvm.loop !15 for.cond13.for.cond.cleanup15_crit_edge: ; preds = %for.body16, %middle.block %cond.i.lcssa = phi i32 [ %14, %middle.block ], [ %cond.i, %for.body16 ] store i32 %cond.i.lcssa, ptr @maxi, align 4, !tbaa !5 br label %for.cond.cleanup15 for.cond.cleanup15: ; preds = %for.cond13.for.cond.cleanup15_crit_edge, %for.cond13.preheader %19 = phi i32 [ %cond.i.lcssa, %for.cond13.for.cond.cleanup15_crit_edge ], [ %maxi.promoted, %for.cond13.preheader ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #9 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 ret i32 0 for.body16: ; preds = %for.body16.preheader74, %for.body16 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body16 ], [ %indvars.iv.ph, %for.body16.preheader74 ] %cond.i5860 = phi i32 [ %cond.i, %for.body16 ], [ %cond.i5860.ph, %for.body16.preheader74 ] %arrayidx = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %indvars.iv %20 = load i32, ptr %arrayidx, align 8, !tbaa !5 %arrayidx20 = getelementptr inbounds [200 x [2 x i32]], ptr @onde, i64 0, i64 %indvars.iv, i64 1 %21 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %sub = sub nsw i32 %20, %21 %cond.i = call i32 @llvm.smax.i32(i32 %cond.i5860, i32 %sub) %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.cond13.for.cond.cleanup15_crit_edge, label %for.body16, !llvm.loop !16 } ; 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 i32 @llvm.smax.i32(i32, i32) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #7 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 memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 willreturn memory(read) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 <string.h> int main(void) { int i, j, c, k=0, max, n, m; char a[200][11]; scanf("%d", &n); for (i=0; i<n; i++) scanf("%s", a[k++]); scanf("%d", &m); for (i=0; i<m; i++) scanf("%s", a[k++]); max = 0; for (i=0; i<k; i++) { c=0; for (j=0; j<k; j++) { if (strcmp(a[i], a[j])==0) { if (j<n) c++; else c--; } } if (c>max) max = c; } printf("%d\n", max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262076/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca [200 x [11 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 2200, ptr nonnull %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp59 = icmp sgt i32 %0, 0 br i1 %cmp59, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %indvars73 = trunc i64 %indvars.iv.next to i32 %arrayidx = getelementptr inbounds [200 x [11 x i8]], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, %indvars73 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %k.0.lcssa = phi i32 [ 0, %entry ], [ %indvars73, %for.body ] %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp562 = icmp sgt i32 %2, 0 br i1 %cmp562, label %for.body6.preheader, label %for.cond15.preheader for.body6.preheader: ; preds = %for.end %3 = zext i32 %k.0.lcssa to i64 br label %for.body6 for.cond15.preheader.loopexit: ; preds = %for.body6 %4 = trunc i64 %indvars.iv.next76 to i32 br label %for.cond15.preheader for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.end %k.1.lcssa = phi i32 [ %k.0.lcssa, %for.end ], [ %4, %for.cond15.preheader.loopexit ] %cmp1668.not = icmp eq i32 %k.1.lcssa, 0 br i1 %cmp1668.not, label %for.end41, label %for.cond18.preheader.lr.ph for.cond18.preheader.lr.ph: ; preds = %for.cond15.preheader %5 = load i32, ptr %n, align 4 %6 = sext i32 %5 to i64 %wide.trip.count84 = zext i32 %k.1.lcssa to i64 br label %for.cond18.preheader for.body6: ; preds = %for.body6.preheader, %for.body6 %indvars.iv75 = phi i64 [ %3, %for.body6.preheader ], [ %indvars.iv.next76, %for.body6 ] %i.163 = phi i32 [ 0, %for.body6.preheader ], [ %inc13, %for.body6 ] %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %arrayidx9 = getelementptr inbounds [200 x [11 x i8]], ptr %a, i64 0, i64 %indvars.iv75 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9) %inc13 = add nuw nsw i32 %i.163, 1 %7 = load i32, ptr %m, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc13, %7 br i1 %cmp5, label %for.body6, label %for.cond15.preheader.loopexit, !llvm.loop !11 for.cond18.preheader: ; preds = %for.cond18.preheader.lr.ph, %for.end35 %indvars.iv81 = phi i64 [ 0, %for.cond18.preheader.lr.ph ], [ %indvars.iv.next82, %for.end35 ] %max.070 = phi i32 [ 0, %for.cond18.preheader.lr.ph ], [ %spec.select, %for.end35 ] %arrayidx22 = getelementptr inbounds [200 x [11 x i8]], ptr %a, i64 0, i64 %indvars.iv81 br label %for.body20 for.body20: ; preds = %for.cond18.preheader, %for.inc33 %indvars.iv78 = phi i64 [ 0, %for.cond18.preheader ], [ %indvars.iv.next79, %for.inc33 ] %c.067 = phi i32 [ 0, %for.cond18.preheader ], [ %c.1, %for.inc33 ] %arrayidx25 = getelementptr inbounds [200 x [11 x i8]], ptr %a, i64 0, i64 %indvars.iv78 %call27 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx22, ptr noundef nonnull dereferenceable(1) %arrayidx25) #6 %cmp28 = icmp eq i32 %call27, 0 br i1 %cmp28, label %if.then, label %for.inc33 if.then: ; preds = %for.body20 %cmp29 = icmp slt i64 %indvars.iv78, %6 br i1 %cmp29, label %if.then30, label %if.else if.then30: ; preds = %if.then %inc31 = add nsw i32 %c.067, 1 br label %for.inc33 if.else: ; preds = %if.then %dec = add nsw i32 %c.067, -1 br label %for.inc33 for.inc33: ; preds = %for.body20, %if.else, %if.then30 %c.1 = phi i32 [ %inc31, %if.then30 ], [ %dec, %if.else ], [ %c.067, %for.body20 ] %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count84 br i1 %exitcond.not, label %for.end35, label %for.body20, !llvm.loop !12 for.end35: ; preds = %for.inc33 %spec.select = call i32 @llvm.smax.i32(i32 %c.1, i32 %max.070) %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84 br i1 %exitcond85.not, label %for.end41, label %for.cond18.preheader, !llvm.loop !13 for.end41: ; preds = %for.end35, %for.cond15.preheader %max.0.lcssa = phi i32 [ 0, %for.cond15.preheader ], [ %spec.select, %for.end35 ] %call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 2200, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> #include<stdlib.h> #include<string.h> #define ll long long #define rep(i,l,r)for(ll i=(l);i<(r);i++) char s[5010]; int main(){ scanf("%s",s); if(strlen(s)<3){ puts("No"); return 0; } while(s[1]){ char temp[5010]={}; int cnt=0; int n=strlen(s); int flag=0; int check=0; rep(i,0,n){ if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){ temp[cnt++]='X'; i+=2; check=1; }else{ temp[cnt++]=s[i]; flag|=1<<(s[i]-'A'); } } if(cnt==1){ puts("Yes"); return 0; }else if((check&&(flag==3||flag==5||flag==6))){ rep(i,0,cnt)if(temp[i]=='X')temp[i]=flag==3?'C':flag==5?'B':'A'; memcpy(s,temp,5000); }else{ puts("No"); return 0; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262119/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @s = dso_local global [5010 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %temp = alloca [5010 x i8], align 16 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #6 %cmp = icmp ult i64 %call1, 3 br i1 %cmp, label %if.then, label %while.cond if.then: ; preds = %entry %call2 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %while.end while.cond: ; preds = %entry %.old = load i8, ptr getelementptr inbounds ([5010 x i8], ptr @s, i64 0, i64 1), align 1, !tbaa !5 %tobool.not.old = icmp eq i8 %.old, 0 br i1 %tobool.not.old, label %while.end, label %while.body while.body: ; preds = %while.cond, %cleanup call void @llvm.lifetime.start.p0(i64 5010, ptr nonnull %temp) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5010) %temp, i8 0, i64 5010, i1 false) %call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #6 %sext = shl i64 %call3, 32 %conv4 = ashr exact i64 %sext, 32 %cmp599 = icmp sgt i64 %sext, 0 br i1 %cmp599, label %for.body, label %cleanup.thread for.cond.cleanup: ; preds = %for.inc %0 = trunc i64 %indvars.iv.next to i32 %cmp31 = icmp eq i32 %0, 1 br i1 %cmp31, label %cleanup.thread, label %if.else35 for.body: ; preds = %while.body, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %while.body ] %i.0103 = phi i64 [ %inc30, %for.inc ], [ 0, %while.body ] %check.0102 = phi i32 [ %check.1, %for.inc ], [ 0, %while.body ] %flag.0101 = phi i32 [ %flag.1, %for.inc ], [ 0, %while.body ] %arrayidx = getelementptr inbounds [5010 x i8], ptr @s, i64 0, i64 %i.0103 %1 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp8 = icmp eq i8 %1, 65 br i1 %cmp8, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body %add = add nsw i64 %i.0103, 1 %arrayidx10 = getelementptr inbounds [5010 x i8], ptr @s, i64 0, i64 %add %2 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12 = icmp eq i8 %2, 66 br i1 %cmp12, label %land.lhs.true14, label %if.else land.lhs.true14: ; preds = %land.lhs.true %add15 = add nsw i64 %i.0103, 2 %arrayidx16 = getelementptr inbounds [5010 x i8], ptr @s, i64 0, i64 %add15 %3 = load i8, ptr %arrayidx16, align 1, !tbaa !5 %cmp18 = icmp eq i8 %3, 67 br i1 %cmp18, label %if.then20, label %if.else if.then20: ; preds = %land.lhs.true14 %arrayidx21 = getelementptr inbounds [5010 x i8], ptr %temp, i64 0, i64 %indvars.iv store i8 88, ptr %arrayidx21, align 1, !tbaa !5 br label %for.inc if.else: ; preds = %land.lhs.true14, %land.lhs.true, %for.body %arrayidx26 = getelementptr inbounds [5010 x i8], ptr %temp, i64 0, i64 %indvars.iv store i8 %1, ptr %arrayidx26, align 1, !tbaa !5 %conv28 = sext i8 %1 to i32 %sub = add nsw i32 %conv28, -65 %shl = shl nuw i32 1, %sub %or = or i32 %shl, %flag.0101 br label %for.inc for.inc: ; preds = %if.then20, %if.else %flag.1 = phi i32 [ %flag.0101, %if.then20 ], [ %or, %if.else ] %check.1 = phi i32 [ 1, %if.then20 ], [ %check.0102, %if.else ] %i.1 = phi i64 [ %add15, %if.then20 ], [ %i.0103, %if.else ] %indvars.iv.next = add nuw i64 %indvars.iv, 1 %inc30 = add nsw i64 %i.1, 1 %cmp5 = icmp slt i64 %inc30, %conv4 br i1 %cmp5, label %for.body, label %for.cond.cleanup, !llvm.loop !8 if.else35: ; preds = %for.cond.cleanup %tobool36.not = icmp eq i32 %check.1, 0 br i1 %tobool36.not, label %cleanup.thread, label %land.lhs.true37 land.lhs.true37: ; preds = %if.else35 %cmp38 = icmp eq i32 %flag.1, 3 %cmp40 = icmp eq i32 %flag.1, 5 switch i32 %flag.1, label %cleanup.thread [ i32 6, label %if.then45 i32 5, label %if.then45 i32 3, label %if.then45 ] if.then45: ; preds = %land.lhs.true37, %land.lhs.true37, %land.lhs.true37 %conv48 = and i64 %indvars.iv.next, 4294967295 %cmp49106.not = icmp eq i32 %0, 0 br i1 %cmp49106.not, label %cleanup, label %iter.check iter.check: ; preds = %if.then45 %cond = select i1 %cmp40, i8 66, i8 65 %spec.select = select i1 %cmp38, i8 67, i8 %cond %min.iters.check = icmp ult i64 %conv48, 8 br i1 %min.iters.check, label %for.body52.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check120 = icmp ult i64 %conv48, 32 br i1 %min.iters.check120, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %indvars.iv.next, 31 %n.vec = sub nsw i64 %conv48, %n.mod.vf %broadcast.splatinsert = insertelement <16 x i8> poison, i8 %spec.select, i64 0 %broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = getelementptr inbounds [5010 x i8], ptr %temp, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i8, ptr %4, i64 16 %wide.load121 = load <16 x i8>, ptr %5, align 16, !tbaa !5 %6 = icmp eq <16 x i8> %wide.load, <i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88> %7 = icmp eq <16 x i8> %wide.load121, <i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88> %8 = select <16 x i1> %6, <16 x i8> %broadcast.splat, <16 x i8> %wide.load %9 = select <16 x i1> %7, <16 x i8> %broadcast.splat, <16 x i8> %wide.load121 store <16 x i8> %8, ptr %4, align 16 store <16 x i8> %9, ptr %5, align 16 %index.next = add nuw i64 %index, 32 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body52.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.mod.vf122 = and i64 %indvars.iv.next, 7 %n.vec123 = sub nsw i64 %conv48, %n.mod.vf122 %broadcast.splatinsert127 = insertelement <8 x i8> poison, i8 %spec.select, i64 0 %broadcast.splat128 = shufflevector <8 x i8> %broadcast.splatinsert127, <8 x i8> poison, <8 x i32> zeroinitializer br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index125 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next129, %vec.epilog.vector.body ] %11 = getelementptr inbounds [5010 x i8], ptr %temp, i64 0, i64 %index125 %wide.load126 = load <8 x i8>, ptr %11, align 1, !tbaa !5 %12 = icmp eq <8 x i8> %wide.load126, <i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88, i8 88> %13 = select <8 x i1> %12, <8 x i8> %broadcast.splat128, <8 x i8> %wide.load126 store <8 x i8> %13, ptr %11, align 1 %index.next129 = add nuw i64 %index125, 8 %14 = icmp eq i64 %index.next129, %n.vec123 br i1 %14, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !13 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n124 = icmp eq i64 %n.mod.vf122, 0 br i1 %cmp.n124, label %cleanup, label %for.body52.preheader for.body52.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %i46.0107.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec123, %vec.epilog.middle.block ] br label %for.body52 for.body52: ; preds = %for.body52.preheader, %for.body52 %i46.0107 = phi i64 [ %inc67, %for.body52 ], [ %i46.0107.ph, %for.body52.preheader ] %arrayidx53 = getelementptr inbounds [5010 x i8], ptr %temp, i64 0, i64 %i46.0107 %15 = load i8, ptr %arrayidx53, align 1, !tbaa !5 %cmp55 = icmp eq i8 %15, 88 %spec.store.select = select i1 %cmp55, i8 %spec.select, i8 %15 store i8 %spec.store.select, ptr %arrayidx53, align 1 %inc67 = add nuw nsw i64 %i46.0107, 1 %exitcond.not = icmp eq i64 %inc67, %conv48 br i1 %exitcond.not, label %cleanup, label %for.body52, !llvm.loop !14 cleanup.thread: ; preds = %if.else35, %land.lhs.true37, %while.body, %for.cond.cleanup %.str.2.sink = phi ptr [ @.str.2, %for.cond.cleanup ], [ @.str.1, %while.body ], [ @.str.1, %land.lhs.true37 ], [ @.str.1, %if.else35 ] %call34 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 5010, ptr nonnull %temp) #7 br label %while.end cleanup: ; preds = %for.body52, %middle.block, %vec.epilog.middle.block, %if.then45 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(5000) @s, ptr noundef nonnull align 16 dereferenceable(5000) %temp, i64 5000, i1 false) call void @llvm.lifetime.end.p0(i64 5010, ptr nonnull %temp) #7 %16 = load i8, ptr getelementptr inbounds ([5010 x i8], ptr @s, i64 0, i64 1), align 1 %tobool.not = icmp eq i8 %16, 0 br i1 %tobool.not, label %while.end, label %while.body while.end: ; preds = %cleanup, %cleanup.thread, %if.then, %while.cond 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1 ; 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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind willreturn memory(read) } 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, !12} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !9, !11, !12} !14 = distinct !{!14, !9, !12, !11}
#include<stdio.h> int main() { int n,k,i,walk=0,a,a1,b[500]; scanf("%d %d",&n,&k); scanf("%d",&a1); b[0]=a1; for(i=1;i<n;i++){ scanf("%d",&a); if(a+a1<k){ walk+=k-a-a1; a1=k-a1; b[i]=a1; } else{ b[i]=a; a1=a; } } printf("%d\n",walk); for(i=0;i<n;i++){ printf("%d ",b[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26217/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26217/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca i32, align 4 %a1 = alloca i32, align 4 %b = alloca [500 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 %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #3 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a1) %0 = load i32, ptr %a1, align 4, !tbaa !5 store i32 %0, ptr %b, align 16, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 1 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %walk.029 = phi i32 [ %walk.1, %for.body ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %a1, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp3 = icmp slt i32 %add, %4 %sub4 = sub i32 %walk.029, %add %add5 = add i32 %sub4, %4 %sub6 = sub nsw i32 %4, %3 %.sink36 = select i1 %cmp3, i32 %sub6, i32 %2 %walk.1 = select i1 %cmp3, i32 %add5, i32 %walk.029 store i32 %.sink36, ptr %a1, align 4 %5 = getelementptr inbounds [500 x i32], ptr %b, i64 0, i64 %indvars.iv store i32 %.sink36, ptr %5, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %walk.0.lcssa = phi i32 [ 0, %entry ], [ %walk.1, %for.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %walk.0.lcssa) %8 = load i32, ptr %n, align 4, !tbaa !5 %cmp1230 = icmp sgt i32 %8, 0 br i1 %cmp1230, label %for.body13, label %for.end19 for.body13: ; preds = %for.end, %for.body13 %indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.body13 ], [ 0, %for.end ] %arrayidx15 = getelementptr inbounds [500 x i32], ptr %b, i64 0, i64 %indvars.iv33 %9 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %9) %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp12 = icmp slt i64 %indvars.iv.next34, %11 br i1 %cmp12, label %for.body13, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.body13, %for.end call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define PI 3.141592653589793 int main(void) { double r,area,cir; scanf("%lf", &r); area = PI*r*r; cir = 2*PI*r; printf("%lf %lf\n", area, cir); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262227/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define pi 3.141592653589 int main(void) { double r; scanf("%lf\n",&r); printf("%lf %lf\n",pi*r*r,2*pi*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262270/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262270/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB5444261E %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB5444261E %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #define PI 3.14159265359 int main(void){ double r; scanf("%lf",&r); printf("%f %f\n",PI*r*r,PI*r*2); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262313/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262313/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442EEA %mul1 = fmul double %0, %mul %mul3 = fmul double %mul, 2.000000e+00 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ double r,pai,men,shu; pai = 3.14159265359; scanf("%lf",&r); men = r * r * pai; shu = 2 * r * pai; printf("%f %f\n",men,shu); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262357/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262357/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB54442EEA %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB54442EEA %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void) { double a, b, c, pi; scanf ("%lf",&a); pi = 3.141592653589; a = 1.00000*a; b = a * a * pi; c = 2 * a * pi; printf("%f %f\n",b ,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262414/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262414/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load double, ptr %a, align 8, !tbaa !5 %mul1 = fmul double %0, %0 %mul2 = fmul double %mul1, 0x400921FB5444261E %mul3 = fmul double %0, 2.000000e+00 %mul4 = fmul double %mul3, 0x400921FB5444261E %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul4) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main() { double r; scanf("%lf", &r); printf("%f %f\n", M_PI * r * r, 2 * M_PI * r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262458/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262458/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<math.h> int main(){ double r; scanf("%lf",&r); printf("%f %f\n",M_PI*r*r,2*M_PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262500/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262500/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { double r; scanf("%lf",&r); printf("%lf %lf\n",r*r*3.141592653589,r*2*3.141592653589); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262544/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262544/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, %0 %mul1 = fmul double %mul, 0x400921FB5444261E %mul2 = fmul double %0, 2.000000e+00 %mul3 = fmul double %mul2, 0x400921FB5444261E %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include<math.h> int main(void) { double r; scanf("%lf",&r); printf("%f %f\n",M_PI*r*r,2*M_PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262588/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262588/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int main() { double r; scanf("%lf", &r); printf("%f %f\n", M_PI*r*r, 2*M_PI*r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262630/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262630/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %r = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r) %0 = load double, ptr %r, align 8, !tbaa !5 %mul = fmul double %0, 0x400921FB54442D18 %mul1 = fmul double %0, %mul %mul2 = fmul double %0, 0x401921FB54442D18 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}