Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <assert.h> #define MAX 1000010 #define clr(ar) memset(ar, 0, sizeof(ar)) #define read() freopen("lol.txt", "r", stdin) int n, k, ar[MAX]; void fft(int n, int* ar){ int i, j, x, g = n, flag = 0; while (((g != 1) || flag) && (n > 1)){ flag = 0; if (g != 1) g *= 0.77425; for (i = 0; (i + g) < n; i++){ if (ar[i] > ar[i + g]){ flag = 1; x = ar[i], ar[i] = ar[i + g], ar[i + g] = x; } } } } int main(){ int i, j, x, res = 0; scanf("%d %d", &n, &k); for (i = 0; i < n; i++) scanf("%d", &ar[i]); fft(n, ar); for (i = 0; i < k; i++) res += ar[i]; printf("%d\n", res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12753/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12753/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @k = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @ar = dso_local global [1000010 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @fft(i32 noundef %n, ptr nocapture noundef %ar) local_unnamed_addr #0 { entry: %cmp1 = icmp sgt i32 %n, 1 br i1 %cmp1, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %invariant.gep = getelementptr i32, ptr %ar, i64 1 br label %while.body while.cond.loopexit.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %flag.2.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %flag.2.1, %for.inc.1 ] %indvars.iv52.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next53.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %flag.147.unr = phi i32 [ 0, %for.body.preheader ], [ %flag.2.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.loopexit, label %for.body.epil for.body.epil: ; preds = %while.cond.loopexit.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i32, ptr %ar, i64 %indvars.iv52.unr %0 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5 %arrayidx8.epil = getelementptr inbounds i32, ptr %ar, i64 %indvars.iv.unr %1 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %cmp9.epil = icmp sgt i32 %0, %1 br i1 %cmp9.epil, label %if.then11.epil, label %while.cond.loopexit if.then11.epil: ; preds = %for.body.epil store i32 %1, ptr %arrayidx.epil, align 4, !tbaa !5 store i32 %0, ptr %arrayidx8.epil, align 4, !tbaa !5 br label %while.cond.loopexit while.cond.loopexit: ; preds = %while.cond.loopexit.loopexit.unr-lcssa, %if.then11.epil, %for.body.epil, %while.body %flag.1.lcssa = phi i32 [ 0, %while.body ], [ %flag.2.lcssa.ph, %while.cond.loopexit.loopexit.unr-lcssa ], [ 1, %if.then11.epil ], [ %flag.147.unr, %for.body.epil ] %cmp = icmp ne i32 %g.1, 1 %tobool = icmp ne i32 %flag.1.lcssa, 0 %or.cond = select i1 %cmp, i1 true, i1 %tobool br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !9 while.body: ; preds = %while.body.preheader, %while.cond.loopexit %cmp51 = phi i1 [ %cmp, %while.cond.loopexit ], [ true, %while.body.preheader ] %g.050 = phi i32 [ %g.1, %while.cond.loopexit ], [ %n, %while.body.preheader ] %conv = sitofp i32 %g.050 to double %mul = fmul double %conv, 7.742500e-01 %conv3 = fptosi double %mul to i32 %g.1 = select i1 %cmp51, i32 %conv3, i32 1 %cmp445 = icmp slt i32 %g.1, %n br i1 %cmp445, label %for.body.preheader, label %while.cond.loopexit for.body.preheader: ; preds = %while.body %2 = sext i32 %g.1 to i64 %3 = sub i32 %n, %g.1 %wide.trip.count = zext i32 %3 to i64 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %3, 1 br i1 %4, label %while.cond.loopexit.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv52 = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next53.1, %for.inc.1 ] %indvars.iv = phi i64 [ %2, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %flag.147 = phi i32 [ 0, %for.body.preheader.new ], [ %flag.2.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i32, ptr %ar, i64 %indvars.iv52 %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx8 = getelementptr inbounds i32, ptr %ar, i64 %indvars.iv %6 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %5, %6 br i1 %cmp9, label %if.then11, label %for.inc if.then11: ; preds = %for.body store i32 %6, ptr %arrayidx, align 4, !tbaa !5 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %if.then11 %flag.2 = phi i32 [ 1, %if.then11 ], [ %flag.147, %for.body ] %indvars.iv.next53 = or i64 %indvars.iv52, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %ar, i64 %indvars.iv.next53 %7 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv %8 = load i32, ptr %gep, align 4, !tbaa !5 %cmp9.1 = icmp sgt i32 %7, %8 br i1 %cmp9.1, label %if.then11.1, label %for.inc.1 if.then11.1: ; preds = %for.inc store i32 %8, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %7, ptr %gep, align 4, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then11.1, %for.inc %flag.2.1 = phi i32 [ 1, %if.then11.1 ], [ %flag.2, %for.inc ] %indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 2 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.cond.loopexit.loopexit.unr-lcssa, label %for.body, !llvm.loop !11 while.end: ; preds = %while.cond.loopexit, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.body, label %fft.exit for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000010 x i32], ptr @ar, i64 0, i64 %indvars.iv %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body %cmp1.i = icmp sgt i32 %1, 1 br i1 %cmp1.i, label %while.body.i, label %fft.exit while.cond.loopexit.i.loopexit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.preheader.i %flag.2.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %flag.2.i.1, %for.inc.i.1 ] %indvars.iv52.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next53.i.1, %for.inc.i.1 ] %indvars.iv.i.unr = phi i64 [ %5, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %flag.147.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %flag.2.i.1, %for.inc.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.cond.loopexit.i, label %for.body.i.epil for.body.i.epil: ; preds = %while.cond.loopexit.i.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i32, ptr @ar, i64 %indvars.iv52.i.unr %3 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5 %arrayidx8.i.epil = getelementptr inbounds i32, ptr @ar, i64 %indvars.iv.i.unr %4 = load i32, ptr %arrayidx8.i.epil, align 4, !tbaa !5 %cmp9.i.epil = icmp sgt i32 %3, %4 br i1 %cmp9.i.epil, label %if.then11.i.epil, label %while.cond.loopexit.i if.then11.i.epil: ; preds = %for.body.i.epil store i32 %4, ptr %arrayidx.i.epil, align 4, !tbaa !5 store i32 %3, ptr %arrayidx8.i.epil, align 4, !tbaa !5 br label %while.cond.loopexit.i while.cond.loopexit.i: ; preds = %while.cond.loopexit.i.loopexit.unr-lcssa, %if.then11.i.epil, %for.body.i.epil, %while.body.i %flag.1.lcssa.i = phi i32 [ 0, %while.body.i ], [ %flag.2.i.lcssa.ph, %while.cond.loopexit.i.loopexit.unr-lcssa ], [ 1, %if.then11.i.epil ], [ %flag.147.i.unr, %for.body.i.epil ] %cmp.i = icmp ne i32 %g.1.i, 1 %tobool.i = icmp ne i32 %flag.1.lcssa.i, 0 %or.cond.i = select i1 %cmp.i, i1 true, i1 %tobool.i br i1 %or.cond.i, label %while.body.i, label %fft.exit, !llvm.loop !9 while.body.i: ; preds = %for.end, %while.cond.loopexit.i %cmp51.i = phi i1 [ %cmp.i, %while.cond.loopexit.i ], [ true, %for.end ] %g.050.i = phi i32 [ %g.1.i, %while.cond.loopexit.i ], [ %1, %for.end ] %conv.i = sitofp i32 %g.050.i to double %mul.i = fmul double %conv.i, 7.742500e-01 %conv3.i = fptosi double %mul.i to i32 %g.1.i = select i1 %cmp51.i, i32 %conv3.i, i32 1 %cmp445.i = icmp slt i32 %g.1.i, %1 br i1 %cmp445.i, label %for.body.preheader.i, label %while.cond.loopexit.i for.body.preheader.i: ; preds = %while.body.i %5 = sext i32 %g.1.i to i64 %6 = sub i32 %1, %g.1.i %wide.trip.count.i = zext i32 %6 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %7 = icmp eq i32 %6, 1 br i1 %7, label %while.cond.loopexit.i.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new %indvars.iv52.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next53.i.1, %for.inc.i.1 ] %indvars.iv.i = phi i64 [ %5, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %flag.147.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %flag.2.i.1, %for.inc.i.1 ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ] %arrayidx.i = getelementptr inbounds i32, ptr @ar, i64 %indvars.iv52.i %8 = load i32, ptr %arrayidx.i, align 8, !tbaa !5 %arrayidx8.i = getelementptr inbounds i32, ptr @ar, i64 %indvars.iv.i %9 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5 %cmp9.i = icmp sgt i32 %8, %9 br i1 %cmp9.i, label %if.then11.i, label %for.inc.i if.then11.i: ; preds = %for.body.i store i32 %9, ptr %arrayidx.i, align 8, !tbaa !5 store i32 %8, ptr %arrayidx8.i, align 4, !tbaa !5 br label %for.inc.i for.inc.i: ; preds = %if.then11.i, %for.body.i %flag.2.i = phi i32 [ 1, %if.then11.i ], [ %flag.147.i, %for.body.i ] %indvars.iv.next53.i = or i64 %indvars.iv52.i, 1 %arrayidx.i.1 = getelementptr inbounds i32, ptr @ar, i64 %indvars.iv.next53.i %10 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5 %gep = getelementptr i32, ptr getelementptr (i32, ptr @ar, i64 1), i64 %indvars.iv.i %11 = load i32, ptr %gep, align 4, !tbaa !5 %cmp9.i.1 = icmp sgt i32 %10, %11 br i1 %cmp9.i.1, label %if.then11.i.1, label %for.inc.i.1 if.then11.i.1: ; preds = %for.inc.i store i32 %11, ptr %arrayidx.i.1, align 4, !tbaa !5 store i32 %10, ptr %gep, align 4, !tbaa !5 br label %for.inc.i.1 for.inc.i.1: ; preds = %if.then11.i.1, %for.inc.i %flag.2.i.1 = phi i32 [ 1, %if.then11.i.1 ], [ %flag.2.i, %for.inc.i ] %indvars.iv.next53.i.1 = add nuw nsw i64 %indvars.iv52.i, 2 %indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %while.cond.loopexit.i.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !11 fft.exit: ; preds = %while.cond.loopexit.i, %entry, %for.end %12 = load i32, ptr @k, align 4, !tbaa !5 %cmp319 = icmp sgt i32 %12, 0 br i1 %cmp319, label %for.body4.preheader, label %for.end9 for.body4.preheader: ; preds = %fft.exit %wide.trip.count = zext i32 %12 to i64 %min.iters.check = icmp ult i32 %12, 8 br i1 %min.iters.check, label %for.body4.preheader32, label %vector.ph vector.ph: ; preds = %for.body4.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ] %vec.phi30 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ] %13 = getelementptr inbounds [1000010 x i32], ptr @ar, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds i32, ptr %13, i64 4 %wide.load31 = load <4 x i32>, ptr %14, align 16, !tbaa !5 %15 = add <4 x i32> %wide.load, %vec.phi %16 = add <4 x i32> %wide.load31, %vec.phi30 %index.next = add nuw i64 %index, 8 %17 = icmp eq i64 %index.next, %n.vec br i1 %17, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %16, %15 %18 = tail 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.end9, label %for.body4.preheader32 for.body4.preheader32: ; preds = %for.body4.preheader, %middle.block %indvars.iv25.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ] %res.021.ph = phi i32 [ 0, %for.body4.preheader ], [ %18, %middle.block ] br label %for.body4 for.body4: ; preds = %for.body4.preheader32, %for.body4 %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.body4 ], [ %indvars.iv25.ph, %for.body4.preheader32 ] %res.021 = phi i32 [ %add, %for.body4 ], [ %res.021.ph, %for.body4.preheader32 ] %arrayidx6 = getelementptr inbounds [1000010 x i32], ptr @ar, i64 0, i64 %indvars.iv25 %19 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %add = add nsw i32 %19, %res.021 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %exitcond.not = icmp eq i64 %indvars.iv.next26, %wide.trip.count br i1 %exitcond.not, label %for.end9, label %for.body4, !llvm.loop !16 for.end9: ; preds = %for.body4, %middle.block, %fft.exit %res.0.lcssa = phi i32 [ 0, %fft.exit ], [ %18, %middle.block ], [ %add, %for.body4 ] %call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14}
#include <stdio.h> int main(void){ int sum , i; char k[1000]; while(1){ scanf("%s",k); if (k[0]=='0')break; for (sum=0,i=0; k[i]!='\0'; i++) { sum+=(k[i]-'0'); } printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127580/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127580/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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: %k = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %k) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i8, ptr %k, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp4.not13 = icmp eq i8 %1, 0 br i1 %cmp4.not13, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ] %sum.014 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv3 = sext i8 %2 to i32 %sub = add i32 %sum.014, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [1000 x i8], ptr %k, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %3, 0 br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %4 = load i8, ptr %k, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1000, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ char x[1000]; int sum; int i; int b; b=10; scanf("%s",&x); while(x[0]!='0'){ sum=0; for(i=0;x[i]!='\0';i++){ sum += x[i]-'0'; } printf("%d\n",sum); scanf("%s",&x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127645/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127645/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %x) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 16, !tbaa !5 %cmp.not17 = icmp eq i8 %0, 48 br i1 %cmp.not17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp4.not14 = icmp eq i8 %1, 0 br i1 %cmp4.not14, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ] %sum.016 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv3 = sext i8 %2 to i32 %sub = add i32 %sum.016, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [1000 x i8], ptr %x, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %3, 0 br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %4 = load i8, ptr %x, align 16, !tbaa !5 %cmp.not = icmp eq i8 %4, 48 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !10 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include <stdio.h> int main(){ char number[1001]; int i, sum; while(1){ scanf("%s", number); if(number[0]=='0')break; sum=0; for(i=0;number[i]!='\0';i++){ sum+=number[i]-'0'; } printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127702/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127702/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %number = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %number) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %0 = load i8, ptr %number, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp4.not13 = icmp eq i8 %1, 0 br i1 %cmp4.not13, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ] %sum.015 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv3 = sext i8 %2 to i32 %sub = add i32 %sum.015, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [1001 x i8], ptr %number, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %3, 0 br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number) %4 = load i8, ptr %number, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %number) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { char ch; while(1){ int sum=0; while(1){ scanf("%c",&ch); if(ch=='\n') break; else sum +=(int)ch-'0'; } if(sum==0) break; else printf("%d\n",sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127746/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127746/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #3 %call1722 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %0 = load i8, ptr %ch, align 1, !tbaa !5 %cmp1823 = icmp eq i8 %0, 10 br i1 %cmp1823, label %while.end11, label %if.else if.else: ; preds = %entry, %if.else.backedge %1 = phi i8 [ %.be, %if.else.backedge ], [ %0, %entry ] %sum.019 = phi i32 [ %sum.019.be, %if.else.backedge ], [ 0, %entry ] %conv = sext i8 %1 to i32 %sub = add i32 %sum.019, -48 %add = add i32 %sub, %conv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %2 = load i8, ptr %ch, align 1, !tbaa !5 %cmp = icmp eq i8 %2, 10 br i1 %cmp, label %while.end, label %if.else.backedge if.else.backedge: ; preds = %if.else, %cleanup %.be = phi i8 [ %2, %if.else ], [ %3, %cleanup ] %sum.019.be = phi i32 [ %add, %if.else ], [ 0, %cleanup ] br label %if.else while.end: ; preds = %if.else %cmp5 = icmp eq i32 %add, 0 br i1 %cmp5, label %while.end11, label %cleanup cleanup: ; preds = %while.end %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %3 = load i8, ptr %ch, align 1, !tbaa !5 %cmp18 = icmp eq i8 %3, 10 br i1 %cmp18, label %while.end11, label %if.else.backedge while.end11: ; preds = %while.end, %cleanup, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #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 () { int i,j; char n[100000] = {0}; int x[1001] = {0}; i = 0; j = 0; while(1) { scanf("%c",&n[i]); if(n[i] == '0' && n[i-1] == '\n'|| n[0] == '0') {break;} if(n[i] >= '1' && '9' >= n[i] && n[i] != '\n') { x[j] += n[i]-48; } if(n[i] == '\n') { j = j + 1; } i= i+1; } for(i=0; i < j;i++) { printf("%d",x[i]); printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127797/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127797/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca [100000 x i8], align 16 %x = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %n) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100000) %n, i8 0, i64 100000, i1 false) call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %x) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %x, i8 0, i64 4004, i1 false) br label %while.cond while.cond: ; preds = %if.end37, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %if.end37 ], [ 0, %entry ] %j.0 = phi i32 [ %spec.select, %if.end37 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %n, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 48 br i1 %cmp, label %land.lhs.true, label %lor.lhs.false land.lhs.true: ; preds = %while.cond %1 = add nsw i64 %indvars.iv, -1 %arrayidx5 = getelementptr inbounds [100000 x i8], ptr %n, i64 0, i64 %1 %2 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7 = icmp eq i8 %2, 10 %3 = load i8, ptr %n, align 16 %cmp11 = icmp eq i8 %3, 48 %or.cond = select i1 %cmp7, i1 true, i1 %cmp11 br i1 %or.cond, label %while.end, label %if.end37 lor.lhs.false: ; preds = %while.cond %.old = load i8, ptr %n, align 16, !tbaa !5 %cmp11.old = icmp eq i8 %.old, 48 br i1 %cmp11.old, label %while.end, label %if.end if.end: ; preds = %lor.lhs.false %4 = add i8 %0, -49 %or.cond66 = icmp ult i8 %4, 9 br i1 %or.cond66, label %if.then30, label %if.end37 if.then30: ; preds = %if.end %conv15 = zext i8 %0 to i32 %sub34 = add nsw i32 %conv15, -48 %idxprom35 = zext i32 %j.0 to i64 %arrayidx36 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %idxprom35 %5 = load i32, ptr %arrayidx36, align 4, !tbaa !8 %add = add nsw i32 %sub34, %5 store i32 %add, ptr %arrayidx36, align 4, !tbaa !8 br label %if.end37 if.end37: ; preds = %land.lhs.true, %if.then30, %if.end %cmp41 = icmp eq i8 %0, 10 %add44 = zext i1 %cmp41 to i32 %spec.select = add nuw nsw i32 %j.0, %add44 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %while.cond while.end: ; preds = %land.lhs.true, %lor.lhs.false %cmp4771.not = icmp eq i32 %j.0, 0 br i1 %cmp4771.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %while.end %wide.trip.count = zext i32 %j.0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv75 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next76, %for.body ] %arrayidx50 = getelementptr inbounds [1001 x i32], ptr %x, i64 0, i64 %indvars.iv75 %6 = load i32, ptr %arrayidx50, align 4, !tbaa !8 %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %putchar = call i32 @putchar(i32 10) %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1 %exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body, %while.end call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i,sum; char num[1001]; for(;;){ scanf("%s", &num); if(num[0] == '0') break; sum = 0; for(i=0;num[i]!='\0';i++) sum += num[i] - '0'; printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127847/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127847/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %num) #3 %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i8, ptr %num, align 16, !tbaa !5 %cmp19 = icmp eq i8 %0, 48 br i1 %cmp19, label %for.end11, label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp5.not15 = icmp eq i8 %1, 0 br i1 %cmp5.not15, label %for.end, label %for.body for.body: ; preds = %for.cond2.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond2.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond2.preheader ] %sum.017 = phi i32 [ %add, %for.body ], [ 0, %for.cond2.preheader ] %conv4 = sext i8 %2 to i32 %sub = add i32 %sum.017, -48 %add = add i32 %sub, %conv4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx3 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %cmp5.not = icmp eq i8 %3, 0 br i1 %cmp5.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %add, %for.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %4 = load i8, ptr %num, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %for.end11, label %for.cond2.preheader for.end11: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %num) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ char A; int B; while(!feof(stdin)){ A=fgetc(stdin); if(A=='0') break; B=0; B+=A-'0'; while((A=fgetc(stdin))!='\n'){ B+=A-'0'; } printf("%d\n",B); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127898/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127898/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call27 = tail call i32 @feof(ptr noundef %0) #2 %tobool.not28 = icmp eq i32 %call27, 0 br i1 %tobool.not28, label %while.body, label %while.end16 while.body: ; preds = %entry, %while.end %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call1 = tail call i32 @fgetc(ptr noundef %1) %sext = shl i32 %call1, 24 %cmp = icmp eq i32 %sext, 805306368 br i1 %cmp, label %while.end16, label %if.end if.end: ; preds = %while.body %conv2 = ashr exact i32 %sext, 24 %sub = add nsw i32 %conv2, -48 %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call622 = tail call i32 @fgetc(ptr noundef %2) %sext2123 = shl i32 %call622, 24 %cmp9.not24 = icmp eq i32 %sext2123, 167772160 br i1 %cmp9.not24, label %while.end, label %while.body11 while.body11: ; preds = %if.end, %while.body11 %sext2126 = phi i32 [ %sext21, %while.body11 ], [ %sext2123, %if.end ] %B.025 = phi i32 [ %add14, %while.body11 ], [ %sub, %if.end ] %conv8 = ashr exact i32 %sext2126, 24 %sub13 = add i32 %B.025, -48 %add14 = add i32 %sub13, %conv8 %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call6 = tail call i32 @fgetc(ptr noundef %3) %sext21 = shl i32 %call6, 24 %cmp9.not = icmp eq i32 %sext21, 167772160 br i1 %cmp9.not, label %while.end, label %while.body11, !llvm.loop !9 while.end: ; preds = %while.body11, %if.end %B.0.lcssa = phi i32 [ %sub, %if.end ], [ %add14, %while.body11 ] %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %B.0.lcssa) %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call i32 @feof(ptr noundef %4) #2 %tobool.not = icmp eq i32 %call, 0 br i1 %tobool.not, label %while.body, label %while.end16, !llvm.loop !11 while.end16: ; preds = %while.end, %while.body, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @fgetc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { char x[1001]; int sum, i; while (1) { sum = 0; scanf("%s", x); if (x[0] == '0') break; for (i = 0; x[i] != '\0'; i++) { sum += x[i] - '0'; } printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127940/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127940/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %x) #3 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 16, !tbaa !5 %cmp17 = icmp eq i8 %0, 48 br i1 %cmp17, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i8 [ %4, %for.end ], [ %0, %entry ] %cmp4.not13 = icmp eq i8 %1, 0 br i1 %cmp4.not13, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %2 = phi i8 [ %3, %for.body ], [ %1, %for.cond.preheader ] %sum.014 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ] %conv3 = sext i8 %2 to i32 %sub = add i32 %sum.014, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx2 = getelementptr inbounds [1001 x i8], ptr %x, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %3, 0 br i1 %cmp4.not, label %for.end, label %for.body, !llvm.loop !8 for.end: ; preds = %for.body, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %4 = load i8, ptr %x, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void) { char str_num[1001]; int res; while ( 1 ) { memset(str_num, '\0', sizeof(str_num)); res = 0; scanf("%s", &str_num[0]); if ( str_num[0] == '0' ) { break; } for ( int i = 0; i < strlen(str_num); i++ ) { res += str_num[i] - '0'; } printf("%d\n", res); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_127984/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_127984/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str_num = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str_num) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %str_num, i8 0, i64 1001, i1 false) %call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str_num) %0 = load i8, ptr %str_num, align 16, !tbaa !5 %cmp19 = icmp eq i8 %0, 48 br i1 %cmp19, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.cleanup %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str_num) #7 %cmp614.not = icmp eq i64 %call5, 0 br i1 %cmp614.not, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %min.iters.check = icmp ult i64 %call5, 8 br i1 %min.iters.check, label %for.body.preheader23, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %call5, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ] %vec.phi21 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ] %1 = getelementptr inbounds [1001 x i8], ptr %str_num, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load22 = load <4 x i8>, ptr %2, align 4, !tbaa !5 %3 = sext <4 x i8> %wide.load to <4 x i32> %4 = sext <4 x i8> %wide.load22 to <4 x i32> %5 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48> %6 = add <4 x i32> %vec.phi21, <i32 -48, i32 -48, i32 -48, i32 -48> %7 = add <4 x i32> %5, %3 %8 = add <4 x i32> %6, %4 %index.next = add nuw i64 %index, 8 %9 = icmp eq i64 %index.next, %n.vec br i1 %9, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %8, %7 %10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %call5, %n.vec br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader23 for.body.preheader23: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %res.015.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %for.cond.preheader %res.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %10, %middle.block ], [ %add, %for.body ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0.lcssa) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %str_num, i8 0, i64 1001, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str_num) %11 = load i8, ptr %str_num, align 16, !tbaa !5 %cmp = icmp eq i8 %11, 48 br i1 %cmp, label %while.end, label %for.cond.preheader for.body: ; preds = %for.body.preheader23, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader23 ] %res.015 = phi i32 [ %add, %for.body ], [ %res.015.ph, %for.body.preheader23 ] %arrayidx8 = getelementptr inbounds [1001 x i8], ptr %str_num, i64 0, i64 %indvars.iv %12 = load i8, ptr %arrayidx8, align 1, !tbaa !5 %conv9 = sext i8 %12 to i32 %sub = add i32 %res.015, -48 %add = add i32 %sub, %conv9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call5 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 while.end: ; preds = %for.cond.cleanup, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str_num) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !11, !10}
#include<stdio.h> int main(void){ int i,c; int ans=0; for(int i=0;;i++){ while((c=getchar())!=EOF){ if(c=='\n')break; ans+=c-'0'; } if(ans==0)break; printf("%d\n",ans); ans=0; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128026/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128026/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond.backedge, %entry %ans.1 = phi i32 [ 0, %entry ], [ %ans.1.be, %while.cond.backedge ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) switch i32 %call.i, label %if.end [ i32 -1, label %while.end i32 10, label %while.end ] if.end: ; preds = %while.cond %sub = add i32 %ans.1, -48 %add = add i32 %sub, %call.i br label %while.cond.backedge while.cond.backedge: ; preds = %if.end, %if.end5 %ans.1.be = phi i32 [ %add, %if.end ], [ 0, %if.end5 ] br label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond, %while.cond %cmp3 = icmp eq i32 %ans.1, 0 br i1 %cmp3, label %if.then4, label %if.end5 if.then4: ; preds = %while.end ret i32 0 if.end5: ; preds = %while.end %call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.1) br label %while.cond.backedge } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> const int d[6]={1,10000,1000,100,10,1}; int a[6][6],p[6]; int ans; int Js(int sta) { int cnt=0,i,j,p1,p2; i=0; do { if (i>=5) break; j=i+1; do { if (j<=4) { p1=sta/d[j]%10;p2=sta/d[j+1]%10; cnt=cnt+a[p1][p2]+a[p2][p1]; } j=j+2; if (j>=5) break; }while(1); i++; }while(1); return cnt; } int Dfs(int tot,int sta) { int j,num; //printf("%d %d\n",tot,sta); if (tot==6) { num=Js(sta); if (num>ans) ans=num; //printf("%d\n",sta); return 0; } for (j=1;j<=5;j++) if (p[j]==0) { p[j]=1; //printf("%d %d\n",j,tot); Dfs(tot+1,sta*10+j); p[j]=0; } return 0; } int main() { int i,j; for (i=1;i<=5;i++) for (j=1;j<=5;j++) scanf("%d",&a[i][j]); //printf("%d\n",a[1][1]); memset(p,0,sizeof(p)); ans=0; Dfs(1,0); printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12807/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12807/source.c" target datalayout = "e-m:e-p270: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 local_unnamed_addr constant [6 x i32] [i32 1, i32 10000, i32 1000, i32 100, i32 10, i32 1], align 16 @a = dso_local global [6 x [6 x i32]] zeroinitializer, align 16 @ans = dso_local local_unnamed_addr global i32 0, align 4 @p = dso_local local_unnamed_addr global [6 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Js(i32 noundef %sta) local_unnamed_addr #0 { if.end19.4: %div = sdiv i32 %sta, 10000 %rem = srem i32 %div, 10 %div7 = sdiv i32 %sta, 1000 %rem8 = srem i32 %div7, 10 %idxprom9 = sext i32 %rem to i64 %idxprom11 = sext i32 %rem8 to i64 %arrayidx12 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9, i64 %idxprom11 %0 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %arrayidx17 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11, i64 %idxprom9 %1 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %div.143 = sdiv i32 %sta, 100 %rem.144 = srem i32 %div.143, 10 %div7.145 = sdiv i32 %sta, 10 %rem8.146 = srem i32 %div7.145, 10 %idxprom9.147 = sext i32 %rem.144 to i64 %idxprom11.148 = sext i32 %rem8.146 to i64 %arrayidx12.149 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.147, i64 %idxprom11.148 %2 = load i32, ptr %arrayidx12.149, align 4, !tbaa !5 %arrayidx17.151 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.148, i64 %idxprom9.147 %3 = load i32, ptr %arrayidx17.151, align 4, !tbaa !5 %div.1 = sdiv i32 %sta, 1000 %rem.1 = srem i32 %div.1, 10 %div7.1 = sdiv i32 %sta, 100 %rem8.1 = srem i32 %div7.1, 10 %idxprom9.1 = sext i32 %rem.1 to i64 %idxprom11.1 = sext i32 %rem8.1 to i64 %arrayidx12.1 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.1, i64 %idxprom11.1 %4 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5 %arrayidx17.1 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.1, i64 %idxprom9.1 %5 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %div.1.1 = sdiv i32 %sta, 10 %rem.1.1 = srem i32 %div.1.1, 10 %rem8.1.1 = srem i32 %sta, 10 %idxprom9.1.1 = sext i32 %rem.1.1 to i64 %idxprom11.1.1 = sext i32 %rem8.1.1 to i64 %arrayidx12.1.1 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.1.1, i64 %idxprom11.1.1 %6 = load i32, ptr %arrayidx12.1.1, align 4, !tbaa !5 %arrayidx17.1.1 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.1.1, i64 %idxprom9.1.1 %7 = load i32, ptr %arrayidx17.1.1, align 4, !tbaa !5 %div.2 = sdiv i32 %sta, 100 %rem.2 = srem i32 %div.2, 10 %div7.2 = sdiv i32 %sta, 10 %rem8.2 = srem i32 %div7.2, 10 %idxprom9.2 = sext i32 %rem.2 to i64 %idxprom11.2 = sext i32 %rem8.2 to i64 %arrayidx12.2 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.2, i64 %idxprom11.2 %8 = load i32, ptr %arrayidx12.2, align 4, !tbaa !5 %arrayidx17.2 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.2, i64 %idxprom9.2 %9 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 %div.3 = sdiv i32 %sta, 10 %rem.3 = srem i32 %div.3, 10 %rem8.3 = srem i32 %sta, 10 %idxprom9.3 = sext i32 %rem.3 to i64 %idxprom11.3 = sext i32 %rem8.3 to i64 %arrayidx12.3 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.3, i64 %idxprom11.3 %10 = load i32, ptr %arrayidx12.3, align 4, !tbaa !5 %arrayidx17.3 = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.3, i64 %idxprom9.3 %11 = load i32, ptr %arrayidx17.3, align 4, !tbaa !5 %add18 = add nsw i32 %0, %1 %add13.150 = add nsw i32 %2, %add18 %add18.152 = add nsw i32 %add13.150, %3 %add13.1 = add nsw i32 %4, %add18.152 %add18.1 = add nsw i32 %add13.1, %5 %add13.1.1 = add nsw i32 %6, %add18.1 %add18.1.1 = add nsw i32 %add13.1.1, %7 %add13.2 = add nsw i32 %8, %add18.1.1 %add18.2 = add nsw i32 %add13.2, %9 %add13.3 = add nsw i32 %10, %add18.2 %add18.3 = add nsw i32 %add13.3, %11 ret i32 %add18.3 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @Dfs(i32 noundef %tot, i32 noundef %sta) local_unnamed_addr #1 { entry: %cmp = icmp eq i32 %tot, 6 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %add = add nsw i32 %tot, 1 %mul = mul nsw i32 %sta, 10 %0 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !5 %cmp5 = icmp eq i32 %0, 0 br i1 %cmp5, label %if.then6, label %for.inc if.then: ; preds = %entry %div.i = sdiv i32 %sta, 10000 %rem.i = srem i32 %div.i, 10 %div7.i = sdiv i32 %sta, 1000 %rem8.i = srem i32 %div7.i, 10 %idxprom9.i = sext i32 %rem.i to i64 %idxprom11.i = sext i32 %rem8.i to i64 %arrayidx12.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.i, i64 %idxprom11.i %1 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5 %arrayidx17.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.i, i64 %idxprom9.i %2 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5 %div.143.i = sdiv i32 %sta, 100 %rem.144.i = srem i32 %div.143.i, 10 %div7.145.i = sdiv i32 %sta, 10 %rem8.146.i = srem i32 %div7.145.i, 10 %idxprom9.147.i = sext i32 %rem.144.i to i64 %idxprom11.148.i = sext i32 %rem8.146.i to i64 %arrayidx12.149.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.147.i, i64 %idxprom11.148.i %3 = load i32, ptr %arrayidx12.149.i, align 4, !tbaa !5 %arrayidx17.151.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.148.i, i64 %idxprom9.147.i %4 = load i32, ptr %arrayidx17.151.i, align 4, !tbaa !5 %arrayidx12.1.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.i, i64 %idxprom9.147.i %5 = load i32, ptr %arrayidx12.1.i, align 4, !tbaa !5 %arrayidx17.1.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom9.147.i, i64 %idxprom11.i %6 = load i32, ptr %arrayidx17.1.i, align 4, !tbaa !5 %rem8.1.1.i = srem i32 %sta, 10 %idxprom11.1.1.i = sext i32 %rem8.1.1.i to i64 %arrayidx12.1.1.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.148.i, i64 %idxprom11.1.1.i %7 = load i32, ptr %arrayidx12.1.1.i, align 4, !tbaa !5 %arrayidx17.1.1.i = getelementptr inbounds [6 x [6 x i32]], ptr @a, i64 0, i64 %idxprom11.1.1.i, i64 %idxprom11.148.i %8 = load i32, ptr %arrayidx17.1.1.i, align 4, !tbaa !5 %reass.add = add i32 %4, %3 %reass.add26 = add i32 %reass.add, %7 %reass.add27 = add i32 %reass.add26, %8 %reass.mul = shl i32 %reass.add27, 1 %add13.2.i = add i32 %2, %1 %add18.2.i = add i32 %add13.2.i, %5 %add13.3.i = add i32 %add18.2.i, %6 %add18.3.i = add i32 %add13.3.i, %reass.mul %9 = load i32, ptr @ans, align 4, !tbaa !5 %cmp1 = icmp sgt i32 %add18.3.i, %9 br i1 %cmp1, label %if.then2, label %common.ret if.then2: ; preds = %if.then store i32 %add18.3.i, ptr @ans, align 4, !tbaa !5 br label %common.ret if.then6: ; preds = %for.cond.preheader store i32 1, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !5 %add9 = or i32 %mul, 1 %call10 = tail call i32 @Dfs(i32 noundef %add, i32 noundef %add9) store i32 0, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.cond.preheader, %if.then6 %10 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 2), align 8, !tbaa !5 %cmp5.1 = icmp eq i32 %10, 0 br i1 %cmp5.1, label %if.then6.1, label %for.inc.1 if.then6.1: ; preds = %for.inc store i32 1, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 2), align 8, !tbaa !5 %add9.1 = add nsw i32 %mul, 2 %call10.1 = tail call i32 @Dfs(i32 noundef %add, i32 noundef %add9.1) store i32 0, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 2), align 8, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then6.1, %for.inc %11 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 3), align 4, !tbaa !5 %cmp5.2 = icmp eq i32 %11, 0 br i1 %cmp5.2, label %if.then6.2, label %for.inc.2 if.then6.2: ; preds = %for.inc.1 store i32 1, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 3), align 4, !tbaa !5 %add9.2 = add nsw i32 %mul, 3 %call10.2 = tail call i32 @Dfs(i32 noundef %add, i32 noundef %add9.2) store i32 0, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 3), align 4, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then6.2, %for.inc.1 %12 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 4), align 16, !tbaa !5 %cmp5.3 = icmp eq i32 %12, 0 br i1 %cmp5.3, label %if.then6.3, label %for.inc.3 if.then6.3: ; preds = %for.inc.2 store i32 1, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 4), align 16, !tbaa !5 %add9.3 = add nsw i32 %mul, 4 %call10.3 = tail call i32 @Dfs(i32 noundef %add, i32 noundef %add9.3) store i32 0, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 4), align 16, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then6.3, %for.inc.2 %13 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 5), align 4, !tbaa !5 %cmp5.4 = icmp eq i32 %13, 0 br i1 %cmp5.4, label %if.then6.4, label %common.ret common.ret: ; preds = %if.then2, %if.then, %for.inc.3, %if.then6.4 %common.ret.op = phi i32 [ 0, %if.then6.4 ], [ 0, %for.inc.3 ], [ 0, %if.then ], [ 0, %if.then2 ] ret i32 %common.ret.op if.then6.4: ; preds = %for.inc.3 store i32 1, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 5), align 4, !tbaa !5 %add9.4 = add nsw i32 %mul, 5 %call10.4 = tail call i32 @Dfs(i32 noundef %add, i32 noundef %add9.4) store i32 0, ptr getelementptr inbounds ([6 x i32], ptr @p, i64 0, i64 5), align 4, !tbaa !5 br label %common.ret } ; 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 getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 1, i64 1)) %call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 1, i64 2)) %call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 1, i64 3)) %call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 1, i64 4)) %call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 1, i64 5)) %call.120 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 2, i64 1)) %call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 2, i64 2)) %call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 2, i64 3)) %call.3.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 2, i64 4)) %call.4.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 2, i64 5)) %call.222 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 3, i64 1)) %call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 3, i64 2)) %call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 3, i64 3)) %call.3.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 3, i64 4)) %call.4.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 3, i64 5)) %call.324 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 4, i64 1)) %call.1.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 4, i64 2)) %call.2.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 4, i64 3)) %call.3.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 4, i64 4)) %call.4.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 4, i64 5)) %call.426 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 5, i64 1)) %call.1.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 5, i64 2)) %call.2.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 5, i64 3)) %call.3.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 5, i64 4)) %call.4.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x [6 x i32]], ptr @a, i64 0, i64 5, i64 5)) tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) @p, i8 0, i64 24, i1 false) store i32 0, ptr @ans, align 4, !tbaa !5 %call9 = tail call i32 @Dfs(i32 noundef 1, i32 noundef 0) %0 = load i32, ptr @ans, align 4, !tbaa !5 %call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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(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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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) { while (1) { char str_num[1001]; scanf("%s", str_num); if (str_num[0] == '0') break; int i = 0; int sum = 0; do { sum += (str_num[i] - '0'); i++; } while (str_num[i] != '\0'); printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128112/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128112/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str_num = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str_num) #3 %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str_num) %0 = load i8, ptr %str_num, align 16, !tbaa !5 %cmp16 = icmp eq i8 %0, 48 br i1 %cmp16, label %while.end, label %do.body do.body: ; preds = %entry, %do.body.backedge %1 = phi i8 [ %.be, %do.body.backedge ], [ %0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.be, %do.body.backedge ], [ 0, %entry ] %sum.0 = phi i32 [ %sum.0.be, %do.body.backedge ], [ 0, %entry ] %conv3 = sext i8 %1 to i32 %sub = add i32 %sum.0, -48 %add = add i32 %sub, %conv3 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx5 = getelementptr inbounds [1001 x i8], ptr %str_num, i64 0, i64 %indvars.iv.next %2 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7.not = icmp eq i8 %2, 0 br i1 %cmp7.not, label %cleanup, label %do.body.backedge do.body.backedge: ; preds = %do.body, %cleanup %.be = phi i8 [ %2, %do.body ], [ %3, %cleanup ] %indvars.iv.be = phi i64 [ %indvars.iv.next, %do.body ], [ 0, %cleanup ] %sum.0.be = phi i32 [ %add, %do.body ], [ 0, %cleanup ] br label %do.body, !llvm.loop !8 cleanup: ; preds = %do.body %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str_num) #3 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %str_num) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str_num) %3 = load i8, ptr %str_num, align 16, !tbaa !5 %cmp = icmp eq i8 %3, 48 br i1 %cmp, label %while.end, label %do.body.backedge while.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %str_num) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ char num[1001]; while(1){ int i=0,sum=0; scanf("%s", num); if(num[0]-'0'==0) break; while(num[i]){ sum+=num[i]-'0'; i++; } printf("%d\n",sum); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128156/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128156/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %num) #3 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i8, ptr %num, align 16, !tbaa !5 %cmp22 = icmp eq i8 %0, 48 br i1 %cmp22, label %while.end11, label %while.cond2.preheader while.cond2.preheader: ; preds = %entry, %cleanup %1 = phi i8 [ %4, %cleanup ], [ %0, %entry ] %tobool.not18 = icmp eq i8 %1, 0 br i1 %tobool.not18, label %cleanup, label %while.body4 while.body4: ; preds = %while.cond2.preheader, %while.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %while.body4 ], [ 0, %while.cond2.preheader ] %2 = phi i8 [ %3, %while.body4 ], [ %1, %while.cond2.preheader ] %sum.020 = phi i32 [ %add, %while.body4 ], [ 0, %while.cond2.preheader ] %conv7 = sext i8 %2 to i32 %sub8 = add i32 %sum.020, -48 %add = add i32 %sub8, %conv7 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx3 = getelementptr inbounds [1001 x i8], ptr %num, i64 0, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %tobool.not = icmp eq i8 %3, 0 br i1 %tobool.not, label %cleanup, label %while.body4, !llvm.loop !8 cleanup: ; preds = %while.body4, %while.cond2.preheader %sum.0.lcssa = phi i32 [ 0, %while.cond2.preheader ], [ %add, %while.body4 ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %4 = load i8, ptr %num, align 16, !tbaa !5 %cmp = icmp eq i8 %4, 48 br i1 %cmp, label %while.end11, label %while.cond2.preheader while.end11: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %num) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int n; scanf("%d",&n); int a[n-1]; for(int i=1;i<n;i++){ scanf("%d",&a[i]); } int b[n]; for(int i=0;i<n;i++){ b[i]=0; } for(int i=1;i<n;i++){ b[a[i]-1]++; } for(int i=0;i<n;i++){ printf("%d\n",b[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128242/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128242/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = zext i32 %sub to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp46 = icmp sgt i32 %3, 1 br i1 %cmp46, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %4 = phi i32 [ %3, %entry ], [ %6, %for.body ] %5 = zext i32 %4 to i64 %vla2 = alloca i32, i64 %5, align 16 %cmp548 = icmp sgt i32 %4, 0 br i1 %cmp548, label %for.cond14.preheader, label %for.cond.cleanup30 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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.cond14.preheader: ; preds = %for.cond.cleanup %8 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla2, i8 0, i64 %8, i1 false), !tbaa !5 %cmp1550.not = icmp eq i32 %4, 1 br i1 %cmp1550.not, label %for.body31.preheader, label %for.body17.preheader for.body17.preheader: ; preds = %for.cond14.preheader %9 = add nsw i64 %5, -1 %xtraiter = and i64 %9, 1 %10 = icmp eq i32 %4, 2 br i1 %10, label %for.cond28.preheader.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %9, -2 %invariant.gep = getelementptr i32, ptr %vla, i64 1 br label %for.body17 for.cond28.preheader.unr-lcssa: ; preds = %for.body17, %for.body17.preheader %indvars.iv59.unr = phi i64 [ 1, %for.body17.preheader ], [ %indvars.iv.next60.1, %for.body17 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond28.preheader, label %for.body17.epil for.body17.epil: ; preds = %for.cond28.preheader.unr-lcssa %arrayidx19.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59.unr %11 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5 %sub20.epil = add nsw i32 %11, -1 %idxprom21.epil = sext i32 %sub20.epil to i64 %arrayidx22.epil = getelementptr inbounds i32, ptr %vla2, i64 %idxprom21.epil %12 = load i32, ptr %arrayidx22.epil, align 4, !tbaa !5 %inc23.epil = add nsw i32 %12, 1 store i32 %inc23.epil, ptr %arrayidx22.epil, align 4, !tbaa !5 br label %for.cond28.preheader for.cond28.preheader: ; preds = %for.cond28.preheader.unr-lcssa, %for.body17.epil br i1 %cmp548, label %for.body31.preheader, label %for.cond.cleanup30 for.body31.preheader: ; preds = %for.cond14.preheader, %for.cond28.preheader br label %for.body31 for.body17: ; preds = %for.body17, %for.body17.preheader.new %indvars.iv59 = phi i64 [ 1, %for.body17.preheader.new ], [ %indvars.iv.next60.1, %for.body17 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.body17 ] %arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59 %13 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %sub20 = add nsw i32 %13, -1 %idxprom21 = sext i32 %sub20 to i64 %arrayidx22 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom21 %14 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %inc23 = add nsw i32 %14, 1 store i32 %inc23, ptr %arrayidx22, align 4, !tbaa !5 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv59 %15 = load i32, ptr %gep, align 4, !tbaa !5 %sub20.1 = add nsw i32 %15, -1 %idxprom21.1 = sext i32 %sub20.1 to i64 %arrayidx22.1 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom21.1 %16 = load i32, ptr %arrayidx22.1, align 4, !tbaa !5 %inc23.1 = add nsw i32 %16, 1 store i32 %inc23.1, ptr %arrayidx22.1, align 4, !tbaa !5 %indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59, 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.cond28.preheader.unr-lcssa, label %for.body17, !llvm.loop !11 for.cond.cleanup30: ; preds = %for.body31, %for.cond.cleanup, %for.cond28.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body31: ; preds = %for.body31.preheader, %for.body31 %indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body31 ], [ 0, %for.body31.preheader ] %arrayidx33 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv62 %17 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17) %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %18 = load i32, ptr %n, align 4, !tbaa !5 %19 = sext i32 %18 to i64 %cmp29 = icmp slt i64 %indvars.iv.next63, %19 br i1 %cmp29, label %for.body31, label %for.cond.cleanup30, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include "stdio.h" #include "string.h" char a[100010]; int main() { int a0,b,c,d; int len,i; long long ans; while(scanf("%d%d%d%d",&a0,&b,&c,&d)==4) { ans=0; memset(a,0,sizeof(a)); scanf("%s",a); len=strlen(a); for(i=0;i<len;i++) { if(a[i]=='1') ans+=a0; else if(a[i]=='2') ans+=b; else if(a[i]=='3') ans+=c; else if(a[i]=='4') ans+=d; } printf("%I64d\n",ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12830/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12830/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @a = dso_local global [100010 x i8] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a0 = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a0) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 %call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a0, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %cmp52 = icmp eq i32 %call51, 4 br i1 %cmp52, label %while.body, label %while.end while.body: ; preds = %entry, %for.end call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100010) @a, i8 0, i64 100010, i1 false) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @a) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @a) #6 %conv = trunc i64 %call2 to i32 %cmp348 = icmp sgt i32 %conv, 0 br i1 %cmp348, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %while.body %0 = load i32, ptr %d, align 4 %conv33 = sext i32 %0 to i64 %1 = load i32, ptr %c, align 4 %conv24 = sext i32 %1 to i64 %2 = load i32, ptr %b, align 4 %conv15 = sext i32 %2 to i64 %3 = load i32, ptr %a0, align 4 %conv8 = sext i32 %3 to i64 %wide.trip.count = and i64 %call2, 4294967295 %xtraiter = and i64 %call2, 1 %4 = icmp eq i64 %wide.trip.count, 1 br i1 %4, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter br label %for.body for.body: ; preds = %for.inc.1, %for.body.lr.ph.new %indvars.iv = phi i64 [ 0, %for.body.lr.ph.new ], [ %indvars.iv.next.1, %for.inc.1 ] %ans.050 = phi i64 [ 0, %for.body.lr.ph.new ], [ %ans.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds [100010 x i8], ptr @a, i64 0, i64 %indvars.iv %5 = load i8, ptr %arrayidx, align 2, !tbaa !5 switch i8 %5, label %for.inc [ i8 49, label %if.then i8 50, label %if.then14 i8 51, label %if.then23 i8 52, label %if.then32 ] if.then: ; preds = %for.body %add = add nsw i64 %ans.050, %conv8 br label %for.inc if.then14: ; preds = %for.body %add16 = add nsw i64 %ans.050, %conv15 br label %for.inc if.then23: ; preds = %for.body %add25 = add nsw i64 %ans.050, %conv24 br label %for.inc if.then32: ; preds = %for.body %add34 = add nsw i64 %ans.050, %conv33 br label %for.inc for.inc: ; preds = %for.body, %if.then, %if.then23, %if.then32, %if.then14 %ans.1 = phi i64 [ %add, %if.then ], [ %add16, %if.then14 ], [ %add25, %if.then23 ], [ %add34, %if.then32 ], [ %ans.050, %for.body ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [100010 x i8], ptr @a, i64 0, i64 %indvars.iv.next %6 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %6, label %for.inc.1 [ i8 49, label %if.then.1 i8 50, label %if.then14.1 i8 51, label %if.then23.1 i8 52, label %if.then32.1 ] if.then32.1: ; preds = %for.inc %add34.1 = add nsw i64 %ans.1, %conv33 br label %for.inc.1 if.then23.1: ; preds = %for.inc %add25.1 = add nsw i64 %ans.1, %conv24 br label %for.inc.1 if.then14.1: ; preds = %for.inc %add16.1 = add nsw i64 %ans.1, %conv15 br label %for.inc.1 if.then.1: ; preds = %for.inc %add.1 = add nsw i64 %ans.1, %conv8 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %if.then14.1, %if.then23.1, %if.then32.1, %for.inc %ans.1.1 = phi i64 [ %add.1, %if.then.1 ], [ %add16.1, %if.then14.1 ], [ %add25.1, %if.then23.1 ], [ %add34.1, %if.then32.1 ], [ %ans.1, %for.inc ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.lr.ph %ans.1.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %ans.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next.1, %for.inc.1 ] %ans.050.unr = phi i64 [ 0, %for.body.lr.ph ], [ %ans.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [100010 x i8], ptr @a, i64 0, i64 %indvars.iv.unr %7 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 switch i8 %7, label %for.end [ i8 49, label %if.then.epil i8 50, label %if.then14.epil i8 51, label %if.then23.epil i8 52, label %if.then32.epil ] if.then32.epil: ; preds = %for.body.epil %add34.epil = add nsw i64 %ans.050.unr, %conv33 br label %for.end if.then23.epil: ; preds = %for.body.epil %add25.epil = add nsw i64 %ans.050.unr, %conv24 br label %for.end if.then14.epil: ; preds = %for.body.epil %add16.epil = add nsw i64 %ans.050.unr, %conv15 br label %for.end if.then.epil: ; preds = %for.body.epil %add.epil = add nsw i64 %ans.050.unr, %conv8 br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %if.then14.epil, %if.then23.epil, %if.then32.epil, %for.body.epil, %while.body %ans.0.lcssa = phi i64 [ 0, %while.body ], [ %ans.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %if.then.epil ], [ %add16.epil, %if.then14.epil ], [ %add25.epil, %if.then23.epil ], [ %add34.epil, %if.then32.epil ], [ %ans.050.unr, %for.body.epil ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a0, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %cmp = icmp eq i32 %call, 4 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a0) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9}
#include<stdio.h> int main(){ int N,i,j,A[300000]={},count[300000]={}; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } for(j=0;j<N;j++) count[A[j]]++; for(j=1;j<N+1;j++) printf("%d\n",count[j]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128350/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128350/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %A = alloca [300000 x i32], align 16 %count = alloca [300000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %A) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1200000) %A, i8 0, i64 1200000, i1 false) call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %count) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1200000) %count, i8 0, i64 1200000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.body, label %for.end21 for.cond2.preheader: ; preds = %for.body %cmp331 = icmp sgt i32 %2, 0 br i1 %cmp331, label %for.body4.preheader, label %for.end21 for.body4.preheader: ; preds = %for.cond2.preheader %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %2, 4 br i1 %1, label %for.cond13.preheader.unr-lcssa, label %for.body4.preheader.new for.body4.preheader.new: ; preds = %for.body4.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [300000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %N, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond13.preheader.unr-lcssa: ; preds = %for.body4, %for.body4.preheader %indvars.iv37.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next38.3, %for.body4 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond13.preheader, label %for.body4.epil for.body4.epil: ; preds = %for.cond13.preheader.unr-lcssa, %for.body4.epil %indvars.iv37.epil = phi i64 [ %indvars.iv.next38.epil, %for.body4.epil ], [ %indvars.iv37.unr, %for.cond13.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body4.epil ], [ 0, %for.cond13.preheader.unr-lcssa ] %arrayidx6.epil = getelementptr inbounds [300000 x i32], ptr %A, i64 0, i64 %indvars.iv37.epil %4 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %idxprom7.epil = sext i32 %4 to i64 %arrayidx8.epil = getelementptr inbounds [300000 x i32], ptr %count, i64 0, i64 %idxprom7.epil %5 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5 %inc9.epil = add nsw i32 %5, 1 store i32 %inc9.epil, ptr %arrayidx8.epil, align 4, !tbaa !5 %indvars.iv.next38.epil = add nuw nsw i64 %indvars.iv37.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.cond13.preheader, label %for.body4.epil, !llvm.loop !11 for.cond13.preheader: ; preds = %for.body4.epil, %for.cond13.preheader.unr-lcssa %cmp14.not33 = icmp slt i32 %2, 1 br i1 %cmp14.not33, label %for.end21, label %for.body15 for.body4: ; preds = %for.body4, %for.body4.preheader.new %indvars.iv37 = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next38.3, %for.body4 ] %niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.3, %for.body4 ] %arrayidx6 = getelementptr inbounds [300000 x i32], ptr %A, i64 0, i64 %indvars.iv37 %6 = load i32, ptr %arrayidx6, align 16, !tbaa !5 %idxprom7 = sext i32 %6 to i64 %arrayidx8 = getelementptr inbounds [300000 x i32], ptr %count, i64 0, i64 %idxprom7 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %inc9 = add nsw i32 %7, 1 store i32 %inc9, ptr %arrayidx8, align 4, !tbaa !5 %indvars.iv.next38 = or i64 %indvars.iv37, 1 %arrayidx6.1 = getelementptr inbounds [300000 x i32], ptr %A, i64 0, i64 %indvars.iv.next38 %8 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %idxprom7.1 = sext i32 %8 to i64 %arrayidx8.1 = getelementptr inbounds [300000 x i32], ptr %count, i64 0, i64 %idxprom7.1 %9 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5 %inc9.1 = add nsw i32 %9, 1 store i32 %inc9.1, ptr %arrayidx8.1, align 4, !tbaa !5 %indvars.iv.next38.1 = or i64 %indvars.iv37, 2 %arrayidx6.2 = getelementptr inbounds [300000 x i32], ptr %A, i64 0, i64 %indvars.iv.next38.1 %10 = load i32, ptr %arrayidx6.2, align 8, !tbaa !5 %idxprom7.2 = sext i32 %10 to i64 %arrayidx8.2 = getelementptr inbounds [300000 x i32], ptr %count, i64 0, i64 %idxprom7.2 %11 = load i32, ptr %arrayidx8.2, align 4, !tbaa !5 %inc9.2 = add nsw i32 %11, 1 store i32 %inc9.2, ptr %arrayidx8.2, align 4, !tbaa !5 %indvars.iv.next38.2 = or i64 %indvars.iv37, 3 %arrayidx6.3 = getelementptr inbounds [300000 x i32], ptr %A, i64 0, i64 %indvars.iv.next38.2 %12 = load i32, ptr %arrayidx6.3, align 4, !tbaa !5 %idxprom7.3 = sext i32 %12 to i64 %arrayidx8.3 = getelementptr inbounds [300000 x i32], ptr %count, i64 0, i64 %idxprom7.3 %13 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5 %inc9.3 = add nsw i32 %13, 1 store i32 %inc9.3, ptr %arrayidx8.3, align 4, !tbaa !5 %indvars.iv.next38.3 = add nuw nsw i64 %indvars.iv37, 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.cond13.preheader.unr-lcssa, label %for.body4, !llvm.loop !13 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body15 ], [ 1, %for.cond13.preheader ] %arrayidx17 = getelementptr inbounds [300000 x i32], ptr %count, i64 0, i64 %indvars.iv40 %14 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %15 = load i32, ptr %N, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp14.not.not = icmp slt i64 %indvars.iv40, %16 br i1 %cmp14.not.not, label %for.body15, label %for.end21, !llvm.loop !14 for.end21: ; preds = %for.body15, %entry, %for.cond2.preheader, %for.cond13.preheader call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %count) #4 call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main() { int n,a,cnt[200001]={0}; int i,j; scanf("%d",&n); i=1; while(scanf("%d",&a)){ cnt[a]++; i++; if(i>=n){break;} } for(i=1;i<=n;i++){ printf("%d\n",cnt[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128394/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128394/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %cnt = alloca [200001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %cnt) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) %cnt, i8 0, i64 800004, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) br label %while.cond while.cond: ; preds = %while.body, %entry %i.0 = phi i32 [ 1, %entry ], [ %inc2, %while.body ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %tobool.not = icmp eq i32 %call1, 0 %.pre = load i32, ptr %n, align 4, !tbaa !5 br i1 %tobool.not, label %while.end, label %while.body while.body: ; preds = %while.cond %0 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [200001 x i32], ptr %cnt, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %inc2 = add nuw nsw i32 %i.0, 1 %cmp.not = icmp slt i32 %inc2, %.pre br i1 %cmp.not, label %while.cond, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %while.cond %cmp3.not12 = icmp slt i32 %.pre, 1 br i1 %cmp3.not12, label %for.end, label %for.body for.body: ; preds = %while.end, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.end ] %arrayidx5 = getelementptr inbounds [200001 x i32], ptr %cnt, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %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 %cmp3.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp3.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %while.end call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %cnt) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int n; scanf("%d", &n); int a[n + 1]; for(int i = 0; i < n + 1; i++){ a[i] = 0; } for(int i = 1; i < n; i++){ int x; scanf("%d", &x); a[x] += 1; } for(int i = 1; i < n + 1; i++){ printf("%d\n", a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128437/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128437/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not31 = icmp slt i32 %3, 0 br i1 %cmp.not31, label %for.cond.cleanup18, label %for.cond3.preheader for.cond3.preheader: ; preds = %entry %4 = add nuw i32 %3, 1 %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %6, i1 false), !tbaa !5 %cmp433 = icmp ugt i32 %3, 1 br i1 %cmp433, label %for.body6, label %for.cond15.preheader for.cond15.preheader: ; preds = %for.body6, %for.cond3.preheader %7 = phi i32 [ %3, %for.cond3.preheader ], [ %10, %for.body6 ] %cmp17.not35 = icmp slt i32 %7, 1 br i1 %cmp17.not35, label %for.cond.cleanup18, label %for.body19 for.body6: ; preds = %for.cond3.preheader, %for.body6 %i2.034 = phi i32 [ %inc12, %for.body6 ], [ 1, %for.cond3.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %8 = load i32, ptr %x, align 4, !tbaa !5 %idxprom8 = sext i32 %8 to i64 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %idxprom8 %9 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %add10 = add nsw i32 %9, 1 store i32 %add10, ptr %arrayidx9, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 %inc12 = add nuw nsw i32 %i2.034, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc12, %10 br i1 %cmp4, label %for.body6, label %for.cond15.preheader, !llvm.loop !9 for.cond.cleanup18: ; preds = %for.body19, %entry, %for.cond15.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body19: ; preds = %for.cond15.preheader, %for.body19 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body19 ], [ 1, %for.cond15.preheader ] %arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %11 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %12 = load i32, ptr %n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp17.not.not = icmp slt i64 %indvars.iv, %13 br i1 %cmp17.not.not, label %for.body19, label %for.cond.cleanup18, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(){ int n,a,b[200005],i; scanf("%d",&n); b[0]=0; for(i=1;i<n;i++){ scanf("%d",&a); b[i]=0; b[a-1]++; } for(i=0;i<n;i++){ printf("%d\n",b[i]); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128480/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128480/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca [200005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 800020, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) store i32 0, ptr %b, align 16, !tbaa !5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %0, 1 br i1 %cmp20, label %for.body, label %for.cond6.preheader for.cond6.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %4, %for.body ] %cmp722 = icmp sgt i32 %1, 0 br i1 %cmp722, label %for.body8, label %for.end14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx2 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv store i32 0, ptr %arrayidx2, align 4, !tbaa !5 %2 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom3 = sext i32 %sub to i64 %arrayidx4 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %idxprom3 %3 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9 for.body8: ; preds = %for.cond6.preheader, %for.body8 %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.body8 ], [ 0, %for.cond6.preheader ] %arrayidx10 = getelementptr inbounds [200005 x i32], ptr %b, i64 0, i64 %indvars.iv25 %6 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp7 = icmp slt i64 %indvars.iv.next26, %8 br i1 %cmp7, label %for.body8, label %for.end14, !llvm.loop !11 for.end14: ; preds = %for.body8, %for.cond6.preheader call void @llvm.lifetime.end.p0(i64 800020, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define MAX(a, b) ((a) > (b) ? (a) : (b)) int main(void) { long N, index; long A, B[200000]; memset(&B, 0, sizeof(long)*200000); scanf("%ld", &N); for (index = 1; index < N; ++index) { scanf("%ld", &A); B[A-1]++; } for (index = 0; index < N; ++index) { printf("%ld\n", B[index]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128523/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128523/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i64, align 8 %A = alloca i64, align 8 %B = alloca [200000 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %B) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600000) %B, i8 0, i64 1600000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i64, ptr %N, align 8, !tbaa !5 %cmp15 = icmp sgt i64 %0, 1 br i1 %cmp15, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %1 = phi i64 [ %0, %entry ], [ %4, %for.body ] %cmp417 = icmp sgt i64 %1, 0 br i1 %cmp417, label %for.body5, label %for.end10 for.body: ; preds = %entry, %for.body %index.016 = phi i64 [ %inc2, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %2 = load i64, ptr %A, align 8, !tbaa !5 %sub = add nsw i64 %2, -1 %arrayidx = getelementptr inbounds [200000 x i64], ptr %B, i64 0, i64 %sub %3 = load i64, ptr %arrayidx, align 8, !tbaa !5 %inc = add nsw i64 %3, 1 store i64 %inc, ptr %arrayidx, align 8, !tbaa !5 %inc2 = add nuw nsw i64 %index.016, 1 %4 = load i64, ptr %N, align 8, !tbaa !5 %cmp = icmp slt i64 %inc2, %4 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.cond3.preheader, %for.body5 %index.118 = phi i64 [ %inc9, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx6 = getelementptr inbounds [200000 x i64], ptr %B, i64 0, i64 %index.118 %5 = load i64, ptr %arrayidx6, align 8, !tbaa !5 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %5) %inc9 = add nuw nsw i64 %index.118, 1 %6 = load i64, ptr %N, align 8, !tbaa !5 %cmp4 = icmp slt i64 %inc9, %6 br i1 %cmp4, label %for.body5, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.body5, %for.cond3.preheader call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = !{!"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<string.h> #include<stdlib.h> #include<math.h> int cnt[200004]; int main(){ int i; int n; int x; scanf("%d", &n); for(i = 1;i <= n;i++) cnt[i] = 0; for(i = 2;i <= n;i++){ scanf("%d", &x); cnt[x]++; } for(i = 1;i <= n;i++) printf("%d\n", cnt[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128567/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128567/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 @cnt = dso_local local_unnamed_addr global [200004 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not27 = icmp slt i32 %0, 1 br i1 %cmp.not27, label %for.end19, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([200004 x i32], ptr @cnt, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 %cmp2.not29 = icmp eq i32 %0, 1 br i1 %cmp2.not29, label %for.body13.preheader, label %for.body3 for.cond11.preheader: ; preds = %for.body3 %cmp12.not31 = icmp slt i32 %5, 1 br i1 %cmp12.not31, label %for.end19, label %for.body13.preheader for.body13.preheader: ; preds = %for.cond1.preheader, %for.cond11.preheader br label %for.body13 for.body3: ; preds = %for.cond1.preheader, %for.body3 %i.130 = phi i32 [ %inc9, %for.body3 ], [ 2, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %3 = load i32, ptr %x, align 4, !tbaa !5 %idxprom5 = sext i32 %3 to i64 %arrayidx6 = getelementptr inbounds [200004 x i32], ptr @cnt, i64 0, i64 %idxprom5 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %inc7 = add nsw i32 %4, 1 store i32 %inc7, ptr %arrayidx6, align 4, !tbaa !5 %inc9 = add nuw nsw i32 %i.130, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp2.not.not = icmp slt i32 %i.130, %5 br i1 %cmp2.not.not, label %for.body3, label %for.cond11.preheader, !llvm.loop !9 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ 1, %for.body13.preheader ] %arrayidx15 = getelementptr inbounds [200004 x i32], ptr @cnt, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp12.not.not = icmp slt i64 %indvars.iv, %8 br i1 %cmp12.not.not, label %for.body13, label %for.end19, !llvm.loop !11 for.end19: ; preds = %for.body13, %entry, %for.cond11.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree 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}
#include<stdio.h> int main() { long long a,b,c,d; scanf("%I64d %I64d %I64d %I64d",&a,&b,&c,&d); char str[100000]; scanf("%s",str); int j=0; long long sum=0; while(str[j]!='\0') { if(str[j]=='1') sum=sum+a; else if(str[j]=='2') sum=sum+b; else if(str[j]=='3') sum=sum+c; else sum=sum+d; j++; } printf("%I64d",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12861/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12861/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [24 x i8] c"%I64d %I64d %I64d %I64d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 %d = alloca i64, align 8 %str = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %str) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str) br label %while.cond while.cond: ; preds = %if.end26, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %if.end26 ], [ 0, %entry ] %sum.0 = phi i64 [ %sum.1, %if.end26 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %str, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %0, label %if.else23 [ i8 0, label %while.end i8 49, label %if.end26 i8 50, label %if.then13 i8 51, label %if.then21 ] if.then13: ; preds = %while.cond br label %if.end26 if.then21: ; preds = %while.cond br label %if.end26 if.else23: ; preds = %while.cond br label %if.end26 if.end26: ; preds = %while.cond, %if.then13, %if.else23, %if.then21 %.pn.in = phi ptr [ %b, %if.then13 ], [ %c, %if.then21 ], [ %d, %if.else23 ], [ %a, %while.cond ] %.pn = load i64, ptr %.pn.in, align 8, !tbaa !8 %sum.1 = add nsw i64 %.pn, %sum.0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br label %while.cond, !llvm.loop !10 while.end: ; preds = %while.cond %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sum.0) call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %str) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"long long", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int i,a,b[11]={0},c,i2; scanf("%d",&a); while(a!=0){ for(i=0;i<11;i++){ b[i]=0; } for(i=0;i<a;i++){ scanf("%d",&c); b[c]++; } for(i=0;i<10;i++){ if(b[i]==0){ printf("-\n"); } else{ for(i2=0;i2<b[i];i2++){ printf("*"); } printf("\n"); } } scanf("%d",&a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128675/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128675/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [2 x i8] c"-\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 [11 x i32], align 16 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not49 = icmp eq i32 %0, 0 br i1 %cmp.not49, label %while.end, label %for.cond.preheader.preheader for.cond.preheader.preheader: ; preds = %entry %arrayidx16.1 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 1 %arrayidx16.2 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 2 %arrayidx16.3 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 3 %arrayidx16.4 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 4 %arrayidx16.5 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 5 %arrayidx16.6 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 6 %arrayidx16.7 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 7 %arrayidx16.8 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 8 %arrayidx16.9 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 9 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.inc29.9 %1 = phi i32 [ %0, %for.cond.preheader.preheader ], [ %14, %for.inc29.9 ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44) %b, i8 0, i64 44, i1 false), !tbaa !5 %cmp344 = icmp sgt i32 %1, 0 br i1 %cmp344, label %for.body4, label %if.then for.cond12.preheader: ; preds = %for.body4 %.pre = load i32, ptr %b, align 16, !tbaa !5 %cmp17 = icmp eq i32 %.pre, 0 br i1 %cmp17, label %if.then, label %for.cond19.preheader for.body4: ; preds = %for.cond.preheader, %for.body4 %i.145 = phi i32 [ %inc10, %for.body4 ], [ 0, %for.cond.preheader ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %2 = load i32, ptr %c, align 4, !tbaa !5 %idxprom6 = sext i32 %2 to i64 %arrayidx7 = getelementptr inbounds [11 x i32], ptr %b, i64 0, i64 %idxprom6 %3 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %inc8 = add nsw i32 %3, 1 store i32 %inc8, ptr %arrayidx7, align 4, !tbaa !5 %inc10 = add nuw nsw i32 %i.145, 1 %4 = load i32, ptr %a, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc10, %4 br i1 %cmp3, label %for.body4, label %for.cond12.preheader, !llvm.loop !9 for.cond19.preheader: ; preds = %for.cond12.preheader %cmp2246 = icmp sgt i32 %.pre, 0 br i1 %cmp2246, label %for.body23, label %for.end27 if.then: ; preds = %for.cond.preheader, %for.cond12.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29 for.body23: ; preds = %for.cond19.preheader, %for.body23 %i2.047 = phi i32 [ %inc26, %for.body23 ], [ 0, %for.cond19.preheader ] %putchar42 = call i32 @putchar(i32 42) %inc26 = add nuw nsw i32 %i2.047, 1 %exitcond.not = icmp eq i32 %inc26, %.pre br i1 %exitcond.not, label %for.end27, label %for.body23, !llvm.loop !11 for.end27: ; preds = %for.body23, %for.cond19.preheader %putchar = call i32 @putchar(i32 10) br label %for.inc29 for.inc29: ; preds = %if.then, %for.end27 %5 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %cmp17.1 = icmp eq i32 %5, 0 br i1 %cmp17.1, label %if.then.1, label %for.cond19.preheader.1 for.cond19.preheader.1: ; preds = %for.inc29 %cmp2246.1 = icmp sgt i32 %5, 0 br i1 %cmp2246.1, label %for.body23.1, label %for.end27.1 for.body23.1: ; preds = %for.cond19.preheader.1, %for.body23.1 %i2.047.1 = phi i32 [ %inc26.1, %for.body23.1 ], [ 0, %for.cond19.preheader.1 ] %putchar42.1 = call i32 @putchar(i32 42) %inc26.1 = add nuw nsw i32 %i2.047.1, 1 %exitcond.1.not = icmp eq i32 %inc26.1, %5 br i1 %exitcond.1.not, label %for.end27.1, label %for.body23.1, !llvm.loop !11 for.end27.1: ; preds = %for.body23.1, %for.cond19.preheader.1 %putchar.1 = call i32 @putchar(i32 10) br label %for.inc29.1 if.then.1: ; preds = %for.inc29 %puts.1 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.1 for.inc29.1: ; preds = %if.then.1, %for.end27.1 %6 = load i32, ptr %arrayidx16.2, align 8, !tbaa !5 %cmp17.2 = icmp eq i32 %6, 0 br i1 %cmp17.2, label %if.then.2, label %for.cond19.preheader.2 for.cond19.preheader.2: ; preds = %for.inc29.1 %cmp2246.2 = icmp sgt i32 %6, 0 br i1 %cmp2246.2, label %for.body23.2, label %for.end27.2 for.body23.2: ; preds = %for.cond19.preheader.2, %for.body23.2 %i2.047.2 = phi i32 [ %inc26.2, %for.body23.2 ], [ 0, %for.cond19.preheader.2 ] %putchar42.2 = call i32 @putchar(i32 42) %inc26.2 = add nuw nsw i32 %i2.047.2, 1 %exitcond.2.not = icmp eq i32 %inc26.2, %6 br i1 %exitcond.2.not, label %for.end27.2, label %for.body23.2, !llvm.loop !11 for.end27.2: ; preds = %for.body23.2, %for.cond19.preheader.2 %putchar.2 = call i32 @putchar(i32 10) br label %for.inc29.2 if.then.2: ; preds = %for.inc29.1 %puts.2 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.2 for.inc29.2: ; preds = %if.then.2, %for.end27.2 %7 = load i32, ptr %arrayidx16.3, align 4, !tbaa !5 %cmp17.3 = icmp eq i32 %7, 0 br i1 %cmp17.3, label %if.then.3, label %for.cond19.preheader.3 for.cond19.preheader.3: ; preds = %for.inc29.2 %cmp2246.3 = icmp sgt i32 %7, 0 br i1 %cmp2246.3, label %for.body23.3, label %for.end27.3 for.body23.3: ; preds = %for.cond19.preheader.3, %for.body23.3 %i2.047.3 = phi i32 [ %inc26.3, %for.body23.3 ], [ 0, %for.cond19.preheader.3 ] %putchar42.3 = call i32 @putchar(i32 42) %inc26.3 = add nuw nsw i32 %i2.047.3, 1 %exitcond.3.not = icmp eq i32 %inc26.3, %7 br i1 %exitcond.3.not, label %for.end27.3, label %for.body23.3, !llvm.loop !11 for.end27.3: ; preds = %for.body23.3, %for.cond19.preheader.3 %putchar.3 = call i32 @putchar(i32 10) br label %for.inc29.3 if.then.3: ; preds = %for.inc29.2 %puts.3 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.3 for.inc29.3: ; preds = %if.then.3, %for.end27.3 %8 = load i32, ptr %arrayidx16.4, align 16, !tbaa !5 %cmp17.4 = icmp eq i32 %8, 0 br i1 %cmp17.4, label %if.then.4, label %for.cond19.preheader.4 for.cond19.preheader.4: ; preds = %for.inc29.3 %cmp2246.4 = icmp sgt i32 %8, 0 br i1 %cmp2246.4, label %for.body23.4, label %for.end27.4 for.body23.4: ; preds = %for.cond19.preheader.4, %for.body23.4 %i2.047.4 = phi i32 [ %inc26.4, %for.body23.4 ], [ 0, %for.cond19.preheader.4 ] %putchar42.4 = call i32 @putchar(i32 42) %inc26.4 = add nuw nsw i32 %i2.047.4, 1 %exitcond.4.not = icmp eq i32 %inc26.4, %8 br i1 %exitcond.4.not, label %for.end27.4, label %for.body23.4, !llvm.loop !11 for.end27.4: ; preds = %for.body23.4, %for.cond19.preheader.4 %putchar.4 = call i32 @putchar(i32 10) br label %for.inc29.4 if.then.4: ; preds = %for.inc29.3 %puts.4 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.4 for.inc29.4: ; preds = %if.then.4, %for.end27.4 %9 = load i32, ptr %arrayidx16.5, align 4, !tbaa !5 %cmp17.5 = icmp eq i32 %9, 0 br i1 %cmp17.5, label %if.then.5, label %for.cond19.preheader.5 for.cond19.preheader.5: ; preds = %for.inc29.4 %cmp2246.5 = icmp sgt i32 %9, 0 br i1 %cmp2246.5, label %for.body23.5, label %for.end27.5 for.body23.5: ; preds = %for.cond19.preheader.5, %for.body23.5 %i2.047.5 = phi i32 [ %inc26.5, %for.body23.5 ], [ 0, %for.cond19.preheader.5 ] %putchar42.5 = call i32 @putchar(i32 42) %inc26.5 = add nuw nsw i32 %i2.047.5, 1 %exitcond.5.not = icmp eq i32 %inc26.5, %9 br i1 %exitcond.5.not, label %for.end27.5, label %for.body23.5, !llvm.loop !11 for.end27.5: ; preds = %for.body23.5, %for.cond19.preheader.5 %putchar.5 = call i32 @putchar(i32 10) br label %for.inc29.5 if.then.5: ; preds = %for.inc29.4 %puts.5 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.5 for.inc29.5: ; preds = %if.then.5, %for.end27.5 %10 = load i32, ptr %arrayidx16.6, align 8, !tbaa !5 %cmp17.6 = icmp eq i32 %10, 0 br i1 %cmp17.6, label %if.then.6, label %for.cond19.preheader.6 for.cond19.preheader.6: ; preds = %for.inc29.5 %cmp2246.6 = icmp sgt i32 %10, 0 br i1 %cmp2246.6, label %for.body23.6, label %for.end27.6 for.body23.6: ; preds = %for.cond19.preheader.6, %for.body23.6 %i2.047.6 = phi i32 [ %inc26.6, %for.body23.6 ], [ 0, %for.cond19.preheader.6 ] %putchar42.6 = call i32 @putchar(i32 42) %inc26.6 = add nuw nsw i32 %i2.047.6, 1 %exitcond.6.not = icmp eq i32 %inc26.6, %10 br i1 %exitcond.6.not, label %for.end27.6, label %for.body23.6, !llvm.loop !11 for.end27.6: ; preds = %for.body23.6, %for.cond19.preheader.6 %putchar.6 = call i32 @putchar(i32 10) br label %for.inc29.6 if.then.6: ; preds = %for.inc29.5 %puts.6 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.6 for.inc29.6: ; preds = %if.then.6, %for.end27.6 %11 = load i32, ptr %arrayidx16.7, align 4, !tbaa !5 %cmp17.7 = icmp eq i32 %11, 0 br i1 %cmp17.7, label %if.then.7, label %for.cond19.preheader.7 for.cond19.preheader.7: ; preds = %for.inc29.6 %cmp2246.7 = icmp sgt i32 %11, 0 br i1 %cmp2246.7, label %for.body23.7, label %for.end27.7 for.body23.7: ; preds = %for.cond19.preheader.7, %for.body23.7 %i2.047.7 = phi i32 [ %inc26.7, %for.body23.7 ], [ 0, %for.cond19.preheader.7 ] %putchar42.7 = call i32 @putchar(i32 42) %inc26.7 = add nuw nsw i32 %i2.047.7, 1 %exitcond.7.not = icmp eq i32 %inc26.7, %11 br i1 %exitcond.7.not, label %for.end27.7, label %for.body23.7, !llvm.loop !11 for.end27.7: ; preds = %for.body23.7, %for.cond19.preheader.7 %putchar.7 = call i32 @putchar(i32 10) br label %for.inc29.7 if.then.7: ; preds = %for.inc29.6 %puts.7 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.7 for.inc29.7: ; preds = %if.then.7, %for.end27.7 %12 = load i32, ptr %arrayidx16.8, align 16, !tbaa !5 %cmp17.8 = icmp eq i32 %12, 0 br i1 %cmp17.8, label %if.then.8, label %for.cond19.preheader.8 for.cond19.preheader.8: ; preds = %for.inc29.7 %cmp2246.8 = icmp sgt i32 %12, 0 br i1 %cmp2246.8, label %for.body23.8, label %for.end27.8 for.body23.8: ; preds = %for.cond19.preheader.8, %for.body23.8 %i2.047.8 = phi i32 [ %inc26.8, %for.body23.8 ], [ 0, %for.cond19.preheader.8 ] %putchar42.8 = call i32 @putchar(i32 42) %inc26.8 = add nuw nsw i32 %i2.047.8, 1 %exitcond.8.not = icmp eq i32 %inc26.8, %12 br i1 %exitcond.8.not, label %for.end27.8, label %for.body23.8, !llvm.loop !11 for.end27.8: ; preds = %for.body23.8, %for.cond19.preheader.8 %putchar.8 = call i32 @putchar(i32 10) br label %for.inc29.8 if.then.8: ; preds = %for.inc29.7 %puts.8 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.8 for.inc29.8: ; preds = %if.then.8, %for.end27.8 %13 = load i32, ptr %arrayidx16.9, align 4, !tbaa !5 %cmp17.9 = icmp eq i32 %13, 0 br i1 %cmp17.9, label %if.then.9, label %for.cond19.preheader.9 for.cond19.preheader.9: ; preds = %for.inc29.8 %cmp2246.9 = icmp sgt i32 %13, 0 br i1 %cmp2246.9, label %for.body23.9, label %for.end27.9 for.body23.9: ; preds = %for.cond19.preheader.9, %for.body23.9 %i2.047.9 = phi i32 [ %inc26.9, %for.body23.9 ], [ 0, %for.cond19.preheader.9 ] %putchar42.9 = call i32 @putchar(i32 42) %inc26.9 = add nuw nsw i32 %i2.047.9, 1 %exitcond.9.not = icmp eq i32 %inc26.9, %13 br i1 %exitcond.9.not, label %for.end27.9, label %for.body23.9, !llvm.loop !11 for.end27.9: ; preds = %for.body23.9, %for.cond19.preheader.9 %putchar.9 = call i32 @putchar(i32 10) br label %for.inc29.9 if.then.9: ; preds = %for.inc29.8 %puts.9 = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %for.inc29.9 for.inc29.9: ; preds = %if.then.9, %for.end27.9 %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %14 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp eq i32 %14, 0 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.inc29.9, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; 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}
// Aizu Vol-1 0137: Middle-Square Method // 2017.8.1 #include <stdio.h> #include <stdlib.h> char *gets(char *); char buf[50]; int main() { int i, n, s, k; gets(buf); n = atoi(buf); for (i = 1; i <= n; i++) { gets(buf); s = atoi(buf); printf("Case %d:\n", i); for (k = 0; k < 10; k++) { s = (s * s / 100) % 10000; printf("%d\n", s); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128718/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128718/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @buf = dso_local global [50 x i8] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"Case %d:\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call ptr @gets(ptr noundef nonnull @buf) %call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #3 %conv.i = trunc i64 %call.i to i32 %cmp.not21 = icmp slt i32 %conv.i, 1 br i1 %cmp.not21, label %for.end11, label %for.body for.body: ; preds = %entry, %for.body %i.022 = phi i32 [ %inc10, %for.body ], [ 1, %entry ] %call2 = tail call ptr @gets(ptr noundef nonnull @buf) %call.i17 = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #3 %conv.i18 = trunc i64 %call.i17 to i32 %call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.022) %mul = mul nsw i32 %conv.i18, %conv.i18 %div = udiv i32 %mul, 100 %rem = urem i32 %div, 10000 %call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem) %mul.1 = mul nuw nsw i32 %rem, %rem %div.1 = udiv i32 %mul.1, 100 %rem.1 = urem i32 %div.1, 10000 %call8.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.1) %mul.2 = mul nuw nsw i32 %rem.1, %rem.1 %div.2 = udiv i32 %mul.2, 100 %rem.2 = urem i32 %div.2, 10000 %call8.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.2) %mul.3 = mul nuw nsw i32 %rem.2, %rem.2 %div.3 = udiv i32 %mul.3, 100 %rem.3 = urem i32 %div.3, 10000 %call8.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.3) %mul.4 = mul nuw nsw i32 %rem.3, %rem.3 %div.4 = udiv i32 %mul.4, 100 %rem.4 = urem i32 %div.4, 10000 %call8.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.4) %mul.5 = mul nuw nsw i32 %rem.4, %rem.4 %div.5 = udiv i32 %mul.5, 100 %rem.5 = urem i32 %div.5, 10000 %call8.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.5) %mul.6 = mul nuw nsw i32 %rem.5, %rem.5 %div.6 = udiv i32 %mul.6, 100 %rem.6 = urem i32 %div.6, 10000 %call8.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.6) %mul.7 = mul nuw nsw i32 %rem.6, %rem.6 %div.7 = udiv i32 %mul.7, 100 %rem.7 = urem i32 %div.7, 10000 %call8.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.7) %mul.8 = mul nuw nsw i32 %rem.7, %rem.7 %div.8 = udiv i32 %mul.8, 100 %rem.8 = urem i32 %div.8, 10000 %call8.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.8) %mul.9 = mul nuw nsw i32 %rem.8, %rem.8 %div.9 = udiv i32 %mul.9, 100 %rem.9 = urem i32 %div.9, 10000 %call8.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.9) %inc10 = add nuw i32 %i.022, 1 %exitcond.not = icmp eq i32 %i.022, %conv.i br i1 %exitcond.not, label %for.end11, label %for.body, !llvm.loop !5 for.end11: ; preds = %for.body, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @gets(ptr noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 8 int main() { int val = 0, tmp = 0, i = 0, j = 0, diff = 0; char str[9], tmpstr[5]; scanf( "%d", &val ); for ( int i = 0 ; i < val ; i++ ) { scanf( "%d", &tmp ); printf( "Case %d:\n", i+1 ); for ( int k = 0 ; k < 10 ; k++ ) { tmp = tmp * tmp; memset( str, 0, strlen( str ) ); memset( tmpstr, 0, strlen( tmpstr ) ); sprintf( str, "%d", tmp ); diff = MAX - strlen( str ); for ( j = strlen( str )-1 ; j >= 0 ; j-- ) { str[j+diff] = str[j]; } for ( j = 0 ; j < diff ; j++ ) { str[j] = '0'; } for ( j = 0 ; j < 4 ; j++ ) { tmpstr[j] = str[j+2]; } tmp = atoi( tmpstr ); printf( "%d\n", tmp ); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128769/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128769/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"Case %d:\0A\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: %val = alloca i32, align 4 %tmp = alloca i32, align 4 %str = alloca [9 x i8], align 1 %str95 = ptrtoint ptr %str to i64 %tmpstr = alloca [5 x i8], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %val) #6 store i32 0, ptr %val, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #6 store i32 0, ptr %tmp, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %str) #6 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %tmpstr) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %val) %0 = load i32, ptr %val, align 4, !tbaa !5 %cmp78 = icmp sgt i32 %0, 0 br i1 %cmp78, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %scevgep = getelementptr inbounds i8, ptr %str, i64 2 %invariant.gep = getelementptr i8, ptr %str, i64 -15 %invariant.gep108 = getelementptr i8, ptr %str, i64 -15 %invariant.gep110 = getelementptr i8, ptr %str, i64 -3 %invariant.gep112 = getelementptr i8, ptr %str, i64 -3 br label %for.body for.cond.loopexit: ; preds = %for.cond36.preheader %1 = load i32, ptr %val, align 4, !tbaa !5 %cmp = icmp slt i32 %add, %1 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.cond.cleanup: ; preds = %for.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %tmpstr) #6 call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %str) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %val) #6 ret i32 0 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %i1.079 = phi i32 [ %add, %for.cond.loopexit ], [ 0, %for.body.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp) %add = add nuw nsw i32 %i1.079, 1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) br label %for.body7 for.body7: ; preds = %for.body, %for.cond36.preheader %k.077 = phi i32 [ 0, %for.body ], [ %inc52, %for.cond36.preheader ] %2 = load i32, ptr %tmp, align 4, !tbaa !5 %mul = mul nsw i32 %2, %2 store i32 %mul, ptr %tmp, align 4, !tbaa !5 %call9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7 call void @llvm.memset.p0.i64(ptr nonnull align 1 %str, i8 0, i64 %call9, i1 false) %call12 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %tmpstr) #7 call void @llvm.memset.p0.i64(ptr nonnull align 4 %tmpstr, i8 0, i64 %call12, i1 false) %call14 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul) #6 %call16 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #7 %3 = trunc i64 %call16 to i32 %conv = sub i32 8, %3 %j.071 = add i32 %3, -1 %cmp2272 = icmp sgt i32 %j.071, -1 br i1 %cmp2272, label %iter.check, label %for.cond28.preheader iter.check: ; preds = %for.body7 %4 = zext i32 %j.071 to i64 %5 = sext i32 %conv to i64 %6 = add nuw nsw i64 %4, 1 %min.iters.check = icmp ult i32 %j.071, 3 br i1 %min.iters.check, label %for.body24.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %iter.check %7 = getelementptr i8, ptr %str, i64 %5 %scevgep89 = getelementptr i8, ptr %7, i64 %4 %8 = icmp ugt ptr %7, %scevgep89 %scevgep91 = getelementptr i8, ptr %str, i64 %4 %9 = icmp ugt ptr %str, %scevgep91 %10 = or i1 %8, %9 br i1 %10, label %for.body24.preheader, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %11 = add i64 %str95, %4 %12 = add i64 %str95, %5 %13 = add i64 %12, %4 %14 = sub i64 %11, %13 %diff.check = icmp ult i64 %14, 16 br i1 %diff.check, label %for.body24.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %vector.memcheck %min.iters.check96 = icmp ult i32 %j.071, 15 br i1 %min.iters.check96, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %6, 8589934576 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %4, %index %gep = getelementptr [9 x i8], ptr %invariant.gep, i64 0, i64 %offset.idx %wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !11 %15 = add nsw i64 %offset.idx, %5 %gep109 = getelementptr [9 x i8], ptr %invariant.gep108, i64 0, i64 %15 store <16 x i8> %wide.load, ptr %gep109, align 1, !tbaa !11 %index.next = add nuw i64 %index, 16 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %6, %n.vec br i1 %cmp.n, label %for.cond28.preheader, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %ind.end100 = sub nsw i64 %4, %n.vec %n.vec.remaining = and i64 %6, 12 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body24.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.vec99 = and i64 %6, 8589934588 %ind.end = sub nsw i64 %4, %n.vec99 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index102 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next107, %vec.epilog.vector.body ] %offset.idx103 = sub i64 %4, %index102 %gep111 = getelementptr [9 x i8], ptr %invariant.gep110, i64 0, i64 %offset.idx103 %wide.load104 = load <4 x i8>, ptr %gep111, align 1, !tbaa !11 %17 = add nsw i64 %offset.idx103, %5 %gep113 = getelementptr [9 x i8], ptr %invariant.gep112, i64 0, i64 %17 store <4 x i8> %wide.load104, ptr %gep113, align 1, !tbaa !11 %index.next107 = add nuw i64 %index102, 4 %18 = icmp eq i64 %index.next107, %n.vec99 br i1 %18, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n101 = icmp eq i64 %6, %n.vec99 br i1 %cmp.n101, label %for.cond28.preheader, label %for.body24.preheader for.body24.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ %4, %iter.check ], [ %4, %vector.memcheck ], [ %4, %vector.scevcheck ], [ %ind.end100, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ] %19 = add nsw i64 %indvars.iv.ph, 1 %xtraiter = and i64 %19, 3 %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.preheader, %for.body24.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body24.prol ], [ %indvars.iv.ph, %for.body24.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body24.prol ], [ 0, %for.body24.preheader ] %arrayidx.prol = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %indvars.iv.prol %20 = load i8, ptr %arrayidx.prol, align 1, !tbaa !11 %21 = add nsw i64 %indvars.iv.prol, %5 %arrayidx27.prol = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %21 store i8 %20, ptr %arrayidx27.prol, align 1, !tbaa !11 %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, -1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body24.prol.loopexit, label %for.body24.prol, !llvm.loop !16 for.body24.prol.loopexit: ; preds = %for.body24.prol, %for.body24.preheader %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body24.preheader ], [ %indvars.iv.next.prol, %for.body24.prol ] %22 = icmp ult i64 %indvars.iv.ph, 3 br i1 %22, label %for.cond28.preheader, label %for.body24 for.cond28.preheader: ; preds = %for.body24.prol.loopexit, %for.body24, %middle.block, %vec.epilog.middle.block, %for.body7 %cmp2974 = icmp sgt i32 %conv, 0 br i1 %cmp2974, label %for.body31.preheader, label %for.cond36.preheader for.body31.preheader: ; preds = %for.cond28.preheader %23 = zext i32 %conv to i64 call void @llvm.memset.p0.i64(ptr nonnull align 1 %str, i8 48, i64 %23, i1 false), !tbaa !11 br label %for.cond36.preheader for.body24: ; preds = %for.body24.prol.loopexit, %for.body24 %indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body24 ], [ %indvars.iv.unr, %for.body24.prol.loopexit ] %arrayidx = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %indvars.iv %24 = load i8, ptr %arrayidx, align 1, !tbaa !11 %25 = add nsw i64 %indvars.iv, %5 %arrayidx27 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %25 store i8 %24, ptr %arrayidx27, align 1, !tbaa !11 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %arrayidx.1 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %indvars.iv.next %26 = load i8, ptr %arrayidx.1, align 1, !tbaa !11 %27 = add nsw i64 %indvars.iv.next, %5 %arrayidx27.1 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %27 store i8 %26, ptr %arrayidx27.1, align 1, !tbaa !11 %indvars.iv.next.1 = add nsw i64 %indvars.iv, -2 %arrayidx.2 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %indvars.iv.next.1 %28 = load i8, ptr %arrayidx.2, align 1, !tbaa !11 %29 = add nsw i64 %indvars.iv.next.1, %5 %arrayidx27.2 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %29 store i8 %28, ptr %arrayidx27.2, align 1, !tbaa !11 %indvars.iv.next.2 = add nsw i64 %indvars.iv, -3 %arrayidx.3 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %indvars.iv.next.2 %30 = load i8, ptr %arrayidx.3, align 1, !tbaa !11 %31 = add nsw i64 %indvars.iv.next.2, %5 %arrayidx27.3 = getelementptr inbounds [9 x i8], ptr %str, i64 0, i64 %31 store i8 %30, ptr %arrayidx27.3, align 1, !tbaa !11 %indvars.iv.next.3 = add nsw i64 %indvars.iv, -4 %cmp22.not.3 = icmp eq i64 %indvars.iv.next.2, 0 br i1 %cmp22.not.3, label %for.cond28.preheader, label %for.body24, !llvm.loop !18 for.cond36.preheader: ; preds = %for.body31.preheader, %for.cond28.preheader %32 = load i32, ptr %scevgep, align 1, !tbaa !11 store i32 %32, ptr %tmpstr, align 4, !tbaa !11 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmpstr, ptr noundef null, i32 noundef 10) #6 %conv.i = trunc i64 %call.i to i32 store i32 %conv.i, ptr %tmp, align 4, !tbaa !5 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv.i) %inc52 = add nuw nsw i32 %k.077, 1 %exitcond.not = icmp eq i32 %inc52, 10 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body7, !llvm.loop !19 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, 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(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 nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { 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 #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, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !13, !14} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10, !13} !19 = distinct !{!19, !10}
#include <stdio.h> int main(void) { int A,B,C; scanf("%d%d", &A, &B); if( A + B >= 10) printf("error\n"); else printf("%d\n", A+B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128811/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128811/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [6 x i8] c"error\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b; scanf("%d%d",&a,&b); if(a+b>=10){ printf("error"); } else{ printf("%d",a+b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128855/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128855/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"error\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
# include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); if(a+b>=10) puts("error"); else printf("%d\n",a+b); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128899/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128899/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"error\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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %if.then 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b; scanf("%d%d",&a,&b); if(10>a+b)printf("%d",a+b); else puts("error"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128941/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128941/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"error\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp = icmp slt i32 %add, 10 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) br label %if.end if.else: ; preds = %entry %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end if.end: ; preds = %if.else, %if.then 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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(int argc, char **argv) { int a, b; scanf("%d %d", &a, &b); if (a+b >= 10) { puts("error"); } else { printf("%d\n", a+b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_128985/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_128985/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"error\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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %if.then 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a, b, sum; scanf("%d%d", &a, &b); sum = a + b; if(sum>=10){ printf("error\n"); }else{ printf("%d\n", sum); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129027/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129027/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [6 x i8] c"error\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int A, B; scanf("%d %d", &A, &B); if(A+B>=10)printf("error\n"); else printf("%d\n", A+B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129070/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129070/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [6 x i8] c"error\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (){ int a,b; scanf("%d%d",&a,&b); if(a+b>=10)printf("error\n"); else printf("%d\n",a+b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [6 x i8] c"error\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %add = add nsw i32 %1, %0 %cmp = icmp sgt i32 %add, 9 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.else: ; preds = %entry %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int min(int a,int b){ if(a>b)a=b; return a; } int max(int a,int b){ if(a<b)a=b; return a; } int main(){ int a,b,n,k,m=0,i,j,x[100001],y[100001],z=0; scanf("%d%d",&n,&k); for(i=0;i<n-1;i++)scanf("%d",&x[i]); for(i=0;i<k;i++)scanf("%d",&y[i]); for(i=0;i<k;i++){ a=min(m,m+y[i]),b=max(m,m+y[i]); for(j=a;j<b;j++)z+=x[j]; m+=y[i]; z%=100000; } printf("%d\n",z); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129164/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129164/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %spec.select } ; 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: %spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %spec.select } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %x = alloca [100001 x i32], align 16 %y = alloca [100001 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 %k) #5 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp57 = icmp sgt i32 %0, 1 br i1 %cmp57, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp359 = icmp sgt i32 %1, 0 br i1 %cmp359, label %for.body4, label %for.end35 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %3 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond11.preheader: ; preds = %for.body4 %cmp1265 = icmp sgt i32 %4, 0 br i1 %cmp1265, label %for.body13.preheader, label %for.end35 for.body13.preheader: ; preds = %for.cond11.preheader %wide.trip.count = zext i32 %4 to i64 br label %for.body13 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [100001 x i32], ptr %y, i64 0, i64 %indvars.iv72 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %4 = load i32, ptr %k, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp3 = icmp slt i64 %indvars.iv.next73, %5 br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11 for.body13: ; preds = %for.body13.preheader, %for.end29 %indvars.iv77 = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next78, %for.end29 ] %z.068 = phi i32 [ 0, %for.body13.preheader ], [ %rem, %for.end29 ] %m.066 = phi i32 [ 0, %for.body13.preheader ], [ %add, %for.end29 ] %arrayidx15 = getelementptr inbounds [100001 x i32], ptr %y, i64 0, i64 %indvars.iv77 %6 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %add = add i32 %6, %m.066 %spec.select.i = call i32 @llvm.smin.i32(i32 %m.066, i32 %add) %spec.select.i55 = call i32 @llvm.smax.i32(i32 %m.066, i32 %add) %cmp2261 = icmp slt i32 %spec.select.i, %spec.select.i55 br i1 %cmp2261, label %for.body23.preheader, label %for.end29 for.body23.preheader: ; preds = %for.body13 %7 = call i32 @llvm.smin.i32(i32 %m.066, i32 %add) %smin = sext i32 %7 to i64 %8 = call i32 @llvm.smax.i32(i32 %m.066, i32 %add) %9 = xor i32 %7, -1 %10 = add i32 %8, %9 %11 = zext i32 %10 to i64 %12 = add nuw nsw i64 %11, 1 %min.iters.check = icmp ult i32 %10, 7 br i1 %min.iters.check, label %for.body23.preheader85, label %vector.ph vector.ph: ; preds = %for.body23.preheader %n.vec = and i64 %12, 8589934584 %ind.end = add nsw i64 %n.vec, %smin %13 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %z.068, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %13, %vector.ph ], [ %16, %vector.body ] %vec.phi83 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ] %offset.idx = add i64 %index, %smin %14 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %14, align 4, !tbaa !5 %15 = getelementptr inbounds i32, ptr %14, i64 4 %wide.load84 = load <4 x i32>, ptr %15, align 4, !tbaa !5 %16 = add <4 x i32> %wide.load, %vec.phi %17 = add <4 x i32> %wide.load84, %vec.phi83 %index.next = add nuw i64 %index, 8 %18 = icmp eq i64 %index.next, %n.vec br i1 %18, label %middle.block, label %vector.body, !llvm.loop !12 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) %cmp.n = icmp eq i64 %12, %n.vec br i1 %cmp.n, label %for.end29, label %for.body23.preheader85 for.body23.preheader85: ; preds = %for.body23.preheader, %middle.block %indvars.iv75.ph = phi i64 [ %smin, %for.body23.preheader ], [ %ind.end, %middle.block ] %z.163.ph = phi i32 [ %z.068, %for.body23.preheader ], [ %19, %middle.block ] br label %for.body23 for.body23: ; preds = %for.body23.preheader85, %for.body23 %indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body23 ], [ %indvars.iv75.ph, %for.body23.preheader85 ] %z.163 = phi i32 [ %add26, %for.body23 ], [ %z.163.ph, %for.body23.preheader85 ] %arrayidx25 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %indvars.iv75 %20 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %add26 = add nsw i32 %20, %z.163 %indvars.iv.next76 = add nsw i64 %indvars.iv75, 1 %lftr.wideiv = trunc i64 %indvars.iv.next76 to i32 %exitcond.not = icmp eq i32 %8, %lftr.wideiv br i1 %exitcond.not, label %for.end29, label %for.body23, !llvm.loop !15 for.end29: ; preds = %for.body23, %middle.block, %for.body13 %z.1.lcssa = phi i32 [ %z.068, %for.body13 ], [ %19, %middle.block ], [ %add26, %for.body23 ] %rem = srem i32 %z.1.lcssa, 100000 %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %exitcond80.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count br i1 %exitcond80.not, label %for.end35, label %for.body13, !llvm.loop !16 for.end35: ; preds = %for.end29, %for.cond2.preheader, %for.cond11.preheader %z.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ 0, %for.cond2.preheader ], [ %rem, %for.end29 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %z.0.lcssa) call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 = !{!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, !14, !13} !16 = distinct !{!16, !10}
#include <stdio.h> int main() { int a; scanf("%d",&a); printf("%d\n",a * (1 + a + a * a)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129207/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %mul = mul nsw i32 %0, %0 %add1 = add nsw i32 %add, %mul %mul2 = mul nsw i32 %add1, %0 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int N; scanf("%d",&N); printf("%d",N+N*N+N*N*N); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129250/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129250/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a; scanf("%d", &a); printf("%d", a + (a * a) + (a * a * a)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129294/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129294/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a; LOOP: scanf("%d", &a); if (a<1 || a>10) goto LOOP; a = a + a*a + a*a*a; printf("%d\n", a); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129337/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129337/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 br label %LOOP LOOP: ; preds = %LOOP, %entry %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4 %1 = add i32 %0, -11 %or.cond = icmp ult i32 %1, -10 br i1 %or.cond, label %LOOP, label %if.end if.end: ; preds = %LOOP %mul = mul nuw nsw i32 %0, %0 %add = add nuw nsw i32 %mul, %0 %mul3 = mul nuw nsw i32 %mul, %0 %add4 = add nuw nsw i32 %add, %mul3 store i32 %add4, ptr %a, align 4, !tbaa !5 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int n; char buf[30]; fgets(buf, sizeof(buf), stdin); n = atoi(buf); printf("%d\n", n + (n*n) + (n*n*n)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129380/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129380/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %buf = alloca [30 x i8], align 16 call void @llvm.lifetime.start.p0(i64 30, ptr nonnull %buf) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 30, ptr noundef %0) %call.i = call i64 @strtol(ptr nocapture noundef nonnull %buf, ptr noundef null, i32 noundef 10) #4 %conv.i = trunc i64 %call.i to i32 %mul = mul nsw i32 %conv.i, %conv.i %add = add nsw i32 %mul, %conv.i %mul4 = mul nsw i32 %mul, %conv.i %add5 = add nsw i32 %add, %mul4 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add5) call void @llvm.lifetime.end.p0(i64 30, 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, 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 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int n; scanf("%d", &n); printf("%d",n+n*n+n*n*n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129423/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129423/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,sum; scanf("%d", &a); sum = a + a*a + a*a*a; printf("%d", sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129467/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129467/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3) 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> long long int i,j,c[15]={0},z,a[30],l,r,n,x,ans = 0; void bit(long long int now){ long long int p,sum; if(now == z) { sum = a[i] + a[j]; for(p=0;p<z;p++) if(c[p] == 1) sum += a[i+p+1]; if(sum >= l && sum<=r) ans++; } else { c[now] = 0; bit(now+1); c[now] = 1; bit(now+1); } return ; } int main(){ long long int k,m,p,q; scanf("%lld%lld%lld%lld",&n,&l,&r,&x); for(p=0;p<n;p++) scanf("%lld",&a[p]); for(p=n-1;p>0;p--) for(q=0;q<p;q++) if(a[q] > a[q+1]) { k = a[q]; a[q] = a[q+1]; a[q+1] = k; } for(i=0;i<n;i++) for(j=i+1;j<n;j++) if(a[j]-a[i] >= x && a[j]+a[i]<=r) { for(p=0;p<15;p++) c[p] = 0; z = j-i-1; bit(0); } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12951/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12951/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @c = dso_local local_unnamed_addr global [15 x i64] zeroinitializer, align 16 @ans = dso_local local_unnamed_addr global i64 0, align 8 @z = dso_local local_unnamed_addr global i64 0, align 8 @a = dso_local global [30 x i64] zeroinitializer, align 16 @i = dso_local local_unnamed_addr global i64 0, align 8 @j = dso_local local_unnamed_addr global i64 0, align 8 @l = dso_local global i64 0, align 8 @r = dso_local global i64 0, align 8 @.str = private unnamed_addr constant [17 x i8] c"%lld%lld%lld%lld\00", align 1 @n = dso_local global i64 0, align 8 @x = dso_local global i64 0, align 8 @.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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @bit(i64 noundef %now) local_unnamed_addr #0 { entry: %0 = load i64, ptr @z, align 8, !tbaa !5 %cmp29 = icmp eq i64 %0, %now br i1 %cmp29, label %if.then, label %if.else if.then: ; preds = %if.else, %entry %.lcssa = phi i64 [ %now, %entry ], [ %add16, %if.else ] %1 = load i64, ptr @i, align 8, !tbaa !5 %arrayidx = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %1 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %3 = load i64, ptr @j, align 8, !tbaa !5 %arrayidx1 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %3 %4 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %add = add nsw i64 %4, %2 %cmp231 = icmp sgt i64 %.lcssa, 0 br i1 %cmp231, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %if.then %add6 = add i64 %1, 1 %xtraiter = and i64 %.lcssa, 1 %5 = icmp eq i64 %.lcssa, 1 br i1 %5, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %.lcssa, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.lr.ph.new %sum.033 = phi i64 [ %add, %for.body.lr.ph.new ], [ %sum.1.1, %for.inc.1 ] %p.032 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx3 = getelementptr inbounds [15 x i64], ptr @c, i64 0, i64 %p.032 %6 = load i64, ptr %arrayidx3, align 16, !tbaa !5 %cmp4 = icmp eq i64 %6, 1 br i1 %cmp4, label %if.then5, label %for.inc if.then5: ; preds = %for.body %add7 = add i64 %add6, %p.032 %arrayidx8 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add7 %7 = load i64, ptr %arrayidx8, align 8, !tbaa !5 %add9 = add nsw i64 %7, %sum.033 br label %for.inc for.inc: ; preds = %for.body, %if.then5 %sum.1 = phi i64 [ %add9, %if.then5 ], [ %sum.033, %for.body ] %inc = or i64 %p.032, 1 %arrayidx3.1 = getelementptr inbounds [15 x i64], ptr @c, i64 0, i64 %inc %8 = load i64, ptr %arrayidx3.1, align 8, !tbaa !5 %cmp4.1 = icmp eq i64 %8, 1 br i1 %cmp4.1, label %if.then5.1, label %for.inc.1 if.then5.1: ; preds = %for.inc %add7.1 = add i64 %add6, %inc %arrayidx8.1 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add7.1 %9 = load i64, ptr %arrayidx8.1, align 8, !tbaa !5 %add9.1 = add nsw i64 %9, %sum.1 br label %for.inc.1 for.inc.1: ; preds = %if.then5.1, %for.inc %sum.1.1 = phi i64 [ %add9.1, %if.then5.1 ], [ %sum.1, %for.inc ] %inc.1 = add nuw nsw i64 %p.032, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.lr.ph %sum.1.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %sum.1.1, %for.inc.1 ] %sum.033.unr = phi i64 [ %add, %for.body.lr.ph ], [ %sum.1.1, %for.inc.1 ] %p.032.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx3.epil = getelementptr inbounds [15 x i64], ptr @c, i64 0, i64 %p.032.unr %10 = load i64, ptr %arrayidx3.epil, align 8, !tbaa !5 %cmp4.epil = icmp eq i64 %10, 1 br i1 %cmp4.epil, label %if.then5.epil, label %for.end if.then5.epil: ; preds = %for.body.epil %add7.epil = add i64 %add6, %p.032.unr %arrayidx8.epil = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add7.epil %11 = load i64, ptr %arrayidx8.epil, align 8, !tbaa !5 %add9.epil = add nsw i64 %11, %sum.033.unr br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then5.epil, %for.body.epil, %if.then %sum.0.lcssa = phi i64 [ %add, %if.then ], [ %sum.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add9.epil, %if.then5.epil ], [ %sum.033.unr, %for.body.epil ] %12 = load i64, ptr @l, align 8, !tbaa !5 %cmp10.not = icmp slt i64 %sum.0.lcssa, %12 %13 = load i64, ptr @r, align 8 %cmp11.not = icmp sgt i64 %sum.0.lcssa, %13 %or.cond = select i1 %cmp10.not, i1 true, i1 %cmp11.not br i1 %or.cond, label %if.end19, label %if.then12 if.then12: ; preds = %for.end %14 = load i64, ptr @ans, align 8, !tbaa !5 %inc13 = add nsw i64 %14, 1 store i64 %inc13, ptr @ans, align 8, !tbaa !5 br label %if.end19 if.else: ; preds = %entry, %if.else %now.tr30 = phi i64 [ %add16, %if.else ], [ %now, %entry ] %arrayidx15 = getelementptr inbounds [15 x i64], ptr @c, i64 0, i64 %now.tr30 store i64 0, ptr %arrayidx15, align 8, !tbaa !5 %add16 = add nsw i64 %now.tr30, 1 tail call void @bit(i64 noundef %add16) store i64 1, ptr %arrayidx15, align 8, !tbaa !5 %15 = load i64, ptr @z, align 8, !tbaa !5 %cmp = icmp eq i64 %15, %add16 br i1 %cmp, label %if.then, label %if.else if.end19: ; preds = %for.end, %if.then12 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @l, ptr noundef nonnull @r, ptr noundef nonnull @x) %0 = load i64, ptr @n, align 8, !tbaa !5 %cmp75 = icmp sgt i64 %0, 0 br i1 %cmp75, label %for.body, label %for.cond22.preheader.thread for.cond22.preheader.thread: ; preds = %entry store i64 0, ptr @i, align 8, !tbaa !5 br label %for.end53 for.cond2.preheader: ; preds = %for.body %cmp380 = icmp sgt i64 %1, 1 br i1 %cmp380, label %for.body7.preheader, label %for.cond22.preheader for.body: ; preds = %entry, %for.body %p.076 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %p.076 %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %p.076, 1 %1 = load i64, ptr @n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11 for.cond2.loopexit.unr-lcssa: ; preds = %for.inc17.1, %for.body7.preheader %.unr = phi i64 [ %.pre, %for.body7.preheader ], [ %10, %for.inc17.1 ] %q.078.unr = phi i64 [ 0, %for.body7.preheader ], [ %add.1, %for.inc17.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond2.loopexit, label %for.body7.epil for.body7.epil: ; preds = %for.cond2.loopexit.unr-lcssa %add.epil = add nuw nsw i64 %q.078.unr, 1 %arrayidx9.epil = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add.epil %2 = load i64, ptr %arrayidx9.epil, align 8, !tbaa !5 %cmp10.epil = icmp sgt i64 %.unr, %2 br i1 %cmp10.epil, label %if.then.epil, label %for.cond2.loopexit if.then.epil: ; preds = %for.body7.epil %arrayidx8.epil = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %q.078.unr store i64 %2, ptr %arrayidx8.epil, align 8, !tbaa !5 store i64 %.unr, ptr %arrayidx9.epil, align 8, !tbaa !5 br label %for.cond2.loopexit for.cond2.loopexit: ; preds = %for.body7.epil, %if.then.epil, %for.cond2.loopexit.unr-lcssa %cmp3 = icmp sgt i64 %p.181.in, 2 %indvar.next = add i64 %indvar, 1 br i1 %cmp3, label %for.body7.preheader, label %for.cond22.preheader, !llvm.loop !12 for.body7.preheader: ; preds = %for.cond2.preheader, %for.cond2.loopexit %indvar = phi i64 [ %indvar.next, %for.cond2.loopexit ], [ 0, %for.cond2.preheader ] %p.181.in = phi i64 [ %p.181, %for.cond2.loopexit ], [ %1, %for.cond2.preheader ] %3 = xor i64 %indvar, -1 %4 = add i64 %1, %3 %smax = tail call i64 @llvm.smax.i64(i64 %4, i64 1) %p.181 = add nsw i64 %p.181.in, -1 %.pre = load i64, ptr @a, align 16, !tbaa !5 %xtraiter = and i64 %smax, 1 %5 = icmp slt i64 %4, 2 br i1 %5, label %for.cond2.loopexit.unr-lcssa, label %for.body7.preheader.new for.body7.preheader.new: ; preds = %for.body7.preheader %unroll_iter = and i64 %smax, 9223372036854775806 br label %for.body7 for.cond22.preheader: ; preds = %for.cond2.loopexit, %for.cond2.preheader store i64 0, ptr @i, align 8, !tbaa !5 %cmp2387 = icmp sgt i64 %1, 0 br i1 %cmp2387, label %for.cond26.preheader, label %for.end53 for.body7: ; preds = %for.inc17.1, %for.body7.preheader.new %6 = phi i64 [ %.pre, %for.body7.preheader.new ], [ %10, %for.inc17.1 ] %q.078 = phi i64 [ 0, %for.body7.preheader.new ], [ %add.1, %for.inc17.1 ] %niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.inc17.1 ] %add = or i64 %q.078, 1 %arrayidx9 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add %7 = load i64, ptr %arrayidx9, align 8, !tbaa !5 %cmp10 = icmp sgt i64 %6, %7 br i1 %cmp10, label %if.then, label %for.inc17 if.then: ; preds = %for.body7 %arrayidx8 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %q.078 store i64 %7, ptr %arrayidx8, align 16, !tbaa !5 store i64 %6, ptr %arrayidx9, align 8, !tbaa !5 br label %for.inc17 for.inc17: ; preds = %for.body7, %if.then %8 = phi i64 [ %7, %for.body7 ], [ %6, %if.then ] %add.1 = add nuw nsw i64 %q.078, 2 %arrayidx9.1 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add.1 %9 = load i64, ptr %arrayidx9.1, align 16, !tbaa !5 %cmp10.1 = icmp sgt i64 %8, %9 br i1 %cmp10.1, label %if.then.1, label %for.inc17.1 if.then.1: ; preds = %for.inc17 %arrayidx8.1 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %add store i64 %9, ptr %arrayidx8.1, align 8, !tbaa !5 store i64 %8, ptr %arrayidx9.1, align 16, !tbaa !5 br label %for.inc17.1 for.inc17.1: ; preds = %if.then.1, %for.inc17 %10 = phi i64 [ %9, %for.inc17 ], [ %8, %if.then.1 ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.cond2.loopexit.unr-lcssa, label %for.body7, !llvm.loop !13 for.cond26.preheader: ; preds = %for.cond22.preheader, %for.inc51 %11 = phi i64 [ %24, %for.inc51 ], [ %1, %for.cond22.preheader ] %.pre91 = phi i64 [ %inc52.pre-phi, %for.inc51 ], [ 0, %for.cond22.preheader ] %storemerge7483 = add nsw i64 %.pre91, 1 store i64 %storemerge7483, ptr @j, align 8, !tbaa !5 %cmp2784 = icmp slt i64 %storemerge7483, %11 br i1 %cmp2784, label %for.body28.preheader, label %for.inc51 for.body28.preheader: ; preds = %for.cond26.preheader %.pre93 = load i64, ptr @x, align 8, !tbaa !5 br label %for.body28 for.body28: ; preds = %for.body28.preheader, %for.inc48 %12 = phi i64 [ %19, %for.inc48 ], [ %11, %for.body28.preheader ] %13 = phi i64 [ %20, %for.inc48 ], [ %11, %for.body28.preheader ] %14 = phi i64 [ %22, %for.inc48 ], [ %.pre93, %for.body28.preheader ] %15 = phi i64 [ %23, %for.inc48 ], [ %.pre91, %for.body28.preheader ] %storemerge7486 = phi i64 [ %storemerge74, %for.inc48 ], [ %storemerge7483, %for.body28.preheader ] %storemerge74.in85 = phi i64 [ %21, %for.inc48 ], [ %.pre91, %for.body28.preheader ] %arrayidx29 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %storemerge7486 %16 = load i64, ptr %arrayidx29, align 8, !tbaa !5 %arrayidx30 = getelementptr inbounds [30 x i64], ptr @a, i64 0, i64 %15 %17 = load i64, ptr %arrayidx30, align 8, !tbaa !5 %sub31 = sub nsw i64 %16, %17 %cmp32.not = icmp slt i64 %sub31, %14 br i1 %cmp32.not, label %for.inc48, label %land.lhs.true land.lhs.true: ; preds = %for.body28 %add35 = add nsw i64 %17, %16 %18 = load i64, ptr @r, align 8, !tbaa !5 %cmp36.not = icmp sgt i64 %add35, %18 br i1 %cmp36.not, label %for.inc48, label %for.body40.preheader for.body40.preheader: ; preds = %land.lhs.true tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) @c, i8 0, i64 120, i1 false), !tbaa !5 %sub46 = sub i64 %storemerge74.in85, %15 store i64 %sub46, ptr @z, align 8, !tbaa !5 tail call void @bit(i64 noundef 0) %.pre90 = load i64, ptr @i, align 8, !tbaa !5 %.pre92 = load i64, ptr @x, align 8, !tbaa !5 %.pre94 = load i64, ptr @j, align 8, !tbaa !5 %.pre95 = load i64, ptr @n, align 8, !tbaa !5 br label %for.inc48 for.inc48: ; preds = %for.body28, %land.lhs.true, %for.body40.preheader %19 = phi i64 [ %12, %for.body28 ], [ %12, %land.lhs.true ], [ %.pre95, %for.body40.preheader ] %20 = phi i64 [ %13, %for.body28 ], [ %13, %land.lhs.true ], [ %.pre95, %for.body40.preheader ] %21 = phi i64 [ %storemerge7486, %for.body28 ], [ %storemerge7486, %land.lhs.true ], [ %.pre94, %for.body40.preheader ] %22 = phi i64 [ %14, %for.body28 ], [ %14, %land.lhs.true ], [ %.pre92, %for.body40.preheader ] %23 = phi i64 [ %15, %for.body28 ], [ %15, %land.lhs.true ], [ %.pre90, %for.body40.preheader ] %storemerge74 = add nsw i64 %21, 1 store i64 %storemerge74, ptr @j, align 8, !tbaa !5 %cmp27 = icmp slt i64 %storemerge74, %20 br i1 %cmp27, label %for.body28, label %for.inc51.loopexit, !llvm.loop !14 for.inc51.loopexit: ; preds = %for.inc48 %.pre96 = add nsw i64 %23, 1 br label %for.inc51 for.inc51: ; preds = %for.inc51.loopexit, %for.cond26.preheader %inc52.pre-phi = phi i64 [ %.pre96, %for.inc51.loopexit ], [ %storemerge7483, %for.cond26.preheader ] %24 = phi i64 [ %19, %for.inc51.loopexit ], [ %11, %for.cond26.preheader ] store i64 %inc52.pre-phi, ptr @i, align 8, !tbaa !5 %cmp23 = icmp slt i64 %inc52.pre-phi, %24 br i1 %cmp23, label %for.cond26.preheader, label %for.end53, !llvm.loop !15 for.end53: ; preds = %for.inc51, %for.cond22.preheader.thread, %for.cond22.preheader %25 = load i64, ptr @ans, align 8, !tbaa !5 %call54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %25) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> int main(void) { int a; scanf("%d",&a); printf("%d",a+a*a+a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129553/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129553/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(int argc, char *argv[]){ int a, ans; scanf("%d",&a); //aの値を定義 ans = a + a*a + a*a*a; printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129603/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129603/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a; scanf("%d",&a); printf("%d\n",a+a*a+a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129647/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129647/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,a2,a3; scanf("%d",&a); a2=a*a; a3=a*a*a; printf("%d\n",a+a2+a3); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129690/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129690/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %mul2 = mul nsw i32 %mul, %0 %add = add nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a; scanf("%d",&a); printf("%d\n",a+a*a+a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129733/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129733/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) 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(void) { int a; scanf("%d", &a); printf("%d\n",a+a*a+a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129777/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129777/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) 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> typedef long long ll; ll b[3000005]; int main() { ll x; int a; ll ans = 0LL; memset(b, 0, sizeof b); scanf("%I64d", &x); x *= 6LL; for (a = 1; a <= 3000000; a++) { ll aa = a * (a + 1LL); if (x % aa != 0LL) continue; ll rr = x / aa; ll mm = rr + a - 1LL; if (mm % 3LL == 0LL) { ll m = mm / 3LL; if (m > a) { b[a] = m; ans += 2LL; } else if (m == a) { b[a] = m; ans++; } } } printf("%I64d\n", ans); for (a = 1; a <= 3000000; a++) if (b[a]) printf("%d %I64d\n", a, b[a]); for (a = 3000000; a >= 1; a--) if (b[a] > 0LL && a != b[a]) printf("%I64d %d\n", b[a], a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12982/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12982/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @b = dso_local local_unnamed_addr global [3000005 x i64] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"%I64d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %I64d\0A\00", align 1 @.str.3 = private unnamed_addr constant [10 x i8] c"%I64d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24000040) @b, i8 0, i64 24000040, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i64, ptr %x, align 8, !tbaa !5 %mul = mul nsw i64 %0, 6 store i64 %mul, ptr %x, align 8, !tbaa !5 br label %for.body for.body: ; preds = %entry, %cleanup %indvars.iv = phi i64 [ 1, %entry ], [ %add, %cleanup ] %ans.093 = phi i64 [ 0, %entry ], [ %ans.3, %cleanup ] %add = add nuw nsw i64 %indvars.iv, 1 %mul2 = mul nuw nsw i64 %add, %indvars.iv %rem = srem i64 %mul, %mul2 %div = sdiv i64 %mul, %mul2 %cmp3.not = icmp eq i64 %rem, 0 br i1 %cmp3.not, label %if.end, label %cleanup if.end: ; preds = %for.body %add6 = add nsw i64 %indvars.iv, -1 %sub = add i64 %add6, %div %rem7 = srem i64 %sub, 3 %div11 = sdiv i64 %sub, 3 %cmp8 = icmp eq i64 %rem7, 0 br i1 %cmp8, label %if.then10, label %cleanup if.then10: ; preds = %if.end %cmp13 = icmp sgt i64 %div11, %indvars.iv br i1 %cmp13, label %cleanup.sink.split, label %if.else if.else: ; preds = %if.then10 %cmp18 = icmp eq i64 %div11, %indvars.iv br i1 %cmp18, label %cleanup.sink.split, label %cleanup cleanup.sink.split: ; preds = %if.else, %if.then10 %indvars.iv.sink = phi i64 [ %div11, %if.then10 ], [ %indvars.iv, %if.else ] %.sink = phi i64 [ 2, %if.then10 ], [ 1, %if.else ] %arrayidx22 = getelementptr inbounds [3000005 x i64], ptr @b, i64 0, i64 %indvars.iv store i64 %indvars.iv.sink, ptr %arrayidx22, align 8, !tbaa !5 %inc = add nsw i64 %ans.093, %.sink br label %cleanup cleanup: ; preds = %cleanup.sink.split, %if.end, %if.else, %for.body %ans.3 = phi i64 [ %ans.093, %for.body ], [ %ans.093, %if.end ], [ %ans.093, %if.else ], [ %inc, %cleanup.sink.split ] %exitcond.not = icmp eq i64 %add, 3000001 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %cleanup %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.3) br label %for.body31 for.body31: ; preds = %for.end, %for.inc39 %indvars.iv98 = phi i64 [ 1, %for.end ], [ %indvars.iv.next99, %for.inc39 ] %arrayidx33 = getelementptr inbounds [3000005 x i64], ptr @b, i64 0, i64 %indvars.iv98 %1 = load i64, ptr %arrayidx33, align 8, !tbaa !5 %tobool.not = icmp eq i64 %1, 0 br i1 %tobool.not, label %for.inc39, label %if.then34 if.then34: ; preds = %for.body31 %2 = trunc i64 %indvars.iv98 to i32 %call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2, i64 noundef %1) br label %for.inc39 for.inc39: ; preds = %for.body31, %if.then34 %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %exitcond101.not = icmp eq i64 %indvars.iv.next99, 3000001 br i1 %exitcond101.not, label %for.body45, label %for.body31, !llvm.loop !11 for.body45: ; preds = %for.inc39, %for.inc60 %indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.inc60 ], [ 3000000, %for.inc39 ] %arrayidx47 = getelementptr inbounds [3000005 x i64], ptr @b, i64 0, i64 %indvars.iv102 %3 = load i64, ptr %arrayidx47, align 8, !tbaa !5 %cmp48 = icmp slt i64 %3, 1 %cmp53.not = icmp eq i64 %3, %indvars.iv102 %or.cond = or i1 %cmp48, %cmp53.not br i1 %or.cond, label %for.inc60, label %if.then55 if.then55: ; preds = %for.body45 %4 = trunc i64 %indvars.iv102 to i32 %call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %3, i32 noundef %4) br label %for.inc60 for.inc60: ; preds = %for.body45, %if.then55 %indvars.iv.next103 = add nsw i64 %indvars.iv102, -1 %cmp43 = icmp ugt i64 %indvars.iv102, 1 br i1 %cmp43, label %for.body45, label %for.end61, !llvm.loop !12 for.end61: ; preds = %for.inc60 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main() { int a; scanf("%d",&a); printf("%d\n",a+a*a+a*a*a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129863/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129863/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <ctype.h> #define SIZE 100005 #define PI acosl(-1) //3.14159265358979323846264338327950L #define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転 #define array(N, t) (t*)calloc(N, sizeof(t)) //t型N要素の1次元配列を動的確保後0クリア(freeを忘れずに) #define zero(a); {int iter; rep(iter, sizeof(a)/sizeof((a)[0])) (a)[iter]=0;} //1次元配列aのゼロ初期化? #define Sort(a, t) qsort(a, sizeof(a)/sizeof((a)[0]), sizeof(t), comp) //compを使って1次元配列をソート typedef long long ll; typedef long double ld; typedef struct node { int data; struct node *next; } Node; Node *list[SIZE]; int queue[SIZE]; int q_head = 0, q_tail = 0; void print_log(); //とりあえず文字を出力してどこまで実行できているか確認(for debug) void printa_int(int *a, int size); //int型の1次元配列aを出力(for debug) void printl_int(int size); //リンクリストを出力(for debug) int comp(const void *a, const void *b); //昇順並び替えに使う比較関数 Node* add_node(int i, int data); void free_list(Node* head); int queue_empty(); int queue_full(); void enqueue(int data); int dequeue(); ll* factorize(ll N); //Nを素因数分解、得られる配列は素因数,指数,素因数,…となっている(添字はintで指定する必要あり?) void check_factorization(ll *fact); //素因数分解を表示(for debug) int main() { int a; scanf("%d", &a); printf("%d\n", a + a * a + a * a * a); return 0; } void print_log() { printf("=== print log ===\n"); } void printa_int(int *a, int size) { int i; printf("["); for (i = 0; i < size; i++) printf("%d, ", a[i]); printf("]\n"); } void printl_int(int size) { int i; Node *t; rep(i, size) { printf("[%d] ", i); for (t = list[i]; t; t = t->next) printf("%d, ", t->data); printf("\n"); } } int comp(const void *a, const void *b) { return *(int*)a - *(int*)b; } Node* add_node(int i, int data) { if (!list[i]) { list[i] = (Node*)malloc(sizeof(Node*)); list[i]->data = data; } else { Node *t; t = list[i]; list[i] = (Node*)malloc(sizeof(Node*)); list[i]->data = data; list[i]->next = t; } return list[i]; } void free_list(Node* head) { Node *prev = NULL, *t = head; while (t) { prev = t; t = t->next; free(prev); } } int queue_empty() { return q_head == q_tail; } int queue_full() { return (q_head - 1) % SIZE == q_tail % SIZE; } void enqueue(int data) { if (queue_full()) { printf("full!\n"); return; } queue[q_tail++] = data; q_tail %= SIZE; } int dequeue() { if (queue_empty()) { printf("empty!\n"); return -444444; } int data = queue[q_head++]; q_head %= SIZE; return data; } ll* factorize(ll N) { ll *res = array(((sqrt(N) + 1) * 2), ll); ll i, x = N; int count = 0; for (i = 2; i * i <= N; i++) { ll e = 0; while (x % i == 0) { x /= i; e++; } if (e > 0) { res[count * 2] = i; res[count * 2 + 1] = e; count++; } } if (x > 1) { res[count * 2] = x; res[count * 2 + 1] = 1; } return res; } void check_factorization(ll *fact) { int i = 1; printf("%lld^%lld", fact[0], fact[1]); while (fact[i * 2] > 0) { printf(" * %lld^%lld", fact[i * 2], fact[i * 2 + 1]); i++; } printf("\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129906/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129906/source.c" target datalayout = "e-m:e-p270: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.node = type { i32, ptr } @q_head = dso_local local_unnamed_addr global i32 0, align 4 @q_tail = dso_local local_unnamed_addr 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 @.str.4 = private unnamed_addr constant [5 x i8] c"%d, \00", align 1 @.str.6 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1 @list = dso_local local_unnamed_addr global [100005 x ptr] zeroinitializer, align 16 @queue = dso_local local_unnamed_addr global [100005 x i32] zeroinitializer, align 16 @.str.10 = private unnamed_addr constant [10 x i8] c"%lld^%lld\00", align 1 @.str.11 = private unnamed_addr constant [13 x i8] c" * %lld^%lld\00", align 1 @str = private unnamed_addr constant [18 x i8] c"=== print log ===\00", align 1 @str.12 = private unnamed_addr constant [2 x i8] c"]\00", align 1 @str.13 = private unnamed_addr constant [6 x i8] c"full!\00", align 1 @str.14 = private unnamed_addr constant [7 x i8] c"empty!\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #13 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %0, %0 %add = add nsw i32 %mul, %0 %mul2 = mul nsw i32 %mul, %0 %add3 = add nsw i32 %add, %mul2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #13 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(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 uwtable define dso_local void @print_log() local_unnamed_addr #0 { entry: %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printa_int(ptr nocapture noundef readonly %a, i32 noundef %size) local_unnamed_addr #0 { entry: %putchar = tail call i32 @putchar(i32 91) %cmp5 = icmp sgt i32 %size, 0 br i1 %cmp5, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size 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 ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %0) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.12) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printl_int(i32 noundef %size) local_unnamed_addr #0 { entry: %cmp15 = icmp sgt i32 %size, 0 br i1 %cmp15, label %for.body.preheader, label %for.end6 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %size to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.end %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.end ] %0 = trunc i64 %indvars.iv to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %0) %arrayidx = getelementptr inbounds [100005 x ptr], ptr @list, i64 0, i64 %indvars.iv %t.012 = load ptr, ptr %arrayidx, align 8, !tbaa !11 %tobool.not13 = icmp eq ptr %t.012, null br i1 %tobool.not13, label %for.end, label %for.body2 for.body2: ; preds = %for.body, %for.body2 %t.014 = phi ptr [ %t.0, %for.body2 ], [ %t.012, %for.body ] %1 = load i32, ptr %t.014, align 8, !tbaa !13 %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %1) %next = getelementptr inbounds %struct.node, ptr %t.014, i64 0, i32 1 %t.0 = load ptr, ptr %next, align 8, !tbaa !11 %tobool.not = icmp eq ptr %t.0, null br i1 %tobool.not, label %for.end, label %for.body2, !llvm.loop !15 for.end: ; preds = %for.body2, %for.body %putchar = tail call i32 @putchar(i32 10) %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.end6, label %for.body, !llvm.loop !16 for.end6: ; preds = %for.end, %entry ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, argmem: none) uwtable define dso_local ptr @add_node(i32 noundef %i, i32 noundef %data) local_unnamed_addr #4 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [100005 x ptr], ptr @list, i64 0, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !11 %tobool.not = icmp eq ptr %0, null %call = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #14 br i1 %tobool.not, label %if.then, label %if.else if.then: ; preds = %entry store i32 %data, ptr %call, align 8, !tbaa !13 br label %if.end if.else: ; preds = %entry %next = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1 store ptr %0, ptr %next, align 8, !tbaa !17 br label %if.end if.end: ; preds = %if.else, %if.then store ptr %call, ptr %arrayidx, align 8 ret ptr %call } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5 ; Function Attrs: nounwind uwtable define dso_local void @free_list(ptr noundef %head) local_unnamed_addr #6 { entry: %tobool.not3 = icmp eq ptr %head, null br i1 %tobool.not3, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %t.04 = phi ptr [ %0, %while.body ], [ %head, %entry ] %next = getelementptr inbounds %struct.node, ptr %t.04, i64 0, i32 1 %0 = load ptr, ptr %next, align 8, !tbaa !17 tail call void @free(ptr noundef nonnull %t.04) #13 %tobool.not = icmp eq ptr %0, null br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %while.body, %entry ret void } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @queue_empty() local_unnamed_addr #8 { entry: %0 = load i32, ptr @q_head, align 4, !tbaa !5 %1 = load i32, ptr @q_tail, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %1 %conv = zext i1 %cmp to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @queue_full() local_unnamed_addr #8 { entry: %0 = load i32, ptr @q_head, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %rem = srem i32 %sub, 100005 %1 = load i32, ptr @q_tail, align 4, !tbaa !5 %rem1 = srem i32 %1, 100005 %cmp = icmp eq i32 %rem, %rem1 %conv = zext i1 %cmp to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @enqueue(i32 noundef %data) local_unnamed_addr #0 { entry: %0 = load i32, ptr @q_head, align 4, !tbaa !5 %sub.i = add nsw i32 %0, -1 %rem.i = srem i32 %sub.i, 100005 %1 = load i32, ptr @q_tail, align 4, !tbaa !5 %rem1.i = srem i32 %1, 100005 %cmp.i.not = icmp eq i32 %rem.i, %rem1.i br i1 %cmp.i.not, label %if.then, label %if.end if.then: ; preds = %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.13) br label %return if.end: ; preds = %entry %inc = add nsw i32 %1, 1 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [100005 x i32], ptr @queue, i64 0, i64 %idxprom store i32 %data, ptr %arrayidx, align 4, !tbaa !5 %rem = srem i32 %inc, 100005 store i32 %rem, ptr @q_tail, align 4, !tbaa !5 br label %return return: ; preds = %if.end, %if.then ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @dequeue() local_unnamed_addr #0 { entry: %0 = load i32, ptr @q_head, align 4, !tbaa !5 %1 = load i32, ptr @q_tail, align 4, !tbaa !5 %cmp.i.not = icmp eq i32 %0, %1 br i1 %cmp.i.not, label %if.then, label %if.end if.then: ; preds = %entry %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.14) br label %return if.end: ; preds = %entry %inc = add nsw i32 %0, 1 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x i32], ptr @queue, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %rem = srem i32 %inc, 100005 store i32 %rem, ptr @q_head, align 4, !tbaa !5 br label %return return: ; preds = %if.end, %if.then %retval.0 = phi i32 [ -444444, %if.then ], [ %2, %if.end ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind memory(write, inaccessiblemem: readwrite) uwtable define dso_local noalias ptr @factorize(i64 noundef %N) local_unnamed_addr #9 { entry: %conv = sitofp i64 %N to double %call = tail call double @sqrt(double noundef %conv) #13 %add = fadd double %call, 1.000000e+00 %mul = fmul double %add, 2.000000e+00 %conv1 = fptoui double %mul to i64 %call2 = tail call noalias ptr @calloc(i64 noundef %conv1, i64 noundef 8) #15 %cmp.not52 = icmp slt i64 %N, 4 br i1 %cmp.not52, label %for.end, label %while.cond.preheader while.cond.preheader: ; preds = %entry, %if.end %count.055 = phi i32 [ %count.1, %if.end ], [ 0, %entry ] %x.054 = phi i64 [ %x.1.lcssa61, %if.end ], [ %N, %entry ] %i.053 = phi i64 [ %inc15, %if.end ], [ 2, %entry ] %rem47 = srem i64 %x.054, %i.053 %cmp548 = icmp eq i64 %rem47, 0 br i1 %cmp548, label %while.body, label %if.end while.body: ; preds = %while.cond.preheader, %while.body %e.050 = phi i64 [ %inc, %while.body ], [ 0, %while.cond.preheader ] %x.149 = phi i64 [ %div, %while.body ], [ %x.054, %while.cond.preheader ] %div = sdiv i64 %x.149, %i.053 %inc = add nuw nsw i64 %e.050, 1 %rem = srem i64 %div, %i.053 %cmp5 = icmp eq i64 %rem, 0 br i1 %cmp5, label %while.body, label %if.then, !llvm.loop !19 if.then: ; preds = %while.body %mul9 = shl nsw i32 %count.055, 1 %idxprom = sext i32 %mul9 to i64 %arrayidx = getelementptr inbounds i64, ptr %call2, i64 %idxprom store i64 %i.053, ptr %arrayidx, align 8, !tbaa !20 %add11 = or i32 %mul9, 1 %idxprom12 = sext i32 %add11 to i64 %arrayidx13 = getelementptr inbounds i64, ptr %call2, i64 %idxprom12 store i64 %inc, ptr %arrayidx13, align 8, !tbaa !20 %inc14 = add nsw i32 %count.055, 1 br label %if.end if.end: ; preds = %while.cond.preheader, %if.then %x.1.lcssa61 = phi i64 [ %div, %if.then ], [ %x.054, %while.cond.preheader ] %count.1 = phi i32 [ %inc14, %if.then ], [ %count.055, %while.cond.preheader ] %inc15 = add nuw nsw i64 %i.053, 1 %mul3 = mul nsw i64 %inc15, %inc15 %cmp.not = icmp sgt i64 %mul3, %N br i1 %cmp.not, label %for.end.loopexit, label %while.cond.preheader, !llvm.loop !22 for.end.loopexit: ; preds = %if.end %0 = shl nsw i32 %count.1, 1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %x.0.lcssa = phi i64 [ %N, %entry ], [ %x.1.lcssa61, %for.end.loopexit ] %count.0.lcssa = phi i32 [ 0, %entry ], [ %0, %for.end.loopexit ] %cmp16 = icmp sgt i64 %x.0.lcssa, 1 br i1 %cmp16, label %if.then18, label %if.end26 if.then18: ; preds = %for.end %idxprom20 = sext i32 %count.0.lcssa to i64 %arrayidx21 = getelementptr inbounds i64, ptr %call2, i64 %idxprom20 store i64 %x.0.lcssa, ptr %arrayidx21, align 8, !tbaa !20 %add23 = or i32 %count.0.lcssa, 1 %idxprom24 = sext i32 %add23 to i64 %arrayidx25 = getelementptr inbounds i64, ptr %call2, i64 %idxprom24 store i64 1, ptr %arrayidx25, align 8, !tbaa !20 br label %if.end26 if.end26: ; preds = %if.then18, %for.end ret ptr %call2 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #10 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #11 ; Function Attrs: nofree nounwind uwtable define dso_local void @check_factorization(ptr nocapture noundef readonly %fact) local_unnamed_addr #0 { entry: %0 = load i64, ptr %fact, align 8, !tbaa !20 %arrayidx1 = getelementptr inbounds i64, ptr %fact, i64 1 %1 = load i64, ptr %arrayidx1, align 8, !tbaa !20 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef %0, i64 noundef %1) %arrayidx218 = getelementptr inbounds i64, ptr %fact, i64 2 %2 = load i64, ptr %arrayidx218, align 8, !tbaa !20 %cmp19 = icmp sgt i64 %2, 0 br i1 %cmp19, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 1, %entry ] %3 = phi i64 [ %6, %while.body ], [ %2, %entry ] %mul21 = phi i32 [ %mul, %while.body ], [ 2, %entry ] %add = or i32 %mul21, 1 %idxprom7 = zext i32 %add to i64 %arrayidx8 = getelementptr inbounds i64, ptr %fact, i64 %idxprom7 %4 = load i64, ptr %arrayidx8, align 8, !tbaa !20 %call9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i64 noundef %3, i64 noundef %4) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %5 = trunc i64 %indvars.iv.next to i32 %mul = shl nuw nsw i32 %5, 1 %idxprom = zext i32 %mul to i64 %arrayidx2 = getelementptr inbounds i64, ptr %fact, i64 %idxprom %6 = load i64, ptr %arrayidx2, align 8, !tbaa !20 %cmp = icmp sgt i64 %6, 0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !23 while.end: ; preds = %while.body, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #12 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(readwrite, argmem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { 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 #9 = { nofree nounwind memory(write, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { 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 #12 = { nofree nounwind } attributes #13 = { nounwind } attributes #14 = { nounwind allocsize(0) } attributes #15 = { nounwind allocsize(0,1) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"any pointer", !7, i64 0} !13 = !{!14, !6, i64 0} !14 = !{!"node", !6, i64 0, !12, i64 8} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = !{!14, !12, i64 8} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = !{!21, !21, i64 0} !21 = !{!"long long", !7, i64 0} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10}
#include <stdio.h> #define MAX 400000 int N, K; int P[MAX]; int sumipe[MAX]; int asumikana[MAX * 2]; int isidaakira[MAX * 2]; int kitamuraeri; int mizuhasu(int idx, int kleft, int kright, int sleft, int sright, int is_saidai) { /* 完全に関係ない */ /*printf("%d %d %d %d\n", kleft, kright, sleft, sright);*/ if (sright <= kleft || kright <= sleft) { /*puts("ignore");*/ return is_saidai ? -1 : N; } /* 完全に含まれる */ if(kleft <= sleft && sright <= kright) { /*puts("all");*/ return (is_saidai ? asumikana : isidaakira)[idx]; } /* 一部含まれる */ { int mimorinn = (sleft + sright) / 2; int satorina = mizuhasu(idx * 2 + 1, kleft, kright, sleft, mimorinn, is_saidai); int morikubo = mizuhasu(idx * 2 + 2, kleft, kright, mimorinn, sright, is_saidai); /*printf("part %d %d\n", satorina, morikubo);*/ return (is_saidai ? satorina > morikubo : satorina < morikubo) ? satorina : morikubo; } } /* [left, right) */ int saidaiti(int left, int right) { return mizuhasu(0, left, right, 0, kitamuraeri, 1); } int saisyouti(int left, int right) { return mizuhasu(0, left, right, 0, kitamuraeri, 0); } #if 0 int hayamin[MAX]; int yosinagasayuri; void syokika(void) { int i; for (i = 0; i < N; i++) { hayamin[i] = i; } } int ne(int a) { if (hayamin[a] == a) return a; yosinagasayuri++; return hayamin[a] = ne(hayamin[a]); } void matomeru(int a, int b) { int ne_a, ne_b, yakusimaruhiroko; yosinagasayuri = 0; ne_a = ne(a); yakusimaruhiroko = yosinagasayuri; yosinagasayuri = 0; ne_b = ne(b); if (yosinagasayuri < yakusimaruhiroko) { hayamin[ne_b] = ne_a; } else { hayamin[ne_a] = ne_b; } } int onazi(int a, int b) { int ne_a = ne(a); int ne_b = ne(b); return ne_a == ne_b; } #endif int main(void) { int i; int sasakikotoko; int minaseinori; if (scanf("%d%d", &N, &K) != 2) return 1; for (i = 0; i < N; i++) { if (scanf("%d", &P[i]) != 1) return 1; } #if 0 syokika(); #endif for (kitamuraeri = 1; kitamuraeri < N; kitamuraeri <<= 1); for (i = 0; i < N; i++) { asumikana[kitamuraeri - 1 + i] = P[i]; isidaakira[kitamuraeri - 1 + i] = P[i]; } for (i = N; i < kitamuraeri; i++) { asumikana[kitamuraeri - 1 + i] = -1; isidaakira[kitamuraeri - 1 + i] = N; } for (i = kitamuraeri - 1; i >= 0; i--) { int mizukinana = asumikana[i * 2 + 1]; int horieyui = asumikana[i * 2 + 2]; int mareitaso = isidaakira[i * 2 + 1]; int tomatu = isidaakira[i * 2 + 2]; asumikana[i] = mizukinana > horieyui ? mizukinana : horieyui; isidaakira[i] = mareitaso < tomatu ? mareitaso : tomatu; } sasakikotoko = N - K + 1; /* 昇順に並んでいる数を数える */ sumipe[0] = 1; for (i = 1; i < N; i++) { if (P[i - 1] < P[i]) { sumipe[i] = sumipe[i - 1] + 1; } else { sumipe[i] = 1; } } /* 操作が意味ない場所の分を減らす */ minaseinori = 0; for (i = 0; i < N; i++) { if (sumipe[i] >= K) { if (minaseinori) { sasakikotoko--; } else { minaseinori = 1; } } } /* K+1個の列の一番左が最小値、かつ一番右が最大値なら、1ずらしても結果が変わらない */ for (i = K + 1; i <= N; i++) { /*printf("%d %d %d %d\n", P[i - (K+1)], saisyouti(i - (K+1), i), P[i - 1], saidaiti(i - (K+1), i));*/ if (P[i - (K+1)] == saisyouti(i - (K+1), i) && P[i - 1] == saidaiti(i - (K+1), i)) { /* すでに意味ないわけではない場合に限り、減らす */ if (sumipe[i - 2] < K || sumipe[i - 1] < K) { sasakikotoko--; } } } printf("%d\n", sasakikotoko); return 0; } /* 10 6 0 1 2 3 5 4 6 7 8 9 1だと思うが、5が出てしまう */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_129957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_129957/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @N = dso_local global i32 0, align 4 @asumikana = dso_local local_unnamed_addr global [800000 x i32] zeroinitializer, align 16 @isidaakira = dso_local local_unnamed_addr global [800000 x i32] zeroinitializer, align 16 @kitamuraeri = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @K = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @P = dso_local global [400000 x i32] zeroinitializer, align 16 @sumipe = dso_local local_unnamed_addr global [400000 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @mizuhasu(i32 noundef %idx, i32 noundef %kleft, i32 noundef %kright, i32 noundef %sleft, i32 noundef %sright, i32 noundef %is_saidai) local_unnamed_addr #0 { entry: %cmp.not = icmp sgt i32 %sright, %kleft %cmp1.not = icmp sgt i32 %kright, %sleft %or.cond = and i1 %cmp1.not, %cmp.not br i1 %or.cond, label %if.end, label %if.then if.then: ; preds = %entry %tobool.not = icmp eq i32 %is_saidai, 0 %0 = load i32, ptr @N, align 4 %cond = select i1 %tobool.not, i32 %0, i32 -1 br label %return if.end: ; preds = %entry %cmp2.not = icmp sgt i32 %kleft, %sleft %cmp3.not = icmp sgt i32 %sright, %kright %or.cond44 = or i1 %cmp2.not, %cmp3.not br i1 %or.cond44, label %if.end7, label %if.then4 if.then4: ; preds = %if.end %tobool5.not = icmp eq i32 %is_saidai, 0 %cond6 = select i1 %tobool5.not, ptr @isidaakira, ptr @asumikana %idxprom = sext i32 %idx to i64 %arrayidx = getelementptr inbounds i32, ptr %cond6, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 br label %return if.end7: ; preds = %if.end %add = add nsw i32 %sright, %sleft %div = sdiv i32 %add, 2 %mul = shl nsw i32 %idx, 1 %add8 = or i32 %mul, 1 %call = tail call i32 @mizuhasu(i32 noundef %add8, i32 noundef %kleft, i32 noundef %kright, i32 noundef %sleft, i32 noundef %div, i32 noundef %is_saidai) %add10 = add nsw i32 %mul, 2 %call11 = tail call i32 @mizuhasu(i32 noundef %add10, i32 noundef %kleft, i32 noundef %kright, i32 noundef %div, i32 noundef %sright, i32 noundef %is_saidai) %tobool12.not = icmp eq i32 %is_saidai, 0 br i1 %tobool12.not, label %cond.false15, label %cond.true13 cond.true13: ; preds = %if.end7 %cmp14 = icmp sgt i32 %call, %call11 br i1 %cmp14, label %return, label %cond.false18 cond.false15: ; preds = %if.end7 %cmp16 = icmp slt i32 %call, %call11 br i1 %cmp16, label %return, label %cond.false18 cond.false18: ; preds = %cond.false15, %cond.true13 br label %return return: ; preds = %cond.false18, %cond.false15, %cond.true13, %if.then4, %if.then %retval.0 = phi i32 [ %cond, %if.then ], [ %1, %if.then4 ], [ %call11, %cond.false18 ], [ %call, %cond.false15 ], [ %call, %cond.true13 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @saidaiti(i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %0 = load i32, ptr @kitamuraeri, align 4, !tbaa !5 %call = tail call i32 @mizuhasu(i32 noundef 0, i32 noundef %left, i32 noundef %right, i32 noundef 0, i32 noundef %0, i32 noundef 1) ret i32 %call } ; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable define dso_local i32 @saisyouti(i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %0 = load i32, ptr @kitamuraeri, align 4, !tbaa !5 %call = tail call i32 @mizuhasu(i32 noundef 0, i32 noundef %left, i32 noundef %right, i32 noundef 0, i32 noundef %0, i32 noundef 0) ret i32 %call } ; 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, ptr noundef nonnull @K) %cmp.not = icmp eq i32 %call, 2 br i1 %cmp.not, label %for.cond.preheader, label %cleanup for.cond.preheader: ; preds = %entry %0 = load i32, ptr @N, align 4, !tbaa !5 %cmp1200 = icmp sgt i32 %0, 0 br i1 %cmp1200, label %for.body, label %for.cond6.preheader for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp1, label %for.body, label %for.cond6.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond, %for.cond.preheader %.lcssa = phi i32 [ %0, %for.cond.preheader ], [ %1, %for.cond ] br label %for.cond6 for.body: ; preds = %for.cond.preheader, %for.cond %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %cmp3.not = icmp eq i32 %call2, 1 br i1 %cmp3.not, label %for.cond, label %cleanup for.cond6: ; preds = %for.cond6, %for.cond6.preheader %storemerge = phi i32 [ %shl, %for.cond6 ], [ 1, %for.cond6.preheader ] %cmp7 = icmp slt i32 %storemerge, %.lcssa %shl = shl i32 %storemerge, 1 br i1 %cmp7, label %for.cond6, label %for.cond11.preheader, !llvm.loop !11 for.cond11.preheader: ; preds = %for.cond6 store i32 %storemerge, ptr @kitamuraeri, align 4, !tbaa !5 %cmp12203 = icmp sgt i32 %.lcssa, 0 br i1 %cmp12203, label %for.body13.lr.ph, label %for.cond27.preheader for.body13.lr.ph: ; preds = %for.cond11.preheader %sub = add nsw i32 %storemerge, -1 %3 = sext i32 %sub to i64 %wide.trip.count = zext i32 %.lcssa to i64 %min.iters.check = icmp ult i32 %.lcssa, 8 br i1 %min.iters.check, label %for.body13.preheader, label %vector.ph vector.ph: ; preds = %for.body13.lr.ph %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 ] %4 = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 %wide.load259 = load <4 x i32>, ptr %5, align 16, !tbaa !5 %6 = add nsw i64 %index, %3 %7 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %6 store <4 x i32> %wide.load, ptr %7, align 4, !tbaa !5 %8 = getelementptr inbounds i32, ptr %7, i64 4 store <4 x i32> %wide.load259, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %6 store <4 x i32> %wide.load, ptr %9, align 4, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> %wide.load259, ptr %10, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond27.preheader, label %for.body13.preheader for.body13.preheader: ; preds = %for.body13.lr.ph, %middle.block %indvars.iv224.ph = phi i64 [ 0, %for.body13.lr.ph ], [ %n.vec, %middle.block ] br label %for.body13 for.cond27.preheader: ; preds = %for.body13, %middle.block, %for.cond11.preheader %cmp28205 = icmp slt i32 %.lcssa, %storemerge br i1 %cmp28205, label %for.body29.lr.ph, label %for.cond42.preheader for.body29.lr.ph: ; preds = %for.cond27.preheader %sub30 = add nsw i32 %storemerge, -1 %12 = sext i32 %.lcssa to i64 %13 = sext i32 %sub30 to i64 %wide.trip.count232 = sext i32 %storemerge to i64 %14 = sub nsw i64 %wide.trip.count232, %12 %min.iters.check262 = icmp ult i64 %14, 8 br i1 %min.iters.check262, label %for.body29.preheader, label %vector.ph263 vector.ph263: ; preds = %for.body29.lr.ph %n.vec265 = and i64 %14, -8 %ind.end = add nsw i64 %n.vec265, %12 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.lcssa, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body268 vector.body268: ; preds = %vector.body268, %vector.ph263 %index269 = phi i64 [ 0, %vector.ph263 ], [ %index.next270, %vector.body268 ] %offset.idx = add i64 %index269, %12 %15 = add nsw i64 %offset.idx, %13 %16 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %15 store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, ptr %16, align 4, !tbaa !5 %17 = getelementptr inbounds i32, ptr %16, i64 4 store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, ptr %17, align 4, !tbaa !5 %18 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %15 store <4 x i32> %broadcast.splat, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds i32, ptr %18, i64 4 store <4 x i32> %broadcast.splat, ptr %19, align 4, !tbaa !5 %index.next270 = add nuw i64 %index269, 8 %20 = icmp eq i64 %index.next270, %n.vec265 br i1 %20, label %middle.block260, label %vector.body268, !llvm.loop !15 middle.block260: ; preds = %vector.body268 %cmp.n267 = icmp eq i64 %14, %n.vec265 br i1 %cmp.n267, label %for.cond42.preheader, label %for.body29.preheader for.body29.preheader: ; preds = %for.body29.lr.ph, %middle.block260 %indvars.iv228.ph = phi i64 [ %12, %for.body29.lr.ph ], [ %ind.end, %middle.block260 ] br label %for.body29 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv224 = phi i64 [ %indvars.iv.next225, %for.body13 ], [ %indvars.iv224.ph, %for.body13.preheader ] %arrayidx15 = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %indvars.iv224 %21 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %22 = add nsw i64 %indvars.iv224, %3 %arrayidx17 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %22 store i32 %21, ptr %arrayidx17, align 4, !tbaa !5 %arrayidx23 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %22 store i32 %21, ptr %arrayidx23, align 4, !tbaa !5 %indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1 %exitcond.not = icmp eq i64 %indvars.iv.next225, %wide.trip.count br i1 %exitcond.not, label %for.cond27.preheader, label %for.body13, !llvm.loop !16 for.cond42.preheader: ; preds = %for.body29, %middle.block260, %for.cond27.preheader %cmp43207 = icmp sgt i32 %storemerge, 0 br i1 %cmp43207, label %for.body44.preheader, label %for.end71 for.body44.preheader: ; preds = %for.cond42.preheader %23 = zext i32 %storemerge to i64 br label %for.body44 for.body29: ; preds = %for.body29.preheader, %for.body29 %indvars.iv228 = phi i64 [ %indvars.iv.next229, %for.body29 ], [ %indvars.iv228.ph, %for.body29.preheader ] %24 = add nsw i64 %indvars.iv228, %13 %arrayidx33 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %24 store i32 -1, ptr %arrayidx33, align 4, !tbaa !5 %arrayidx37 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %24 store i32 %.lcssa, ptr %arrayidx37, align 4, !tbaa !5 %indvars.iv.next229 = add nsw i64 %indvars.iv228, 1 %exitcond233.not = icmp eq i64 %indvars.iv.next229, %wide.trip.count232 br i1 %exitcond233.not, label %for.cond42.preheader, label %for.body29, !llvm.loop !17 for.body44: ; preds = %for.body44.preheader, %for.body44 %indvars.iv234 = phi i64 [ %23, %for.body44.preheader ], [ %indvars.iv.next235, %for.body44 ] %indvars.iv.next235 = add nsw i64 %indvars.iv234, -1 %indvars = trunc i64 %indvars.iv.next235 to i32 %mul = shl nuw nsw i32 %indvars, 1 %add45 = or i32 %mul, 1 %idxprom46 = zext i32 %add45 to i64 %arrayidx47 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %idxprom46 %25 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %add49 = add nuw nsw i32 %mul, 2 %idxprom50 = zext i32 %add49 to i64 %arrayidx51 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %idxprom50 %26 = load i32, ptr %arrayidx51, align 8, !tbaa !5 %arrayidx55 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %idxprom46 %27 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %arrayidx59 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %idxprom50 %28 = load i32, ptr %arrayidx59, align 8, !tbaa !5 %cond = tail call i32 @llvm.smax.i32(i32 %25, i32 %26) %idxprom61 = and i64 %indvars.iv.next235, 4294967295 %arrayidx62 = getelementptr inbounds [800000 x i32], ptr @asumikana, i64 0, i64 %idxprom61 store i32 %cond, ptr %arrayidx62, align 4, !tbaa !5 %cond67 = tail call i32 @llvm.smin.i32(i32 %27, i32 %28) %arrayidx69 = getelementptr inbounds [800000 x i32], ptr @isidaakira, i64 0, i64 %idxprom61 store i32 %cond67, ptr %arrayidx69, align 4, !tbaa !5 %cmp43 = icmp ugt i64 %indvars.iv234, 1 br i1 %cmp43, label %for.body44, label %for.end71, !llvm.loop !18 for.end71: ; preds = %for.body44, %for.cond42.preheader %29 = load i32, ptr @K, align 4, !tbaa !5 %sub72 = add i32 %.lcssa, 1 %add73 = sub i32 %sub72, %29 store i32 1, ptr @sumipe, align 16, !tbaa !5 %cmp75209 = icmp sgt i32 %.lcssa, 1 br i1 %cmp75209, label %for.body76.preheader, label %for.cond96.preheader for.body76.preheader: ; preds = %for.end71 %wide.trip.count242 = zext i32 %.lcssa to i64 %.pre = load i32, ptr @P, align 16, !tbaa !5 %30 = add nsw i64 %wide.trip.count242, -1 %xtraiter = and i64 %30, 1 %31 = icmp eq i32 %.lcssa, 2 br i1 %31, label %for.cond96.preheader.loopexit.unr-lcssa, label %for.body76.preheader.new for.body76.preheader.new: ; preds = %for.body76.preheader %unroll_iter = and i64 %30, -2 br label %for.body76 for.cond96.preheader.loopexit.unr-lcssa.loopexit: ; preds = %for.body76 %32 = add nsw i32 %.sink.1, 1 br label %for.cond96.preheader.loopexit.unr-lcssa for.cond96.preheader.loopexit.unr-lcssa: ; preds = %for.cond96.preheader.loopexit.unr-lcssa.loopexit, %for.body76.preheader %.unr = phi i32 [ 2, %for.body76.preheader ], [ %32, %for.cond96.preheader.loopexit.unr-lcssa.loopexit ] %.unr272 = phi i32 [ %.pre, %for.body76.preheader ], [ %40, %for.cond96.preheader.loopexit.unr-lcssa.loopexit ] %indvars.iv237.unr = phi i64 [ 1, %for.body76.preheader ], [ %indvars.iv.next238.1, %for.cond96.preheader.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond96.preheader, label %for.body76.epil for.body76.epil: ; preds = %for.cond96.preheader.loopexit.unr-lcssa %arrayidx81.epil = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %indvars.iv237.unr %33 = load i32, ptr %arrayidx81.epil, align 4, !tbaa !5 %cmp82.epil = icmp slt i32 %.unr272, %33 %.sink.epil = select i1 %cmp82.epil, i32 %.unr, i32 1 %34 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv237.unr store i32 %.sink.epil, ptr %34, align 4 br label %for.cond96.preheader for.cond96.preheader: ; preds = %for.body76.epil, %for.cond96.preheader.loopexit.unr-lcssa, %for.end71 br i1 %cmp12203, label %for.body98.preheader, label %for.cond112.preheader for.body98.preheader: ; preds = %for.cond96.preheader %wide.trip.count248 = zext i32 %.lcssa to i64 %xtraiter273 = and i64 %wide.trip.count248, 1 %35 = icmp eq i32 %.lcssa, 1 br i1 %35, label %for.cond112.preheader.loopexit.unr-lcssa, label %for.body98.preheader.new for.body98.preheader.new: ; preds = %for.body98.preheader %unroll_iter276 = and i64 %wide.trip.count248, 4294967294 br label %for.body98 for.body76: ; preds = %for.body76, %for.body76.preheader.new %36 = phi i32 [ 1, %for.body76.preheader.new ], [ %.sink.1, %for.body76 ] %37 = phi i32 [ %.pre, %for.body76.preheader.new ], [ %40, %for.body76 ] %indvars.iv237 = phi i64 [ 1, %for.body76.preheader.new ], [ %indvars.iv.next238.1, %for.body76 ] %niter = phi i64 [ 0, %for.body76.preheader.new ], [ %niter.next.1, %for.body76 ] %arrayidx81 = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %indvars.iv237 %38 = load i32, ptr %arrayidx81, align 4, !tbaa !5 %cmp82 = icmp slt i32 %37, %38 %add87 = add nsw i32 %36, 1 %.sink = select i1 %cmp82, i32 %add87, i32 1 %39 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv237 store i32 %.sink, ptr %39, align 4 %indvars.iv.next238 = add nuw nsw i64 %indvars.iv237, 1 %arrayidx81.1 = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %indvars.iv.next238 %40 = load i32, ptr %arrayidx81.1, align 4, !tbaa !5 %cmp82.1 = icmp slt i32 %38, %40 %add87.1 = add nsw i32 %.sink, 1 %.sink.1 = select i1 %cmp82.1, i32 %add87.1, i32 1 %41 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv.next238 store i32 %.sink.1, ptr %41, align 4 %indvars.iv.next238.1 = add nuw nsw i64 %indvars.iv237, 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.cond96.preheader.loopexit.unr-lcssa.loopexit, label %for.body76, !llvm.loop !19 for.cond112.preheader.loopexit.unr-lcssa.loopexit: ; preds = %for.body98 %42 = icmp ne i32 %minaseinori.1.1, 0 br label %for.cond112.preheader.loopexit.unr-lcssa for.cond112.preheader.loopexit.unr-lcssa: ; preds = %for.cond112.preheader.loopexit.unr-lcssa.loopexit, %for.body98.preheader %sasakikotoko.1.lcssa.ph = phi i32 [ undef, %for.body98.preheader ], [ %sasakikotoko.1.1, %for.cond112.preheader.loopexit.unr-lcssa.loopexit ] %indvars.iv244.unr = phi i64 [ 0, %for.body98.preheader ], [ %indvars.iv.next245.1, %for.cond112.preheader.loopexit.unr-lcssa.loopexit ] %sasakikotoko.0213.unr = phi i32 [ %add73, %for.body98.preheader ], [ %sasakikotoko.1.1, %for.cond112.preheader.loopexit.unr-lcssa.loopexit ] %minaseinori.0212.unr = phi i1 [ false, %for.body98.preheader ], [ %42, %for.cond112.preheader.loopexit.unr-lcssa.loopexit ] %lcmp.mod274.not = icmp eq i64 %xtraiter273, 0 br i1 %lcmp.mod274.not, label %for.cond112.preheader, label %for.body98.epil for.body98.epil: ; preds = %for.cond112.preheader.loopexit.unr-lcssa %arrayidx100.epil = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv244.unr %43 = load i32, ptr %arrayidx100.epil, align 4, !tbaa !5 %cmp101.not.epil = icmp sge i32 %43, %29 %narrow.epil = select i1 %cmp101.not.epil, i1 %minaseinori.0212.unr, i1 false %spec.select.epil = sext i1 %narrow.epil to i32 %sasakikotoko.1.epil = add nsw i32 %sasakikotoko.0213.unr, %spec.select.epil br label %for.cond112.preheader for.cond112.preheader: ; preds = %for.body98.epil, %for.cond112.preheader.loopexit.unr-lcssa, %for.cond96.preheader %sasakikotoko.0.lcssa = phi i32 [ %add73, %for.cond96.preheader ], [ %sasakikotoko.1.lcssa.ph, %for.cond112.preheader.loopexit.unr-lcssa ], [ %sasakikotoko.1.epil, %for.body98.epil ] %cmp113.not.not217 = icmp slt i32 %29, %.lcssa br i1 %cmp113.not.not217, label %for.body114.preheader, label %for.end145 for.body114.preheader: ; preds = %for.cond112.preheader %44 = sext i32 %29 to i64 %wide.trip.count255 = sext i32 %.lcssa to i64 br label %for.body114 for.body98: ; preds = %for.body98, %for.body98.preheader.new %indvars.iv244 = phi i64 [ 0, %for.body98.preheader.new ], [ %indvars.iv.next245.1, %for.body98 ] %sasakikotoko.0213 = phi i32 [ %add73, %for.body98.preheader.new ], [ %sasakikotoko.1.1, %for.body98 ] %minaseinori.0212 = phi i32 [ 0, %for.body98.preheader.new ], [ %minaseinori.1.1, %for.body98 ] %niter277 = phi i64 [ 0, %for.body98.preheader.new ], [ %niter277.next.1, %for.body98 ] %arrayidx100 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv244 %45 = load i32, ptr %arrayidx100, align 8, !tbaa !5 %cmp101.not = icmp sge i32 %45, %29 %tobool.not = icmp ne i32 %minaseinori.0212, 0 %minaseinori.1 = select i1 %cmp101.not, i32 1, i32 %minaseinori.0212 %narrow = select i1 %cmp101.not, i1 %tobool.not, i1 false %spec.select = sext i1 %narrow to i32 %sasakikotoko.1 = add nsw i32 %sasakikotoko.0213, %spec.select %indvars.iv.next245 = or i64 %indvars.iv244, 1 %arrayidx100.1 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv.next245 %46 = load i32, ptr %arrayidx100.1, align 4, !tbaa !5 %cmp101.not.1 = icmp sge i32 %46, %29 %tobool.not.1 = icmp ne i32 %minaseinori.1, 0 %minaseinori.1.1 = select i1 %cmp101.not.1, i32 1, i32 %minaseinori.1 %narrow.1 = select i1 %cmp101.not.1, i1 %tobool.not.1, i1 false %spec.select.1 = sext i1 %narrow.1 to i32 %sasakikotoko.1.1 = add nsw i32 %sasakikotoko.1, %spec.select.1 %indvars.iv.next245.1 = add nuw nsw i64 %indvars.iv244, 2 %niter277.next.1 = add i64 %niter277, 2 %niter277.ncmp.1 = icmp eq i64 %niter277.next.1, %unroll_iter276 br i1 %niter277.ncmp.1, label %for.cond112.preheader.loopexit.unr-lcssa.loopexit, label %for.body98, !llvm.loop !20 for.body114: ; preds = %for.body114.preheader, %for.inc143 %indvars.iv250 = phi i64 [ %44, %for.body114.preheader ], [ %indvars.iv.next251, %for.inc143 ] %sasakikotoko.2218 = phi i32 [ %sasakikotoko.0.lcssa, %for.body114.preheader ], [ %sasakikotoko.3, %for.inc143 ] %indvars.iv.next251 = add nsw i64 %indvars.iv250, 1 %47 = trunc i64 %indvars.iv250 to i32 %sub116 = sub i32 %47, %29 %idxprom117 = sext i32 %sub116 to i64 %arrayidx118 = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %idxprom117 %48 = load i32, ptr %arrayidx118, align 4, !tbaa !5 %49 = trunc i64 %indvars.iv.next251 to i32 %call.i = tail call i32 @mizuhasu(i32 noundef 0, i32 noundef %sub116, i32 noundef %49, i32 noundef 0, i32 noundef %storemerge, i32 noundef 0) %cmp122 = icmp eq i32 %48, %call.i br i1 %cmp122, label %land.lhs.true, label %for.inc143 land.lhs.true: ; preds = %for.body114 %arrayidx125 = getelementptr inbounds [400000 x i32], ptr @P, i64 0, i64 %indvars.iv250 %50 = load i32, ptr %arrayidx125, align 4, !tbaa !5 %call.i198 = tail call i32 @mizuhasu(i32 noundef 0, i32 noundef %sub116, i32 noundef %49, i32 noundef 0, i32 noundef %storemerge, i32 noundef 1) %cmp129 = icmp eq i32 %50, %call.i198 br i1 %cmp129, label %if.then130, label %for.inc143 if.then130: ; preds = %land.lhs.true %51 = add nsw i64 %indvars.iv250, -1 %arrayidx133 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %51 %52 = load i32, ptr %arrayidx133, align 4, !tbaa !5 %cmp134 = icmp slt i32 %52, %29 br i1 %cmp134, label %if.then139, label %lor.lhs.false lor.lhs.false: ; preds = %if.then130 %arrayidx137 = getelementptr inbounds [400000 x i32], ptr @sumipe, i64 0, i64 %indvars.iv250 %53 = load i32, ptr %arrayidx137, align 4, !tbaa !5 %cmp138 = icmp slt i32 %53, %29 br i1 %cmp138, label %if.then139, label %for.inc143 if.then139: ; preds = %lor.lhs.false, %if.then130 %dec140 = add nsw i32 %sasakikotoko.2218, -1 br label %for.inc143 for.inc143: ; preds = %for.body114, %land.lhs.true, %if.then139, %lor.lhs.false %sasakikotoko.3 = phi i32 [ %dec140, %if.then139 ], [ %sasakikotoko.2218, %lor.lhs.false ], [ %sasakikotoko.2218, %land.lhs.true ], [ %sasakikotoko.2218, %for.body114 ] %exitcond256.not = icmp eq i64 %indvars.iv.next251, %wide.trip.count255 br i1 %exitcond256.not, label %for.end145, label %for.body114, !llvm.loop !21 for.end145: ; preds = %for.inc143, %for.cond112.preheader %sasakikotoko.2.lcssa = phi i32 [ %sasakikotoko.0.lcssa, %for.cond112.preheader ], [ %sasakikotoko.3, %for.inc143 ] %call146 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sasakikotoko.2.lcssa) br label %cleanup cleanup: ; preds = %for.body, %entry, %for.end145 %retval.0 = phi i32 [ 0, %for.end145 ], [ 1, %entry ], [ 1, %for.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree 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 #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = 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, !13, !14} !16 = distinct !{!16, !10, !14, !13} !17 = distinct !{!17, !10, !14, !13} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10}
#include<stdio.h> int main() { int a,b,c,a1[7],max=0,i; scanf("%d%d%d",&a,&b,&c); a1[1]=a+b+c; a1[2]=a+(b*c); a1[3]=(a+b)*c; a1[4]=a*b*c; a1[5]=(a*b)+c; a1[6]=a*(b+c); for(i=1; i<=6; i++) { if(a1[i]>max) max=a1[i]; } printf("%d\n",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %mul = mul nsw i32 %2, %1 %add2 = add nsw i32 %mul, %0 %mul5 = mul nsw i32 %add, %2 %mul7 = mul nsw i32 %1, %0 %mul8 = mul nsw i32 %mul7, %2 %add11 = add nsw i32 %mul7, %2 %add13 = add nsw i32 %2, %1 %mul14 = mul nsw i32 %add13, %0 %spec.select = call i32 @llvm.smax.i32(i32 %add1, i32 %add2) %spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %mul5) %spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %mul8) %spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %add11) %spec.select.4 = call i32 @llvm.smax.i32(i32 %spec.select.3, i32 %mul14) %spec.select.5 = call i32 @llvm.smax.i32(i32 %spec.select.4, i32 0) %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.5) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int n; scanf("%d",&n); for(int i=0;i<=n/4;i++){ if((n-i*4)%7==0){ printf("Yes\n"); return 0;; } } printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130041/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130041/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not8 = icmp slt i32 %0, -3 br i1 %cmp.not8, label %cleanup4, label %for.body.preheader for.body.preheader: ; preds = %entry %div = sdiv i32 %0, 4 br label %for.body for.cond: ; preds = %for.body %inc = add nuw nsw i32 %i.09, 1 %exitcond.not = icmp eq i32 %i.09, %div br i1 %exitcond.not, label %cleanup4, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond %i.09 = phi i32 [ %inc, %for.cond ], [ 0, %for.body.preheader ] %mul = shl nsw i32 %i.09, 2 %sub = sub nsw i32 %0, %mul %rem = srem i32 %sub, 7 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %cleanup4, label %for.cond cleanup4: ; preds = %for.cond, %for.body, %entry %str.sink = phi ptr [ @str.3, %entry ], [ @str, %for.body ], [ @str.3, %for.cond ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int N,i,j,count=0; scanf("%d",&N); for(i=0;i<N;i++){ for(j=0;j<N;j++){ if(i*7+j*4==N){ count++; } } } if(count>0){ printf("\nYes\n\n"); }else { printf("\nNo\n\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130085/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130085/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [5 x i8] c"\0ANo\0A\00", align 1 @str.3 = private unnamed_addr constant [6 x i8] c"\0AYes\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %0, 0 br i1 %cmp24, label %for.cond1.preheader.us.preheader, label %if.else for.cond1.preheader.us.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %0, 8 %n.vec = and i32 %0, -8 %broadcast.splatinsert32 = insertelement <4 x i32> poison, i32 %0, i64 0 %broadcast.splat33 = shufflevector <4 x i32> %broadcast.splatinsert32, <4 x i32> poison, <4 x i32> zeroinitializer %cmp.n = icmp eq i32 %0, %n.vec br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc7_crit_edge.us %count.026.us = phi i32 [ %spec.select.us.lcssa, %for.cond1.for.inc7_crit_edge.us ], [ 0, %for.cond1.preheader.us.preheader ] %i.025.us = phi i32 [ %inc8.us, %for.cond1.for.inc7_crit_edge.us ], [ 0, %for.cond1.preheader.us.preheader ] %mul.us = mul nsw i32 %i.025.us, 7 br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond1.preheader.us %1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.026.us, i64 0 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %mul.us, 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> [ %1, %vector.ph ], [ %10, %vector.body ] %vec.phi30 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %2 = shl nsw <4 x i32> %vec.ind, <i32 2, i32 2, i32 2, i32 2> %step.add = shl <4 x i32> %vec.ind, <i32 2, i32 2, i32 2, i32 2> %3 = add <4 x i32> %step.add, <i32 16, i32 16, i32 16, i32 16> %4 = add nuw nsw <4 x i32> %2, %broadcast.splat %5 = add nuw nsw <4 x i32> %3, %broadcast.splat %6 = icmp eq <4 x i32> %4, %broadcast.splat33 %7 = icmp eq <4 x i32> %5, %broadcast.splat33 %8 = zext <4 x i1> %6 to <4 x i32> %9 = zext <4 x i1> %7 to <4 x i32> %10 = add <4 x i32> %vec.phi, %8 %11 = add <4 x i32> %vec.phi30, %9 %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %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) br i1 %cmp.n, label %for.cond1.for.inc7_crit_edge.us, label %for.body3.us.preheader for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block %count.123.us.ph = phi i32 [ %count.026.us, %for.cond1.preheader.us ], [ %13, %middle.block ] %j.022.us.ph = phi i32 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ] br label %for.body3.us for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us %count.123.us = phi i32 [ %spec.select.us, %for.body3.us ], [ %count.123.us.ph, %for.body3.us.preheader ] %j.022.us = phi i32 [ %inc6.us, %for.body3.us ], [ %j.022.us.ph, %for.body3.us.preheader ] %mul4.us = shl nsw i32 %j.022.us, 2 %add.us = add nuw nsw i32 %mul4.us, %mul.us %cmp5.us = icmp eq i32 %add.us, %0 %inc.us = zext i1 %cmp5.us to i32 %spec.select.us = add nsw i32 %count.123.us, %inc.us %inc6.us = add nuw nsw i32 %j.022.us, 1 %exitcond.not = icmp eq i32 %inc6.us, %0 br i1 %exitcond.not, label %for.cond1.for.inc7_crit_edge.us, label %for.body3.us, !llvm.loop !13 for.cond1.for.inc7_crit_edge.us: ; preds = %for.body3.us, %middle.block %spec.select.us.lcssa = phi i32 [ %13, %middle.block ], [ %spec.select.us, %for.body3.us ] %inc8.us = add nuw nsw i32 %i.025.us, 1 %exitcond28.not = icmp eq i32 %inc8.us, %0 br i1 %exitcond28.not, label %for.end9, label %for.cond1.preheader.us, !llvm.loop !14 for.end9: ; preds = %for.cond1.for.inc7_crit_edge.us %14 = icmp sgt i32 %spec.select.us.lcssa, 0 br i1 %14, label %if.end14, label %if.else if.else: ; preds = %entry, %for.end9 br label %if.end14 if.end14: ; preds = %for.end9, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end9 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10}
#include <stdio.h> int main(void){ int N,i,j,x=4,y=7,a=0,flag=0; scanf("%d",&N); for(i = 1; i < 101; i++){ for(j = 1; j < 101; j++){ a= (x * i) + (y * j); if(N % 4 == 0){ flag = 1; } else if(N % 7 == 0){ flag = 1; } else if(N % a == 0){ flag = 1; } else{ } } } flag ? printf("Yes\n") : printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130128/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130128/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = and i32 %0, 3 %cmp5 = icmp eq i32 %1, 0 %rem6 = srem i32 %0, 7 %cmp7 = icmp eq i32 %rem6, 0 %or.cond = or i1 %cmp5, %cmp7 br i1 %or.cond, label %cond.end, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc16.split %flag.029 = phi i32 [ %spec.select.1, %for.inc16.split ], [ 0, %entry ] %i.028 = phi i32 [ %inc17, %for.inc16.split ], [ 1, %entry ] %mul = shl nsw i32 %i.028, 2 br label %for.body3 for.body3: ; preds = %for.body3, %for.cond1.preheader %flag.127 = phi i32 [ %flag.029, %for.cond1.preheader ], [ %spec.select.1, %for.body3 ] %j.026 = phi i32 [ 1, %for.cond1.preheader ], [ %inc.1, %for.body3 ] %mul4 = mul nuw nsw i32 %j.026, 7 %add = add nuw nsw i32 %mul4, %mul %rem10 = srem i32 %0, %add %cmp11 = icmp eq i32 %rem10, 0 %2 = mul nuw i32 %j.026, 7 %mul4.1 = add nuw i32 %2, 7 %add.1 = add nuw nsw i32 %mul4.1, %mul %rem10.1 = srem i32 %0, %add.1 %cmp11.1 = icmp eq i32 %rem10.1, 0 %3 = or i1 %cmp11.1, %cmp11 %spec.select.1 = select i1 %3, i32 1, i32 %flag.127 %inc.1 = add nuw nsw i32 %j.026, 2 %exitcond.not.1 = icmp eq i32 %inc.1, 101 br i1 %exitcond.not.1, label %for.inc16.split, label %for.body3, !llvm.loop !9 for.inc16.split: ; preds = %for.body3 %inc17 = add nuw nsw i32 %i.028, 1 %exitcond32.not = icmp eq i32 %inc17, 101 br i1 %exitcond32.not, label %for.end18, label %for.cond1.preheader, !llvm.loop !11 for.end18: ; preds = %for.inc16.split %4 = icmp eq i32 %spec.select.1, 0 %spec.select34 = select i1 %4, ptr @str, ptr @str.3 br label %cond.end cond.end: ; preds = %for.end18, %entry %str.sink = phi ptr [ @str.3, %entry ], [ %spec.select34, %for.end18 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void) { int n; scanf("%d",&n); for(int i=0;i*7<=n;i++) { if((n-i*7)%4==0) { puts("Yes"); return 0; } } puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130179/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130179/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not8 = icmp slt i32 %0, 0 br i1 %cmp.not8, label %cleanup5, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = sub nsw i32 0, %0 %wide.trip.count = and i32 %1, 3 %exitcond = icmp eq i32 %wide.trip.count, 0 br i1 %exitcond, label %cleanup5, label %for.cond for.cond: ; preds = %for.body.preheader %cmp.not = icmp slt i32 %0, 7 br i1 %cmp.not, label %cleanup5, label %for.body.1, !llvm.loop !9 for.body.1: ; preds = %for.cond %exitcond.1 = icmp eq i32 %wide.trip.count, 1 br i1 %exitcond.1, label %cleanup5, label %for.cond.1 for.cond.1: ; preds = %for.body.1 %cmp.not.1 = icmp slt i32 %0, 14 br i1 %cmp.not.1, label %cleanup5, label %for.body.2, !llvm.loop !9 for.body.2: ; preds = %for.cond.1 %exitcond.2 = icmp eq i32 %wide.trip.count, 2 br i1 %exitcond.2, label %cleanup5, label %for.cond.2 for.cond.2: ; preds = %for.body.2 %cmp.not.2 = icmp slt i32 %0, 21 br i1 %cmp.not.2, label %cleanup5, label %for.body.3, !llvm.loop !9 for.body.3: ; preds = %for.cond.2 %exitcond.3 = icmp eq i32 %wide.trip.count, 3 %spec.select = select i1 %exitcond.3, ptr @.str.1, ptr @.str.2 br label %cleanup5 cleanup5: ; preds = %for.body.3, %for.cond, %for.body.preheader, %for.body.1, %for.cond.1, %for.body.2, %for.cond.2, %entry %.str.1.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body.preheader ], [ @.str.2, %for.cond ], [ @.str.1, %for.body.1 ], [ @.str.2, %for.cond.1 ], [ @.str.1, %for.body.2 ], [ @.str.2, %for.cond.2 ], [ %spec.select, %for.body.3 ] %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !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 divisible(int N); int main(void){ int N, judge; scanf("%d", &N); judge = divisible(N); if (judge == 1){ printf("Yes"); } else{ printf("No"); } return 0; } int divisible (int N){ if((N<4)&&(N!=0)){ return 0; } else{ if(N%4==0){ return 1; } else{ return divisible(N-7); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130221/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130221/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp8.i = icmp slt i32 %0, 4 %cmp19.i = icmp ne i32 %0, 0 %or.cond10.i = and i1 %cmp8.i, %cmp19.i br i1 %or.cond10.i, label %if.end, label %if.else.i tailrecurse.i: ; preds = %if.else.i %sub.i = add nsw i32 %0, -7 %cmp.i = icmp slt i32 %0, 11 %cmp1.i = icmp ne i32 %sub.i, 0 %or.cond.i = and i1 %cmp.i, %cmp1.i br i1 %or.cond.i, label %if.end, label %if.else.i.1 if.else.i.1: ; preds = %tailrecurse.i %1 = and i32 %sub.i, 3 %cmp2.i.1 = icmp eq i32 %1, 0 br i1 %cmp2.i.1, label %if.end, label %tailrecurse.i.1 tailrecurse.i.1: ; preds = %if.else.i.1 %sub.i.1 = add nsw i32 %0, -14 %cmp.i.1 = icmp slt i32 %0, 18 %cmp1.i.1 = icmp ne i32 %sub.i.1, 0 %or.cond.i.1 = and i1 %cmp.i.1, %cmp1.i.1 br i1 %or.cond.i.1, label %if.end, label %if.else.i.2 if.else.i.2: ; preds = %tailrecurse.i.1 %2 = and i32 %sub.i.1, 3 %cmp2.i.2 = icmp eq i32 %2, 0 br i1 %cmp2.i.2, label %if.end, label %tailrecurse.i.2 tailrecurse.i.2: ; preds = %if.else.i.2 %sub.i.2 = add nsw i32 %0, -21 %cmp.i.2 = icmp slt i32 %0, 25 %cmp1.i.2 = icmp ne i32 %sub.i.2, 0 %or.cond.i.2 = and i1 %cmp.i.2, %cmp1.i.2 br i1 %or.cond.i.2, label %if.end, label %if.else.i.3 if.else.i.3: ; preds = %tailrecurse.i.2 %3 = and i32 %sub.i.2, 3 %cmp2.i.3 = icmp eq i32 %3, 0 %spec.select = select i1 %cmp2.i.3, ptr @.str.1, ptr @.str.2 br label %if.end if.else.i: ; preds = %entry %4 = and i32 %0, 3 %cmp2.i = icmp eq i32 %4, 0 br i1 %cmp2.i, label %if.end, label %tailrecurse.i if.end: ; preds = %if.else.i.3, %tailrecurse.i, %if.else.i, %if.else.i.1, %tailrecurse.i.1, %if.else.i.2, %tailrecurse.i.2, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %if.else.i ], [ @.str.2, %tailrecurse.i ], [ @.str.1, %if.else.i.1 ], [ @.str.2, %tailrecurse.i.1 ], [ @.str.1, %if.else.i.2 ], [ @.str.2, %tailrecurse.i.2 ], [ %spec.select, %if.else.i.3 ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @divisible(i32 noundef %N) local_unnamed_addr #3 { entry: %cmp8 = icmp slt i32 %N, 4 %cmp19 = icmp ne i32 %N, 0 %or.cond10 = and i1 %cmp8, %cmp19 br i1 %or.cond10, label %return, label %if.else tailrecurse: ; preds = %if.else %sub = add nsw i32 %N, -7 %cmp = icmp slt i32 %N, 11 %cmp1 = icmp ne i32 %sub, 0 %or.cond = and i1 %cmp, %cmp1 br i1 %or.cond, label %return, label %if.else.1 if.else.1: ; preds = %tailrecurse %0 = and i32 %sub, 3 %cmp2.1 = icmp eq i32 %0, 0 br i1 %cmp2.1, label %return, label %tailrecurse.1 tailrecurse.1: ; preds = %if.else.1 %sub.1 = add nsw i32 %N, -14 %cmp.1 = icmp slt i32 %N, 18 %cmp1.1 = icmp ne i32 %sub.1, 0 %or.cond.1 = and i1 %cmp.1, %cmp1.1 br i1 %or.cond.1, label %return, label %if.else.2 if.else.2: ; preds = %tailrecurse.1 %1 = and i32 %sub.1, 3 %cmp2.2 = icmp eq i32 %1, 0 br i1 %cmp2.2, label %return, label %tailrecurse.2 tailrecurse.2: ; preds = %if.else.2 %sub.2 = add nsw i32 %N, -21 %cmp.2 = icmp slt i32 %N, 25 %cmp1.2 = icmp ne i32 %sub.2, 0 %or.cond.2 = and i1 %cmp.2, %cmp1.2 br i1 %or.cond.2, label %return, label %if.else.3 if.else.3: ; preds = %tailrecurse.2 %2 = and i32 %sub.2, 3 %cmp2.3 = icmp eq i32 %2, 0 %spec.select = select i1 %cmp2.3, i32 1, i32 0 br label %return if.else: ; preds = %entry %3 = and i32 %N, 3 %cmp2 = icmp eq i32 %3, 0 br i1 %cmp2, label %return, label %tailrecurse return: ; preds = %if.else.3, %tailrecurse, %if.else, %if.else.1, %tailrecurse.1, %if.else.2, %tailrecurse.2, %entry %retval.0 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 0, %tailrecurse ], [ 1, %if.else.1 ], [ 0, %tailrecurse.1 ], [ 1, %if.else.2 ], [ 0, %tailrecurse.2 ], [ %spec.select, %if.else.3 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main(void) { int n,i,j; scanf("%d",&n); for(i=0;i<=n;i++){ for(j=0;j<=n;j++){ if(4*i+7*j==n){ puts("Yes"); return 0; } } } puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130265/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130265/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not19 = icmp slt i32 %0, 0 br i1 %cmp.not19, label %cleanup, label %for.cond1.preheader.preheader for.cond1.preheader.preheader: ; preds = %entry %1 = mul i32 %0, -1227133513 br label %for.body3 for.body3: ; preds = %for.cond1.for.inc7_crit_edge, %for.cond1.preheader.preheader %indvars.iv = phi i32 [ %1, %for.cond1.preheader.preheader ], [ %indvars.iv.next, %for.cond1.for.inc7_crit_edge ] %i.020 = phi i32 [ 0, %for.cond1.preheader.preheader ], [ %inc8, %for.cond1.for.inc7_crit_edge ] %.not = icmp ugt i32 %indvars.iv, %0 br i1 %.not, label %for.cond1.for.inc7_crit_edge, label %cleanup for.cond1.for.inc7_crit_edge: ; preds = %for.body3 %inc8 = add nuw i32 %i.020, 1 %indvars.iv.next = add i32 %indvars.iv, 613566756 %exitcond.not = icmp eq i32 %i.020, %0 br i1 %exitcond.not, label %cleanup, label %for.body3, !llvm.loop !9 cleanup: ; preds = %for.cond1.for.inc7_crit_edge, %for.body3, %entry %.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body3 ], [ @.str.2, %for.cond1.for.inc7_crit_edge ] %call10 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> #include<ctype.h> int main(void){ char w[11], t[1001]; int i=0,j; scanf("%s",w); w[0]=tolower(w[0]); while(1) { scanf("%s", t); if (strcmp(t, "END_OF_TEXT") == 0) break; for(j=0; j<50; j++) t[j] = tolower(t[j]); if (strcmp(w, t) == 0) i++; } printf("%d\n", i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130337/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130337/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [12 x i8] c"END_OF_TEXT\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: %w = alloca [11 x i8], align 1 %t = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %w) #6 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %t) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %call1 = tail call ptr @__ctype_tolower_loc() #7 %0 = load ptr, ptr %call1, align 8, !tbaa !5 %1 = load i8, ptr %w, align 1, !tbaa !9 %idxprom = sext i8 %1 to i64 %arrayidx2 = getelementptr inbounds i32, ptr %0, i64 %idxprom %2 = load i32, ptr %arrayidx2, align 4, !tbaa !10 %conv3 = trunc i32 %2 to i8 store i8 %conv3, ptr %w, align 1, !tbaa !9 %call637 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %bcmp38 = call i32 @bcmp(ptr noundef nonnull dereferenceable(12) %t, ptr noundef nonnull dereferenceable(12) @.str.1, i64 12) %cmp39 = icmp eq i32 %bcmp38, 0 br i1 %cmp39, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %i.040 = phi i32 [ %spec.select, %for.end ], [ 0, %entry ] br label %for.body for.body: ; preds = %for.body, %for.cond.preheader %indvars.iv = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next.1, %for.body ] %3 = load ptr, ptr %call1, align 8, !tbaa !5 %arrayidx15 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv %4 = load i8, ptr %arrayidx15, align 2, !tbaa !9 %idxprom17 = sext i8 %4 to i64 %arrayidx18 = getelementptr inbounds i32, ptr %3, i64 %idxprom17 %5 = load i32, ptr %arrayidx18, align 4, !tbaa !10 %conv20 = trunc i32 %5 to i8 store i8 %conv20, ptr %arrayidx15, align 2, !tbaa !9 %indvars.iv.next = or i64 %indvars.iv, 1 %6 = load ptr, ptr %call1, align 8, !tbaa !5 %arrayidx15.1 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv.next %7 = load i8, ptr %arrayidx15.1, align 1, !tbaa !9 %idxprom17.1 = sext i8 %7 to i64 %arrayidx18.1 = getelementptr inbounds i32, ptr %6, i64 %idxprom17.1 %8 = load i32, ptr %arrayidx18.1, align 4, !tbaa !10 %conv20.1 = trunc i32 %8 to i8 store i8 %conv20.1, ptr %arrayidx15.1, align 1, !tbaa !9 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 50 br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.body %call25 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %w, ptr noundef nonnull dereferenceable(1) %t) #8 %cmp26 = icmp eq i32 %call25, 0 %inc29 = zext i1 %cmp26 to i32 %spec.select = add nuw nsw i32 %i.040, %inc29 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(12) %t, ptr noundef nonnull dereferenceable(12) @.str.1, i64 12) %cmp = icmp eq i32 %bcmp, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.end ] %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %w) #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 nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() 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 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: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 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 #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind willreturn memory(argmem: read) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(none) } 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> #include <ctype.h> int main() { int i, sw = 0, se = 0, a = 0; char w[11], e[] = "END_OF_TEXT"; scanf("%s ", w); for (i = 0; w[i] != '\0'; ++i) w[i] = tolower(w[i]); for (;;) { char c = getchar(); if (c == '\n') c = ' '; if (se != -1) { if (c == e[se]) { ++se; } else { if (se == strlen(e)) break; se = -1; } } c = tolower(c); if (sw != -1) { if (c == w[sw]) { ++sw; } else { if (c == ' ' && sw == strlen(w)) ++a; sw = -1; } } if (c == ' ') sw = se = 0; //printf("'%c' -> (%d, %d)\n", c, sw, se); } printf("%d\n", a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130380/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130380/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @__const.main.e = private unnamed_addr constant [12 x i8] c"END_OF_TEXT\00", align 1 @.str = private unnamed_addr constant [4 x i8] c"%s \00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %w) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %0 = load i8, ptr %w, align 1, !tbaa !5 %cmp.not108 = icmp eq i8 %0, 0 br i1 %cmp.not108, label %for.cond11.preheader, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %call2 = tail call ptr @__ctype_tolower_loc() #6 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %1 = phi i8 [ %0, %for.body.lr.ph ], [ %4, %for.body ] %arrayidx110 = phi ptr [ %w, %for.body.lr.ph ], [ %arrayidx, %for.body ] %2 = load ptr, ptr %call2, align 8, !tbaa !8 %idxprom6 = sext i8 %1 to i64 %arrayidx7 = getelementptr inbounds i32, ptr %2, i64 %idxprom6 %3 = load i32, ptr %arrayidx7, align 4, !tbaa !10 %conv8 = trunc i32 %3 to i8 store i8 %conv8, ptr %arrayidx110, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [11 x i8], ptr %w, i64 0, i64 %indvars.iv.next %4 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %4, 0 br i1 %cmp.not, label %for.cond11.preheader, label %for.body, !llvm.loop !12 for.cond11.preheader: ; preds = %for.body, %entry br label %for.cond11 for.cond11: ; preds = %for.cond11.preheader, %cleanup %a.0 = phi i32 [ %a.2, %cleanup ], [ 0, %for.cond11.preheader ] %se.0 = phi i32 [ %se.0.be, %cleanup ], [ 0, %for.cond11.preheader ] %sw.0 = phi i32 [ %sw.0.be, %cleanup ], [ 0, %for.cond11.preheader ] %5 = load ptr, ptr @stdin, align 8, !tbaa !8 %call.i = call i32 @getc(ptr noundef %5) %conv13 = trunc i32 %call.i to i8 %sext.mask = and i32 %call.i, 255 %cmp15 = icmp eq i32 %sext.mask, 10 %spec.store.select = select i1 %cmp15, i8 32, i8 %conv13 %cmp17.not = icmp eq i32 %se.0, -1 br i1 %cmp17.not, label %if.end36, label %if.then19 if.then19: ; preds = %for.cond11 %idxprom21 = sext i32 %se.0 to i64 %arrayidx22 = getelementptr inbounds [12 x i8], ptr @__const.main.e, i64 0, i64 %idxprom21 %6 = load i8, ptr %arrayidx22, align 1, !tbaa !5 %cmp24 = icmp eq i8 %spec.store.select, %6 br i1 %cmp24, label %if.then26, label %if.else if.then26: ; preds = %if.then19 %inc27 = add nuw nsw i32 %se.0, 1 br label %if.end36 if.else: ; preds = %if.then19 %cmp31 = icmp eq i32 %se.0, 11 br i1 %cmp31, label %for.end74, label %if.end36 if.end36: ; preds = %if.else, %if.then26, %for.cond11 %se.1 = phi i32 [ %inc27, %if.then26 ], [ -1, %for.cond11 ], [ -1, %if.else ] %call38 = tail call ptr @__ctype_tolower_loc() #6 %7 = load ptr, ptr %call38, align 8, !tbaa !8 %idxprom40 = sext i8 %spec.store.select to i64 %arrayidx41 = getelementptr inbounds i32, ptr %7, i64 %idxprom40 %8 = load i32, ptr %arrayidx41, align 4, !tbaa !10 %cmp44.not = icmp eq i32 %sw.0, -1 br i1 %cmp44.not, label %cleanup, label %if.then46 if.then46: ; preds = %if.end36 %sext = shl i32 %8, 24 %conv47 = ashr exact i32 %sext, 24 %idxprom48 = sext i32 %sw.0 to i64 %arrayidx49 = getelementptr inbounds [11 x i8], ptr %w, i64 0, i64 %idxprom48 %9 = load i8, ptr %arrayidx49, align 1, !tbaa !5 %conv50 = sext i8 %9 to i32 %cmp51 = icmp eq i32 %conv47, %conv50 br i1 %cmp51, label %if.then53, label %if.else55 if.then53: ; preds = %if.then46 %inc54 = add nuw nsw i32 %sw.0, 1 br label %cleanup if.else55: ; preds = %if.then46 %cmp57 = icmp eq i32 %sext, 536870912 br i1 %cmp57, label %land.lhs.true, label %cleanup land.lhs.true: ; preds = %if.else55 %call61 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %w) #7 %cmp62 = icmp eq i64 %call61, %idxprom48 %inc65 = zext i1 %cmp62 to i32 %spec.select = add nsw i32 %a.0, %inc65 br label %cleanup cleanup: ; preds = %if.end36, %if.then53, %if.else55, %land.lhs.true %a.2 = phi i32 [ %a.0, %if.then53 ], [ %a.0, %if.end36 ], [ %a.0, %if.else55 ], [ %spec.select, %land.lhs.true ] %sw.1 = phi i32 [ %inc54, %if.then53 ], [ -1, %if.end36 ], [ -1, %if.else55 ], [ -1, %land.lhs.true ] %sext97.mask = and i32 %8, 255 %cmp70 = icmp eq i32 %sext97.mask, 32 %se.0.be = select i1 %cmp70, i32 0, i32 %se.1 %sw.0.be = select i1 %cmp70, i32 0, i32 %sw.1 br label %for.cond11 for.end74: ; preds = %if.else %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %w) #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 nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() 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 memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"any pointer", !6, i64 0} !10 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define GROUP_1_MAX 7 typedef struct{ int iNum; //番号 int aiGroup[GROUP_1_MAX]; //整数のグループ }GROUP_t; int judge(int aXY, GROUP_t* pstGroup); int main(void) { int x, y; int GroupNoX, GroupNoY; int n; //x,yを入力 scanf("%d %d",&x,&y); //構造体変数の定義 GROUP_t m_Group[3] = { {0,{1,3,5,7,8,10,12}}, {1,{4,6,9,11}}, {2,{2}} }; //x yの属するグループの比較を行う for (n = 0;n < 3;n++) { GroupNoX = judge(x, &m_Group[n]); GroupNoY = judge(y, &m_Group[n]); //同じグループに属していた場合Yesを表示 if (GroupNoX == GroupNoY && GroupNoX != -1 && GroupNoY != -1) { printf("Yes\n"); return 0; } else {} } //異なるグループに所属していた場合Noを表示 printf("No\n"); return 0; } /****** *x,yの値がどの整数のグループに属するかを調べる関数 *[in]aXY 入力値であるxまたはyを入れる *[in]* pstGroup x,yと比較したい整数のグループの所属する構造体のを入れる * */ int judge(int aXY, GROUP_t* pstGroup) { int i=0; int max = 0; //グループ内の整数の数によって繰り返す最大数を決める if (pstGroup->iNum == 0) { max = 6; } else if (pstGroup->iNum == 1) { max = 3; } else if (pstGroup->iNum == 2) { max = 0; } else {} /*グループ内の数と比較して一致するものがあればグループの割り当てた番号を返す そうでないときは一致無し(-1)を返す*/ for (i = 0;i <= max;i++) { if (aXY == pstGroup->aiGroup[i]) { return (pstGroup->iNum); } else {} } return(-1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130452/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130452/source.c" target datalayout = "e-m:e-p270: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.GROUP_t = type { i32, [7 x i32] } @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { if.end10.i: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp12.i = icmp eq i32 %0, 1 br i1 %cmp12.i, label %for.body.i26, label %for.body.i.151, !llvm.loop !9 for.body.i.151: ; preds = %if.end10.i %cmp12.i.148 = icmp eq i32 %0, 3 br i1 %cmp12.i.148, label %for.body.i26, label %for.body.i.253, !llvm.loop !9 for.body.i.253: ; preds = %for.body.i.151 %cmp12.i.252 = icmp eq i32 %0, 5 br i1 %cmp12.i.252, label %for.body.i26, label %for.body.i.3, !llvm.loop !9 for.body.i.3: ; preds = %for.body.i.253 %cmp12.i.3 = icmp eq i32 %0, 7 br i1 %cmp12.i.3, label %for.body.i26, label %for.body.i.4, !llvm.loop !9 for.body.i.4: ; preds = %for.body.i.3 %cmp12.i.4 = icmp eq i32 %0, 8 br i1 %cmp12.i.4, label %for.body.i26, label %for.body.i.5, !llvm.loop !9 for.body.i.5: ; preds = %for.body.i.4 %cmp12.i.5 = icmp eq i32 %0, 10 %cmp12.i.6 = icmp eq i32 %0, 12 %spec.select62 = select i1 %cmp12.i.5, i1 %cmp12.i.5, i1 %cmp12.i.6 br label %for.body.i26, !llvm.loop !9 for.body.i26: ; preds = %for.body.i.5, %if.end10.i, %for.body.i.151, %for.body.i.253, %for.body.i.3, %for.body.i.4 %cmp12.i.lcssa = phi i1 [ %cmp12.i, %if.end10.i ], [ %cmp12.i.148, %for.body.i.151 ], [ %cmp12.i.252, %for.body.i.253 ], [ %cmp12.i.3, %for.body.i.3 ], [ %cmp12.i.4, %for.body.i.4 ], [ %spec.select62, %for.body.i.5 ] switch i32 %1, label %for.body.i.1 [ i32 1, label %judge.exit36 i32 3, label %judge.exit36 i32 5, label %judge.exit36 i32 7, label %judge.exit36 i32 8, label %judge.exit36 i32 10, label %judge.exit36 i32 12, label %judge.exit36 ] judge.exit36: ; preds = %for.body.i26, %for.body.i26, %for.body.i26, %for.body.i26, %for.body.i26, %for.body.i26, %for.body.i26 br i1 %cmp12.i.lcssa, label %cleanup, label %for.body.i.1 for.body.i.1: ; preds = %judge.exit36, %for.body.i26 %cmp12.i.1 = icmp eq i32 %0, 4 br i1 %cmp12.i.1, label %for.body.i26.1, label %for.body.i.1.1, !llvm.loop !9 for.body.i.1.1: ; preds = %for.body.i.1 %cmp12.i.1.1 = icmp eq i32 %0, 6 br i1 %cmp12.i.1.1, label %for.body.i26.1, label %for.body.i.1.2, !llvm.loop !9 for.body.i.1.2: ; preds = %for.body.i.1.1 %cmp12.i.1.2 = icmp eq i32 %0, 9 %cmp12.i.1.3 = icmp eq i32 %0, 11 %spec.select63 = select i1 %cmp12.i.1.2, i1 %cmp12.i.1.2, i1 %cmp12.i.1.3 br label %for.body.i26.1, !llvm.loop !9 for.body.i26.1: ; preds = %for.body.i.1.2, %for.body.i.1, %for.body.i.1.1 %cmp12.i.1.lcssa = phi i1 [ %cmp12.i.1, %for.body.i.1 ], [ %cmp12.i.1.1, %for.body.i.1.1 ], [ %spec.select63, %for.body.i.1.2 ] switch i32 %1, label %for.body.i.2 [ i32 4, label %judge.exit36.1 i32 6, label %judge.exit36.1 i32 9, label %judge.exit36.1 i32 11, label %judge.exit36.1 ] judge.exit36.1: ; preds = %for.body.i26.1, %for.body.i26.1, %for.body.i26.1, %for.body.i26.1 br i1 %cmp12.i.1.lcssa, label %cleanup, label %for.body.i.2 for.body.i.2: ; preds = %for.body.i26.1, %judge.exit36.1 %cmp12.i.2 = icmp ne i32 %0, 2 %cmp12.i29.2 = icmp ne i32 %1, 2 %brmerge = or i1 %cmp12.i29.2, %cmp12.i.2 %spec.select = select i1 %brmerge, ptr @str, ptr @str.3 br label %cleanup cleanup: ; preds = %for.body.i.2, %judge.exit36, %judge.exit36.1 %str.sink = phi ptr [ @str.3, %judge.exit36.1 ], [ @str.3, %judge.exit36 ], [ %spec.select, %for.body.i.2 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @judge(i32 noundef %aXY, ptr nocapture noundef readonly %pstGroup) local_unnamed_addr #3 { entry: %0 = load i32, ptr %pstGroup, align 4, !tbaa !11 %1 = icmp ult i32 %0, 3 %switch.idx.cast = zext i32 %0 to i64 %switch.idx.mult = mul nsw i64 %switch.idx.cast, -3 %switch.offset = add nsw i64 %switch.idx.mult, 7 %max.0 = select i1 %1, i64 %switch.offset, i64 1 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, %max.0 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9 for.body: ; preds = %entry, %for.cond %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds %struct.GROUP_t, ptr %pstGroup, i64 0, i32 1, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp12 = icmp eq i32 %2, %aXY br i1 %cmp12, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond %retval.0 = phi i32 [ -1, %for.cond ], [ %0, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = { 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 #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 = !{!12, !6, i64 0} !12 = !{!"", !6, i64 0, !7, i64 4}
#include <stdio.h> #include <stdlib.h> int main() { int a[7]={1,3,5,7,8,10,12}; int b[4]={4,6,9,11}; int c[1]={2},e,d,i,w,z,h; while(~scanf("%d%d",&e,&d)) { w=0;z=0;h=0; { for(i=0;i<7;i++) { if(e==a[i]) w++; if(d==a[i]) w++; } for(i=0;i<4;i++) { if(e==b[i]) z++; if(d==b[i]) z++; } for(i=0;i<1;i++) { if(e==c[i]) h++; if(d==c[i]) h++; } if(w==2||z==2||h==2) { printf("Yes\n"); } else printf("No\n"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130496/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130496/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %e = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 %call79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e, ptr noundef nonnull %d) %tobool.not80 = icmp eq i32 %call79, -1 br i1 %tobool.not80, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.cond.preheader %0 = load i32, ptr %e, align 4, !tbaa !5 %1 = load i32, ptr %d, align 4, !tbaa !5 %2 = insertelement <4 x i32> poison, i32 %0, i64 0 %3 = insertelement <4 x i32> %2, i32 %1, i64 1 %4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1> %5 = icmp eq <4 x i32> %4, <i32 8, i32 8, i32 10, i32 10> %cmp1.6 = icmp eq i32 %0, 12 %inc.6 = zext i1 %cmp1.6 to i32 %cmp4.6 = icmp eq i32 %1, 12 %inc6.6 = zext i1 %cmp4.6 to i32 %6 = insertelement <8 x i32> poison, i32 %1, i64 0 %7 = insertelement <8 x i32> %6, i32 %0, i64 1 %8 = shufflevector <8 x i32> %7, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1> %9 = icmp eq <8 x i32> %8, <i32 4, i32 4, i32 6, i32 6, i32 9, i32 9, i32 11, i32 11> %10 = bitcast <8 x i1> %9 to i8 %11 = call i8 @llvm.ctpop.i8(i8 %10), !range !9 %12 = icmp eq <8 x i32> %8, <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7> %13 = bitcast <8 x i1> %12 to i8 %14 = call i8 @llvm.ctpop.i8(i8 %13), !range !9 %15 = zext i8 %14 to i32 %16 = bitcast <4 x i1> %5 to i4 %17 = call i4 @llvm.ctpop.i4(i4 %16), !range !10 %18 = zext i4 %17 to i32 %op.rdx = add nuw nsw i32 %15, %18 %op.rdx83 = add nuw nsw i32 %op.rdx, %inc.6 %op.rdx84 = add nuw nsw i32 %op.rdx83, %inc6.6 %cmp32 = icmp eq i32 %0, 2 %cmp38 = icmp eq i32 %1, 2 %cmp45 = icmp eq i32 %op.rdx84, 2 %cmp46 = icmp eq i8 %11, 2 %or.cond = select i1 %cmp45, i1 true, i1 %cmp46 %cmp48 = and i1 %cmp32, %cmp38 %or.cond53 = select i1 %or.cond, i1 true, i1 %cmp48 %str.3.str = select i1 %or.cond53, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e, ptr noundef nonnull %d) %tobool.not = icmp eq i32 %call, -1 br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %for.cond.preheader, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.ctpop.i8(i8) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i4 @llvm.ctpop.i4(i4) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i8 0, i8 9} !10 = !{i4 0, i4 5} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
// Ver19.02 #include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #define INF 1 << 29 #define LLINF 4545454545454545454 #define MOD 1000000007 #define ll long long #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) 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); } int main() { int a[] = {1, 3, 5, 7, 8, 10, 12}; int b[] = {4, 6, 9, 11}; int x, y; scanf("%d%d", &x, &y); if (x == 2 || y == 2) { puts("No"); return 0; } for (int i = 0; i < sizeof(a) / sizeof(int); i++) { if (x == a[i]) { if (y == 4 || y == 6 || y == 9 || y == 11) { puts("No"); return 0; } else { puts("Yes"); return 0; } } } if (y == 4 || y == 6 || y == 9 || y == 11) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130546/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130546/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @switch.table.main = private unnamed_addr constant [8 x ptr] [ptr @.str.2, ptr @.str.1, ptr @.str.2, ptr @.str.1, ptr @.str.1, ptr @.str.2, ptr @.str.1, ptr @.str.2], align 8 @switch.table.main.3 = private unnamed_addr constant [8 x ptr] [ptr @.str.1, ptr @.str.2, ptr @.str.1, ptr @.str.2, ptr @.str.2, ptr @.str.1, ptr @.str.2, ptr @.str.1], align 8 ; 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 nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !9 %cmp = icmp eq i32 %0, 2 %1 = load i32, ptr %y, align 4 %cmp1 = icmp eq i32 %1, 2 %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %cleanup39, label %for.body.preheader for.body.preheader: ; preds = %entry switch i32 %0, label %for.cond.6 [ i32 1, label %if.then7 i32 3, label %if.then7 i32 5, label %if.then7 i32 7, label %if.then7 i32 8, label %if.then7 i32 10, label %if.then7 i32 12, label %if.then7 ] for.cond.6: ; preds = %for.body.preheader %switch.tableidx = add i32 %1, -4 %2 = icmp ult i32 %switch.tableidx, 8 br i1 %2, label %switch.lookup, label %cleanup39 if.then7: ; preds = %for.body.preheader, %for.body.preheader, %for.body.preheader, %for.body.preheader, %for.body.preheader, %for.body.preheader, %for.body.preheader %switch.tableidx54 = add i32 %1, -4 %3 = icmp ult i32 %switch.tableidx54, 8 br i1 %3, label %switch.lookup53, label %cleanup39 switch.lookup: ; preds = %for.cond.6 %4 = sext i32 %switch.tableidx to i64 %switch.gep = getelementptr inbounds [8 x ptr], ptr @switch.table.main, i64 0, i64 %4 br label %cleanup39.sink.split switch.lookup53: ; preds = %if.then7 %5 = sext i32 %switch.tableidx54 to i64 %switch.gep55 = getelementptr inbounds [8 x ptr], ptr @switch.table.main.3, i64 0, i64 %5 br label %cleanup39.sink.split cleanup39.sink.split: ; preds = %switch.lookup, %switch.lookup53 %switch.gep55.sink = phi ptr [ %switch.gep55, %switch.lookup53 ], [ %switch.gep, %switch.lookup ] %switch.load56 = load ptr, ptr %switch.gep55.sink, align 8 br label %cleanup39 cleanup39: ; preds = %cleanup39.sink.split, %for.cond.6, %if.then7, %entry %.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.then7 ], [ @.str.1, %for.cond.6 ], [ %switch.load56, %cleanup39.sink.split ] %call20 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0}
#include <stdio.h> int main () { long int a,b,c; scanf("%ld %ld %ld", &a, &b, &c); long int x[4] = {2*(a+b), a+b+c, 2*(a+c), 2*(b+c)}; long int i, min = x[0]; for (i = 0; i < 4; i++) min = min>x[i]?x[i]:min; printf("%ld\n", min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13059/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13059/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %add = add nsw i64 %1, %0 %mul = shl nsw i64 %add, 1 %2 = load i64, ptr %c, align 8, !tbaa !5 %add2 = add nsw i64 %2, %add %add4 = add nsw i64 %2, %0 %mul5 = shl nsw i64 %add4, 1 %add7 = add nsw i64 %2, %1 %mul8 = shl nsw i64 %add7, 1 %.min.0.1 = call i64 @llvm.smin.i64(i64 %mul, i64 %add2) %.min.0.2 = call i64 @llvm.smin.i64(i64 %.min.0.1, i64 %mul5) %.min.0.3 = call i64 @llvm.smin.i64(i64 %.min.0.2, i64 %mul8) %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.min.0.3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int x,y; int number[13] = {3,0,2,0,1,0,1,0,0,1,0,1,0}; scanf( "%d %d", &x,&y ); if( number[x] == number[y] ){ printf("Yes"); } else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130632/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %number = alloca [13 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %number) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %number, i8 0, i64 52, i1 false) store i32 3, ptr %number, align 16 %0 = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 2 store i32 2, ptr %0, align 8 %1 = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 4 store i32 1, ptr %1, align 16 %2 = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 6 store i32 1, ptr %2, align 8 %3 = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 9 store i32 1, ptr %3, align 4 %4 = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 11 store i32 1, ptr %4, align 4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %5 = load i32, ptr %x, align 4, !tbaa !5 %idxprom = sext i32 %5 to i64 %arrayidx = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %7 = load i32, ptr %y, align 4, !tbaa !5 %idxprom1 = sext i32 %7 to i64 %arrayidx2 = getelementptr inbounds [13 x i32], ptr %number, i64 0, i64 %idxprom1 %8 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp eq i32 %6, %8 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %number) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; 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"}
#include <stdio.h> int main(void) { int x, y; int i; int gx = 0, gy = 0; int a[] = {4, 6, 9, 11}; int b[] = {1,3, 5, 7, 8, 10 , 12}; scanf("%d %d", &x, &y); if (x == 2 && y == 2) { gx = 0; gy = 0; } for (i = 0; i < 4; i++) { if (x == a[i]) { gx = 1; } if (y == a[i]) { gy = 1; } } if (gx == 0 || gy == 0) { for (i = 0; i < 7; i++) { if (x == b[i]) { gx = 2; } if (y == b[i]){ gy = 2; } } } if (gx == gy) { printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130676/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130676/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4 %2 = and i32 %0, -3 %narrow = icmp eq i32 %2, 4 %3 = and i32 %1, -3 %narrow59 = icmp eq i32 %3, 4 %cmp8.2 = icmp eq i32 %1, 9 %narrow61 = or i1 %cmp8.2, %narrow59 %4 = and i32 %0, -3 %5 = icmp eq i32 %4, 9 %narrow62 = or i1 %5, %narrow %cmp8.3 = icmp eq i32 %1, 11 %narrow63 = select i1 %cmp8.3, i1 true, i1 %narrow61 %6 = select i1 %narrow62, i1 %narrow63, i1 false br i1 %6, label %if.end35, label %for.body16.preheader for.body16.preheader: ; preds = %entry %7 = and i32 %0, -3 %8 = icmp eq i32 %7, 1 %9 = and i32 %1, -3 %10 = icmp eq i32 %9, 1 %cmp24.2 = icmp eq i32 %1, 5 %11 = or i1 %cmp24.2, %10 %12 = and i32 %0, -3 %13 = icmp eq i32 %12, 5 %14 = or i1 %13, %8 %15 = add i32 %1, -7 %16 = icmp ult i32 %15, 2 %17 = and i32 %0, -3 %18 = icmp eq i32 %17, 8 %19 = or i1 %18, %14 %cmp24.5 = icmp eq i32 %1, 10 %20 = or i1 %cmp24.5, %16 %cmp19.6 = icmp eq i32 %0, 12 %21 = or i1 %cmp19.6, %19 %cmp24.6 = icmp eq i32 %1, 12 %22 = select i1 %cmp24.6, i1 true, i1 %20 %23 = select i1 %22, i1 true, i1 %11 %24 = xor i1 %narrow63, %narrow62 %25 = select i1 %23, i1 true, i1 %24 %cmp3164 = xor i1 %25, true %cmp31 = select i1 %21, i1 %23, i1 %cmp3164 %spec.select = select i1 %cmp31, ptr @str.3, ptr @str br label %if.end35 if.end35: ; preds = %for.body16.preheader, %entry %str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %for.body16.preheader ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b; scanf("%d %d", &a, &b); printf("%d %d %.5f\n",a/b,a%b,(double)a/(double)b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130719/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130719/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.5f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b, d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = (double)a / b; printf("%d %d %f\n",d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130762/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130762/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %lf\n",d,r,f); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130805/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130805/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a, b; scanf("%d %d", &a, &b); printf("%d %d %f\n", a/b, a%b, (double)a/(double)b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130849/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130849/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=1.00000*a/b; printf("%d %d %.5lf\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130892/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130892/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%d %d %.5lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %f\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130935/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130935/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a2,b2,d,r; double a,b,f; scanf("%lf %lf", &a, &b); a2 = a; b2 = b; d = a/b; r = a2%b2; f = a/b; printf("%d %d %.5lf\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_130979/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_130979/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %.5lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca double, align 8 %b = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load double, ptr %a, align 8, !tbaa !5 %conv = fptosi double %0 to i32 %1 = load double, ptr %b, align 8, !tbaa !5 %conv1 = fptosi double %1 to i32 %div = fdiv double %0, %1 %conv2 = fptosi double %div to i32 %rem = srem i32 %conv, %conv1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv2, i32 noundef %rem, double noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %.8f\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131020/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131020/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.8f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b; scanf("%d",&a); scanf("%d",&b); printf("%d %d %f\n",a/b, a%b, (double)a/(double)b); return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131071/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131071/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv2 = sitofp i32 %1 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); int d,r; double f; d=a/b; r=a%b; f=(double)a/(double)b; printf("%d %d %f\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131121/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131121/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,d,r; double f; scanf("%d%d",&a,&b); d=a/b; r=a%b; f=1.0*a/b; printf("%d %d %5lf\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131165/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131165/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %5lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); printf("%d %d %f\n", a / b, a % b, (double)a / b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131208/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131208/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; scanf("%d %d", &a, &b); printf("%d %d %f\n", a / b, a % b, (double)a / b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131251/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131251/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main (void) { int a=0,b=0,d=0,r=0; double f=0; scanf("%d%d",&a,&b); d=a/b; r=a%b; f=(double)a/(double)b; printf("%d %d %f\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131295/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131295/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 store i32 0, ptr %a, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 store i32 0, ptr %b, align 4, !tbaa !5 %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 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ double a,b; scanf("%lf %lf",&a,&b); printf("%d %d %lf\n",(int)a/(int)b,(int)a%(int)b,a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131338/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131338/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca double, align 8 %b = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load double, ptr %a, align 8, !tbaa !5 %conv = fptosi double %0 to i32 %1 = load double, ptr %b, align 8, !tbaa !5 %conv1 = fptosi double %1 to i32 %div = sdiv i32 %conv, %conv1 %rem = srem i32 %conv, %conv1 %div4 = fdiv double %0, %1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div4) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b,d,r ; double f ; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %lf\n",d,r,f); return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131381/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131381/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b; double c; scanf("%d%d",&a,&b); c = (double)a/b; printf("%d %d %f\n",a/b,a%b,c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131431/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131431/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %b, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %div = fdiv double %conv, %conv1 %div2 = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2, i32 noundef %rem, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a,b,d,r; double f; scanf("%d",&a); scanf("%d",&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %lf\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131503/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131503/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv2 = sitofp i32 %1 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a, b, d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a - b * d; f = (double)a / b; printf("%d %d %f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131547/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131547/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %mul = mul nsw i32 %div, %1 %sub.recomposed = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %sub.recomposed, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b; double aa,bb,d; scanf("%d %d",&a,&b); aa = 1.0*a; bb = 1.0*b; d = aa / bb; printf("%d %d %f\n",a/b,a%b,d); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131604/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131604/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %conv = sitofp i32 %0 to double %1 = load i32, ptr %b, align 4, !tbaa !5 %conv1 = sitofp i32 %1 to double %div = fdiv double %conv, %conv1 %div3 = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div3, i32 noundef %rem, double noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d = a/b; r = a%b; f = (double)a/(double)b; printf("%d %d %f\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131655/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131655/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %f\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131727/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131727/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b, d, r; double i, j, f; scanf("%d %d", &a, &b); if ((1 <= a) && (1 <= b)) { d = a / b; r = a % b; i = a; j = b; f = i / j; printf("%d %d %.5f\n",d,r,f); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131770/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131770/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %.5f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 0 %1 = load i32, ptr %b, align 4 %cmp1 = icmp sgt i32 %1, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %entry %div = udiv i32 %0, %1 %rem = urem i32 %0, %1 %conv = sitofp i32 %0 to double %conv2 = sitofp i32 %1 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div3) br label %if.end if.end: ; preds = %if.then, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b; int d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = (double)a / b; printf("%d %d %f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131813/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131813/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a, b, c, d ; double e; scanf("%d%d", &a, &b); c = a / b; d = a%b; e = (double)a / b; printf("%d %d %f",c, d, e); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131857/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131857/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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"}
/*ITP1_4_A.c*/ #include<stdio.h> int main(void){ int a,b,d,r; scanf("%d %d",&a,&b); d=a/b; r=a%b; printf("%d %d %f\n",d,r,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131907/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131907/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/(double)b; printf("%d %d %lf\n",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131950/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131950/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a, b; scanf("%d %d", &a, &b); printf("%d %d %f\n", a / b, a % b, (double)a / b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_131994/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_131994/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %f\n",d,r,f); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132036/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132036/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int fun(int x){ if((x % 3 == 0) || (x % 7 == 0)){ return 1; } if(x > 7){ return fun(x - 7); } else{ return 0; } } int main(){ int t; scanf("%d",&t); while(t--){ int x; scanf("%d",&x); int a = fun(x); if(a) printf("YES\n"); else printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13208/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13208/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fun(i32 noundef %x) local_unnamed_addr #0 { entry: %rem8 = srem i32 %x, 3 %cmp9 = icmp eq i32 %rem8, 0 %rem110 = srem i32 %x, 7 %cmp211 = icmp eq i32 %rem110, 0 %or.cond12 = or i1 %cmp9, %cmp211 br i1 %or.cond12, label %return, label %if.end tailrecurse: ; preds = %if.end %sub = add nsw i32 %x.tr13, -7 %rem15 = urem i32 %sub, 3 %cmp = icmp eq i32 %rem15, 0 %rem116 = urem i32 %sub, 7 %cmp2 = icmp eq i32 %rem116, 0 %or.cond = or i1 %cmp, %cmp2 br i1 %or.cond, label %return, label %if.end if.end: ; preds = %entry, %tailrecurse %x.tr13 = phi i32 [ %sub, %tailrecurse ], [ %x, %entry ] %cmp3 = icmp sgt i32 %x.tr13, 7 br i1 %cmp3, label %tailrecurse, label %return return: ; preds = %tailrecurse, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ 0, %if.end ], [ 1, %tailrecurse ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %t = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec9 = add nsw i32 %0, -1 store i32 %dec9, ptr %t, align 4, !tbaa !5 %tobool.not10 = icmp eq i32 %0, 0 br i1 %tobool.not10, label %while.end, label %while.body while.body: ; preds = %entry, %if.end call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %1 = load i32, ptr %x, align 4, !tbaa !5 %rem8.i = srem i32 %1, 3 %cmp9.i = icmp eq i32 %rem8.i, 0 %rem110.i = srem i32 %1, 7 %cmp211.i = icmp eq i32 %rem110.i, 0 %or.cond12.i = or i1 %cmp9.i, %cmp211.i br i1 %or.cond12.i, label %if.end, label %if.end.i tailrecurse.i: ; preds = %if.end.i %sub.i = add nsw i32 %x.tr13.i, -7 %rem15.i = urem i32 %sub.i, 3 %cmp.i = icmp eq i32 %rem15.i, 0 %rem116.i = urem i32 %sub.i, 7 %cmp2.i = icmp eq i32 %rem116.i, 0 %or.cond.i = or i1 %cmp.i, %cmp2.i br i1 %or.cond.i, label %if.end, label %if.end.i if.end.i: ; preds = %while.body, %tailrecurse.i %x.tr13.i = phi i32 [ %sub.i, %tailrecurse.i ], [ %1, %while.body ] %cmp3.i = icmp sgt i32 %x.tr13.i, 7 br i1 %cmp3.i, label %tailrecurse.i, label %if.end if.end: ; preds = %if.end.i, %tailrecurse.i, %while.body %str.sink = phi ptr [ @str.3, %while.body ], [ @str.3, %tailrecurse.i ], [ @str, %if.end.i ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 %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.end, %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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 a, b, d, r; double f; scanf("%d %d", &a, &b); d = a/b; r = a%b; f = (double)a/(double)b; printf("%d %d %f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132122/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132122/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b, d,r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = 1.0*a / b; printf("%d %d %lf",d,r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132166/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132166/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %lf\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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"}