Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
// AOJ 0504: Card Game II // 2017.12.6 bal4u@uu #include <stdio.h> #include <string.h> #define N 6 char ans[10015], *ap = ans+1; int d[10015]; void calc(int b, int n) { int i, a; for (a = 1, i = 0; a > 0 && i <= n; i++) { d[i] += a / b, a %= b; a *= 10; } } int main() { int n, k, m, r, i; while (scanf("%d%d%d%d", &n, &k, &m, &r) && n > 0) { r += N; memset(d, 0, sizeof(d)); calc(n, r); if (m == 1) for (k = n, i = 1; i < n; i++, k+=n) calc(k, r); for (k = 0, i = r; i >= 0; i--) { k += d[i]; ap[i] = '0' + k % 10; k /= 10; } ans[0] = ans[1], ans[1] = '.'; ans[r-N+2] = 0; puts(ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_250808/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_250808/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ans = dso_local global [10015 x i8] zeroinitializer, align 16 @ap = dso_local local_unnamed_addr global ptr getelementptr inbounds ([10015 x i8], ptr @ans, i64 0, i64 1), align 8 @d = dso_local local_unnamed_addr global [10015 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @calc(i32 noundef %b, i32 noundef %n) local_unnamed_addr #0 { entry: %cmp18 = icmp sgt i32 %n, -1 br i1 %cmp18, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = zext i32 %n to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %a.010 = phi i32 [ 1, %for.body.preheader ], [ %mul, %for.body ] %div = sdiv i32 %a.010, %b %arrayidx = getelementptr inbounds [10015 x i32], ptr @d, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %1, %div store i32 %add, ptr %arrayidx, align 4, !tbaa !5 %rem = srem i32 %a.010, %b %mul = mul nsw i32 %rem, 10 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp = icmp sgt i32 %rem, 0 %cmp1 = icmp ult i64 %indvars.iv, %0 %2 = and i1 %cmp, %cmp1 br i1 %2, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %m = alloca i32, align 4 %r = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5 %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %m, ptr noundef nonnull %r) %tobool42 = icmp ne i32 %call41, 0 %0 = load i32, ptr %n, align 4 %cmp43 = icmp sgt i32 %0, 0 %1 = select i1 %tobool42, i1 %cmp43, i1 false br i1 %1, label %while.body, label %while.end while.body: ; preds = %entry, %for.end12 %2 = phi i32 [ %20, %for.end12 ], [ %0, %entry ] %3 = load i32, ptr %r, align 4, !tbaa !5 %add = add i32 %3, 6 store i32 %add, ptr %r, align 4, !tbaa !5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40060) @d, i8 0, i64 40060, i1 false) %cmp18.i = icmp sgt i32 %3, -7 br i1 %cmp18.i, label %for.body.preheader.i, label %calc.exit for.body.preheader.i: ; preds = %while.body %4 = zext i32 %add to i64 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %a.010.i = phi i32 [ 1, %for.body.preheader.i ], [ %mul.i, %for.body.i ] %div.i = sdiv i32 %a.010.i, %2 %arrayidx.i = getelementptr inbounds [10015 x i32], ptr @d, i64 0, i64 %indvars.iv.i %5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %add.i = add nsw i32 %5, %div.i store i32 %add.i, ptr %arrayidx.i, align 4, !tbaa !5 %rem.i = srem i32 %a.010.i, %2 %mul.i = mul nsw i32 %rem.i, 10 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %cmp.i = icmp sgt i32 %rem.i, 0 %cmp1.i = icmp ult i64 %indvars.iv.i, %4 %6 = and i1 %cmp1.i, %cmp.i br i1 %6, label %for.body.i, label %calc.exit, !llvm.loop !9 calc.exit: ; preds = %for.body.i, %while.body %7 = load i32, ptr %m, align 4, !tbaa !5 %cmp1 = icmp eq i32 %7, 1 %cmp236 = icmp sgt i32 %2, 1 %or.cond = select i1 %cmp1, i1 %cmp236, i1 false br i1 %or.cond, label %for.body.lr.ph, label %if.end for.body.lr.ph: ; preds = %calc.exit %8 = zext i32 %add to i64 br i1 %cmp18.i, label %for.body.us, label %for.end12.critedge for.body.us: ; preds = %for.body.lr.ph, %calc.exit35.loopexit.us %i.038.us = phi i32 [ %inc.us, %calc.exit35.loopexit.us ], [ 1, %for.body.lr.ph ] %storemerge37.us = phi i32 [ %add3.us, %calc.exit35.loopexit.us ], [ %2, %for.body.lr.ph ] br label %for.body.i24.us for.body.i24.us: ; preds = %for.body.i24.us, %for.body.us %indvars.iv.i25.us = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next.i32.us, %for.body.i24.us ] %a.010.i26.us = phi i32 [ 1, %for.body.us ], [ %mul.i31.us, %for.body.i24.us ] %div.i27.us = sdiv i32 %a.010.i26.us, %storemerge37.us %arrayidx.i28.us = getelementptr inbounds [10015 x i32], ptr @d, i64 0, i64 %indvars.iv.i25.us %9 = load i32, ptr %arrayidx.i28.us, align 4, !tbaa !5 %add.i29.us = add nsw i32 %9, %div.i27.us store i32 %add.i29.us, ptr %arrayidx.i28.us, align 4, !tbaa !5 %rem.i30.us = srem i32 %a.010.i26.us, %storemerge37.us %mul.i31.us = mul nsw i32 %rem.i30.us, 10 %indvars.iv.next.i32.us = add nuw nsw i64 %indvars.iv.i25.us, 1 %cmp.i33.us = icmp sgt i32 %rem.i30.us, 0 %cmp1.i34.us = icmp ult i64 %indvars.iv.i25.us, %8 %10 = and i1 %cmp1.i34.us, %cmp.i33.us br i1 %10, label %for.body.i24.us, label %calc.exit35.loopexit.us, !llvm.loop !9 calc.exit35.loopexit.us: ; preds = %for.body.i24.us %inc.us = add nuw nsw i32 %i.038.us, 1 %add3.us = add nsw i32 %storemerge37.us, %2 %exitcond.not = icmp eq i32 %inc.us, %2 br i1 %exitcond.not, label %if.end, label %for.body.us, !llvm.loop !11 if.end: ; preds = %calc.exit35.loopexit.us, %calc.exit store i32 0, ptr %k, align 4, !tbaa !5 br i1 %cmp18.i, label %for.body6.preheader, label %for.end12 for.body6.preheader: ; preds = %if.end %11 = zext i32 %add to i64 br label %for.body6 for.body6: ; preds = %for.body6.preheader, %for.body6 %12 = phi i32 [ 0, %for.body6.preheader ], [ %div, %for.body6 ] %indvars.iv = phi i64 [ %11, %for.body6.preheader ], [ %indvars.iv.next, %for.body6 ] %arrayidx = getelementptr inbounds [10015 x i32], ptr @d, i64 0, i64 %indvars.iv %13 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add7 = add nsw i32 %12, %13 store i32 %add7, ptr %k, align 4, !tbaa !5 %rem = srem i32 %add7, 10 %14 = trunc i32 %rem to i8 %conv = add nsw i8 %14, 48 %15 = load ptr, ptr @ap, align 8, !tbaa !12 %arrayidx10 = getelementptr inbounds i8, ptr %15, i64 %indvars.iv store i8 %conv, ptr %arrayidx10, align 1, !tbaa !14 %16 = load i32, ptr %k, align 4, !tbaa !5 %div = sdiv i32 %16, 10 store i32 %div, ptr %k, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %17 = trunc i64 %indvars.iv to i32 %cmp5 = icmp sgt i32 %17, 0 br i1 %cmp5, label %for.body6, label %for.end12.loopexit, !llvm.loop !15 for.end12.loopexit: ; preds = %for.body6 %.pre = load i32, ptr %r, align 4, !tbaa !5 br label %for.end12 for.end12.critedge: ; preds = %for.body.lr.ph store i32 0, ptr %k, align 4, !tbaa !5 br label %for.end12 for.end12: ; preds = %for.end12.critedge, %for.end12.loopexit, %if.end %18 = phi i32 [ %.pre, %for.end12.loopexit ], [ %add, %if.end ], [ %add, %for.end12.critedge ] %19 = load i8, ptr getelementptr inbounds ([10015 x i8], ptr @ans, i64 0, i64 1), align 1, !tbaa !14 store i8 %19, ptr @ans, align 16, !tbaa !14 store i8 46, ptr getelementptr inbounds ([10015 x i8], ptr @ans, i64 0, i64 1), align 1, !tbaa !14 %add13 = add nsw i32 %18, -4 %idxprom14 = sext i32 %add13 to i64 %arrayidx15 = getelementptr inbounds [10015 x i8], ptr @ans, i64 0, i64 %idxprom14 store i8 0, ptr %arrayidx15, align 1, !tbaa !14 %call16 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @ans) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %m, ptr noundef nonnull %r) %tobool = icmp ne i32 %call, 0 %20 = load i32, ptr %n, align 4 %cmp = icmp sgt i32 %20, 0 %21 = select i1 %tobool, i1 %cmp, i1 false br i1 %21, label %while.body, label %while.end, !llvm.loop !16 while.end: ; preds = %for.end12, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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: 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree 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 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> int main() { int a[200],b[200],c[200],i=0,j,k; while(scanf("%d %d",&a[i],&b[i])!=EOF) { c[i] = a[i] + b[i]; i++; if(i==200) break; } for(j=0; j<i; j++) { for(k=0; c[j]>=1; k++) c[j]/=10; printf("%d\n",k); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_250851/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_250851/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [200 x i32], align 16 %b = alloca [200 x i32], align 16 %c = alloca [200 x i32], align 16 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %c) #3 br label %while.cond while.cond: ; preds = %while.body, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [200 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [200 x i32], ptr %b, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body while.body: ; preds = %while.cond %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %arrayidx8 = getelementptr inbounds [200 x i32], ptr %c, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx8, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp9 = icmp eq i64 %indvars.iv.next, 200 br i1 %cmp9, label %for.cond11.preheader.preheader, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %2 = and i64 %indvars.iv, 4294967295 %cmp1039.not = icmp eq i64 %2, 0 br i1 %cmp1039.not, label %for.end22, label %for.cond11.preheader.preheader for.cond11.preheader.preheader: ; preds = %while.body, %while.end %i.147 = phi i64 [ %indvars.iv, %while.end ], [ 200, %while.body ] %wide.trip.count = and i64 %i.147, 4294967295 br label %for.cond11.preheader for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.end %indvars.iv42 = phi i64 [ 0, %for.cond11.preheader.preheader ], [ %indvars.iv.next43, %for.end ] %arrayidx13 = getelementptr inbounds [200 x i32], ptr %c, i64 0, i64 %indvars.iv42 %arrayidx13.promoted = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp1435 = icmp sgt i32 %arrayidx13.promoted, 0 br i1 %cmp1435, label %for.body15, label %for.end for.body15: ; preds = %for.cond11.preheader, %for.body15 %k.037 = phi i32 [ %inc18, %for.body15 ], [ 0, %for.cond11.preheader ] %div3436 = phi i32 [ %div, %for.body15 ], [ %arrayidx13.promoted, %for.cond11.preheader ] %div = udiv i32 %div3436, 10 %inc18 = add nuw nsw i32 %k.037, 1 %cmp14.not = icmp ult i32 %div3436, 10 br i1 %cmp14.not, label %for.end, label %for.body15, !llvm.loop !11 for.end: ; preds = %for.body15, %for.cond11.preheader %div34.lcssa = phi i32 [ %arrayidx13.promoted, %for.cond11.preheader ], [ %div, %for.body15 ] %k.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ %inc18, %for.body15 ] store i32 %div34.lcssa, ptr %arrayidx13, align 4, !tbaa !5 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa) %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end22, label %for.cond11.preheader, !llvm.loop !12 for.end22: ; preds = %for.end, %while.end call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void){ int x,y,z; int ans; while(1){ z = scanf("%d %d", &x, &y); if(z==EOF)break; ans=0; x = x + y; while(x > 0){ x/=10; ans++; } printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_250895/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_250895/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp10 = icmp eq i32 %call9, -1 br i1 %cmp10, label %while.end5, label %if.end if.end: ; preds = %entry, %while.end %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %add = add nsw i32 %1, %0 store i32 %add, ptr %x, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %add, 0 br i1 %cmp27, label %while.body3, label %while.end while.body3: ; preds = %if.end, %while.body3 %ans.08 = phi i32 [ %inc, %while.body3 ], [ 0, %if.end ] %2 = phi i32 [ %div, %while.body3 ], [ %add, %if.end ] %div = udiv i32 %2, 10 %inc = add nuw nsw i32 %ans.08, 1 %cmp2.not = icmp ult i32 %2, 10 br i1 %cmp2.not, label %while.cond1.while.end_crit_edge, label %while.body3, !llvm.loop !9 while.cond1.while.end_crit_edge: ; preds = %while.body3 store i32 %div, ptr %x, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond1.while.end_crit_edge, %if.end %ans.0.lcssa = phi i32 [ %inc, %while.cond1.while.end_crit_edge ], [ 0, %if.end ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp = icmp eq i32 %call, -1 br i1 %cmp, label %while.end5, label %if.end while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int keta(int x) { int i = 0; while ( x > 0 ) { x /= 10; i++; } return i; } int main(void) { int a, b; while ( scanf("%d %d", &a, &b) != EOF ) { printf("%d\n", keta(a+b)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_250938/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_250938/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @keta(i32 noundef %x) local_unnamed_addr #0 { entry: %cmp3 = icmp sgt i32 %x, 0 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %i.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %x.addr.04 = phi i32 [ %div, %while.body ], [ %x, %entry ] %div = udiv i32 %x.addr.04, 10 %inc = add nuw nsw i32 %i.05, 1 %cmp.not = icmp ult i32 %x.addr.04, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ] ret i32 %i.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not4 = icmp eq i32 %call3, -1 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %keta.exit %0 = load i32, ptr %a, align 4, !tbaa !7 %1 = load i32, ptr %b, align 4, !tbaa !7 %add = add nsw i32 %1, %0 %cmp3.i = icmp sgt i32 %add, 0 br i1 %cmp3.i, label %while.body.i, label %keta.exit while.body.i: ; preds = %while.body, %while.body.i %i.05.i = phi i32 [ %inc.i, %while.body.i ], [ 0, %while.body ] %x.addr.04.i = phi i32 [ %div.i, %while.body.i ], [ %add, %while.body ] %div.i = udiv i32 %x.addr.04.i, 10 %inc.i = add nuw nsw i32 %i.05.i, 1 %cmp.not.i = icmp ult i32 %x.addr.04.i, 10 br i1 %cmp.not.i, label %keta.exit, label %while.body.i, !llvm.loop !5 keta.exit: ; preds = %while.body.i, %while.body %i.0.lcssa.i = phi i32 [ 0, %while.body ], [ %inc.i, %while.body.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %keta.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int main(void) { int a, b, sum, keta; while(scanf("%d %d", &a, &b)!=EOF){ sum=a+b; keta=1; while((sum/=10)>0) keta++; printf("%d\n", keta); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_250981/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_250981/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end5, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp28 = icmp sgt i32 %add, 9 br i1 %cmp28, label %while.body3, label %while.end while.body3: ; preds = %while.body, %while.body3 %keta.010 = phi i32 [ %inc, %while.body3 ], [ 1, %while.body ] %sum.09 = phi i32 [ %div7, %while.body3 ], [ %add, %while.body ] %div7 = udiv i32 %sum.09, 10 %inc = add nuw nsw i32 %keta.010, 1 %cmp2 = icmp ugt i32 %sum.09, 99 br i1 %cmp2, label %while.body3, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %keta.0.lcssa = phi i32 [ 1, %while.body ], [ %inc, %while.body3 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %keta.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end5, label %while.body, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int a; int b; int sum; int c = 1; while (scanf("%d %d", &a, &b) != EOF){ sum = a + b; for (; sum / 10 != 0; sum /= 10){ c++; } printf("%d\n", c); c = 1; } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251023/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251023/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not11 = icmp eq i32 %call10, -1 br i1 %cmp.not11, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %sum.0.off6 = add i32 %add, 9 %cmp1.not7 = icmp ult i32 %sum.0.off6, 19 br i1 %cmp1.not7, label %for.end, label %for.body for.body: ; preds = %while.body, %for.body %c.19 = phi i32 [ %inc, %for.body ], [ 1, %while.body ] %sum.08 = phi i32 [ %div, %for.body ], [ %add, %while.body ] %div = sdiv i32 %sum.08, 10 %inc = add nuw nsw i32 %c.19, 1 %sum.0.off = add nsw i32 %div, 9 %cmp1.not = icmp ult i32 %sum.0.off, 19 br i1 %cmp1.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %c.1.lcssa = phi i32 [ 1, %while.body ], [ %inc, %for.body ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<string.h> int main(){ int a,b; char keta[16]; while(scanf("%d %d",&a,&b)!=EOF){ sprintf(keta,"%d",a+b); printf("%d\n",strlen(keta)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251074/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251074/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %keta = alloca [16 x i8], align 16 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 16, ptr nonnull %keta) #4 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not6 = icmp eq i32 %call5, -1 br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %keta, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add) #4 %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %keta) #5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %keta) #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 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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[200],b[200],c[200],n,j,i=0; while(1) { if((scanf("%d %d",&a[i],&b[i]))==EOF) break; c[i] = a[i] + b[i]; i++; } for(j=0;j<i;j++) { for(n=1;1;n++) { if(c[j]/10 == 0)break; c[j]/=10; } printf("%d\n",n); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251117/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251117/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [200 x i32], align 16 %b = alloca [200 x i32], align 16 %c = alloca [200 x i32], align 16 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %c) #3 %call35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp36 = icmp eq i32 %call35, -1 br i1 %cmp36, label %for.end24, label %if.end for.cond.preheader: ; preds = %if.end %0 = and i64 %indvars.iv.next, 4294967295 %cmp948.not = icmp eq i64 %0, 0 br i1 %cmp948.not, label %for.end24, label %for.cond10.preheader.preheader for.cond10.preheader.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.cond10.preheader if.end: ; preds = %entry, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %arrayidx240 = phi ptr [ %arrayidx2, %if.end ], [ %b, %entry ] %arrayidx39 = phi ptr [ %arrayidx, %if.end ], [ %a, %entry ] %1 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx240, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %arrayidx8 = getelementptr inbounds [200 x i32], ptr %c, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx8, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [200 x i32], ptr %a, i64 0, i64 %indvars.iv.next %arrayidx2 = getelementptr inbounds [200 x i32], ptr %b, i64 0, i64 %indvars.iv.next %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %cmp = icmp eq i32 %call, -1 br i1 %cmp, label %for.cond.preheader, label %if.end for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.end %indvars.iv51 = phi i64 [ 0, %for.cond10.preheader.preheader ], [ %indvars.iv.next52, %for.end ] %arrayidx13 = getelementptr inbounds [200 x i32], ptr %c, i64 0, i64 %indvars.iv51 %arrayidx13.promoted = load i32, ptr %arrayidx13, align 4, !tbaa !5 %.off42 = add i32 %arrayidx13.promoted, 9 %cmp1443 = icmp ult i32 %.off42, 19 br i1 %cmp1443, label %for.end, label %if.end16 if.end16: ; preds = %for.cond10.preheader, %if.end16 %n.045 = phi i32 [ %inc20, %if.end16 ], [ 1, %for.cond10.preheader ] %div4144 = phi i32 [ %div, %if.end16 ], [ %arrayidx13.promoted, %for.cond10.preheader ] %div = sdiv i32 %div4144, 10 %inc20 = add nuw nsw i32 %n.045, 1 %.off = add nsw i32 %div, 9 %cmp14 = icmp ult i32 %.off, 19 br i1 %cmp14, label %for.end, label %if.end16 for.end: ; preds = %if.end16, %for.cond10.preheader %div41.lcssa = phi i32 [ %arrayidx13.promoted, %for.cond10.preheader ], [ %div, %if.end16 ] %n.0.lcssa = phi i32 [ 1, %for.cond10.preheader ], [ %inc20, %if.end16 ] store i32 %div41.lcssa, ptr %arrayidx13, align 4, !tbaa !5 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.0.lcssa) %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 %exitcond.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count br i1 %exitcond.not, label %for.end24, label %for.cond10.preheader, !llvm.loop !9 for.end24: ; preds = %for.end, %entry, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ long long a, b, n; int count; while(scanf("%lld%lld",&a,&b)!=-1){ n=a+b; count=0; while(n){ n/=10; count++; } printf("%d\n", count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251160/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251160/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld%lld\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 i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not11 = icmp eq i32 %call10, -1 br i1 %cmp.not11, label %while.end4, label %while.body while.body: ; preds = %entry, %while.end %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %add = add nsw i64 %1, %0 %tobool.not7 = icmp eq i64 %add, 0 br i1 %tobool.not7, label %while.end, label %while.body2 while.body2: ; preds = %while.body, %while.body2 %count.09 = phi i32 [ %inc, %while.body2 ], [ 0, %while.body ] %n.08 = phi i64 [ %div, %while.body2 ], [ %add, %while.body ] %div = sdiv i64 %n.08, 10 %inc = add nuw nsw i32 %count.09, 1 %n.08.off = add i64 %n.08, 9 %tobool.not = icmp ult i64 %n.08.off, 19 br i1 %tobool.not, label %while.end, label %while.body2, !llvm.loop !9 while.end: ; preds = %while.body2, %while.body %count.0.lcssa = phi i32 [ 0, %while.body ], [ %inc, %while.body2 ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end4, label %while.body, !llvm.loop !11 while.end4: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ int a, b, sum, i, len; while(scanf("%d %d", &a, &b) != EOF){ sum = a + b; for(len = 1; sum >= 10; len++){ sum /= 10; } printf("%d\n", len); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251210/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251210/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp15 = icmp sgt i32 %add, 9 br i1 %cmp15, label %for.body, label %for.end for.body: ; preds = %while.body, %for.body %len.07 = phi i32 [ %inc, %for.body ], [ 1, %while.body ] %sum.06 = phi i32 [ %div, %for.body ], [ %add, %while.body ] %div = udiv i32 %sum.06, 10 %inc = add nuw nsw i32 %len.07, 1 %cmp1 = icmp ugt i32 %sum.06, 99 br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %len.0.lcssa = phi i32 [ 1, %while.body ], [ %inc, %for.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %len.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int a; int b; int keta = 1; int sum; while(scanf("%d %d", &a, &b) != EOF){ sum = a + b; while(sum >= 10){ sum /= 10; keta++; } printf("%d\n", keta); keta = 1; } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251261/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251261/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end5, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp28 = icmp sgt i32 %add, 9 br i1 %cmp28, label %while.body3, label %while.end while.body3: ; preds = %while.body, %while.body3 %sum.010 = phi i32 [ %div, %while.body3 ], [ %add, %while.body ] %keta.19 = phi i32 [ %inc, %while.body3 ], [ 1, %while.body ] %div = udiv i32 %sum.010, 10 %inc = add nuw nsw i32 %keta.19, 1 %cmp2 = icmp ugt i32 %sum.010, 99 br i1 %cmp2, label %while.body3, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %keta.1.lcssa = phi i32 [ 1, %while.body ], [ %inc, %while.body3 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %keta.1.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end5, label %while.body, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int a,b,c; while(scanf("%d %d",&a,&b)!=EOF){ c=a+b; int keta=0; while(c!=0){ c=c/10; keta++; } printf("%d\n",keta); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251304/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251304/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end5, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp2.not8 = icmp eq i32 %add, 0 br i1 %cmp2.not8, label %while.end, label %while.body3 while.body3: ; preds = %while.body, %while.body3 %keta.010 = phi i32 [ %inc, %while.body3 ], [ 0, %while.body ] %c.09 = phi i32 [ %div, %while.body3 ], [ %add, %while.body ] %div = sdiv i32 %c.09, 10 %inc = add nuw nsw i32 %keta.010, 1 %c.09.off = add i32 %c.09, 9 %cmp2.not = icmp ult i32 %c.09.off, 19 br i1 %cmp2.not, label %while.end, label %while.body3, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %keta.0.lcssa = phi i32 [ 0, %while.body ], [ %inc, %while.body3 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %keta.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end5, label %while.body, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ int a, b, c, d; while (scanf("%d %d", &a, &b) != EOF) { c = a + b; d = 0; while (c > 0) { c = c / 10; d++; } printf("%d\n", d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251399/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251399/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end5, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp28 = icmp sgt i32 %add, 0 br i1 %cmp28, label %while.body3, label %while.end while.body3: ; preds = %while.body, %while.body3 %d.010 = phi i32 [ %inc, %while.body3 ], [ 0, %while.body ] %c.09 = phi i32 [ %div, %while.body3 ], [ %add, %while.body ] %div = udiv i32 %c.09, 10 %inc = add nuw nsw i32 %d.010, 1 %cmp2.not = icmp ult i32 %c.09, 10 br i1 %cmp2.not, label %while.end, label %while.body3, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %d.0.lcssa = phi i32 [ 0, %while.body ], [ %inc, %while.body3 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end5, label %while.body, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int a,b,i,s; while(scanf("%d %d",&a,&b)!=EOF){ s=a+b; for(i=0;s!=0;i++){ s/=10; } printf("%d\n",i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251463/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251463/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp1.not5 = icmp eq i32 %add, 0 br i1 %cmp1.not5, label %for.end, label %for.body for.body: ; preds = %while.body, %for.body %s.07 = phi i32 [ %div, %for.body ], [ %add, %while.body ] %i.06 = phi i32 [ %inc, %for.body ], [ 0, %while.body ] %div = sdiv i32 %s.07, 10 %inc = add nuw nsw i32 %i.06, 1 %s.07.off = add i32 %s.07, 9 %cmp1.not = icmp ult i32 %s.07.off, 19 br i1 %cmp1.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %i.0.lcssa = phi i32 [ 0, %while.body ], [ %inc, %for.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int sum[1000],a[1000],b[1000],i,n,count[1000]; i=0; while(scanf("%d %d",&a[i],&b[i])!=EOF){ sum[i]=a[i]+b[i]; i++; } for(n=0;n<i;n++){ count[n]=0; while(sum[n]>0){ count[n]++; sum[n]=sum[n]/10; } } for(n=0;n<i;n++){ printf("%d\n",count[n]); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251506/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251506/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %sum = alloca [1000 x i32], align 16 %a = alloca [1000 x i32], align 16 %b = alloca [1000 x i32], align 16 %count = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %sum) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %count) #3 %call52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not53 = icmp eq i32 %call52, -1 br i1 %cmp.not53, label %for.end34, label %while.body for.cond.preheader: ; preds = %while.body %0 = and i64 %indvars.iv.next, 4294967295 %cmp962.not = icmp eq i64 %0, 0 br i1 %cmp962.not, label %for.end34, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx257 = phi ptr [ %arrayidx2, %while.body ], [ %b, %entry ] %arrayidx56 = phi ptr [ %arrayidx, %while.body ], [ %a, %entry ] %1 = load i32, ptr %arrayidx56, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx257, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %arrayidx8 = getelementptr inbounds [1000 x i32], ptr %sum, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx8, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next %arrayidx2 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv.next %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !9 for.cond26.preheader: ; preds = %for.inc br i1 %cmp962.not, label %for.end34, label %for.body28.preheader for.body28.preheader: ; preds = %for.cond26.preheader %wide.trip.count73 = and i64 %indvars.iv.next, 4294967295 br label %for.body28 for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv67 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next68, %for.inc ] %arrayidx11 = getelementptr inbounds [1000 x i32], ptr %count, i64 0, i64 %indvars.iv67 store i32 0, ptr %arrayidx11, align 4, !tbaa !5 %arrayidx14 = getelementptr inbounds [1000 x i32], ptr %sum, i64 0, i64 %indvars.iv67 %arrayidx14.promoted = load i32, ptr %arrayidx14, align 4, !tbaa !5 %cmp1559 = icmp sgt i32 %arrayidx14.promoted, 0 br i1 %cmp1559, label %while.body16, label %for.inc while.body16: ; preds = %for.body, %while.body16 %3 = phi i32 [ %inc19, %while.body16 ], [ 0, %for.body ] %div515860 = phi i32 [ %div51, %while.body16 ], [ %arrayidx14.promoted, %for.body ] %inc19 = add nuw nsw i32 %3, 1 %div51 = udiv i32 %div515860, 10 %cmp15.not = icmp ult i32 %div515860, 10 br i1 %cmp15.not, label %while.cond12.for.inc_crit_edge, label %while.body16, !llvm.loop !11 while.cond12.for.inc_crit_edge: ; preds = %while.body16 store i32 %inc19, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %while.cond12.for.inc_crit_edge, %for.body %div5158.lcssa = phi i32 [ %div51, %while.cond12.for.inc_crit_edge ], [ %arrayidx14.promoted, %for.body ] store i32 %div5158.lcssa, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %exitcond.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count br i1 %exitcond.not, label %for.cond26.preheader, label %for.body, !llvm.loop !12 for.body28: ; preds = %for.body28.preheader, %for.body28 %indvars.iv70 = phi i64 [ 0, %for.body28.preheader ], [ %indvars.iv.next71, %for.body28 ] %arrayidx30 = getelementptr inbounds [1000 x i32], ptr %count, i64 0, i64 %indvars.iv70 %4 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1 %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73 br i1 %exitcond74.not, label %for.end34, label %for.body28, !llvm.loop !13 for.end34: ; preds = %for.body28, %entry, %for.cond.preheader, %for.cond26.preheader call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %count) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %sum) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(void) { int a,b, sum,d; while(scanf("%d %d", &a, &b)!=EOF) { d=1; sum=a+b; while(sum >= 10) { sum /=10; d++; } printf("%d\n", d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251557/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251557/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end5, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp28 = icmp sgt i32 %add, 9 br i1 %cmp28, label %while.body3, label %while.end while.body3: ; preds = %while.body, %while.body3 %d.010 = phi i32 [ %inc, %while.body3 ], [ 1, %while.body ] %sum.09 = phi i32 [ %div, %while.body3 ], [ %add, %while.body ] %div = udiv i32 %sum.09, 10 %inc = add nuw nsw i32 %d.010, 1 %cmp2 = icmp ugt i32 %sum.09, 99 br i1 %cmp2, label %while.body3, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %d.0.lcssa = phi i32 [ 1, %while.body ], [ %inc, %while.body3 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end5, label %while.body, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int nDigits( int ); int main( void ) { int i, a, b; while ( scanf( "%d %d", &a, &b ) == 2 ) printf( "%d\n", nDigits( a + b ) ); return 0; } int nDigits( int x ) { int d = 1; while ( ( x /= 10 ) > 0 ) d++; return d; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251607/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251607/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp4 = icmp eq i32 %call3, 2 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %nDigits.exit %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp3.i = icmp sgt i32 %add, 9 br i1 %cmp3.i, label %while.body.i, label %nDigits.exit while.body.i: ; preds = %while.body, %while.body.i %d.05.i = phi i32 [ %inc.i, %while.body.i ], [ 1, %while.body ] %x.addr.04.i = phi i32 [ %div2.i, %while.body.i ], [ %add, %while.body ] %div2.i = udiv i32 %x.addr.04.i, 10 %inc.i = add nuw nsw i32 %d.05.i, 1 %cmp.i = icmp ugt i32 %x.addr.04.i, 99 br i1 %cmp.i, label %while.body.i, label %nDigits.exit, !llvm.loop !9 nDigits.exit: ; preds = %while.body.i, %while.body %d.0.lcssa.i = phi i32 [ 1, %while.body ], [ %inc.i, %while.body.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0.lcssa.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %nDigits.exit, %entry 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: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nDigits(i32 noundef %x) local_unnamed_addr #3 { entry: %cmp3 = icmp sgt i32 %x, 9 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %d.05 = phi i32 [ %inc, %while.body ], [ 1, %entry ] %x.addr.04 = phi i32 [ %div2, %while.body ], [ %x, %entry ] %div2 = udiv i32 %x.addr.04, 10 %inc = add nuw nsw i32 %d.05, 1 %cmp = icmp ugt i32 %x.addr.04, 99 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %d.0.lcssa = phi i32 [ 1, %entry ], [ %inc, %while.body ] ret i32 %d.0.lcssa } ; 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"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { int a,b,c,k; while(scanf("%d%d",&a,&b)!=EOF) { k=0; c=a+b; for(;c!=0;) { c=c/10; k++; } printf("%d\n",k); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251650/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251650/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp1.not5 = icmp eq i32 %add, 0 br i1 %cmp1.not5, label %for.end, label %for.body for.body: ; preds = %while.body, %for.body %k.07 = phi i32 [ %inc, %for.body ], [ 0, %while.body ] %c.06 = phi i32 [ %div, %for.body ], [ %add, %while.body ] %div = sdiv i32 %c.06, 10 %inc = add nuw nsw i32 %k.07, 1 %c.06.off = add i32 %c.06, 9 %cmp1.not = icmp ult i32 %c.06.off, 19 br i1 %cmp1.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %k.0.lcssa = phi i32 [ 0, %while.body ], [ %inc, %for.body ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int a, b; int wa; int count = 0; while(scanf("%d %d", &a, &b) != EOF){ wa = a + b; count = 0; do{ wa = wa / 10; count++; }while(wa != 0); printf("%d\n", count); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251700/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251700/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not6 = icmp eq i32 %call5, -1 br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %do.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 br label %do.body do.body: ; preds = %do.body, %while.body %wa.0 = phi i32 [ %add, %while.body ], [ %div, %do.body ] %count.0 = phi i32 [ 0, %while.body ], [ %inc, %do.body ] %div = sdiv i32 %wa.0, 10 %inc = add nuw nsw i32 %count.0, 1 %wa.0.off = add i32 %wa.0, 9 %cmp1.not = icmp ult i32 %wa.0.off, 19 br i1 %cmp1.not, label %do.end, label %do.body, !llvm.loop !9 do.end: ; preds = %do.body %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %do.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { long i,j,a,b; while(scanf("%ld %ld",&a,&b)==2) { long sum=a+b; i=0; while(sum!=0) { sum/=10; i++; } printf("%d\n",i); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251744/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251744/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [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 i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp12 = icmp eq i32 %call11, 2 br i1 %cmp12, label %while.body, label %while.end5 while.body: ; preds = %entry, %while.end %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %add = add nsw i64 %1, %0 %cmp2.not8 = icmp eq i64 %add, 0 br i1 %cmp2.not8, label %while.end, label %while.body3 while.body3: ; preds = %while.body, %while.body3 %sum.010 = phi i64 [ %div, %while.body3 ], [ %add, %while.body ] %i.09 = phi i64 [ %inc, %while.body3 ], [ 0, %while.body ] %div = sdiv i64 %sum.010, 10 %inc = add nuw nsw i64 %i.09, 1 %sum.010.off = add i64 %sum.010, 9 %cmp2.not = icmp ult i64 %sum.010.off, 19 br i1 %cmp2.not, label %while.end, label %while.body3, !llvm.loop !9 while.end: ; preds = %while.body3, %while.body %i.0.lcssa = phi i64 [ 0, %while.body ], [ %inc, %while.body3 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %i.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end5, !llvm.loop !11 while.end5: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { int i,j,k,l; while(scanf("%d%d",&i,&j)!=EOF) { k=i+j; for(l=0;k;l++) k/=10; printf("%d\n",l); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251788/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251788/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j) %cmp.not8 = icmp eq i32 %call7, -1 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %0 = load i32, ptr %i, align 4, !tbaa !5 %1 = load i32, ptr %j, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %tobool.not4 = icmp eq i32 %add, 0 br i1 %tobool.not4, label %for.end, label %for.body for.body: ; preds = %while.body, %for.body %l.06 = phi i32 [ %inc, %for.body ], [ 0, %while.body ] %k.05 = phi i32 [ %div, %for.body ], [ %add, %while.body ] %div = sdiv i32 %k.05, 10 %inc = add nuw nsw i32 %l.06, 1 %k.05.off = add i32 %k.05, 9 %tobool.not = icmp ult i32 %k.05.off, 19 br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %while.body %l.0.lcssa = phi i32 [ 0, %while.body ], [ %inc, %for.body ] %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %l.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i, ptr noundef nonnull %j) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void) { int a,b,i,cnt; while(scanf("%d %d",&a,&b) != EOF){ cnt=1; for(i=10;i<=10000000;i=i*10){ if(a+b>=i){ cnt+=1; } else{ printf("%d\n",cnt); break; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251838/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251838/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %cmp2.not = icmp slt i32 %add, 10 br i1 %cmp2.not, label %if.else, label %if.then if.then: ; preds = %for.cond.preheader %cmp2.not.1 = icmp ult i32 %add, 100 br i1 %cmp2.not.1, label %if.else, label %if.then.1 if.then.1: ; preds = %if.then %cmp2.not.2 = icmp ult i32 %add, 1000 br i1 %cmp2.not.2, label %if.else, label %if.then.2 if.then.2: ; preds = %if.then.1 %cmp2.not.3 = icmp ult i32 %add, 10000 br i1 %cmp2.not.3, label %if.else, label %if.then.3 if.then.3: ; preds = %if.then.2 %cmp2.not.4 = icmp ult i32 %add, 100000 br i1 %cmp2.not.4, label %if.else, label %if.then.4 if.then.4: ; preds = %if.then.3 %cmp2.not.5 = icmp ult i32 %add, 1000000 br i1 %cmp2.not.5, label %if.else, label %if.then.5 if.then.5: ; preds = %if.then.4 %cmp2.not.6 = icmp ult i32 %add, 10000000 br i1 %cmp2.not.6, label %if.else, label %for.end if.else: ; preds = %if.then.5, %if.then.4, %if.then.3, %if.then.2, %if.then.1, %if.then, %for.cond.preheader %cnt.010.lcssa = phi i32 [ 1, %for.cond.preheader ], [ 2, %if.then ], [ 3, %if.then.1 ], [ 4, %if.then.2 ], [ 5, %if.then.3 ], [ 6, %if.then.4 ], [ 7, %if.then.5 ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.010.lcssa) br label %for.end for.end: ; preds = %if.then.5, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !9 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stddef.h> #include <stdio.h> #include <stdlib.h> // I/O void put_uint(int n) { if(!n) { putchar_unlocked('0'); return; } char buf[11]; int i = 0; while(n) buf[i++] = (char)(n % 10 + '0'), n /= 10; while(i--)putchar_unlocked(buf[i]); } void put_str(char *str) { while(*str) putchar_unlocked(*str++); } int get_uint() { int n = 0; int c = getchar_unlocked(); if(c < 48 || 57 < c) return c; while(47 < c && c < 58) n = 10 * n + (c & 0xf), c = getchar_unlocked(); return n; } int get_str(char *str) { int c; while((c = getchar_unlocked()) > 32) *str++ = (char)c; *str = 0; return c; } // // Util #define container_of(ptr, type, member) ({ \ void *__mptr = (void *)(ptr); \ ((type *)(__mptr - offsetof(type, member))); }) // // List struct list_head { struct list_head *next, *prev; }; static inline void INIT_LIST_HEAD(struct list_head *list) { list->next = list; list->prev = list; } static inline void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { next->prev = new; new->next = next; new->prev = prev; prev->next = new; } static inline void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } static inline void list_add_tail(struct list_head *new, struct list_head *head) { __list_add(new, head->prev, head); } static inline void __list_del(struct list_head *prev, struct list_head *next) { next->prev = prev; prev->next = next; } static inline void __list_del_entry(struct list_head *entry) { __list_del(entry->prev, entry->next); } static inline void list_del(struct list_head *entry) { __list_del_entry(entry); entry->next = NULL; entry->prev = NULL; } static inline void list_move_tail(struct list_head *list, struct list_head *head) { __list_del_entry(list); list_add_tail(list, head); } static inline int list_empty(const struct list_head *head) { return head->next == head; } #define list_entry(ptr, type, member) container_of(ptr, type, member) #define list_first_entry(ptr, type, member) list_entry((ptr)->next, type, member) // // my node struct my_node { char str[16]; int num; struct list_head list; }; // int main(int argc, char **argv) { struct list_head head; INIT_LIST_HEAD(&head); int n = get_uint(); int q = get_uint(); for(int i = 0; i < n; ++i) { struct my_node *data = malloc(sizeof(struct my_node)); get_str(data->str); data->num = get_uint(); list_add_tail(&data->list, &head); } int cnt = 0; while(!list_empty(&head)) { struct my_node *data = list_first_entry(&head, struct my_node, list); if(data->num > q) { cnt += q; data->num -= q; list_move_tail(&data->list, &head); } else { cnt += data->num; put_str(data->str); putchar_unlocked(' '); put_uint(cnt); putchar_unlocked('\n'); list_del(&data->list); free(data); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251881/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251881/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] } %struct.list_head = type { ptr, ptr } %struct.my_node = type { [16 x i8], i32, %struct.list_head } @stdout = external local_unnamed_addr global ptr, align 8 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local void @put_uint(i32 noundef %n) local_unnamed_addr #0 { entry: %buf = alloca [11 x i8], align 1 %tobool.not = icmp eq i32 %n, 0 br i1 %tobool.not, label %if.then, label %if.end if.then: ; preds = %entry %0 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 5 %1 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !9 %_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 6 %2 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %if.then %call.i = tail call i32 @__overflow(ptr noundef nonnull %0, i32 noundef 48) #6 br label %return cond.false.i: ; preds = %if.then %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !9 store i8 48, ptr %1, align 1, !tbaa !16 br label %return if.end: ; preds = %entry call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %buf) #6 br label %while.body while.body: ; preds = %if.end, %while.body %indvars.iv28 = phi i32 [ 1, %if.end ], [ %indvars.iv.next29, %while.body ] %indvars.iv = phi i64 [ 0, %if.end ], [ %indvars.iv.next, %while.body ] %n.addr.024 = phi i32 [ %n, %if.end ], [ %div, %while.body ] %rem = srem i32 %n.addr.024, 10 %3 = trunc i32 %rem to i8 %conv = add nsw i8 %3, 48 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [11 x i8], ptr %buf, i64 0, i64 %indvars.iv store i8 %conv, ptr %arrayidx, align 1, !tbaa !16 %div = sdiv i32 %n.addr.024, 10 %n.addr.024.off = add i32 %n.addr.024, 9 %tobool1.not = icmp ult i32 %n.addr.024.off, 19 %indvars.iv.next29 = add nuw i32 %indvars.iv28, 1 br i1 %tobool1.not, label %while.body4.preheader, label %while.body, !llvm.loop !17 while.body4.preheader: ; preds = %while.body %4 = sext i32 %indvars.iv28 to i64 br label %while.body4 while.body4: ; preds = %while.body4.preheader, %putchar_unlocked.exit23 %indvars.iv30 = phi i64 [ %4, %while.body4.preheader ], [ %indvars.iv.next31, %putchar_unlocked.exit23 ] %indvars.iv.next31 = add nsw i64 %indvars.iv30, -1 %arrayidx6 = getelementptr inbounds [11 x i8], ptr %buf, i64 0, i64 %indvars.iv.next31 %5 = load i8, ptr %arrayidx6, align 1, !tbaa !16 %6 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 5 %7 = load ptr, ptr %_IO_write_ptr.i15, align 8, !tbaa !9 %_IO_write_end.i16 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 6 %8 = load ptr, ptr %_IO_write_end.i16, align 8, !tbaa !14 %cmp.not.i17 = icmp ult ptr %7, %8 br i1 %cmp.not.i17, label %cond.false.i21, label %cond.true.i18, !prof !15 cond.true.i18: ; preds = %while.body4 %conv7 = zext i8 %5 to i32 %call.i19 = tail call i32 @__overflow(ptr noundef nonnull %6, i32 noundef %conv7) #6 br label %putchar_unlocked.exit23 cond.false.i21: ; preds = %while.body4 %incdec.ptr.i22 = getelementptr inbounds i8, ptr %7, i64 1 store ptr %incdec.ptr.i22, ptr %_IO_write_ptr.i15, align 8, !tbaa !9 store i8 %5, ptr %7, align 1, !tbaa !16 br label %putchar_unlocked.exit23 putchar_unlocked.exit23: ; preds = %cond.true.i18, %cond.false.i21 %9 = and i64 %indvars.iv.next31, 4294967295 %tobool3.not = icmp eq i64 %9, 0 br i1 %tobool3.not, label %while.end9, label %while.body4, !llvm.loop !19 while.end9: ; preds = %putchar_unlocked.exit23 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %buf) #6 br label %return return: ; preds = %cond.false.i, %cond.true.i, %while.end9 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define dso_local void @put_str(ptr nocapture noundef readonly %str) local_unnamed_addr #0 { entry: %0 = load i8, ptr %str, align 1, !tbaa !16 %tobool.not2 = icmp eq i8 %0, 0 br i1 %tobool.not2, label %while.end, label %while.body while.body: ; preds = %entry, %putchar_unlocked.exit %1 = phi i8 [ %5, %putchar_unlocked.exit ], [ %0, %entry ] %str.addr.03 = phi ptr [ %incdec.ptr, %putchar_unlocked.exit ], [ %str, %entry ] %incdec.ptr = getelementptr inbounds i8, ptr %str.addr.03, i64 1 %2 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %2, i64 0, i32 5 %3 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !9 %_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %2, i64 0, i32 6 %4 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %3, %4 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %while.body %conv = zext i8 %1 to i32 %call.i = tail call i32 @__overflow(ptr noundef nonnull %2, i32 noundef %conv) #6 br label %putchar_unlocked.exit cond.false.i: ; preds = %while.body %incdec.ptr.i = getelementptr inbounds i8, ptr %3, i64 1 store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !9 store i8 %1, ptr %3, align 1, !tbaa !16 br label %putchar_unlocked.exit putchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %5 = load i8, ptr %incdec.ptr, align 1, !tbaa !16 %tobool.not = icmp eq i8 %5, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !20 while.end: ; preds = %putchar_unlocked.exit, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @get_uint() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !21 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !22 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #6 br label %getchar_unlocked.exit cond.false.i: ; preds = %entry %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !21 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %getchar_unlocked.exit getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ] %4 = add i32 %cond.i, -58 %or.cond = icmp ult i32 %4, -10 br i1 %or.cond, label %cleanup, label %while.body.preheader while.body.preheader: ; preds = %getchar_unlocked.exit %.pre24 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit21 %5 = phi ptr [ %9, %getchar_unlocked.exit21 ], [ %.pre24, %while.body.preheader ] %c.023 = phi i32 [ %cond.i17, %getchar_unlocked.exit21 ], [ %cond.i, %while.body.preheader ] %n.022 = phi i32 [ %add, %getchar_unlocked.exit21 ], [ 0, %while.body.preheader ] %mul = mul nsw i32 %n.022, 10 %and = and i32 %c.023, 15 %add = add nsw i32 %and, %mul %_IO_read_ptr.i12 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 1 %6 = load ptr, ptr %_IO_read_ptr.i12, align 8, !tbaa !21 %_IO_read_end.i13 = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 2 %7 = load ptr, ptr %_IO_read_end.i13, align 8, !tbaa !22 %cmp.not.i14 = icmp ult ptr %6, %7 br i1 %cmp.not.i14, label %cond.false.i18, label %cond.true.i15, !prof !15 cond.true.i15: ; preds = %while.body %call.i16 = tail call i32 @__uflow(ptr noundef nonnull %5) #6 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21 cond.false.i18: ; preds = %while.body %incdec.ptr.i19 = getelementptr inbounds i8, ptr %6, i64 1 store ptr %incdec.ptr.i19, ptr %_IO_read_ptr.i12, align 8, !tbaa !21 %8 = load i8, ptr %6, align 1, !tbaa !16 %conv3.i20 = zext i8 %8 to i32 br label %getchar_unlocked.exit21 getchar_unlocked.exit21: ; preds = %cond.true.i15, %cond.false.i18 %9 = phi ptr [ %.pre, %cond.true.i15 ], [ %5, %cond.false.i18 ] %cond.i17 = phi i32 [ %call.i16, %cond.true.i15 ], [ %conv3.i20, %cond.false.i18 ] %10 = add i32 %cond.i17, -48 %11 = icmp ult i32 %10, 10 br i1 %11, label %while.body, label %cleanup, !llvm.loop !23 cleanup: ; preds = %getchar_unlocked.exit21, %getchar_unlocked.exit %retval.0 = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %add, %getchar_unlocked.exit21 ] ret i32 %retval.0 } ; Function Attrs: nounwind uwtable define dso_local i32 @get_str(ptr nocapture noundef writeonly %str) local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.body, %entry %str.addr.0 = phi ptr [ %str, %entry ], [ %incdec.ptr, %while.body ] %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !21 %_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !22 %cmp.not.i = icmp ult ptr %1, %2 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %while.cond %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #6 br label %getchar_unlocked.exit cond.false.i: ; preds = %while.cond %incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !21 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %getchar_unlocked.exit getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ] %cmp = icmp sgt i32 %cond.i, 32 br i1 %cmp, label %while.body, label %while.end while.body: ; preds = %getchar_unlocked.exit %conv = trunc i32 %cond.i to i8 %incdec.ptr = getelementptr inbounds i8, ptr %str.addr.0, i64 1 store i8 %conv, ptr %str.addr.0, align 1, !tbaa !16 br label %while.cond, !llvm.loop !24 while.end: ; preds = %getchar_unlocked.exit store i8 0, ptr %str.addr.0, align 1, !tbaa !16 ret i32 %cond.i } ; Function Attrs: nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %buf.i = alloca [11 x i8], align 1 %head = alloca %struct.list_head, align 8 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %head) #6 store ptr %head, ptr %head, align 8, !tbaa !25 %prev.i = getelementptr inbounds %struct.list_head, ptr %head, i64 0, i32 1 store ptr %head, ptr %prev.i, align 8, !tbaa !27 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1 %1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !21 %_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2 %2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !22 %cmp.not.i.i = icmp ult ptr %1, %2 br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15 cond.true.i.i: ; preds = %entry %call.i.i = call i32 @__uflow(ptr noundef nonnull %0) #6 %.pre.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i cond.false.i.i: ; preds = %entry %incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1 store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !21 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i.i = zext i8 %3 to i32 br label %getchar_unlocked.exit.i getchar_unlocked.exit.i: ; preds = %cond.false.i.i, %cond.true.i.i %.pre = phi ptr [ %.pre.pre, %cond.true.i.i ], [ %0, %cond.false.i.i ] %cond.i.i = phi i32 [ %call.i.i, %cond.true.i.i ], [ %conv3.i.i, %cond.false.i.i ] %4 = add i32 %cond.i.i, -58 %or.cond.i = icmp ult i32 %4, -10 br i1 %or.cond.i, label %get_uint.exit, label %while.body.i while.body.i: ; preds = %getchar_unlocked.exit.i, %getchar_unlocked.exit21.i %5 = phi ptr [ %9, %getchar_unlocked.exit21.i ], [ %.pre, %getchar_unlocked.exit.i ] %c.023.i = phi i32 [ %cond.i17.i, %getchar_unlocked.exit21.i ], [ %cond.i.i, %getchar_unlocked.exit.i ] %n.022.i = phi i32 [ %add.i, %getchar_unlocked.exit21.i ], [ 0, %getchar_unlocked.exit.i ] %mul.i = mul nsw i32 %n.022.i, 10 %and.i = and i32 %c.023.i, 15 %add.i = add nsw i32 %mul.i, %and.i %_IO_read_ptr.i12.i = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 1 %6 = load ptr, ptr %_IO_read_ptr.i12.i, align 8, !tbaa !21 %_IO_read_end.i13.i = getelementptr inbounds %struct._IO_FILE, ptr %5, i64 0, i32 2 %7 = load ptr, ptr %_IO_read_end.i13.i, align 8, !tbaa !22 %cmp.not.i14.i = icmp ult ptr %6, %7 br i1 %cmp.not.i14.i, label %cond.false.i18.i, label %cond.true.i15.i, !prof !15 cond.true.i15.i: ; preds = %while.body.i %call.i16.i = call i32 @__uflow(ptr noundef nonnull %5) #6 %.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21.i cond.false.i18.i: ; preds = %while.body.i %incdec.ptr.i19.i = getelementptr inbounds i8, ptr %6, i64 1 store ptr %incdec.ptr.i19.i, ptr %_IO_read_ptr.i12.i, align 8, !tbaa !21 %8 = load i8, ptr %6, align 1, !tbaa !16 %conv3.i20.i = zext i8 %8 to i32 br label %getchar_unlocked.exit21.i getchar_unlocked.exit21.i: ; preds = %cond.false.i18.i, %cond.true.i15.i %9 = phi ptr [ %.pre.i, %cond.true.i15.i ], [ %5, %cond.false.i18.i ] %cond.i17.i = phi i32 [ %call.i16.i, %cond.true.i15.i ], [ %conv3.i20.i, %cond.false.i18.i ] %10 = add i32 %cond.i17.i, -48 %11 = icmp ult i32 %10, 10 br i1 %11, label %while.body.i, label %get_uint.exit, !llvm.loop !23 get_uint.exit: ; preds = %getchar_unlocked.exit21.i, %getchar_unlocked.exit.i %12 = phi ptr [ %.pre, %getchar_unlocked.exit.i ], [ %9, %getchar_unlocked.exit21.i ] %retval.0.i = phi i32 [ %cond.i.i, %getchar_unlocked.exit.i ], [ %add.i, %getchar_unlocked.exit21.i ] %_IO_read_ptr.i.i31 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 1 %13 = load ptr, ptr %_IO_read_ptr.i.i31, align 8, !tbaa !21 %_IO_read_end.i.i32 = getelementptr inbounds %struct._IO_FILE, ptr %12, i64 0, i32 2 %14 = load ptr, ptr %_IO_read_end.i.i32, align 8, !tbaa !22 %cmp.not.i.i33 = icmp ult ptr %13, %14 br i1 %cmp.not.i.i33, label %cond.false.i.i59, label %cond.true.i.i34, !prof !15 cond.true.i.i34: ; preds = %get_uint.exit %call.i.i35 = call i32 @__uflow(ptr noundef nonnull %12) #6 br label %getchar_unlocked.exit.i36 cond.false.i.i59: ; preds = %get_uint.exit %incdec.ptr.i.i60 = getelementptr inbounds i8, ptr %13, i64 1 store ptr %incdec.ptr.i.i60, ptr %_IO_read_ptr.i.i31, align 8, !tbaa !21 %15 = load i8, ptr %13, align 1, !tbaa !16 %conv3.i.i61 = zext i8 %15 to i32 br label %getchar_unlocked.exit.i36 getchar_unlocked.exit.i36: ; preds = %cond.false.i.i59, %cond.true.i.i34 %cond.i.i37 = phi i32 [ %call.i.i35, %cond.true.i.i34 ], [ %conv3.i.i61, %cond.false.i.i59 ] %16 = add i32 %cond.i.i37, -58 %or.cond.i38 = icmp ult i32 %16, -10 br i1 %or.cond.i38, label %get_uint.exit62, label %while.body.preheader.i39 while.body.preheader.i39: ; preds = %getchar_unlocked.exit.i36 %.pre24.i40 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body.i41 while.body.i41: ; preds = %getchar_unlocked.exit21.i53, %while.body.preheader.i39 %17 = phi ptr [ %21, %getchar_unlocked.exit21.i53 ], [ %.pre24.i40, %while.body.preheader.i39 ] %c.023.i42 = phi i32 [ %cond.i17.i54, %getchar_unlocked.exit21.i53 ], [ %cond.i.i37, %while.body.preheader.i39 ] %n.022.i43 = phi i32 [ %add.i46, %getchar_unlocked.exit21.i53 ], [ 0, %while.body.preheader.i39 ] %mul.i44 = mul nsw i32 %n.022.i43, 10 %and.i45 = and i32 %c.023.i42, 15 %add.i46 = add nsw i32 %mul.i44, %and.i45 %_IO_read_ptr.i12.i47 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 1 %18 = load ptr, ptr %_IO_read_ptr.i12.i47, align 8, !tbaa !21 %_IO_read_end.i13.i48 = getelementptr inbounds %struct._IO_FILE, ptr %17, i64 0, i32 2 %19 = load ptr, ptr %_IO_read_end.i13.i48, align 8, !tbaa !22 %cmp.not.i14.i49 = icmp ult ptr %18, %19 br i1 %cmp.not.i14.i49, label %cond.false.i18.i56, label %cond.true.i15.i50, !prof !15 cond.true.i15.i50: ; preds = %while.body.i41 %call.i16.i51 = call i32 @__uflow(ptr noundef nonnull %17) #6 %.pre.i52 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21.i53 cond.false.i18.i56: ; preds = %while.body.i41 %incdec.ptr.i19.i57 = getelementptr inbounds i8, ptr %18, i64 1 store ptr %incdec.ptr.i19.i57, ptr %_IO_read_ptr.i12.i47, align 8, !tbaa !21 %20 = load i8, ptr %18, align 1, !tbaa !16 %conv3.i20.i58 = zext i8 %20 to i32 br label %getchar_unlocked.exit21.i53 getchar_unlocked.exit21.i53: ; preds = %cond.false.i18.i56, %cond.true.i15.i50 %21 = phi ptr [ %.pre.i52, %cond.true.i15.i50 ], [ %17, %cond.false.i18.i56 ] %cond.i17.i54 = phi i32 [ %call.i16.i51, %cond.true.i15.i50 ], [ %conv3.i20.i58, %cond.false.i18.i56 ] %22 = add i32 %cond.i17.i54, -48 %23 = icmp ult i32 %22, 10 br i1 %23, label %while.body.i41, label %get_uint.exit62, !llvm.loop !23 get_uint.exit62: ; preds = %getchar_unlocked.exit21.i53, %getchar_unlocked.exit.i36 %retval.0.i55 = phi i32 [ %cond.i.i37, %getchar_unlocked.exit.i36 ], [ %add.i46, %getchar_unlocked.exit21.i53 ] %cmp138 = icmp sgt i32 %retval.0.i, 0 br i1 %cmp138, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %get_uint.exit105, %get_uint.exit62 %24 = load ptr, ptr %head, align 8, !tbaa !25 %cmp.i107.not140 = icmp eq ptr %24, %head br i1 %cmp.i107.not140, label %while.end, label %while.body for.body: ; preds = %get_uint.exit62, %get_uint.exit105 %i.0139 = phi i32 [ %inc, %get_uint.exit105 ], [ 0, %get_uint.exit62 ] %call2 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #7 %.pre143 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %while.body.i70, %for.body %25 = phi ptr [ %.pre143, %for.body ], [ %29, %while.body.i70 ] %str.addr.0.i = phi ptr [ %call2, %for.body ], [ %incdec.ptr.i, %while.body.i70 ] %_IO_read_ptr.i.i63 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 1 %26 = load ptr, ptr %_IO_read_ptr.i.i63, align 8, !tbaa !21 %_IO_read_end.i.i64 = getelementptr inbounds %struct._IO_FILE, ptr %25, i64 0, i32 2 %27 = load ptr, ptr %_IO_read_end.i.i64, align 8, !tbaa !22 %cmp.not.i.i65 = icmp ult ptr %26, %27 br i1 %cmp.not.i.i65, label %cond.false.i.i71, label %cond.true.i.i66, !prof !15 cond.true.i.i66: ; preds = %while.cond.i %call.i.i67 = call i32 @__uflow(ptr noundef nonnull %25) #6 %.pre142 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit.i68 cond.false.i.i71: ; preds = %while.cond.i %incdec.ptr.i.i72 = getelementptr inbounds i8, ptr %26, i64 1 store ptr %incdec.ptr.i.i72, ptr %_IO_read_ptr.i.i63, align 8, !tbaa !21 %28 = load i8, ptr %26, align 1, !tbaa !16 %conv3.i.i73 = zext i8 %28 to i32 br label %getchar_unlocked.exit.i68 getchar_unlocked.exit.i68: ; preds = %cond.false.i.i71, %cond.true.i.i66 %29 = phi ptr [ %.pre142, %cond.true.i.i66 ], [ %25, %cond.false.i.i71 ] %cond.i.i69 = phi i32 [ %call.i.i67, %cond.true.i.i66 ], [ %conv3.i.i73, %cond.false.i.i71 ] %cmp.i = icmp sgt i32 %cond.i.i69, 32 br i1 %cmp.i, label %while.body.i70, label %get_str.exit while.body.i70: ; preds = %getchar_unlocked.exit.i68 %conv.i = trunc i32 %cond.i.i69 to i8 %incdec.ptr.i = getelementptr inbounds i8, ptr %str.addr.0.i, i64 1 store i8 %conv.i, ptr %str.addr.0.i, align 1, !tbaa !16 br label %while.cond.i, !llvm.loop !24 get_str.exit: ; preds = %getchar_unlocked.exit.i68 store i8 0, ptr %str.addr.0.i, align 1, !tbaa !16 %_IO_read_ptr.i.i74 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 1 %30 = load ptr, ptr %_IO_read_ptr.i.i74, align 8, !tbaa !21 %_IO_read_end.i.i75 = getelementptr inbounds %struct._IO_FILE, ptr %29, i64 0, i32 2 %31 = load ptr, ptr %_IO_read_end.i.i75, align 8, !tbaa !22 %cmp.not.i.i76 = icmp ult ptr %30, %31 br i1 %cmp.not.i.i76, label %cond.false.i.i102, label %cond.true.i.i77, !prof !15 cond.true.i.i77: ; preds = %get_str.exit %call.i.i78 = call i32 @__uflow(ptr noundef nonnull %29) #6 br label %getchar_unlocked.exit.i79 cond.false.i.i102: ; preds = %get_str.exit %incdec.ptr.i.i103 = getelementptr inbounds i8, ptr %30, i64 1 store ptr %incdec.ptr.i.i103, ptr %_IO_read_ptr.i.i74, align 8, !tbaa !21 %32 = load i8, ptr %30, align 1, !tbaa !16 %conv3.i.i104 = zext i8 %32 to i32 br label %getchar_unlocked.exit.i79 getchar_unlocked.exit.i79: ; preds = %cond.false.i.i102, %cond.true.i.i77 %cond.i.i80 = phi i32 [ %call.i.i78, %cond.true.i.i77 ], [ %conv3.i.i104, %cond.false.i.i102 ] %33 = add i32 %cond.i.i80, -58 %or.cond.i81 = icmp ult i32 %33, -10 br i1 %or.cond.i81, label %get_uint.exit105, label %while.body.preheader.i82 while.body.preheader.i82: ; preds = %getchar_unlocked.exit.i79 %.pre24.i83 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body.i84 while.body.i84: ; preds = %getchar_unlocked.exit21.i96, %while.body.preheader.i82 %34 = phi ptr [ %38, %getchar_unlocked.exit21.i96 ], [ %.pre24.i83, %while.body.preheader.i82 ] %c.023.i85 = phi i32 [ %cond.i17.i97, %getchar_unlocked.exit21.i96 ], [ %cond.i.i80, %while.body.preheader.i82 ] %n.022.i86 = phi i32 [ %add.i89, %getchar_unlocked.exit21.i96 ], [ 0, %while.body.preheader.i82 ] %mul.i87 = mul nsw i32 %n.022.i86, 10 %and.i88 = and i32 %c.023.i85, 15 %add.i89 = add nsw i32 %mul.i87, %and.i88 %_IO_read_ptr.i12.i90 = getelementptr inbounds %struct._IO_FILE, ptr %34, i64 0, i32 1 %35 = load ptr, ptr %_IO_read_ptr.i12.i90, align 8, !tbaa !21 %_IO_read_end.i13.i91 = getelementptr inbounds %struct._IO_FILE, ptr %34, i64 0, i32 2 %36 = load ptr, ptr %_IO_read_end.i13.i91, align 8, !tbaa !22 %cmp.not.i14.i92 = icmp ult ptr %35, %36 br i1 %cmp.not.i14.i92, label %cond.false.i18.i99, label %cond.true.i15.i93, !prof !15 cond.true.i15.i93: ; preds = %while.body.i84 %call.i16.i94 = call i32 @__uflow(ptr noundef nonnull %34) #6 %.pre.i95 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit21.i96 cond.false.i18.i99: ; preds = %while.body.i84 %incdec.ptr.i19.i100 = getelementptr inbounds i8, ptr %35, i64 1 store ptr %incdec.ptr.i19.i100, ptr %_IO_read_ptr.i12.i90, align 8, !tbaa !21 %37 = load i8, ptr %35, align 1, !tbaa !16 %conv3.i20.i101 = zext i8 %37 to i32 br label %getchar_unlocked.exit21.i96 getchar_unlocked.exit21.i96: ; preds = %cond.false.i18.i99, %cond.true.i15.i93 %38 = phi ptr [ %.pre.i95, %cond.true.i15.i93 ], [ %34, %cond.false.i18.i99 ] %cond.i17.i97 = phi i32 [ %call.i16.i94, %cond.true.i15.i93 ], [ %conv3.i20.i101, %cond.false.i18.i99 ] %39 = add i32 %cond.i17.i97, -48 %40 = icmp ult i32 %39, 10 br i1 %40, label %while.body.i84, label %get_uint.exit105, !llvm.loop !23 get_uint.exit105: ; preds = %getchar_unlocked.exit21.i96, %getchar_unlocked.exit.i79 %retval.0.i98 = phi i32 [ %cond.i.i80, %getchar_unlocked.exit.i79 ], [ %add.i89, %getchar_unlocked.exit21.i96 ] %num = getelementptr inbounds %struct.my_node, ptr %call2, i64 0, i32 1 store i32 %retval.0.i98, ptr %num, align 8, !tbaa !28 %list = getelementptr inbounds %struct.my_node, ptr %call2, i64 0, i32 2 %41 = load ptr, ptr %prev.i, align 8, !tbaa !27 store ptr %list, ptr %prev.i, align 8, !tbaa !27 store ptr %head, ptr %list, align 8, !tbaa !25 %prev3.i.i = getelementptr inbounds %struct.my_node, ptr %call2, i64 0, i32 2, i32 1 store ptr %41, ptr %prev3.i.i, align 8, !tbaa !27 store ptr %list, ptr %41, align 8, !tbaa !25 %inc = add nuw nsw i32 %i.0139, 1 %exitcond.not = icmp eq i32 %inc, %retval.0.i br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !30 while.body: ; preds = %while.cond.preheader, %if.end %42 = phi ptr [ %69, %if.end ], [ %24, %while.cond.preheader ] %cnt.0141 = phi i32 [ %cnt.1, %if.end ], [ 0, %while.cond.preheader ] %num7 = getelementptr inbounds i8, ptr %42, i64 -8 %43 = load i32, ptr %num7, align 8, !tbaa !28 %cmp8 = icmp sgt i32 %43, %retval.0.i55 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %while.body %add = add nsw i32 %cnt.0141, %retval.0.i55 %sub = sub nsw i32 %43, %retval.0.i55 store i32 %sub, ptr %num7, align 8, !tbaa !28 %list.val.i = load ptr, ptr %42, align 8, !tbaa !25 %44 = getelementptr i8, ptr %42, i64 8 %list.val2.i = load ptr, ptr %44, align 8, !tbaa !27 %prev1.i.i.i = getelementptr inbounds %struct.list_head, ptr %list.val.i, i64 0, i32 1 store ptr %list.val2.i, ptr %prev1.i.i.i, align 8, !tbaa !27 store ptr %list.val.i, ptr %list.val2.i, align 8, !tbaa !25 %45 = load ptr, ptr %prev.i, align 8, !tbaa !27 store ptr %42, ptr %prev.i, align 8, !tbaa !27 store ptr %head, ptr %42, align 8, !tbaa !25 store ptr %45, ptr %44, align 8, !tbaa !27 store ptr %42, ptr %45, align 8, !tbaa !25 br label %if.end if.else: ; preds = %while.body %add.ptr = getelementptr inbounds i8, ptr %42, i64 -24 %add12 = add nsw i32 %43, %cnt.0141 %46 = load i8, ptr %add.ptr, align 1, !tbaa !16 %tobool.not2.i = icmp eq i8 %46, 0 br i1 %tobool.not2.i, label %put_str.exit, label %while.body.i109 while.body.i109: ; preds = %if.else, %putchar_unlocked.exit.i %47 = phi i8 [ %51, %putchar_unlocked.exit.i ], [ %46, %if.else ] %str.addr.03.i = phi ptr [ %incdec.ptr.i110, %putchar_unlocked.exit.i ], [ %add.ptr, %if.else ] %incdec.ptr.i110 = getelementptr inbounds i8, ptr %str.addr.03.i, i64 1 %48 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %48, i64 0, i32 5 %49 = load ptr, ptr %_IO_write_ptr.i.i, align 8, !tbaa !9 %_IO_write_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %48, i64 0, i32 6 %50 = load ptr, ptr %_IO_write_end.i.i, align 8, !tbaa !14 %cmp.not.i.i111 = icmp ult ptr %49, %50 br i1 %cmp.not.i.i111, label %cond.false.i.i115, label %cond.true.i.i112, !prof !15 cond.true.i.i112: ; preds = %while.body.i109 %conv.i113 = zext i8 %47 to i32 %call.i.i114 = call i32 @__overflow(ptr noundef nonnull %48, i32 noundef %conv.i113) #6 br label %putchar_unlocked.exit.i cond.false.i.i115: ; preds = %while.body.i109 %incdec.ptr.i.i116 = getelementptr inbounds i8, ptr %49, i64 1 store ptr %incdec.ptr.i.i116, ptr %_IO_write_ptr.i.i, align 8, !tbaa !9 store i8 %47, ptr %49, align 1, !tbaa !16 br label %putchar_unlocked.exit.i putchar_unlocked.exit.i: ; preds = %cond.false.i.i115, %cond.true.i.i112 %51 = load i8, ptr %incdec.ptr.i110, align 1, !tbaa !16 %tobool.not.i = icmp eq i8 %51, 0 br i1 %tobool.not.i, label %put_str.exit, label %while.body.i109, !llvm.loop !20 put_str.exit: ; preds = %putchar_unlocked.exit.i, %if.else %52 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %52, i64 0, i32 5 %53 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !9 %_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %52, i64 0, i32 6 %54 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !14 %cmp.not.i = icmp ult ptr %53, %54 br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15 cond.true.i: ; preds = %put_str.exit %call.i = call i32 @__overflow(ptr noundef nonnull %52, i32 noundef 32) #6 br label %putchar_unlocked.exit cond.false.i: ; preds = %put_str.exit %incdec.ptr.i117 = getelementptr inbounds i8, ptr %53, i64 1 store ptr %incdec.ptr.i117, ptr %_IO_write_ptr.i, align 8, !tbaa !9 store i8 32, ptr %53, align 1, !tbaa !16 br label %putchar_unlocked.exit putchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i %tobool.not.i118 = icmp eq i32 %add12, 0 br i1 %tobool.not.i118, label %if.then.i, label %if.end.i if.then.i: ; preds = %putchar_unlocked.exit %55 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i.i121 = getelementptr inbounds %struct._IO_FILE, ptr %55, i64 0, i32 5 %56 = load ptr, ptr %_IO_write_ptr.i.i121, align 8, !tbaa !9 %_IO_write_end.i.i122 = getelementptr inbounds %struct._IO_FILE, ptr %55, i64 0, i32 6 %57 = load ptr, ptr %_IO_write_end.i.i122, align 8, !tbaa !14 %cmp.not.i.i123 = icmp ult ptr %56, %57 br i1 %cmp.not.i.i123, label %cond.false.i.i126, label %cond.true.i.i124, !prof !15 cond.true.i.i124: ; preds = %if.then.i %call.i.i125 = call i32 @__overflow(ptr noundef nonnull %55, i32 noundef 48) #6 br label %put_uint.exit cond.false.i.i126: ; preds = %if.then.i %incdec.ptr.i.i127 = getelementptr inbounds i8, ptr %56, i64 1 store ptr %incdec.ptr.i.i127, ptr %_IO_write_ptr.i.i121, align 8, !tbaa !9 store i8 48, ptr %56, align 1, !tbaa !16 br label %put_uint.exit if.end.i: ; preds = %putchar_unlocked.exit call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %buf.i) #6 br label %while.body.i119 while.body.i119: ; preds = %while.body.i119, %if.end.i %indvars.iv28.i = phi i32 [ 1, %if.end.i ], [ %indvars.iv.next29.i, %while.body.i119 ] %indvars.iv.i = phi i64 [ 0, %if.end.i ], [ %indvars.iv.next.i, %while.body.i119 ] %n.addr.024.i = phi i32 [ %add12, %if.end.i ], [ %div.i, %while.body.i119 ] %rem.i = srem i32 %n.addr.024.i, 10 %58 = trunc i32 %rem.i to i8 %conv.i120 = add nsw i8 %58, 48 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %arrayidx.i = getelementptr inbounds [11 x i8], ptr %buf.i, i64 0, i64 %indvars.iv.i store i8 %conv.i120, ptr %arrayidx.i, align 1, !tbaa !16 %div.i = sdiv i32 %n.addr.024.i, 10 %n.addr.024.off.i = add i32 %n.addr.024.i, 9 %tobool1.not.i = icmp ult i32 %n.addr.024.off.i, 19 %indvars.iv.next29.i = add nuw i32 %indvars.iv28.i, 1 br i1 %tobool1.not.i, label %while.body4.preheader.i, label %while.body.i119, !llvm.loop !17 while.body4.preheader.i: ; preds = %while.body.i119 %59 = sext i32 %indvars.iv28.i to i64 br label %while.body4.i while.body4.i: ; preds = %putchar_unlocked.exit23.i, %while.body4.preheader.i %indvars.iv30.i = phi i64 [ %59, %while.body4.preheader.i ], [ %indvars.iv.next31.i, %putchar_unlocked.exit23.i ] %indvars.iv.next31.i = add nsw i64 %indvars.iv30.i, -1 %arrayidx6.i = getelementptr inbounds [11 x i8], ptr %buf.i, i64 0, i64 %indvars.iv.next31.i %60 = load i8, ptr %arrayidx6.i, align 1, !tbaa !16 %61 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i15.i = getelementptr inbounds %struct._IO_FILE, ptr %61, i64 0, i32 5 %62 = load ptr, ptr %_IO_write_ptr.i15.i, align 8, !tbaa !9 %_IO_write_end.i16.i = getelementptr inbounds %struct._IO_FILE, ptr %61, i64 0, i32 6 %63 = load ptr, ptr %_IO_write_end.i16.i, align 8, !tbaa !14 %cmp.not.i17.i = icmp ult ptr %62, %63 br i1 %cmp.not.i17.i, label %cond.false.i21.i, label %cond.true.i18.i, !prof !15 cond.true.i18.i: ; preds = %while.body4.i %conv7.i = zext i8 %60 to i32 %call.i19.i = call i32 @__overflow(ptr noundef nonnull %61, i32 noundef %conv7.i) #6 br label %putchar_unlocked.exit23.i cond.false.i21.i: ; preds = %while.body4.i %incdec.ptr.i22.i = getelementptr inbounds i8, ptr %62, i64 1 store ptr %incdec.ptr.i22.i, ptr %_IO_write_ptr.i15.i, align 8, !tbaa !9 store i8 %60, ptr %62, align 1, !tbaa !16 br label %putchar_unlocked.exit23.i putchar_unlocked.exit23.i: ; preds = %cond.false.i21.i, %cond.true.i18.i %64 = and i64 %indvars.iv.next31.i, 4294967295 %tobool3.not.i = icmp eq i64 %64, 0 br i1 %tobool3.not.i, label %while.end9.i, label %while.body4.i, !llvm.loop !19 while.end9.i: ; preds = %putchar_unlocked.exit23.i call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %buf.i) #6 br label %put_uint.exit put_uint.exit: ; preds = %cond.true.i.i124, %cond.false.i.i126, %while.end9.i %65 = load ptr, ptr @stdout, align 8, !tbaa !5 %_IO_write_ptr.i128 = getelementptr inbounds %struct._IO_FILE, ptr %65, i64 0, i32 5 %66 = load ptr, ptr %_IO_write_ptr.i128, align 8, !tbaa !9 %_IO_write_end.i129 = getelementptr inbounds %struct._IO_FILE, ptr %65, i64 0, i32 6 %67 = load ptr, ptr %_IO_write_end.i129, align 8, !tbaa !14 %cmp.not.i130 = icmp ult ptr %66, %67 br i1 %cmp.not.i130, label %cond.false.i134, label %cond.true.i131, !prof !15 cond.true.i131: ; preds = %put_uint.exit %call.i132 = call i32 @__overflow(ptr noundef nonnull %65, i32 noundef 10) #6 br label %putchar_unlocked.exit136 cond.false.i134: ; preds = %put_uint.exit %incdec.ptr.i135 = getelementptr inbounds i8, ptr %66, i64 1 store ptr %incdec.ptr.i135, ptr %_IO_write_ptr.i128, align 8, !tbaa !9 store i8 10, ptr %66, align 1, !tbaa !16 br label %putchar_unlocked.exit136 putchar_unlocked.exit136: ; preds = %cond.true.i131, %cond.false.i134 %entry1.val.i = load ptr, ptr %42, align 8, !tbaa !25 %68 = getelementptr i8, ptr %42, i64 8 %entry1.val4.i = load ptr, ptr %68, align 8, !tbaa !27 %prev1.i.i.i137 = getelementptr inbounds %struct.list_head, ptr %entry1.val.i, i64 0, i32 1 store ptr %entry1.val4.i, ptr %prev1.i.i.i137, align 8, !tbaa !27 store ptr %entry1.val.i, ptr %entry1.val4.i, align 8, !tbaa !25 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %42, i8 0, i64 16, i1 false) call void @free(ptr noundef nonnull %add.ptr) #6 br label %if.end if.end: ; preds = %putchar_unlocked.exit136, %if.then %cnt.1 = phi i32 [ %add, %if.then ], [ %add12, %putchar_unlocked.exit136 ] %69 = load ptr, ptr %head, align 8, !tbaa !25 %cmp.i107.not = icmp eq ptr %69, %head br i1 %cmp.i107.not, label %while.end, label %while.body, !llvm.loop !31 while.end: ; preds = %if.end, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %head) #6 ret i32 0 } ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3 declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #4 declare i32 @__uflow(ptr noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 40} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 48} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = distinct !{!19, !18} !20 = distinct !{!20, !18} !21 = !{!10, !6, i64 8} !22 = !{!10, !6, i64 16} !23 = distinct !{!23, !18} !24 = distinct !{!24, !18} !25 = !{!26, !6, i64 0} !26 = !{!"list_head", !6, i64 0, !6, i64 8} !27 = !{!26, !6, i64 8} !28 = !{!29, !11, i64 16} !29 = !{!"my_node", !7, i64 0, !11, i64 16, !26, i64 24} !30 = distinct !{!30, !18} !31 = distinct !{!31, !18}
#include<stdio.h> #include<string.h> #define LEN 1000005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN+1]; int main(){ int elaps=0,c; int i,q,n,sum=0; P u; scanf("%d %d", &n, &q); for ( i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } i=1; sum=n; while(1){ if(Q[i].t<=q){ sum--; elaps+=Q[i].t; printf("%s %d\n",Q[i].name,elaps); if(sum==0)break; } else{ elaps+=q; Q[i].t-=q; Q[i+sum].t=Q[i].t; strcpy(Q[i+sum].name,Q[i].name); } i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_251931/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_251931/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @Q = dso_local global [1000006 x %struct.pp] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #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, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not61 = icmp slt i32 %0, 1 br i1 %cmp.not61, label %while.cond.preheader, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [1000006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [1000006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.cond.preheader: ; preds = %for.body, %entry %sum.0.ph = phi i32 [ %0, %entry ], [ %1, %for.body ] br label %while.cond while.cond: ; preds = %while.cond.preheader, %if.end40 %indvars.iv65 = phi i64 [ %indvars.iv.next66, %if.end40 ], [ 1, %while.cond.preheader ] %sum.0 = phi i32 [ %sum.1, %if.end40 ], [ %sum.0.ph, %while.cond.preheader ] %elaps.0 = phi i32 [ %elaps.1, %if.end40 ], [ 0, %while.cond.preheader ] %arrayidx6 = getelementptr inbounds [1000006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv65 %t7 = getelementptr inbounds [1000006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv65, i32 1 %3 = load i32, ptr %t7, align 4, !tbaa !11 %4 = load i32, ptr %q, align 4, !tbaa !5 %cmp8.not = icmp sgt i32 %3, %4 br i1 %cmp8.not, label %if.else, label %if.then if.then: ; preds = %while.cond %dec = add nsw i32 %sum.0, -1 %add = add nsw i32 %3, %elaps.0 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %arrayidx6, i32 noundef %add) %cmp17 = icmp eq i32 %dec, 0 br i1 %cmp17, label %while.end, label %if.end40 if.else: ; preds = %while.cond %add19 = add nsw i32 %4, %elaps.0 %sub = sub nsw i32 %3, %4 store i32 %sub, ptr %t7, align 4, !tbaa !11 %5 = trunc i64 %indvars.iv65 to i32 %add26 = add nsw i32 %sum.0, %5 %idxprom27 = sext i32 %add26 to i64 %arrayidx28 = getelementptr inbounds [1000006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom27 %t29 = getelementptr inbounds [1000006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom27, i32 1 store i32 %sub, ptr %t29, align 4, !tbaa !11 %call39 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx28, ptr noundef nonnull dereferenceable(1) %arrayidx6) #4 br label %if.end40 if.end40: ; preds = %if.then, %if.else %sum.1 = phi i32 [ %dec, %if.then ], [ %sum.0, %if.else ] %elaps.1 = phi i32 [ %add, %if.then ], [ %add19, %if.else ] %indvars.iv.next66 = add nuw i64 %indvars.iv65, 1 br label %while.cond while.end: ; preds = %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias 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 = { nofree nounwind "no-trapping-math"="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: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = !{!12, !6, i64 100} !12 = !{!"pp", !7, i64 0, !6, i64 100}
#include <stdio.h> int main (void){ int T, i, j; char s[101]; scanf( "%d", &T ); for( i = 0; i < T; i++ ){ scanf( "%s", s ); j = 0; while( s[j] != '\0') j++; if( j%2 == 1 || s[0] == ')' || s[j-1] == '(') printf("NO\n"); else { printf("YES\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25199/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25199/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %T = alloca i32, align 4 %s = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T) %0 = load i32, ptr %T, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %0, 0 br i1 %cmp24, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %i.025 = phi i32 [ %inc18, %for.inc ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) br label %while.cond while.cond: ; preds = %while.cond, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp2.not = icmp eq i8 %1, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp2.not, label %while.end, label %while.cond, !llvm.loop !10 while.end: ; preds = %while.cond %rem27 = and i64 %indvars.iv, 1 %cmp4 = icmp ne i64 %rem27, 0 %2 = load i8, ptr %s, align 16 %cmp8 = icmp eq i8 %2, 41 %or.cond = select i1 %cmp4, i1 true, i1 %cmp8 br i1 %or.cond, label %for.inc, label %lor.lhs.false10 lor.lhs.false10: ; preds = %while.end %sub = shl i64 %indvars.iv, 32 %sext = add i64 %sub, -4294967296 %idxprom11 = ashr exact i64 %sext, 32 %arrayidx12 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %idxprom11 %3 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %cmp14 = icmp eq i8 %3, 40 %spec.select = select i1 %cmp14, ptr @str.4, ptr @str br label %for.inc for.inc: ; preds = %lor.lhs.false10, %while.end %str.4.sink = phi ptr [ @str.4, %while.end ], [ %spec.select, %lor.lhs.false10 ] %puts23 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) %inc18 = add nuw nsw i32 %i.025, 1 %4 = load i32, ptr %T, align 4, !tbaa !5 %cmp = icmp slt i32 %inc18, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.inc, %entry call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include<stdio.h> #include<string.h> #define ARRAY 100000 int min(int x, int y) { if(x < y) return x; else return y; } typedef struct judge{ char name[10]; int t; }P; P Q[ARRAY+1]; int head, tail, n; void enqueue(P x){ Q[tail] = x; if ( tail == ARRAY ) tail = 1; else tail++; } P dequeue(){ P x = Q[head]; if ( head == ARRAY ) head = 1; else head++; return x; } int main(){ int flag = 0,i,p,q; P s; scanf("%d %d", &n, &q); for ( i = 1; i <= n; i++) scanf("%s %d", Q[i].name, &Q[i].t); head = 1; tail = n+1; while( head != tail ){ s = dequeue(); p = min(q, s.t); s.t -= p; flag += p; if ( s.t > 0 ) enqueue(s); else { printf("%s %d\n",s.name, flag); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252039/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252039/source.c" target datalayout = "e-m:e-p270: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.judge = type { [10 x i8], i32 } @Q = dso_local global [100001 x %struct.judge] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 { entry: %x.y = tail call i32 @llvm.smin.i32(i32 %x, i32 %y) ret i32 %x.y } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @enqueue(i64 %x.coerce0, i64 %x.coerce1) local_unnamed_addr #1 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100001 x %struct.judge], ptr @Q, i64 0, i64 %idxprom store i64 %x.coerce0, ptr %arrayidx, align 16, !tbaa.struct !9 %x.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 store i64 %x.coerce1, ptr %x.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !11 %cmp = icmp eq i32 %0, 100000 %inc = add nsw i32 %0, 1 %storemerge = select i1 %cmp, i32 1, i32 %inc store i32 %storemerge, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local { i64, i64 } @dequeue() local_unnamed_addr #1 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100001 x %struct.judge], ptr @Q, i64 0, i64 %idxprom %retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 16, !tbaa.struct !9 %retval.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 %retval.sroa.2.0.copyload = load i64, ptr %retval.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !11 %cmp = icmp eq i32 %0, 100000 %inc = add nsw i32 %0, 1 %storemerge = select i1 %cmp, i32 1, i32 %inc store i32 %storemerge, ptr @head, align 4, !tbaa !5 %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %retval.sroa.0.0.copyload, 0 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.copyload, 1 ret { i64, i64 } %.fca.1.insert } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %q = alloca i32, align 4 %s = alloca %struct.judge, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %s) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100001 x %struct.judge], ptr @Q, i64 0, i64 %indvars.iv %t = getelementptr inbounds [100001 x %struct.judge], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp4.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp4.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %tmp.sroa.4.0.s.sroa_idx = getelementptr inbounds i8, ptr %s, i64 8 %t6 = getelementptr inbounds %struct.judge, ptr %s, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %9, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %10, %if.end ] %flag.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100001 x %struct.judge], ptr @Q, i64 0, i64 %idxprom.i %retval.sroa.0.0.copyload.i = load i64, ptr %arrayidx.i, align 16, !tbaa.struct !9 %retval.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 8 %retval.sroa.2.0.copyload.i = load i64, ptr %retval.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !11 %cmp.i = icmp eq i32 %4, 100000 %inc.i = add nsw i32 %4, 1 %storemerge.i = select i1 %cmp.i, i32 1, i32 %inc.i store i32 %storemerge.i, ptr @head, align 4, !tbaa !5 store i64 %retval.sroa.0.0.copyload.i, ptr %s, align 8, !tbaa.struct !9 store i64 %retval.sroa.2.0.copyload.i, ptr %tmp.sroa.4.0.s.sroa_idx, align 8, !tbaa.struct !11 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = lshr i64 %retval.sroa.2.0.copyload.i, 32 %7 = trunc i64 %6 to i32 %x.y.i = call i32 @llvm.smin.i32(i32 %5, i32 %7) %sub = sub nsw i32 %7, %x.y.i store i32 %sub, ptr %t6, align 4, !tbaa !14 %add9 = add nsw i32 %x.y.i, %flag.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %8 = load i64, ptr %tmp.sroa.4.0.s.sroa_idx, align 8 %idxprom.i20 = sext i32 %3 to i64 %arrayidx.i21 = getelementptr inbounds [100001 x %struct.judge], ptr @Q, i64 0, i64 %idxprom.i20 store i64 %retval.sroa.0.0.copyload.i, ptr %arrayidx.i21, align 16, !tbaa.struct !9 %x.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i21, i64 8 store i64 %8, ptr %x.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !11 %cmp.i22 = icmp eq i32 %3, 100000 %inc.i23 = add nsw i32 %3, 1 %storemerge.i24 = select i1 %cmp.i22, i32 1, i32 %inc.i23 store i32 %storemerge.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %s, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %9 = phi i32 [ %.pre31, %if.else ], [ %storemerge.i24, %if.then ] %10 = phi i32 [ %.pre, %if.else ], [ %storemerge.i, %if.then ] %cmp4.not = icmp eq i32 %10, %9 br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 10, !10, i64 12, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = !{i64 0, i64 2, !10, i64 4, i64 4, !5} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!15, !6, i64 12} !15 = !{!"judge", !7, i64 0, !6, i64 12} !16 = distinct !{!16, !13}
#include<stdio.h> #include<string.h> #define Length 100005 typedef struct Point{ char name[100]; int t; }Strc; Strc L[Length]; int head,tail,n; void enqueue(Strc x) { L[tail] = x; tail = (tail+1) % Length; } Strc dequeue() { Strc x = L[head]; head = (head + 1) % Length; return x; } int min(int m, int k) {return m<k ? m:k;} int main(){ int elaps = 0,c; int i,q; Strc u; scanf("%d %d",&n,&q); for(i=1;i<=n;i++){ scanf("%s",L[i].name); scanf("%d",&L[i].t); } head = 1; tail = n+1; while (head != tail){ u = dequeue(); c = min(q,u.t); u.t -= c; elaps += c; if(u.t > 0) enqueue(u); else{ printf("%s %d\n",u.name, elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252082/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252082/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" %struct.Point = type { [100 x i8], i32 } @L = dso_local global [100005 x %struct.Point] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.Point) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.Point], ptr @L, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.Point) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.Point], ptr @L, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %m, i32 noundef %k) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %m, i32 %k) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.Point, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.Point], ptr @L, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.Point], ptr @L, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.Point, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.Point], ptr @L, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.Point], ptr @L, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"Point", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> #define max 100005 typedef struct process{ char name[256]; int time; } p; int head = 0, tail = 0, n; p Q[max]; void enqueue(p); p dequeue(void); int main(){ int i, q, temp, passage = 0; p dq; scanf("%d%d", &n, &q); head = 1; tail = n + 1; for(i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].time); } while( tail != head){ dq = dequeue(); if(q > dq.time) temp = dq.time; else temp = q; passage += temp; dq.time -= temp; if(dq.time > 0) enqueue(dq); else printf("%s %d\n", dq.name, passage); } return 0; } void enqueue(p x){ Q[tail] = x; if(tail + 1 == max) tail = 0; else tail++; } p dequeue(void){ p x = Q[head]; if(head + 1 == max) head = 0; else head++; return x; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252125/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252125/source.c" target datalayout = "e-m:e-p270: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.process = type { [256 x i8], i32 } @head = dso_local local_unnamed_addr global i32 0, align 4 @tail = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @Q = dso_local global [100005 x %struct.process] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i32, align 4 %dq = alloca %struct.process, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %dq) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) store i32 1, ptr @head, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp.not31 = icmp slt i32 %0, 1 br i1 %cmp.not31, label %while.cond.preheader, label %for.body while.cond.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr @tail, align 4, !tbaa !5 %.pre36 = load i32, ptr @head, align 4, !tbaa !5 br label %while.cond.preheader while.cond.preheader: ; preds = %while.cond.preheader.loopexit, %entry %1 = phi i32 [ %.pre36, %while.cond.preheader.loopexit ], [ 1, %entry ] %2 = phi i32 [ %.pre, %while.cond.preheader.loopexit ], [ %add, %entry ] %cmp5.not33 = icmp eq i32 %2, %1 br i1 %cmp5.not33, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %while.cond.preheader %time6 = getelementptr inbounds %struct.process, ptr %dq, i64 0, i32 1 br label %while.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.process], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %time = getelementptr inbounds [100005 x %struct.process], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %time) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader.loopexit, !llvm.loop !9 while.body: ; preds = %while.body.lr.ph, %if.end18 %5 = phi i32 [ %1, %while.body.lr.ph ], [ %9, %if.end18 ] %6 = phi i32 [ %2, %while.body.lr.ph ], [ %10, %if.end18 ] %passage.034 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end18 ] %idxprom.i = sext i32 %5 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.process], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(260) %dq, ptr noundef nonnull align 4 dereferenceable(260) %arrayidx.i, i64 260, i1 false) %add.i = add nsw i32 %5, 1 %cmp.i = icmp eq i32 %add.i, 100005 %.add.i = select i1 %cmp.i, i32 0, i32 %add.i store i32 %.add.i, ptr @head, align 4, !tbaa !5, !noalias !11 %7 = load i32, ptr %q, align 4, !tbaa !5 %8 = load i32, ptr %time6, align 8, !tbaa !14 %. = call i32 @llvm.smin.i32(i32 %7, i32 %8) %add9 = add nsw i32 %., %passage.034 %sub = sub nsw i32 %8, %. store i32 %sub, ptr %time6, align 8, !tbaa !14 %cmp12 = icmp sgt i32 %sub, 0 br i1 %cmp12, label %if.then13, label %if.else14 if.then13: ; preds = %while.body %idxprom.i26 = sext i32 %6 to i64 %arrayidx.i27 = getelementptr inbounds [100005 x %struct.process], ptr @Q, i64 0, i64 %idxprom.i26 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(260) %arrayidx.i27, ptr noundef nonnull align 8 dereferenceable(260) %dq, i64 260, i1 false) %add.i28 = add nsw i32 %6, 1 %cmp.i29 = icmp eq i32 %add.i28, 100005 %.add.i30 = select i1 %cmp.i29, i32 0, i32 %add.i28 store i32 %.add.i30, ptr @tail, align 4, !tbaa !5 br label %if.end18 if.else14: ; preds = %while.body %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %dq, i32 noundef %add9) %.pre37 = load i32, ptr @tail, align 4, !tbaa !5 %.pre38 = load i32, ptr @head, align 4, !tbaa !5 br label %if.end18 if.end18: ; preds = %if.else14, %if.then13 %9 = phi i32 [ %.pre38, %if.else14 ], [ %.add.i, %if.then13 ] %10 = phi i32 [ %.pre37, %if.else14 ], [ %.add.i30, %if.then13 ] %cmp5.not = icmp eq i32 %10, %9 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %if.end18, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %dq) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.process) align 4 %agg.result) local_unnamed_addr #3 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.process], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(260) %agg.result, ptr noundef nonnull align 4 dereferenceable(260) %arrayidx, i64 260, i1 false), !tbaa.struct !17 %add = add nsw i32 %0, 1 %cmp = icmp eq i32 %add, 100005 %.add = select i1 %cmp, i32 0, i32 %add store i32 %.add, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.process) align 8 %x) local_unnamed_addr #3 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.process], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(260) %arrayidx, ptr noundef nonnull align 8 dereferenceable(260) %x, i64 260, i1 false), !tbaa.struct !17 %add = add nsw i32 %0, 1 %cmp = icmp eq i32 %add, 100005 %.add = select i1 %cmp, i32 0, i32 %add store i32 %.add, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12} !12 = distinct !{!12, !13, !"dequeue: %agg.result"} !13 = distinct !{!13, !"dequeue"} !14 = !{!15, !6, i64 256} !15 = !{!"process", !7, i64 0, !6, i64 256} !16 = distinct !{!16, !10} !17 = !{i64 0, i64 256, !18, i64 256, i64 4, !5} !18 = !{!7, !7, i64 0}
#include<stdio.h> #include<string.h> #define LEN 100005 /* ?????????????????¨????§??????? */ typedef struct pp { char name[100]; int t; } P; P Q[LEN]; int head, tail, n; void enqueue(P x) { Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue() { P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a, int b) { return a < b ? a : b; } /* ????°????????????? */ int main() { int elaps = 0, c; int i, q; P u; scanf("%d %d", &n, &q); /* ??¨??????????????????????????\??????????????????????????? */ for ( i = 1; i <= n; i++ ) { scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } head = 1; tail = n + 1; /* ????????\??¬????????§??? */ while (head != tail) { u = dequeue(); c = min(q, u.t); /* q ???????????????????????? u.t ????????????????????? */ u.t -= c; /* ?????????????????????????¨???? */ elaps += c; /* ????????????????????? */ if ( u.t > 0 ) enqueue(u); /* ???????????????????????????????????°?????\???????????? */ else { printf("%s %d\n",u.name, elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252169/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252169/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include <stdio.h> #include <string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN+1]; int head,tail,n; void enqueue(P x){ Q[tail]=x; if(tail+1==LEN){ tail=0; } else tail++; } P dequeue(){ P x; x=Q[head]; if(head+1==LEN)head=0; else head++; return x; } int main(){ P u; int i,n,q,total_time=0; scanf("%d%d",&n,&q); for(i=0;i<n;i++){ scanf("%s",u.name); scanf("%d",&u.t); enqueue(u); } while(head!=tail){ u=dequeue(); if(u.t>q){ u.t=u.t-q; enqueue(u); total_time+=q; } else{ printf("%s %d\n",u.name,u.t+total_time); total_time+=u.t; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252211/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252211/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local local_unnamed_addr global [100006 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 @n = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %cmp = icmp eq i32 %add, 100005 %.add = select i1 %cmp, i32 0, i32 %add store i32 %.add, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %cmp = icmp eq i32 %add, 100005 %.add = select i1 %cmp, i32 0, i32 %add store i32 %.add, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %u = alloca %struct.pp, align 8 %n = alloca i32, align 4 %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body.lr.ph, label %entry.while.cond.preheader_crit_edge entry.while.cond.preheader_crit_edge: ; preds = %entry %.pre = load i32, ptr @tail, align 4, !tbaa !5 br label %while.cond.preheader for.body.lr.ph: ; preds = %entry %t = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %for.body while.cond.preheader: ; preds = %for.body, %entry.while.cond.preheader_crit_edge %1 = phi i32 [ %.pre, %entry.while.cond.preheader_crit_edge ], [ %.add.i, %for.body ] %2 = load i32, ptr @head, align 4, !tbaa !5 %cmp3.not33 = icmp eq i32 %2, %1 br i1 %cmp3.not33, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %while.cond.preheader %t4 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body for.body: ; preds = %for.body.lr.ph, %for.body %i.032 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %3 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom.i = sext i32 %3 to i64 %arrayidx.i = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i = add nsw i32 %3, 1 %cmp.i = icmp eq i32 %add.i, 100005 %.add.i = select i1 %cmp.i, i32 0, i32 %add.i store i32 %.add.i, ptr @tail, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.032, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !11 while.body: ; preds = %while.body.lr.ph, %if.end %5 = phi i32 [ %1, %while.body.lr.ph ], [ %10, %if.end ] %6 = phi i32 [ %2, %while.body.lr.ph ], [ %11, %if.end ] %total_time.034 = phi i32 [ 0, %while.body.lr.ph ], [ %total_time.1, %if.end ] %idxprom.i20 = sext i32 %6 to i64 %arrayidx.i21 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i20 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i21, i64 104, i1 false) %add.i22 = add nsw i32 %6, 1 %cmp.i23 = icmp eq i32 %add.i22, 100005 %.add.i24 = select i1 %cmp.i23, i32 0, i32 %add.i22 store i32 %.add.i24, ptr @head, align 4, !tbaa !5, !noalias !13 %7 = load i32, ptr %t4, align 4, !tbaa !16 %8 = load i32, ptr %q, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %7, %8 br i1 %cmp5, label %if.then, label %if.else if.then: ; preds = %while.body %sub = sub nsw i32 %7, %8 store i32 %sub, ptr %t4, align 4, !tbaa !16 %idxprom.i26 = sext i32 %5 to i64 %arrayidx.i27 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i26 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i27, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i28 = add nsw i32 %5, 1 %cmp.i29 = icmp eq i32 %add.i28, 100005 %.add.i30 = select i1 %cmp.i29, i32 0, i32 %add.i28 store i32 %.add.i30, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %add11 = add nsw i32 %7, %total_time.034 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add11) %9 = load i32, ptr %t4, align 4, !tbaa !16 %.pre35 = load i32, ptr @head, align 4, !tbaa !5 %.pre36 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %10 = phi i32 [ %.add.i30, %if.then ], [ %.pre36, %if.else ] %11 = phi i32 [ %.add.i24, %if.then ], [ %.pre35, %if.else ] %.pn = phi i32 [ %8, %if.then ], [ %9, %if.else ] %total_time.1 = add nsw i32 %.pn, %total_time.034 %cmp3.not = icmp eq i32 %11, %10 br i1 %cmp3.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include <stdio.h> #include <string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; } P; P Q[LEN]; int head,tail,n; void enqueue(P x){ Q[tail]=x; tail=(tail+1)%LEN; } P dequeue(){ P x=Q[head]; head=(head+1)%LEN; return x; } int min(int a,int b){ return a<b?a:b; } int main(void){ int elaps=0,c; int i,q; P u; scanf("%d %d",&n,&q); for(i=1;i<=n;i++){ scanf("%s",Q[i].name); scanf("%d",&Q[i].t); } head=1; tail=n+1; while(head != tail){ u=dequeue(); c=min(q,u.t); u.t-=c; elaps+=c; if(u.t > 0) enqueue(u); else printf("%s %d\n",u.name,elaps); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252262/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252262/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN]; int head,tail,n; void enqueue(P x){ Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue(){ P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a,int b) {return a < b ? a : b;} int main(){ int elaps = 0,c; int i,q; P u; scanf("%d %d",&n,&q); for(i = 1;i <= n;i++){ scanf("%s",Q[i].name); scanf("%d",&Q[i].t); } head = 1; tail = n + 1; while(head != tail){ u = dequeue(); c = min(q, u.t); u.t -= c; elaps += c; if(u.t > 0) enqueue(u); else{ printf("%s %d\n",u.name,elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252305/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252305/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN+1]; int head, tail, n; void enqueue( P x ){ strcpy( Q[tail].name, x.name); Q[tail].t = x.t; tail++; if(tail>LEN) tail = 0; n++; } P dequeue(){ int ptr = head; if(head==tail) NULL; head++; if(head>LEN) head = 0; n--; return Q[ptr]; } int main(){ int elaps = 0, c; int i, q; P u; // head = 1; tail = 1; scanf("%d %d", &n, &q); for ( i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); tail++; } while( n != 0){ u = dequeue(); if( u.t > q ){ u.t = u.t - q; enqueue( u ); elaps += q; }else{ elaps += u.t; printf( "%s %d\n", u.name, elaps ); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252356/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252356/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100006 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @n = dso_local global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom %call = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %x) #7 %t = getelementptr inbounds %struct.pp, ptr %x, i64 0, i32 1 %1 = load i32, ptr %t, align 4, !tbaa !9 %t5 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom, i32 1 store i32 %1, ptr %t5, align 4, !tbaa !9 %inc = add nsw i32 %0, 1 %cmp = icmp sgt i32 %0, 100004 %spec.store.select = select i1 %cmp, i32 0, i32 %inc store i32 %spec.store.select, ptr @tail, align 4 %2 = load i32, ptr @n, align 4, !tbaa !5 %inc6 = add nsw i32 %2, 1 store i32 %inc6, ptr @n, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #2 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 %cmp1 = icmp sgt i32 %0, 100004 %spec.store.select = select i1 %cmp1, i32 0, i32 %inc store i32 %spec.store.select, ptr @head, align 4 %1 = load i32, ptr @n, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr @n, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !11 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 store i32 1, ptr @head, align 4, !tbaa !5 store i32 1, ptr @tail, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not27 = icmp slt i32 %0, 1 br i1 %cmp.not27, label %while.cond.preheader, label %for.body while.cond.preheader: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ] %cmp6.not29 = icmp eq i32 %.lcssa, 0 br i1 %cmp6.not29, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %while.cond.preheader %t7 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 %.pre33 = load i32, ptr @head, align 4, !tbaa !5, !noalias !13 %u22.sroa.3.0.u.sroa_idx = getelementptr inbounds i8, ptr %u, i64 100 br label %while.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %1 = load i32, ptr @tail, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr @tail, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr @n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !16 while.body: ; preds = %while.body.lr.ph, %if.end %4 = phi i32 [ %.pre33, %while.body.lr.ph ], [ %9, %if.end ] %elaps.030 = phi i32 [ 0, %while.body.lr.ph ], [ %elaps.1, %if.end ] %5 = phi i32 [ %.lcssa, %while.body.lr.ph ], [ %.pr, %if.end ] %inc.i = add nsw i32 %4, 1 %cmp1.i = icmp sgt i32 %4, 100004 %spec.store.select.i = select i1 %cmp1.i, i32 0, i32 %inc.i store i32 %spec.store.select.i, ptr @head, align 4, !noalias !13 %dec.i = add nsw i32 %5, -1 store i32 %dec.i, ptr @n, align 4, !tbaa !5, !noalias !13 %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %6 = load i32, ptr %t7, align 4, !tbaa !9 %7 = load i32, ptr %q, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %6, %7 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %while.body %sub = sub nsw i32 %6, %7 store i32 %sub, ptr %t7, align 4, !tbaa !9 %u22.sroa.3.0.copyload = load i32, ptr %u22.sroa.3.0.u.sroa_idx, align 4 %8 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom.i23 = sext i32 %8 to i64 %arrayidx.i24 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i23 %call.i = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx.i24, ptr noundef nonnull dereferenceable(1) %u) #7 %t5.i = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i23, i32 1 store i32 %u22.sroa.3.0.copyload, ptr %t5.i, align 4, !tbaa !9 %inc.i25 = add nsw i32 %8, 1 %cmp.i = icmp sgt i32 %8, 100004 %spec.store.select.i26 = select i1 %cmp.i, i32 0, i32 %inc.i25 store i32 %spec.store.select.i26, ptr @tail, align 4 store i32 %5, ptr @n, align 4, !tbaa !5 %add = add nsw i32 %7, %elaps.030 br label %if.end if.else: ; preds = %while.body %add12 = add nsw i32 %6, %elaps.030 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add12) %.pre = load i32, ptr @head, align 4, !tbaa !5, !noalias !13 %.pr.pre = load i32, ptr @n, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %.pr = phi i32 [ %5, %if.then ], [ %.pr.pre, %if.else ] %9 = phi i32 [ %spec.store.select.i, %if.then ], [ %.pre, %if.else ] %elaps.1 = phi i32 [ %add, %if.then ], [ %add12, %if.else ] %cmp6.not = icmp eq i32 %.pr, 0 br i1 %cmp6.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 attributes #0 = { mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 100} !10 = !{!"pp", !7, i64 0, !6, i64 100} !11 = !{i64 0, i64 100, !12, i64 100, i64 4, !5} !12 = !{!7, !7, i64 0} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = distinct !{!18, !17}
#include<stdio.h> int main() { int n1,n2;int a[100001],b[100001]; scanf("%d %d",&n1,&n2); int k,m; scanf("%d %d",&k,&m); int i; for(i=0;i<n1;i++) { scanf("%d",&a[i]); } for(i=0;i<n2;i++) { scanf("%d",&b[i]); } if(a[k-1]<b[n2-m]) { printf("YES\n"); } else{ printf("NO\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2524/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2524/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n1 = alloca i32, align 4 %n2 = alloca i32, align 4 %a = alloca [100001 x i32], align 16 %b = alloca [100001 x i32], align 16 %k = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #4 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1, ptr noundef nonnull %n2) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %m) %0 = load i32, ptr %n1, align 4, !tbaa !5 %cmp26 = icmp sgt i32 %0, 0 br i1 %cmp26, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %1 = load i32, ptr %n2, align 4, !tbaa !5 %cmp428 = icmp sgt i32 %1, 0 br i1 %cmp428, label %for.body5, label %for.end11 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n1, 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.cond3.preheader, !llvm.loop !9 for.body5: ; preds = %for.cond3.preheader, %for.body5 %indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.body5 ], [ 0, %for.cond3.preheader ] %arrayidx7 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv32 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1 %4 = load i32, ptr %n2, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp4 = icmp slt i64 %indvars.iv.next33, %5 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.body5, %for.cond3.preheader %.lcssa = phi i32 [ %1, %for.cond3.preheader ], [ %4, %for.body5 ] %6 = load i32, ptr %k, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %idxprom12 = sext i32 %sub to i64 %arrayidx13 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom12 %7 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %8 = load i32, ptr %m, align 4, !tbaa !5 %sub14 = sub nsw i32 %.lcssa, %8 %idxprom15 = sext i32 %sub14 to i64 %arrayidx16 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %idxprom15 %9 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp slt i32 %7, %9 %str.4.str = select i1 %cmp17, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n1) #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> typedef struct{ char name[11]; int time; }process; int main(){ long long n, q, i, j, sp, ep, stime = 0; process p[520000]; scanf("%lld%lld", &n, &q); for(i = 0; i < n; ++i) scanf("%s%d", p[i].name, &p[i].time); sp = 0; ep = n - 1; while(sp <= ep){ if(p[sp].time > q){ stime += q; p[sp].time -= q; p[++ep] = p[sp]; } else{ stime += p[sp].time; printf("%s %lld\n", p[sp].name, stime); } sp++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252442/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252442/source.c" target datalayout = "e-m:e-p270: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.process = type { [11 x i8], i32 } @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.2 = private unnamed_addr constant [9 x i8] c"%s %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %q = alloca i64, align 8 %p = alloca [520000 x %struct.process], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %q) #4 call void @llvm.lifetime.start.p0(i64 8320000, ptr nonnull %p) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp38 = icmp sgt i64 %0, 0 br i1 %cmp38, label %for.body, label %while.end for.body: ; preds = %entry, %for.body %i.039 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [520000 x %struct.process], ptr %p, i64 0, i64 %i.039 %time = getelementptr inbounds [520000 x %struct.process], ptr %p, i64 0, i64 %i.039, i32 1 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %time) %inc = add nuw nsw i64 %i.039, 1 %1 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp3.not40 = icmp slt i64 %1, 1 br i1 %cmp3.not40, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %for.end %sub = add nsw i64 %1, -1 br label %while.body while.body: ; preds = %while.body.preheader, %if.end %stime.043 = phi i64 [ %stime.1, %if.end ], [ 0, %while.body.preheader ] %ep.042 = phi i64 [ %ep.1, %if.end ], [ %sub, %while.body.preheader ] %sp.041 = phi i64 [ %inc24, %if.end ], [ 0, %while.body.preheader ] %arrayidx4 = getelementptr inbounds [520000 x %struct.process], ptr %p, i64 0, i64 %sp.041 %time5 = getelementptr inbounds [520000 x %struct.process], ptr %p, i64 0, i64 %sp.041, i32 1 %2 = load i32, ptr %time5, align 4, !tbaa !11 %conv = sext i32 %2 to i64 %3 = load i64, ptr %q, align 8, !tbaa !5 %cmp6 = icmp slt i64 %3, %conv br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %while.body %add = add nsw i64 %3, %stime.043 %4 = trunc i64 %3 to i32 %conv12 = sub i32 %2, %4 store i32 %conv12, ptr %time5, align 4, !tbaa !11 %inc13 = add nsw i64 %ep.042, 1 %arrayidx14 = getelementptr inbounds [520000 x %struct.process], ptr %p, i64 0, i64 %inc13 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx14, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx4, i64 16, i1 false), !tbaa.struct !14 br label %if.end if.else: ; preds = %while.body %add19 = add nsw i64 %stime.043, %conv %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %arrayidx4, i64 noundef %add19) br label %if.end if.end: ; preds = %if.else, %if.then %ep.1 = phi i64 [ %inc13, %if.then ], [ %ep.042, %if.else ] %stime.1 = phi i64 [ %add, %if.then ], [ %add19, %if.else ] %inc24 = add nuw nsw i64 %sp.041, 1 %cmp3.not.not = icmp slt i64 %sp.041, %ep.1 br i1 %cmp3.not.not, label %while.body, label %while.end, !llvm.loop !17 while.end: ; preds = %if.end, %entry, %for.end call void @llvm.lifetime.end.p0(i64 8320000, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !13, i64 12} !12 = !{!"", !7, i64 0, !13, i64 12} !13 = !{!"int", !7, i64 0} !14 = !{i64 0, i64 11, !15, i64 12, i64 4, !16} !15 = !{!7, !7, i64 0} !16 = !{!13, !13, i64 0} !17 = distinct !{!17, !10}
#include <stdio.h> #include <stdlib.h> #include <assert.h> #define MIN(x, y) ((x) <= (y) ? (x) : (y)) // just implement simple queue typedef struct QueueKey { char str[16]; int num; } QueueKey; typedef struct QueueDat { QueueKey key; struct QueueDat *next; } QueueDat; typedef struct Queue { size_t len; QueueDat *head; QueueDat *tail; } Queue; #define queue_init(q) ((q) ? ((q)->len = 0, (q)->head = (q)->tail = NULL) : 0) #define queue_len(q) ((q) ? (q)->len : 0) void queue_push(Queue *q, QueueKey x) { QueueDat *new_dat = malloc(sizeof(QueueDat)); *new_dat = (QueueDat){x, NULL}; if(q->len) { q->tail->next = new_dat; q->tail = new_dat; }else{ q->head = q->tail = new_dat; } q->len++; } QueueKey queue_pop(Queue *q) { assert(q->len); QueueDat *old_head = q->head; q->head = old_head->next; QueueKey key = old_head->key; free(old_head); q->len--; return key; } // <- queue int main(int argc, char **argv) { int n, q; scanf("%d%d", &n, &q); Queue Q; queue_init(&Q); QueueKey key; for(int i = 0; i < n; ++i) { scanf("%s%d", key.str, &key.num); queue_push(&Q, key); } int cnt = 0; // while Q is not empty while(queue_len(&Q)){ key = queue_pop(&Q); cnt += MIN(key.num, q); // if key time bt q, re-push if(key.num > q){ key.num -= q; queue_push(&Q, key); } else { printf("%s %d\n", key.str, cnt); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252486/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252486/source.c" target datalayout = "e-m:e-p270: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.QueueKey = type { [16 x i8], i32 } %struct.Queue = type { i64, ptr, ptr } %struct.QueueDat = type { %struct.QueueKey, ptr } @.str = private unnamed_addr constant [7 x i8] c"q->len\00", align 1 @.str.1 = private unnamed_addr constant [63 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/C/Source_252486/source.c\00", align 1 @__PRETTY_FUNCTION__.queue_pop = private unnamed_addr constant [28 x i8] c"QueueKey queue_pop(Queue *)\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.3 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.4 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn uwtable define dso_local void @queue_push(ptr nocapture noundef %q, ptr nocapture noundef readonly byval(%struct.QueueKey) align 8 %x) local_unnamed_addr #0 { entry: %.compoundliteral.sroa.0 = alloca [24 x i8], align 8 %call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %.compoundliteral.sroa.0, ptr noundef nonnull align 8 dereferenceable(20) %x, i64 20, i1 false), !tbaa.struct !5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %call, ptr noundef nonnull align 8 dereferenceable(24) %.compoundliteral.sroa.0, i64 24, i1 false), !tbaa.struct !11 %.compoundliteral.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %call, i64 24 store ptr null, ptr %.compoundliteral.sroa.2.0..sroa_idx, align 8, !tbaa.struct !14 %0 = load i64, ptr %q, align 8, !tbaa !15 %tobool.not = icmp eq i64 %0, 0 %tail3 = getelementptr inbounds %struct.Queue, ptr %q, i64 0, i32 2 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %entry %1 = load ptr, ptr %tail3, align 8, !tbaa !18 %next1 = getelementptr inbounds %struct.QueueDat, ptr %1, i64 0, i32 1 store ptr %call, ptr %next1, align 8, !tbaa !19 br label %if.end if.else: ; preds = %entry store ptr %call, ptr %tail3, align 8, !tbaa !18 %head = getelementptr inbounds %struct.Queue, ptr %q, i64 0, i32 1 br label %if.end if.end: ; preds = %if.else, %if.then %head.sink = phi ptr [ %head, %if.else ], [ %tail3, %if.then ] store ptr %call, ptr %head.sink, align 8, !tbaa !12 %inc = add i64 %0, 1 store i64 %inc, ptr %q, align 8, !tbaa !15 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nounwind uwtable define dso_local void @queue_pop(ptr noalias nocapture writeonly sret(%struct.QueueKey) align 4 %agg.result, ptr nocapture noundef %q) local_unnamed_addr #4 { entry: %0 = load i64, ptr %q, align 8, !tbaa !15 %tobool.not = icmp eq i64 %0, 0 br i1 %tobool.not, label %if.else, label %if.end if.else: ; preds = %entry tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 35, ptr noundef nonnull @__PRETTY_FUNCTION__.queue_pop) #10 unreachable if.end: ; preds = %entry %head = getelementptr inbounds %struct.Queue, ptr %q, i64 0, i32 1 %1 = load ptr, ptr %head, align 8, !tbaa !22 %next = getelementptr inbounds %struct.QueueDat, ptr %1, i64 0, i32 1 %2 = load ptr, ptr %next, align 8, !tbaa !19 store ptr %2, ptr %head, align 8, !tbaa !22 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %agg.result, ptr noundef nonnull align 8 dereferenceable(20) %1, i64 20, i1 false), !tbaa.struct !5 tail call void @free(ptr noundef %1) #11 %3 = load i64, ptr %q, align 8, !tbaa !15 %dec = add i64 %3, -1 store i64 %dec, ptr %q, align 8, !tbaa !15 ret void } ; Function Attrs: noreturn nounwind declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #4 { entry: %.compoundliteral.sroa.0.i30 = alloca [24 x i8], align 8 %.compoundliteral.sroa.0.i = alloca [24 x i8], align 8 %n = alloca i32, align 4 %q = alloca i32, align 4 %Q.sroa.11 = alloca ptr, align 8 %Q.sroa.16 = alloca ptr, align 8 %key = alloca %struct.QueueKey, align 8 %tmp = alloca %struct.QueueKey, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n, ptr noundef nonnull %q) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Q.sroa.11) call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Q.sroa.16) call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %key) #11 %0 = load i32, ptr %n, align 4, !tbaa !9 %cmp47 = icmp sgt i32 %0, 0 br i1 %cmp47, label %queue_push.exit.peel, label %while.end queue_push.exit.peel: ; preds = %entry %num = getelementptr inbounds %struct.QueueKey, ptr %key, i64 0, i32 1 %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %key, ptr noundef nonnull %num) call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %.compoundliteral.sroa.0.i) %call.i.peel = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %.compoundliteral.sroa.0.i, ptr noundef nonnull align 8 dereferenceable(20) %key, i64 20, i1 false) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %call.i.peel, ptr noundef nonnull align 8 dereferenceable(24) %.compoundliteral.sroa.0.i, i64 24, i1 false), !tbaa.struct !11 %.compoundliteral.sroa.2.0..sroa_idx.i.peel = getelementptr inbounds i8, ptr %call.i.peel, i64 24 store ptr null, ptr %.compoundliteral.sroa.2.0..sroa_idx.i.peel, align 8, !tbaa.struct !14 store ptr %call.i.peel, ptr %Q.sroa.16, align 8, !tbaa !18 store ptr %call.i.peel, ptr %Q.sroa.11, align 8, !tbaa !12 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %.compoundliteral.sroa.0.i) %1 = load i32, ptr %n, align 4, !tbaa !9 %cmp.peel = icmp sgt i32 %1, 1 br i1 %cmp.peel, label %queue_push.exit, label %queue_pop.exit.lr.ph queue_pop.exit.lr.ph.loopexit: ; preds = %queue_push.exit store ptr %call.i, ptr %Q.sroa.16, align 8, !tbaa !12 br label %queue_pop.exit.lr.ph queue_pop.exit.lr.ph: ; preds = %queue_pop.exit.lr.ph.loopexit, %queue_push.exit.peel %Q.sroa.0.0.lcssa.ph = phi i64 [ 1, %queue_push.exit.peel ], [ %inc.i, %queue_pop.exit.lr.ph.loopexit ] %num9 = getelementptr inbounds %struct.QueueKey, ptr %key, i64 0, i32 1 br label %queue_pop.exit queue_push.exit: ; preds = %queue_push.exit.peel, %queue_push.exit %Q.sroa.16.0.Q.sroa.16.0.Q.sroa.16.16. = phi ptr [ %call.i, %queue_push.exit ], [ %call.i.peel, %queue_push.exit.peel ] %Q.sroa.0.048 = phi i64 [ %inc.i, %queue_push.exit ], [ 1, %queue_push.exit.peel ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %key, ptr noundef nonnull %num) call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %.compoundliteral.sroa.0.i) %call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %.compoundliteral.sroa.0.i, ptr noundef nonnull align 8 dereferenceable(20) %key, i64 20, i1 false) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %call.i, ptr noundef nonnull align 8 dereferenceable(24) %.compoundliteral.sroa.0.i, i64 24, i1 false), !tbaa.struct !11 %.compoundliteral.sroa.2.0..sroa_idx.i = getelementptr inbounds i8, ptr %call.i, i64 24 store ptr null, ptr %.compoundliteral.sroa.2.0..sroa_idx.i, align 8, !tbaa.struct !14 %next1.i = getelementptr inbounds %struct.QueueDat, ptr %Q.sroa.16.0.Q.sroa.16.0.Q.sroa.16.16., i64 0, i32 1 store ptr %call.i, ptr %next1.i, align 8, !tbaa !19 %inc.i = add nuw nsw i64 %Q.sroa.0.048, 1 %indvars = trunc i64 %inc.i to i32 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %.compoundliteral.sroa.0.i) %2 = load i32, ptr %n, align 4, !tbaa !9 %cmp = icmp sgt i32 %2, %indvars br i1 %cmp, label %queue_push.exit, label %queue_pop.exit.lr.ph.loopexit, !llvm.loop !23 queue_pop.exit: ; preds = %queue_pop.exit.lr.ph, %if.end %cnt.052 = phi i32 [ 0, %queue_pop.exit.lr.ph ], [ %add, %if.end ] %Q.sroa.0.151 = phi i64 [ %Q.sroa.0.0.lcssa.ph, %queue_pop.exit.lr.ph ], [ %Q.sroa.0.2, %if.end ] call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %tmp) %Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.8. = load ptr, ptr %Q.sroa.11, align 8, !tbaa !22, !noalias !26 %next.i = getelementptr inbounds %struct.QueueDat, ptr %Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.8., i64 0, i32 1 %3 = load ptr, ptr %next.i, align 8, !tbaa !19, !noalias !26 store ptr %3, ptr %Q.sroa.11, align 8, !tbaa !22, !noalias !26 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %tmp, ptr noundef nonnull align 8 dereferenceable(20) %Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.8., i64 20, i1 false), !tbaa.struct !5 call void @free(ptr noundef %Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.0.Q.sroa.11.8.) #11, !noalias !26 %dec.i = add i64 %Q.sroa.0.151, -1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %key, ptr noundef nonnull align 4 dereferenceable(20) %tmp, i64 20, i1 false), !tbaa.struct !5 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) %4 = load i32, ptr %num9, align 8 %5 = load i32, ptr %q, align 4 %cond15 = call i32 @llvm.smin.i32(i32 %4, i32 %5) %add = add nsw i32 %cond15, %cnt.052 %cmp17 = icmp sgt i32 %4, %5 br i1 %cmp17, label %if.then, label %if.else if.then: ; preds = %queue_pop.exit %sub = sub nsw i32 %4, %5 store i32 %sub, ptr %num9, align 8, !tbaa !29 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %.compoundliteral.sroa.0.i30) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %.compoundliteral.sroa.0.i30, ptr noundef nonnull align 8 dereferenceable(20) %key, i64 20, i1 false) %call.i31 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %call.i31, ptr noundef nonnull align 8 dereferenceable(24) %.compoundliteral.sroa.0.i30, i64 24, i1 false), !tbaa.struct !11 %.compoundliteral.sroa.2.0..sroa_idx.i32 = getelementptr inbounds i8, ptr %call.i31, i64 24 store ptr null, ptr %.compoundliteral.sroa.2.0..sroa_idx.i32, align 8, !tbaa.struct !14 %tobool.not.i33 = icmp eq i64 %dec.i, 0 br i1 %tobool.not.i33, label %if.else.i39, label %if.then.i35 if.then.i35: ; preds = %if.then %Q.sroa.16.0.Q.sroa.16.0.Q.sroa.16.0.Q.sroa.16.16.46 = load ptr, ptr %Q.sroa.16, align 8, !tbaa !18 %next1.i36 = getelementptr inbounds %struct.QueueDat, ptr %Q.sroa.16.0.Q.sroa.16.0.Q.sroa.16.0.Q.sroa.16.16.46, i64 0, i32 1 store ptr %call.i31, ptr %next1.i36, align 8, !tbaa !19 br label %queue_push.exit41 if.else.i39: ; preds = %if.then store ptr %call.i31, ptr %Q.sroa.16, align 8, !tbaa !18 br label %queue_push.exit41 queue_push.exit41: ; preds = %if.then.i35, %if.else.i39 %head.sink.i37 = phi ptr [ %Q.sroa.11, %if.else.i39 ], [ %Q.sroa.16, %if.then.i35 ] store ptr %call.i31, ptr %head.sink.i37, align 8, !tbaa !12 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %.compoundliteral.sroa.0.i30) br label %if.end if.else: ; preds = %queue_pop.exit %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %key, i32 noundef %add) br label %if.end if.end: ; preds = %if.else, %queue_push.exit41 %Q.sroa.0.2 = phi i64 [ %Q.sroa.0.151, %queue_push.exit41 ], [ %dec.i, %if.else ] %tobool8.not = icmp eq i64 %Q.sroa.0.2, 0 br i1 %tobool8.not, label %while.end, label %queue_pop.exit, !llvm.loop !30 while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %key) #11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Q.sroa.11) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Q.sroa.16) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #11 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #8 attributes #0 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #9 = { nounwind allocsize(0) } attributes #10 = { noreturn nounwind } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{i64 0, i64 16, !6, i64 16, i64 4, !9} !6 = !{!7, !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{i64 0, i64 16, !6, i64 16, i64 4, !9, i64 24, i64 8, !12} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !7, i64 0} !14 = !{i64 0, i64 8, !12} !15 = !{!16, !17, i64 0} !16 = !{!"Queue", !17, i64 0, !13, i64 8, !13, i64 16} !17 = !{!"long", !7, i64 0} !18 = !{!16, !13, i64 16} !19 = !{!20, !13, i64 24} !20 = !{!"QueueDat", !21, i64 0, !13, i64 24} !21 = !{!"QueueKey", !7, i64 0, !10, i64 16} !22 = !{!16, !13, i64 8} !23 = distinct !{!23, !24, !25} !24 = !{!"llvm.loop.mustprogress"} !25 = !{!"llvm.loop.peeled.count", i32 1} !26 = !{!27} !27 = distinct !{!27, !28, !"queue_pop: %agg.result"} !28 = distinct !{!28, !"queue_pop"} !29 = !{!21, !10, i64 16} !30 = distinct !{!30, !24}
#include <stdio.h> #include <string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; } P; P Q[LEN]; int head, tail,n; void enqueue(P x){ Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue(){ P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a, int b){return a < b ? a : b;} int main(){ int elaps = 0,c; int i,q; P u; scanf("%d %d", &n, &q); for( i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } head = 1; tail = n + 1; while (head != tail){ u = dequeue(); c = min(q,u.t); u.t -= c; elaps += c; if ( u.t > 0 )enqueue(u); else{ printf("%s %d\n",u.name, elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252536/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252536/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> int main(){ int t,i,j,k,maxr[2],max,f1,f2,maxb[2],sum[1],n,m,r[101],b[101]; scanf("%d",&t); for(i=0;i<t;i++){ scanf("%d",&n); for(j=0;j<n;j++){ scanf("%d",&r[j]); } sum[1]=0; maxr[1]=r[0]; for(j=0;j<n;j++){ sum[1]=sum[1]+r[j]; if(maxr[1]<sum[1])maxr[1]=sum[1]; }//�� scanf("%d",&m); for(j=0;j<m;j++){ scanf("%d",&b[j]); } sum[1]=0; maxb[1]=b[0]; for(j=0;j<m;j++){ sum[1]=sum[1]+b[j]; if(maxb[1]<sum[1])maxb[1]=sum[1]; }//�� if((maxr[1]<0)&&(maxb[1]<0)){ max=0; }else if(maxr[1]<0){ max=maxb[1]; }else if(maxb[1]<0){ max=maxr[1]; }else{ max=maxr[1]+maxb[1]; } printf("%d\n",max); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25258/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25258/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 %m = alloca i32, align 4 %r = alloca [101 x i32], align 16 %b = alloca [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %r) #5 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp105 = icmp sgt i32 %0, 0 br i1 %cmp105, label %for.body, label %for.end79 for.body: ; preds = %entry, %for.end33 %i.0106 = phi i32 [ %inc78, %for.end33 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp3100 = icmp sgt i32 %1, 0 br i1 %cmp3100, label %for.body4, label %for.end for.body4: ; preds = %for.body, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ] %arrayidx = getelementptr inbounds [101 x i32], ptr %r, i64 0, i64 %indvars.iv %call5 = 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 %cmp3 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body4, %for.body %.lcssa = phi i32 [ %1, %for.body ], [ %2, %for.body4 ] %4 = load i32, ptr %r, align 16, !tbaa !5 %cmp10 = icmp slt i32 %.lcssa, 1 call void @llvm.assume(i1 %cmp10) %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %5 = load i32, ptr %m, align 4, !tbaa !5 %cmp26102 = icmp sgt i32 %5, 0 br i1 %cmp26102, label %for.body27, label %for.end33 for.body27: ; preds = %for.end, %for.body27 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.body27 ], [ 0, %for.end ] %arrayidx29 = getelementptr inbounds [101 x i32], ptr %b, i64 0, i64 %indvars.iv110 %call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx29) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %6 = load i32, ptr %m, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp26 = icmp slt i64 %indvars.iv.next111, %7 br i1 %cmp26, label %for.body27, label %for.end33, !llvm.loop !11 for.end33: ; preds = %for.body27, %for.end %.lcssa99 = phi i32 [ %5, %for.end ], [ %6, %for.body27 ] %8 = load i32, ptr %b, align 16, !tbaa !5 %cmp38 = icmp slt i32 %.lcssa99, 1 call void @llvm.assume(i1 %cmp38) %cmp56 = icmp slt i32 %4, 0 %cmp58 = icmp slt i32 %8, 0 %or.cond = select i1 %cmp56, i1 %cmp58, i1 false %.mux = select i1 %or.cond, i32 0, i32 %8 %add72 = call i32 @llvm.smax.i32(i32 %8, i32 0) %spec.select = add nuw nsw i32 %add72, %4 %max.0 = select i1 %cmp56, i32 %.mux, i32 %spec.select %call76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0) %inc78 = add nuw nsw i32 %i.0106, 1 %9 = load i32, ptr %t, align 4, !tbaa !5 %cmp = icmp slt i32 %inc78, %9 br i1 %cmp, label %for.body, label %for.end79, !llvm.loop !12 for.end79: ; preds = %for.end33, %entry call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %r) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> #define LEN 100005 typedef struct pp{ char name[100]; int time; }P; P Q[LEN+1]; int head=0,tail,tk=0; void enqueue(P x){ Q[tail]=x; tail=(tail+1)%LEN; } P dequeue(){ P x=Q[head]; head=(head+1)%LEN; return x; } int main(){ int n,q,i; P u; scanf("%d%d",&n,&q); for(i=0;i < n;i++){ scanf("%s%d",Q[i].name,&Q[i].time); } tail=n; while(head != tail){ u=dequeue(); if(u.time > q){ tk+=q; u.time=u.time-q; enqueue(u); } else{ tk+=u.time; printf("%s %d\n",u.name,tk); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252622/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252622/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @head = dso_local local_unnamed_addr global i32 0, align 4 @tk = dso_local local_unnamed_addr global i32 0, align 4 @Q = dso_local global [100006 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %0, 0 br i1 %cmp24, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %time = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %time) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 %.lcssa, ptr @tail, align 4, !tbaa !5 %3 = load i32, ptr @head, align 4, !tbaa !5 %cmp4.not26 = icmp eq i32 %3, %.lcssa br i1 %cmp4.not26, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %time5 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %4 = phi i32 [ %.lcssa, %while.body.lr.ph ], [ %9, %if.end ] %5 = phi i32 [ %3, %while.body.lr.ph ], [ %10, %if.end ] %idxprom.i = sext i32 %5 to i64 %arrayidx.i = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %5, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %6 = load i32, ptr %time5, align 4, !tbaa !16 %7 = load i32, ptr %q, align 4, !tbaa !5 %cmp6 = icmp sgt i32 %6, %7 %8 = load i32, ptr @tk, align 4, !tbaa !5 br i1 %cmp6, label %if.then, label %if.else if.then: ; preds = %while.body %add = add nsw i32 %8, %7 store i32 %add, ptr @tk, align 4, !tbaa !5 %sub = sub nsw i32 %6, %7 store i32 %sub, ptr %time5, align 4, !tbaa !16 %idxprom.i20 = sext i32 %4 to i64 %arrayidx.i21 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i20 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i21, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i22 = add nsw i32 %4, 1 %rem.i23 = srem i32 %add.i22, 100005 store i32 %rem.i23, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %add10 = add nsw i32 %8, %6 store i32 %add10, ptr @tk, align 4, !tbaa !5 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %u, i32 noundef %add10) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre29 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %9 = phi i32 [ %.pre29, %if.else ], [ %rem.i23, %if.then ] %10 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp4.not = icmp eq i32 %10, %9 br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> #include<stdbool.h> #define MAX 100001 typedef struct { int id, time; } State; State queue[MAX]; int head, tail; void push(int id,int tm) { queue[tail].id = id, queue[tail].time = tm; tail = ((tail+1==MAX)?0:tail+1); } State pop() { State v = queue[head]; head = ((head+1==MAX)?0:head+1); return v; } inline bool empty() { return (tail - head) == 0; } int n, q; char P[MAX][200]; void exec() { int total_time = 0; while( !empty() ) { if( queue[head].time > q ) { queue[head].time -= q; State tmp = pop(); push(tmp.id,tmp.time); total_time += q; } else { total_time += queue[head].time; printf("%s %d\n",P[queue[head].id],total_time); pop(); } } } int main() { int i, T; scanf("%d %d",&n,&q); for(i=0;i<n;++i) { scanf(" %s %d",&P[i][0],&T); push(i,T); } exec(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252673/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252673/source.c" target datalayout = "e-m:e-p270: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.State = type { i32, i32 } @queue = dso_local local_unnamed_addr global [100001 x %struct.State] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @q = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 @P = dso_local global [100001 x [200 x i8]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.2 = private unnamed_addr constant [7 x i8] c" %s %d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @push(i32 noundef %id, i32 noundef %tm) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom store i32 %id, ptr %arrayidx, align 8, !tbaa !5 %time = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom, i32 1 store i32 %tm, ptr %time, align 4, !tbaa !10 %add = add nsw i32 %0, 1 %cmp = icmp eq i32 %add, 100001 %cond = select i1 %cmp, i32 0, i32 %add store i32 %cond, ptr @tail, align 4, !tbaa !11 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @pop() local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom %retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 8, !tbaa.struct !12 %add = add nsw i32 %0, 1 %cmp = icmp eq i32 %add, 100001 %cond = select i1 %cmp, i32 0, i32 %add store i32 %cond, ptr @head, align 4, !tbaa !11 ret i64 %retval.sroa.0.0.copyload } ; Function Attrs: nofree nounwind uwtable define dso_local void @exec() local_unnamed_addr #1 { entry: %0 = load i32, ptr @tail, align 4 %1 = load i32, ptr @head, align 4 %cmp.i32 = icmp eq i32 %0, %1 br i1 %cmp.i32, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %.pre34 = load i32, ptr @q, align 4, !tbaa !11 br label %while.body while.body: ; preds = %while.body.preheader, %if.end %2 = phi i32 [ %9, %if.end ], [ %.pre34, %while.body.preheader ] %3 = phi i32 [ %cond.i31.sink, %if.end ], [ %1, %while.body.preheader ] %4 = phi i32 [ %8, %if.end ], [ %0, %while.body.preheader ] %total_time.033 = phi i32 [ %total_time.1, %if.end ], [ 0, %while.body.preheader ] %idxprom = sext i32 %3 to i64 %time = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom, i32 1 %5 = load i32, ptr %time, align 4, !tbaa !10 %cmp = icmp sgt i32 %5, %2 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %sub = sub nsw i32 %5, %2 store i32 %sub, ptr %time, align 4, !tbaa !10 %arrayidx.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom %retval.sroa.0.0.copyload.i = load i64, ptr %arrayidx.i, align 8, !tbaa.struct !12 %add.i = add nsw i32 %3, 1 %cmp.i20 = icmp eq i32 %add.i, 100001 %cond.i = select i1 %cmp.i20, i32 0, i32 %add.i %tmp.sroa.0.0.extract.trunc = trunc i64 %retval.sroa.0.0.copyload.i to i32 %tmp.sroa.4.0.extract.shift = lshr i64 %retval.sroa.0.0.copyload.i, 32 %tmp.sroa.4.0.extract.trunc = trunc i64 %tmp.sroa.4.0.extract.shift to i32 %idxprom.i21 = sext i32 %4 to i64 %arrayidx.i22 = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i21 store i32 %tmp.sroa.0.0.extract.trunc, ptr %arrayidx.i22, align 8, !tbaa !5 %time.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i21, i32 1 store i32 %tmp.sroa.4.0.extract.trunc, ptr %time.i, align 4, !tbaa !10 %add.i23 = add nsw i32 %4, 1 %cmp.i24 = icmp eq i32 %add.i23, 100001 %cond.i25 = select i1 %cmp.i24, i32 0, i32 %add.i23 store i32 %cond.i25, ptr @tail, align 4, !tbaa !11 %add = add nsw i32 %2, %total_time.033 br label %if.end if.else: ; preds = %while.body %arrayidx = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom %add9 = add nsw i32 %5, %total_time.033 %6 = load i32, ptr %arrayidx, align 8, !tbaa !5 %idxprom13 = sext i32 %6 to i64 %arrayidx14 = getelementptr inbounds [100001 x [200 x i8]], ptr @P, i64 0, i64 %idxprom13 %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %arrayidx14, i32 noundef %add9) %7 = load i32, ptr @head, align 4 %add.i29 = add nsw i32 %7, 1 %cmp.i30 = icmp eq i32 %add.i29, 100001 %cond.i31 = select i1 %cmp.i30, i32 0, i32 %add.i29 %.pre = load i32, ptr @q, align 4, !tbaa !11 %.pre35 = load i32, ptr @tail, align 4 br label %if.end if.end: ; preds = %if.else, %if.then %8 = phi i32 [ %cond.i25, %if.then ], [ %.pre35, %if.else ] %9 = phi i32 [ %2, %if.then ], [ %.pre, %if.else ] %cond.i31.sink = phi i32 [ %cond.i, %if.then ], [ %cond.i31, %if.else ] %total_time.1 = phi i32 [ %add, %if.then ], [ %add9, %if.else ] store i32 %cond.i31.sink, ptr @head, align 4 %cmp.i = icmp eq i32 %8, %cond.i31.sink br i1 %cmp.i, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %T = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @q) %0 = load i32, ptr @n, align 4, !tbaa !11 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = load i32, ptr @tail, align 4 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100001 x [200 x i8]], ptr @P, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx, ptr noundef nonnull %T) %1 = load i32, ptr %T, align 4, !tbaa !11 %2 = load i32, ptr @tail, align 4 %idxprom.i = sext i32 %2 to i64 %arrayidx.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i %3 = trunc i64 %indvars.iv to i32 store i32 %3, ptr %arrayidx.i, align 8, !tbaa !5 %time.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i, i32 1 store i32 %1, ptr %time.i, align 4, !tbaa !10 %add.i = add nsw i32 %2, 1 %cmp.i = icmp eq i32 %add.i, 100001 %cond.i = select i1 %cmp.i, i32 0, i32 %add.i store i32 %cond.i, ptr @tail, align 4, !tbaa !11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr @n, align 4, !tbaa !11 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !15 for.end: ; preds = %for.body, %entry.for.end_crit_edge %6 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %cond.i, %for.body ] %7 = load i32, ptr @head, align 4 %cmp.i32.i = icmp eq i32 %6, %7 br i1 %cmp.i32.i, label %exec.exit, label %while.body.preheader.i while.body.preheader.i: ; preds = %for.end %.pre34.i = load i32, ptr @q, align 4, !tbaa !11 br label %while.body.i while.body.i: ; preds = %if.end.i, %while.body.preheader.i %8 = phi i32 [ %15, %if.end.i ], [ %.pre34.i, %while.body.preheader.i ] %9 = phi i32 [ %cond.i31.sink.i, %if.end.i ], [ %7, %while.body.preheader.i ] %10 = phi i32 [ %14, %if.end.i ], [ %6, %while.body.preheader.i ] %total_time.033.i = phi i32 [ %total_time.1.i, %if.end.i ], [ 0, %while.body.preheader.i ] %idxprom.i6 = sext i32 %9 to i64 %time.i7 = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i6, i32 1 %11 = load i32, ptr %time.i7, align 4, !tbaa !10 %cmp.i8 = icmp sgt i32 %11, %8 br i1 %cmp.i8, label %if.then.i, label %if.else.i if.then.i: ; preds = %while.body.i %sub.i = sub nsw i32 %11, %8 store i32 %sub.i, ptr %time.i7, align 4, !tbaa !10 %arrayidx.i.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i6 %retval.sroa.0.0.copyload.i.i = load i64, ptr %arrayidx.i.i, align 8, !tbaa.struct !12 %add.i.i = add nsw i32 %9, 1 %cmp.i20.i = icmp eq i32 %add.i.i, 100001 %cond.i.i = select i1 %cmp.i20.i, i32 0, i32 %add.i.i %tmp.sroa.0.0.extract.trunc.i = trunc i64 %retval.sroa.0.0.copyload.i.i to i32 %tmp.sroa.4.0.extract.shift.i = lshr i64 %retval.sroa.0.0.copyload.i.i, 32 %tmp.sroa.4.0.extract.trunc.i = trunc i64 %tmp.sroa.4.0.extract.shift.i to i32 %idxprom.i21.i = sext i32 %10 to i64 %arrayidx.i22.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i21.i store i32 %tmp.sroa.0.0.extract.trunc.i, ptr %arrayidx.i22.i, align 8, !tbaa !5 %time.i.i = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i21.i, i32 1 store i32 %tmp.sroa.4.0.extract.trunc.i, ptr %time.i.i, align 4, !tbaa !10 %add.i23.i = add nsw i32 %10, 1 %cmp.i24.i = icmp eq i32 %add.i23.i, 100001 %cond.i25.i = select i1 %cmp.i24.i, i32 0, i32 %add.i23.i store i32 %cond.i25.i, ptr @tail, align 4, !tbaa !11 %add.i10 = add nsw i32 %total_time.033.i, %8 br label %if.end.i if.else.i: ; preds = %while.body.i %arrayidx.i9 = getelementptr inbounds [100001 x %struct.State], ptr @queue, i64 0, i64 %idxprom.i6 %add9.i = add nsw i32 %11, %total_time.033.i %12 = load i32, ptr %arrayidx.i9, align 8, !tbaa !5 %idxprom13.i = sext i32 %12 to i64 %arrayidx14.i = getelementptr inbounds [100001 x [200 x i8]], ptr @P, i64 0, i64 %idxprom13.i %call15.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %arrayidx14.i, i32 noundef %add9.i) %13 = load i32, ptr @head, align 4 %add.i29.i = add nsw i32 %13, 1 %cmp.i30.i = icmp eq i32 %add.i29.i, 100001 %cond.i31.i = select i1 %cmp.i30.i, i32 0, i32 %add.i29.i %.pre.i = load i32, ptr @q, align 4, !tbaa !11 %.pre35.i = load i32, ptr @tail, align 4 br label %if.end.i if.end.i: ; preds = %if.else.i, %if.then.i %14 = phi i32 [ %cond.i25.i, %if.then.i ], [ %.pre35.i, %if.else.i ] %15 = phi i32 [ %8, %if.then.i ], [ %.pre.i, %if.else.i ] %cond.i31.sink.i = phi i32 [ %cond.i.i, %if.then.i ], [ %cond.i31.i, %if.else.i ] %total_time.1.i = phi i32 [ %add.i10, %if.then.i ], [ %add9.i, %if.else.i ] store i32 %cond.i31.sink.i, ptr @head, align 4 %cmp.i.i = icmp eq i32 %14, %cond.i31.sink.i br i1 %cmp.i.i, label %exec.exit, label %while.body.i, !llvm.loop !13 exec.exit: ; preds = %if.end.i, %for.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"", !7, i64 0, !7, i64 4} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 4} !11 = !{!7, !7, i64 0} !12 = !{i64 0, i64 4, !11, i64 4, i64 4, !11} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"} !15 = distinct !{!15, !14}
#include <stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN+1]; int head=1, tail, n; int main(void){ int i, q; int time=0; scanf("%d %d", &n, &q); tail=n+1; for ( i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } i=1; while(head!=tail){ if(tail==LEN) tail=1; else if(head==LEN) { head=1; i=1; } if(Q[i].t-q <= 0){ time += Q[i].t; printf("%s %d\n",Q[i].name,time); } else{ time += q; Q[i].t -= q; Q[tail]=Q[i]; tail++; } head++; i++; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252723/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252723/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @head = dso_local local_unnamed_addr global i32 1, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @tail = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @Q = dso_local global [100006 x %struct.pp] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp.not50 = icmp slt i32 %0, 1 br i1 %cmp.not50, label %while.condthread-pre-split, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %while.condthread-pre-split.loopexit, !llvm.loop !9 while.condthread-pre-split.loopexit: ; preds = %for.body %.pre = load i32, ptr @tail, align 4, !tbaa !5 br label %while.condthread-pre-split while.condthread-pre-split: ; preds = %while.condthread-pre-split.loopexit, %entry %3 = phi i32 [ %.pre, %while.condthread-pre-split.loopexit ], [ %add, %entry ] %.pr = load i32, ptr @head, align 4, !tbaa !5 %cmp5.not52 = icmp eq i32 %.pr, %3 br i1 %cmp5.not52, label %while.end, label %while.body while.body: ; preds = %while.condthread-pre-split, %if.end35 %4 = phi i32 [ %10, %if.end35 ], [ %3, %while.condthread-pre-split ] %time.054 = phi i32 [ %time.1, %if.end35 ], [ 0, %while.condthread-pre-split ] %i.153 = phi i32 [ %inc37, %if.end35 ], [ 1, %while.condthread-pre-split ] %5 = phi i32 [ %inc36, %if.end35 ], [ %.pr, %while.condthread-pre-split ] %cmp6 = icmp eq i32 %4, 100005 br i1 %cmp6, label %if.end9.sink.split, label %if.else if.else: ; preds = %while.body %cmp7 = icmp eq i32 %5, 100005 br i1 %cmp7, label %if.end9.sink.split, label %if.end9 if.end9.sink.split: ; preds = %if.else, %while.body %head.sink = phi ptr [ @tail, %while.body ], [ @head, %if.else ] %.ph = phi i32 [ %5, %while.body ], [ 1, %if.else ] %.ph58 = phi i32 [ 1, %while.body ], [ %4, %if.else ] %i.2.ph = phi i32 [ %i.153, %while.body ], [ 1, %if.else ] store i32 1, ptr %head.sink, align 4, !tbaa !5 br label %if.end9 if.end9: ; preds = %if.end9.sink.split, %if.else %6 = phi i32 [ %5, %if.else ], [ %.ph, %if.end9.sink.split ] %7 = phi i32 [ %4, %if.else ], [ %.ph58, %if.end9.sink.split ] %i.2 = phi i32 [ %i.153, %if.else ], [ %i.2.ph, %if.end9.sink.split ] %idxprom10 = sext i32 %i.2 to i64 %arrayidx11 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom10 %t12 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom10, i32 1 %8 = load i32, ptr %t12, align 4, !tbaa !11 %9 = load i32, ptr %q, align 4, !tbaa !5 %sub = sub nsw i32 %8, %9 %cmp13 = icmp slt i32 %sub, 1 br i1 %cmp13, label %if.then14, label %if.else24 if.then14: ; preds = %if.end9 %add18 = add nsw i32 %8, %time.054 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %arrayidx11, i32 noundef %add18) %.pre56 = load i32, ptr @head, align 4, !tbaa !5 %.pre57 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end35 if.else24: ; preds = %if.end9 %add25 = add nsw i32 %9, %time.054 store i32 %sub, ptr %t12, align 4, !tbaa !11 %idxprom30 = sext i32 %7 to i64 %arrayidx31 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom30 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx31, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx11, i64 104, i1 false), !tbaa.struct !13 %inc34 = add nsw i32 %7, 1 store i32 %inc34, ptr @tail, align 4, !tbaa !5 br label %if.end35 if.end35: ; preds = %if.else24, %if.then14 %10 = phi i32 [ %.pre57, %if.then14 ], [ %inc34, %if.else24 ] %11 = phi i32 [ %.pre56, %if.then14 ], [ %6, %if.else24 ] %time.1 = phi i32 [ %add18, %if.then14 ], [ %add25, %if.else24 ] %inc36 = add nsw i32 %11, 1 store i32 %inc36, ptr @head, align 4, !tbaa !5 %inc37 = add nsw i32 %i.2, 1 %cmp5.not = icmp eq i32 %inc36, %10 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %if.end35, %while.condthread-pre-split call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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: readwrite) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !6, i64 100} !12 = !{!"pp", !7, i64 0, !6, i64 100} !13 = !{i64 0, i64 100, !14, i64 100, i64 4, !5} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !10}
#include <stdio.h> #include <limits.h> #define LENGTH 50005 typedef struct queue { char name[100]; int value; } Queue; Queue q[LENGTH]; int front; int tail; Queue pop() { Queue tmp = q[front]; front = (front + 1) % LENGTH; return tmp; } void push(Queue x) { q[tail] = x; tail = (tail + 1) % LENGTH; } int main() { #ifdef TEST freopen("input", "r", stdin); #endif int num, period; scanf("%d %d", &num, &period); Queue tmp; for (int i = 0; i < num; ++i) { scanf("%s %d", tmp.name, &tmp.value); push(tmp); } int cnt = 0; int time = 0; while (cnt < num) { Queue tmp = pop(); if (tmp.value <= period) { time += tmp.value; cnt++; printf("%s %d\n", tmp.name, time); } else { time += period; tmp.value -= period; push(tmp); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252767/source.c" target datalayout = "e-m:e-p270: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.queue = type { [100 x i8], i32 } @q = dso_local local_unnamed_addr global [50005 x %struct.queue] zeroinitializer, align 16 @front = dso_local local_unnamed_addr global i32 0, align 4 @tail = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @pop(ptr noalias nocapture writeonly sret(%struct.queue) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @front, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [50005 x %struct.queue], ptr @q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 50005 store i32 %rem, ptr @front, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @push(ptr nocapture noundef readonly byval(%struct.queue) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [50005 x %struct.queue], ptr @q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 50005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %num = alloca i32, align 4 %period = alloca i32, align 4 %tmp = alloca %struct.queue, align 8 %tmp3 = alloca %struct.queue, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %period) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %period) call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %tmp) #5 %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp28 = icmp sgt i32 %0, 0 br i1 %cmp28, label %for.body.lr.ph, label %while.end for.body.lr.ph: ; preds = %entry %value = getelementptr inbounds %struct.queue, ptr %tmp, i64 0, i32 1 br label %for.body while.cond.preheader: ; preds = %for.body %cmp230 = icmp sgt i32 %2, 0 br i1 %cmp230, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %while.cond.preheader %value4 = getelementptr inbounds %struct.queue, ptr %tmp3, i64 0, i32 1 %.pre33 = load i32, ptr @front, align 4, !tbaa !5, !noalias !11 br label %while.body for.body: ; preds = %for.body.lr.ph, %for.body %i.029 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp, ptr noundef nonnull %value) %1 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom.i = sext i32 %1 to i64 %arrayidx.i = getelementptr inbounds [50005 x %struct.queue], ptr @q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, ptr noundef nonnull align 8 dereferenceable(104) %tmp, i64 104, i1 false) %add.i = add nsw i32 %1, 1 %rem.i = srem i32 %add.i, 50005 store i32 %rem.i, ptr @tail, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.029, 1 %2 = load i32, ptr %num, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %2 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !14 while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %2, %while.body.lr.ph ], [ %8, %if.end ] %4 = phi i32 [ %.pre33, %while.body.lr.ph ], [ %9, %if.end ] %time.032 = phi i32 [ 0, %while.body.lr.ph ], [ %time.1, %if.end ] %cnt.031 = phi i32 [ 0, %while.body.lr.ph ], [ %cnt.1, %if.end ] call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %tmp3) #5 %idxprom.i19 = sext i32 %4 to i64 %arrayidx.i20 = getelementptr inbounds [50005 x %struct.queue], ptr @q, i64 0, i64 %idxprom.i19 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %tmp3, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i20, i64 104, i1 false), !tbaa.struct !9 %add.i21 = add nsw i32 %4, 1 %rem.i22 = srem i32 %add.i21, 50005 store i32 %rem.i22, ptr @front, align 4, !tbaa !5, !noalias !11 %5 = load i32, ptr %value4, align 4, !tbaa !16 %6 = load i32, ptr %period, align 4, !tbaa !5 %cmp5.not = icmp sgt i32 %5, %6 br i1 %cmp5.not, label %if.else, label %if.then if.then: ; preds = %while.body %add = add nsw i32 %5, %time.032 %inc7 = add nsw i32 %cnt.031, 1 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %tmp3, i32 noundef %add) %.pre = load i32, ptr @front, align 4, !tbaa !5, !noalias !11 %.pre34 = load i32, ptr %num, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %add11 = add nsw i32 %6, %time.032 %sub = sub nsw i32 %5, %6 store i32 %sub, ptr %value4, align 4, !tbaa !16 %7 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom.i24 = sext i32 %7 to i64 %arrayidx.i25 = getelementptr inbounds [50005 x %struct.queue], ptr @q, i64 0, i64 %idxprom.i24 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i25, ptr noundef nonnull align 8 dereferenceable(104) %tmp3, i64 104, i1 false) %add.i26 = add nsw i32 %7, 1 %rem.i27 = srem i32 %add.i26, 50005 store i32 %rem.i27, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %8 = phi i32 [ %.pre34, %if.then ], [ %3, %if.else ] %9 = phi i32 [ %.pre, %if.then ], [ %rem.i22, %if.else ] %cnt.1 = phi i32 [ %inc7, %if.then ], [ %cnt.031, %if.else ] %time.1 = phi i32 [ %add, %if.then ], [ %add11, %if.else ] call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %tmp3) #5 %cmp2 = icmp slt i32 %cnt.1, %8 br i1 %cmp2, label %while.body, label %while.end, !llvm.loop !18 while.end: ; preds = %if.end, %entry, %while.cond.preheader call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %tmp) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %period) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = !{!12} !12 = distinct !{!12, !13, !"pop: %agg.result"} !13 = distinct !{!13, !"pop"} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = !{!17, !6, i64 100} !17 = !{!"queue", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !15}
#include<stdio.h> #include<stdlib.h> #include<math.h> int cmp(const void *a,const void *b) { return *(int *)a - *(int *)b; } int main() { int n,k; scanf("%d%d",&n,&k); int i,a[1005],sum=0; for(i=0;i<n;i++) { scanf("%d",&a[i]); sum+=a[i]; } int ans=0; while(((double)sum/(double)n)+0.5<k) { ans+=1; sum+=k; n++; } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25281/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25281/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %a = alloca [1005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %a) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry %n.promoted = phi i32 [ %0, %entry ], [ %3, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %1 = load i32, ptr %k, align 4, !tbaa !5 %conv6 = sitofp i32 %1 to double %conv23 = sitofp i32 %sum.0.lcssa to double %conv424 = sitofp i32 %n.promoted to double %div25 = fdiv double %conv23, %conv424 %add526 = fadd double %div25, 5.000000e-01 %cmp727 = fcmp olt double %add526, %conv6 br i1 %cmp727, label %while.body, label %while.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.021 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1005 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %2, %sum.021 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9 while.body: ; preds = %while.cond.preheader, %while.body %ans.030 = phi i32 [ %add9, %while.body ], [ 0, %while.cond.preheader ] %sum.129 = phi i32 [ %add10, %while.body ], [ %sum.0.lcssa, %while.cond.preheader ] %inc112228 = phi i32 [ %inc11, %while.body ], [ %n.promoted, %while.cond.preheader ] %add9 = add nuw nsw i32 %ans.030, 1 %add10 = add nsw i32 %1, %sum.129 %inc11 = add nsw i32 %inc112228, 1 %conv = sitofp i32 %add10 to double %conv4 = sitofp i32 %inc11 to double %div = fdiv double %conv, %conv4 %add5 = fadd double %div, 5.000000e-01 %cmp7 = fcmp olt double %add5, %conv6 br i1 %cmp7, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !11 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %inc11, ptr %n, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %ans.0.lcssa = phi i32 [ %add9, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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> struct q{ char name[10]; int t; struct q *next; struct q *prev; }; typedef struct q * Q; void enqueue(Q); void dequeue(); void moveBack(); void printstate(); Q head; int main(){ int i, n, qt, time = 0; Q x; head = malloc(sizeof(struct q)); head->next = head; head->prev = head; //input scanf("%d%d",&n,&qt); for (i = 0; i < n; i++){ x = malloc(sizeof(struct q)); scanf("%s", x->name); scanf("%d", &x->t); enqueue(x); } //process while(head->prev != head){ if((head->next)->t > qt){ (head->next)->t -= qt; moveBack(); time += qt; } else{ time += (head->next)->t; printf("%s %d\n",(head->next)->name, time); dequeue(); } //printstate(); } free(head); return 0; } void enqueue(Q x){ x->next = head; x->prev = head->prev; head->prev = x; (x->prev)->next = x; } void dequeue(){ Q d = head->next, x = (head->next)->next; head->next = x; x->prev = head; free(d); } void moveBack(){ Q x = (head->next)->next; if(x != head){ enqueue(head->next); head->next = x; x->prev = head; } } void printstate(){ int i; Q x = head; for(i = 0; i < 5; i++){ printf("%s %d\n",x->name,x->t); x=x->next; } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252853/source.c" target datalayout = "e-m:e-p270: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.q = type { [10 x i8], i32, ptr, ptr } @head = dso_local local_unnamed_addr global ptr null, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %qt = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %qt) #8 %call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9 store ptr %call, ptr @head, align 8, !tbaa !5 %next = getelementptr inbounds %struct.q, ptr %call, i64 0, i32 2 store ptr %call, ptr %next, align 8, !tbaa !9 %prev = getelementptr inbounds %struct.q, ptr %call, i64 0, i32 3 store ptr %call, ptr %prev, align 8, !tbaa !12 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %qt) %0 = load i32, ptr %n, align 4, !tbaa !13 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body, label %entry.while.cond.preheader_crit_edge entry.while.cond.preheader_crit_edge: ; preds = %entry %.pre = load ptr, ptr @head, align 8, !tbaa !5 %prev533.phi.trans.insert = getelementptr inbounds %struct.q, ptr %.pre, i64 0, i32 3 %.pre38 = load ptr, ptr %prev533.phi.trans.insert, align 8, !tbaa !12 br label %while.cond.preheader while.cond.preheader: ; preds = %for.body, %entry.while.cond.preheader_crit_edge %1 = phi ptr [ %.pre38, %entry.while.cond.preheader_crit_edge ], [ %call2, %for.body ] %2 = phi ptr [ %.pre, %entry.while.cond.preheader_crit_edge ], [ %3, %for.body ] %cmp6.not34 = icmp eq ptr %1, %2 br i1 %cmp6.not34, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %while.cond.preheader %prev533 = getelementptr inbounds %struct.q, ptr %2, i64 0, i32 3 br label %while.body for.body: ; preds = %entry, %for.body %i.032 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call2 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call2) %t = getelementptr inbounds %struct.q, ptr %call2, i64 0, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %3 = load ptr, ptr @head, align 8, !tbaa !5 %next.i = getelementptr inbounds %struct.q, ptr %call2, i64 0, i32 2 store ptr %3, ptr %next.i, align 8, !tbaa !9 %prev.i = getelementptr inbounds %struct.q, ptr %3, i64 0, i32 3 %4 = load ptr, ptr %prev.i, align 8, !tbaa !12 %prev1.i = getelementptr inbounds %struct.q, ptr %call2, i64 0, i32 3 store ptr %4, ptr %prev1.i, align 8, !tbaa !12 store ptr %call2, ptr %prev.i, align 8, !tbaa !12 %5 = load ptr, ptr %prev1.i, align 8, !tbaa !12 %next4.i = getelementptr inbounds %struct.q, ptr %5, i64 0, i32 2 store ptr %call2, ptr %next4.i, align 8, !tbaa !9 %inc = add nuw nsw i32 %i.032, 1 %6 = load i32, ptr %n, align 4, !tbaa !13 %cmp = icmp slt i32 %inc, %6 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !14 while.body: ; preds = %while.body.preheader, %if.end %7 = phi ptr [ %17, %if.end ], [ %2, %while.body.preheader ] %8 = phi ptr [ %18, %if.end ], [ %1, %while.body.preheader ] %prev536 = phi ptr [ %prev5, %if.end ], [ %prev533, %while.body.preheader ] %time.035 = phi i32 [ %time.1, %if.end ], [ 0, %while.body.preheader ] %next7 = getelementptr inbounds %struct.q, ptr %7, i64 0, i32 2 %9 = load ptr, ptr %next7, align 8, !tbaa !9 %t8 = getelementptr inbounds %struct.q, ptr %9, i64 0, i32 1 %10 = load i32, ptr %t8, align 4, !tbaa !16 %11 = load i32, ptr %qt, align 4, !tbaa !13 %cmp9 = icmp sgt i32 %10, %11 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %while.body %sub = sub nsw i32 %10, %11 store i32 %sub, ptr %t8, align 4, !tbaa !16 %next1.i = getelementptr inbounds %struct.q, ptr %9, i64 0, i32 2 %12 = load ptr, ptr %next1.i, align 8, !tbaa !9 %cmp.not.i = icmp eq ptr %12, %7 br i1 %cmp.not.i, label %moveBack.exit, label %if.then.i if.then.i: ; preds = %if.then store ptr %7, ptr %next1.i, align 8, !tbaa !9 %prev1.i.i = getelementptr inbounds %struct.q, ptr %9, i64 0, i32 3 store ptr %8, ptr %prev1.i.i, align 8, !tbaa !12 store ptr %9, ptr %prev536, align 8, !tbaa !12 %13 = load ptr, ptr %prev1.i.i, align 8, !tbaa !12 %next4.i.i = getelementptr inbounds %struct.q, ptr %13, i64 0, i32 2 store ptr %9, ptr %next4.i.i, align 8, !tbaa !9 store ptr %12, ptr %next7, align 8, !tbaa !9 %prev.i28 = getelementptr inbounds %struct.q, ptr %12, i64 0, i32 3 store ptr %7, ptr %prev.i28, align 8, !tbaa !12 br label %moveBack.exit moveBack.exit: ; preds = %if.then, %if.then.i %add = add nsw i32 %11, %time.035 br label %if.end if.else: ; preds = %while.body %add14 = add nsw i32 %10, %time.035 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %9, i32 noundef %add14) %14 = load ptr, ptr @head, align 8, !tbaa !5 %next.i29 = getelementptr inbounds %struct.q, ptr %14, i64 0, i32 2 %15 = load ptr, ptr %next.i29, align 8, !tbaa !9 %next2.i = getelementptr inbounds %struct.q, ptr %15, i64 0, i32 2 %16 = load ptr, ptr %next2.i, align 8, !tbaa !9 store ptr %16, ptr %next.i29, align 8, !tbaa !9 %prev.i30 = getelementptr inbounds %struct.q, ptr %16, i64 0, i32 3 store ptr %14, ptr %prev.i30, align 8, !tbaa !12 call void @free(ptr noundef %15) #8 %.pre39 = load ptr, ptr @head, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %moveBack.exit %17 = phi ptr [ %7, %moveBack.exit ], [ %.pre39, %if.else ] %time.1 = phi i32 [ %add, %moveBack.exit ], [ %add14, %if.else ] %prev5 = getelementptr inbounds %struct.q, ptr %17, i64 0, i32 3 %18 = load ptr, ptr %prev5, align 8, !tbaa !12 %cmp6.not = icmp eq ptr %18, %17 br i1 %cmp6.not, label %while.end, label %while.body, !llvm.loop !17 while.end: ; preds = %if.end, %while.cond.preheader %.lcssa = phi ptr [ %1, %while.cond.preheader ], [ %17, %if.end ] call void @free(ptr noundef nonnull %.lcssa) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %qt) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr noundef %x) local_unnamed_addr #4 { entry: %0 = load ptr, ptr @head, align 8, !tbaa !5 %next = getelementptr inbounds %struct.q, ptr %x, i64 0, i32 2 store ptr %0, ptr %next, align 8, !tbaa !9 %prev = getelementptr inbounds %struct.q, ptr %0, i64 0, i32 3 %1 = load ptr, ptr %prev, align 8, !tbaa !12 %prev1 = getelementptr inbounds %struct.q, ptr %x, i64 0, i32 3 store ptr %1, ptr %prev1, align 8, !tbaa !12 store ptr %x, ptr %prev, align 8, !tbaa !12 %2 = load ptr, ptr %prev1, align 8, !tbaa !12 %next4 = getelementptr inbounds %struct.q, ptr %2, i64 0, i32 2 store ptr %x, ptr %next4, align 8, !tbaa !9 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nounwind willreturn uwtable define dso_local void @dequeue() local_unnamed_addr #6 { entry: %0 = load ptr, ptr @head, align 8, !tbaa !5 %next = getelementptr inbounds %struct.q, ptr %0, i64 0, i32 2 %1 = load ptr, ptr %next, align 8, !tbaa !9 %next2 = getelementptr inbounds %struct.q, ptr %1, i64 0, i32 2 %2 = load ptr, ptr %next2, align 8, !tbaa !9 store ptr %2, ptr %next, align 8, !tbaa !9 %prev = getelementptr inbounds %struct.q, ptr %2, i64 0, i32 3 store ptr %0, ptr %prev, align 8, !tbaa !12 tail call void @free(ptr noundef %1) #8 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @moveBack() local_unnamed_addr #4 { entry: %0 = load ptr, ptr @head, align 8, !tbaa !5 %next = getelementptr inbounds %struct.q, ptr %0, i64 0, i32 2 %1 = load ptr, ptr %next, align 8, !tbaa !9 %next1 = getelementptr inbounds %struct.q, ptr %1, i64 0, i32 2 %2 = load ptr, ptr %next1, align 8, !tbaa !9 %cmp.not = icmp eq ptr %2, %0 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry store ptr %0, ptr %next1, align 8, !tbaa !9 %prev.i = getelementptr inbounds %struct.q, ptr %0, i64 0, i32 3 %3 = load ptr, ptr %prev.i, align 8, !tbaa !12 %prev1.i = getelementptr inbounds %struct.q, ptr %1, i64 0, i32 3 store ptr %3, ptr %prev1.i, align 8, !tbaa !12 store ptr %1, ptr %prev.i, align 8, !tbaa !12 %4 = load ptr, ptr %prev1.i, align 8, !tbaa !12 %next4.i = getelementptr inbounds %struct.q, ptr %4, i64 0, i32 2 store ptr %1, ptr %next4.i, align 8, !tbaa !9 store ptr %2, ptr %next, align 8, !tbaa !9 %prev = getelementptr inbounds %struct.q, ptr %2, i64 0, i32 3 store ptr %0, ptr %prev, align 8, !tbaa !12 br label %if.end if.end: ; preds = %if.then, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @printstate() local_unnamed_addr #7 { entry: %x.0 = load ptr, ptr @head, align 8, !tbaa !5 %t = getelementptr inbounds %struct.q, ptr %x.0, i64 0, i32 1 %0 = load i32, ptr %t, align 4, !tbaa !16 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %x.0, i32 noundef %0) %next = getelementptr inbounds %struct.q, ptr %x.0, i64 0, i32 2 %x.0.1 = load ptr, ptr %next, align 8, !tbaa !5 %t.1 = getelementptr inbounds %struct.q, ptr %x.0.1, i64 0, i32 1 %1 = load i32, ptr %t.1, align 4, !tbaa !16 %call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %x.0.1, i32 noundef %1) %next.1 = getelementptr inbounds %struct.q, ptr %x.0.1, i64 0, i32 2 %x.0.2 = load ptr, ptr %next.1, align 8, !tbaa !5 %t.2 = getelementptr inbounds %struct.q, ptr %x.0.2, i64 0, i32 1 %2 = load i32, ptr %t.2, align 4, !tbaa !16 %call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %x.0.2, i32 noundef %2) %next.2 = getelementptr inbounds %struct.q, ptr %x.0.2, i64 0, i32 2 %x.0.3 = load ptr, ptr %next.2, align 8, !tbaa !5 %t.3 = getelementptr inbounds %struct.q, ptr %x.0.3, i64 0, i32 1 %3 = load i32, ptr %t.3, align 4, !tbaa !16 %call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %x.0.3, i32 noundef %3) %next.3 = getelementptr inbounds %struct.q, ptr %x.0.3, i64 0, i32 2 %x.0.4 = load ptr, ptr %next.3, align 8, !tbaa !5 %t.4 = getelementptr inbounds %struct.q, ptr %x.0.4, i64 0, i32 1 %4 = load i32, ptr %t.4, align 4, !tbaa !16 %call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %x.0.4, i32 noundef %4) ret void } attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress 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 #6 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nounwind } attributes #9 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 16} !10 = !{!"q", !7, i64 0, !11, i64 12, !6, i64 16, !6, i64 24} !11 = !{!"int", !7, i64 0} !12 = !{!10, !6, i64 24} !13 = !{!11, !11, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"} !16 = !{!10, !11, i64 12} !17 = distinct !{!17, !15}
#include<stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }Ret; Ret Q_s[LEN]; int head, tail,z; void enqueue_s(Ret x){ Q_s[tail]=x; tail=(tail+1)%LEN; } Ret dequeue_s() { Ret x=Q_s[head]; head=(head+1)%LEN; return x; } int min(int c,int d){return c<d? c:d;} int main(){ int times=0,cal; int i,y; Ret rs; scanf("%d %d",&z,&y); for(i=1;i<=z;i++){ scanf("%s",Q_s[i].name); scanf("%d",&Q_s[i].t); } head=1; tail=z+1; while(head!=tail){ rs=dequeue_s(); cal=min(y,rs.t); rs.t-=cal; times+=cal; if(rs.t>0)enqueue_s(rs); else{ printf("%s %d\n",rs.name,times); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252897/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252897/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q_s = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @z = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue_s(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q_s, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue_s(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q_s, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %c, i32 noundef %d) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %c, i32 %d) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %y = alloca i32, align 4 %rs = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %rs) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @z, ptr noundef nonnull %y) %0 = load i32, ptr @z, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q_s, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q_s, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @z, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %rs, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %times.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q_s, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %rs, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %y, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %times.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q_s, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %rs, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %rs, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %rs) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue_s: %agg.result"} !15 = distinct !{!15, !"dequeue_s"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> int main() { int i,j,k,l,n,m; int sum=0,count=0; scanf("%d%d",&n,&k); int a[n]; for(i=0;i<n;i++) { scanf("%d",&a[i]); sum+=a[i]; } count=n; if(sum/n<k) { while((sum/count<k-1)||(((((float)(sum)/count-(sum)/count)))<0.5)&&(sum/count<k)) { sum+=k; count++; // printf("count=%d\n",count); // printf("=%d\n",sum); // printf("%f\n",(((float)sum/count-sum/count))); } } printf("%d",count-n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25294/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25294/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp36 = icmp sgt i32 %3, 0 br i1 %cmp36, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.037 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %4, %sum.037 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %.lcssa = phi i32 [ %3, %entry ], [ %5, %for.body ] %div = sdiv i32 %sum.0.lcssa, %.lcssa %7 = load i32, ptr %k, align 4, !tbaa !5 %cmp4 = icmp slt i32 %div, %7 br i1 %cmp4, label %while.cond.preheader, label %if.end while.cond.preheader: ; preds = %for.end %sub = add nsw i32 %7, -1 br label %while.cond while.cond: ; preds = %while.cond.preheader, %while.body %count.0 = phi i32 [ %inc19, %while.body ], [ %.lcssa, %while.cond.preheader ] %sum.1 = phi i32 [ %add18, %while.body ], [ %sum.0.lcssa, %while.cond.preheader ] %div5 = sdiv i32 %sum.1, %count.0 %cmp6 = icmp slt i32 %div5, %sub br i1 %cmp6, label %while.body, label %lor.rhs lor.rhs: ; preds = %while.cond %conv = sitofp i32 %sum.1 to float %conv7 = sitofp i32 %count.0 to float %div8 = fdiv float %conv, %conv7 %conv10 = sitofp i32 %div5 to float %sub11 = fsub float %div8, %conv10 %cmp13 = fcmp olt float %sub11, 5.000000e-01 %cmp16 = icmp slt i32 %div5, %7 %or.cond = and i1 %cmp16, %cmp13 br i1 %or.cond, label %while.body, label %if.end while.body: ; preds = %lor.rhs, %while.cond %add18 = add nsw i32 %sum.1, %7 %inc19 = add nsw i32 %count.0, 1 br label %while.cond, !llvm.loop !11 if.end: ; preds = %lor.rhs, %for.end %count.1 = phi i32 [ %.lcssa, %for.end ], [ %count.0, %lor.rhs ] %sub20 = sub nsw i32 %count.1, %.lcssa %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub20) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN]; int head, tail, n; void enqueue(P a){ Q[tail]=a; tail=(tail+1)%LEN; } P dequeue(){ P a = Q[head]; head = (head+1)%LEN; return a; } int min(int n,int m){return n < m ? n : m;} int main(){ int elaps = 0,cha; int i,j; P u; scanf("%d %d",&n,&j); for(i=1;i<=n;i++){ scanf("%s",Q[i].name); scanf("%d",&Q[i].t); } head=1;tail=n+1; while(head != tail){ u = dequeue(); cha = min(j,u.t); u.t -= cha; elaps += cha; if(u.t > 0)enqueue(u); else{ printf("%s %d\n",u.name,elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_252983/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_252983/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %a) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %a, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %n, i32 noundef %m) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %n, i32 %m) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %j = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %j) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %j, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include <stdio.h> #define N 100000 typedef struct q{ char name[10]; int time; }queue; queue Q[N]; int head,tail,n; void enqueue(queue x){ Q[tail] = x; tail = (tail+1)%N; } queue dequeue(){ queue x = Q[head]; head = (head+1)%N; return x; } int min(int a,int b){return a < b ? a : b;} int main(){ queue x; int q,i; int pass = 0,c; scanf("%d %d",&n,&q); for(i=1;i<=n;i++){ scanf("%s %d",Q[i].name,&Q[i].time); } head=1; tail=n+1; while(head!=tail){ x=dequeue(); c=min(q,x.time); x.time-=c; pass+=c; if(x.time>0)enqueue(x); else printf("%s %d\n",x.name,pass); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253025/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253025/source.c" target datalayout = "e-m:e-p270: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.q = type { [10 x i8], i32 } @Q = dso_local global [100000 x %struct.q] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @enqueue(i64 %x.coerce0, i64 %x.coerce1) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100000 x %struct.q], ptr @Q, i64 0, i64 %idxprom store i64 %x.coerce0, ptr %arrayidx, align 16, !tbaa.struct !9 %x.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 store i64 %x.coerce1, ptr %x.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !11 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100000 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local { i64, i64 } @dequeue() local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100000 x %struct.q], ptr @Q, i64 0, i64 %idxprom %retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 16, !tbaa.struct !9 %retval.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 %retval.sroa.2.0.copyload = load i64, ptr %retval.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !11 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100000 store i32 %rem, ptr @head, align 4, !tbaa !5 %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %retval.sroa.0.0.copyload, 0 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.copyload, 1 ret { i64, i64 } %.fca.1.insert } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %x = alloca %struct.q, align 8 %q = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %x) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not24 = icmp slt i32 %0, 1 br i1 %cmp.not24, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100000 x %struct.q], ptr @Q, i64 0, i64 %indvars.iv %time = getelementptr inbounds [100000 x %struct.q], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %time) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp4.not26 = icmp eq i32 %.lcssa, 0 br i1 %cmp4.not26, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %tmp.sroa.4.0.x.sroa_idx = getelementptr inbounds i8, ptr %x, i64 8 %time6 = getelementptr inbounds %struct.q, ptr %x, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %9, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %10, %if.end ] %pass.027 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100000 x %struct.q], ptr @Q, i64 0, i64 %idxprom.i %retval.sroa.0.0.copyload.i = load i64, ptr %arrayidx.i, align 16, !tbaa.struct !9 %retval.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 8 %retval.sroa.2.0.copyload.i = load i64, ptr %retval.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !11 %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100000 store i32 %rem.i, ptr @head, align 4, !tbaa !5 store i64 %retval.sroa.0.0.copyload.i, ptr %x, align 8, !tbaa.struct !9 store i64 %retval.sroa.2.0.copyload.i, ptr %tmp.sroa.4.0.x.sroa_idx, align 8, !tbaa.struct !11 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = lshr i64 %retval.sroa.2.0.copyload.i, 32 %7 = trunc i64 %6 to i32 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %7) %sub = sub nsw i32 %7, %cond.i store i32 %sub, ptr %time6, align 4, !tbaa !14 %add9 = add nsw i32 %cond.i, %pass.027 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %8 = load i64, ptr %tmp.sroa.4.0.x.sroa_idx, align 8 %idxprom.i20 = sext i32 %3 to i64 %arrayidx.i21 = getelementptr inbounds [100000 x %struct.q], ptr @Q, i64 0, i64 %idxprom.i20 store i64 %retval.sroa.0.0.copyload.i, ptr %arrayidx.i21, align 16, !tbaa.struct !9 %x.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i21, i64 8 store i64 %8, ptr %x.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !11 %add.i22 = add nsw i32 %3, 1 %rem.i23 = srem i32 %add.i22, 100000 store i32 %rem.i23, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %x, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre30 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %9 = phi i32 [ %.pre30, %if.else ], [ %rem.i23, %if.then ] %10 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp4.not = icmp eq i32 %10, %9 br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %x) #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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 10, !10, i64 12, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = !{i64 0, i64 2, !10, i64 4, i64 4, !5} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!15, !6, i64 12} !15 = !{!"q", !7, i64 0, !6, i64 12} !16 = distinct !{!16, !13}
#include<stdio.h> #include<string.h> typedef struct { char name[10]; int time; }task; int main(void){ int n,q; int time=0,k=0,end; scanf("%d %d",&n,&q); task a[1000000]; for(int i=0;i<n;i++){ scanf("%s %d",&a[i].name,&a[i].time); } end=n-1; for(int i=0;k<n;i++){ if(a[i].time>q){ a[i].time-=q; time+=q; a[++end]=a[i]; } else{ time+=a[i].time; printf("%s %d\n",a[i].name,time); k++; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253076/source.c" target datalayout = "e-m:e-p270: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.task = type { [10 x i8], i32 } @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %q = alloca i32, align 4 %a = alloca [1000000 x %struct.task], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) call void @llvm.lifetime.start.p0(i64 16000000, ptr nonnull %a) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp48 = icmp sgt i32 %0, 0 br i1 %cmp48, label %for.body, label %for.cond.cleanup8 for.cond.cleanup: ; preds = %for.body %cmp750 = icmp sgt i32 %1, 0 br i1 %cmp750, label %for.body9.preheader, label %for.cond.cleanup8 for.body9.preheader: ; preds = %for.cond.cleanup %sub = add nsw i32 %1, -1 br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000000 x %struct.task], ptr %a, i64 0, i64 %indvars.iv %time3 = getelementptr inbounds [1000000 x %struct.task], ptr %a, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %time3) %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.cond.cleanup, !llvm.loop !9 for.cond.cleanup8: ; preds = %for.inc32, %entry, %for.cond.cleanup call void @llvm.lifetime.end.p0(i64 16000000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body9: ; preds = %for.body9.preheader, %for.inc32 %3 = phi i32 [ %1, %for.body9.preheader ], [ %6, %for.inc32 ] %indvars.iv57 = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next58, %for.inc32 ] %end.053 = phi i32 [ %sub, %for.body9.preheader ], [ %end.1, %for.inc32 ] %k.052 = phi i32 [ 0, %for.body9.preheader ], [ %k.1, %for.inc32 ] %time.051 = phi i32 [ 0, %for.body9.preheader ], [ %time.1, %for.inc32 ] %arrayidx11 = getelementptr inbounds [1000000 x %struct.task], ptr %a, i64 0, i64 %indvars.iv57 %time12 = getelementptr inbounds [1000000 x %struct.task], ptr %a, i64 0, i64 %indvars.iv57, i32 1 %4 = load i32, ptr %time12, align 4, !tbaa !11 %5 = load i32, ptr %q, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %4, %5 br i1 %cmp13, label %if.then, label %if.else if.then: ; preds = %for.body9 %sub17 = sub nsw i32 %4, %5 store i32 %sub17, ptr %time12, align 4, !tbaa !11 %add = add nsw i32 %5, %time.051 %inc18 = add nsw i32 %end.053, 1 %idxprom19 = sext i32 %inc18 to i64 %arrayidx20 = getelementptr inbounds [1000000 x %struct.task], ptr %a, i64 0, i64 %idxprom19 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx20, ptr noundef nonnull align 16 dereferenceable(16) %arrayidx11, i64 16, i1 false), !tbaa.struct !13 br label %for.inc32 if.else: ; preds = %for.body9 %add26 = add nsw i32 %4, %time.051 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %arrayidx11, i32 noundef %add26) %inc31 = add nsw i32 %k.052, 1 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc32 for.inc32: ; preds = %if.then, %if.else %6 = phi i32 [ %3, %if.then ], [ %.pre, %if.else ] %time.1 = phi i32 [ %add, %if.then ], [ %add26, %if.else ] %k.1 = phi i32 [ %k.052, %if.then ], [ %inc31, %if.else ] %end.1 = phi i32 [ %inc18, %if.then ], [ %end.053, %if.else ] %indvars.iv.next58 = add nuw i64 %indvars.iv57, 1 %cmp7 = icmp slt i32 %k.1, %6 br i1 %cmp7, label %for.body9, label %for.cond.cleanup8, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !6, i64 12} !12 = !{!"", !7, i64 0, !6, i64 12} !13 = !{i64 0, i64 10, !14, i64 12, i64 4, !5} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !10}
#include <stdio.h> #include <stdlib.h> #define N_MAX 100000 #define NAME_LEN 10 struct q { char name[NAME_LEN+1]; int time; struct q *next; }; int main(void) { int i, n, qtm; struct q *head = NULL; struct q *tail = NULL; int time = 0; scanf("%d", &n); scanf("%d", &qtm); for (i = 0; i < n; i++) { struct q *a = (struct q *)malloc(sizeof(struct q)); if (a == NULL) return 1; scanf("%s", a->name); scanf("%d", &a->time); a->next = NULL; if (head == NULL) head = a; if (tail == NULL) { tail = a; } else { tail->next = a; tail = a; } } while (n) { if (head->time <= qtm) { struct q *a = head; time += a->time; printf("%s %d\n", a->name, time); head = a->next; free(a); n--; continue; } head->time -= qtm; time += qtm; tail->next = head; tail = head; head = head->next; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253119/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253119/source.c" target datalayout = "e-m:e-p270: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.q = type { [11 x i8], i32, ptr } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %qtm = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %qtm) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %qtm) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp71 = icmp sgt i32 %0, 0 br i1 %cmp71, label %for.body, label %while.cond.preheader while.cond.preheader: ; preds = %for.inc, %entry %head.0.lcssa = phi ptr [ null, %entry ], [ %spec.select, %for.inc ] %tail.0.lcssa = phi ptr [ null, %entry ], [ %call2, %for.inc ] %.lcssa67 = phi i32 [ %0, %entry ], [ %1, %for.inc ] %tobool.not7780 = icmp eq i32 %.lcssa67, 0 br i1 %tobool.not7780, label %cleanup29, label %while.body.lr.ph for.body: ; preds = %entry, %for.inc %i.074 = phi i32 [ %inc, %for.inc ], [ 0, %entry ] %tail.073 = phi ptr [ %call2, %for.inc ], [ null, %entry ] %head.072 = phi ptr [ %spec.select, %for.inc ], [ null, %entry ] %call2 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6 %cmp3.not = icmp eq ptr %call2, null br i1 %cmp3.not, label %cleanup29, label %if.end if.end: ; preds = %for.body %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %call2) %time5 = getelementptr inbounds %struct.q, ptr %call2, i64 0, i32 1 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %time5) %next = getelementptr inbounds %struct.q, ptr %call2, i64 0, i32 2 store ptr null, ptr %next, align 8, !tbaa !9 %cmp7 = icmp eq ptr %head.072, null %spec.select = select i1 %cmp7, ptr %call2, ptr %head.072 %cmp10 = icmp eq ptr %tail.073, null br i1 %cmp10, label %for.inc, label %if.else if.else: ; preds = %if.end %next12 = getelementptr inbounds %struct.q, ptr %tail.073, i64 0, i32 2 store ptr %call2, ptr %next12, align 8, !tbaa !9 br label %for.inc for.inc: ; preds = %if.else, %if.end %inc = add nuw nsw i32 %i.074, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %1 br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !12 while.body: ; preds = %while.body.lr.ph, %if.then16 %time.079 = phi i32 [ %time.0.ph83, %while.body.lr.ph ], [ %add, %if.then16 ] %head.378 = phi ptr [ %head.3.ph81, %while.body.lr.ph ], [ %4, %if.then16 ] %time14 = getelementptr inbounds %struct.q, ptr %head.378, i64 0, i32 1 %2 = load i32, ptr %time14, align 4, !tbaa !14 %3 = load i32, ptr %qtm, align 4, !tbaa !5 %cmp15.not = icmp sgt i32 %2, %3 br i1 %cmp15.not, label %if.end24, label %if.then16 if.then16: ; preds = %while.body %add = add nsw i32 %2, %time.079 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %head.378, i32 noundef %add) %next22 = getelementptr inbounds %struct.q, ptr %head.378, i64 0, i32 2 %4 = load ptr, ptr %next22, align 8, !tbaa !9 call void @free(ptr noundef nonnull %head.378) #5 %5 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %5, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %dec, 0 br i1 %tobool.not, label %cleanup29, label %while.body if.end24: ; preds = %while.body %time14.le = getelementptr inbounds %struct.q, ptr %head.378, i64 0, i32 1 %sub = sub nsw i32 %2, %3 store i32 %sub, ptr %time14.le, align 4, !tbaa !14 %add26 = add nsw i32 %3, %time.079 %next27 = getelementptr inbounds %struct.q, ptr %tail.3.ph82, i64 0, i32 2 store ptr %head.378, ptr %next27, align 8, !tbaa !9 %next28 = getelementptr inbounds %struct.q, ptr %head.378, i64 0, i32 2 %6 = load ptr, ptr %next28, align 8, !tbaa !9 br label %while.body.lr.ph, !llvm.loop !15 while.body.lr.ph: ; preds = %while.cond.preheader, %if.end24 %time.0.ph83 = phi i32 [ %add26, %if.end24 ], [ 0, %while.cond.preheader ] %tail.3.ph82 = phi ptr [ %head.378, %if.end24 ], [ %tail.0.lcssa, %while.cond.preheader ] %head.3.ph81 = phi ptr [ %6, %if.end24 ], [ %head.0.lcssa, %while.cond.preheader ] br label %while.body cleanup29: ; preds = %for.body, %if.then16, %while.cond.preheader %retval.2 = phi i32 [ 0, %while.cond.preheader ], [ 0, %if.then16 ], [ 1, %for.body ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %qtm) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 %retval.2 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !11, i64 16} !10 = !{!"q", !7, i64 0, !6, i64 12, !11, i64 16} !11 = !{!"any pointer", !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!10, !6, i64 12} !15 = distinct !{!15, !13}
#include<stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN]; int head, tail, n; void enqueue(P x){ Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue(){ P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a,int b){return a < b ? a : b;} int main(){ int elaps =0, c; int i, q; P u; char str[64]; scanf("%d %d", &n, &q); for(i=1;i<=n;i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } head =1; tail =n+1; while(head != tail){ u = dequeue(); c = min(q, u.t); u.t -= c; elaps += c; if(u.t>0) enqueue(u); else{ printf("%s %d\n",u.name, elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253162/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253162/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include <stdio.h> #include<string.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; } P; P Q[LEN]; int head, tail, n; void enqueue(P x){ Q[tail] = x; tail = (tail + 1) % LEN; } P dequeue(){ P x = Q[head]; head = (head + 1) % LEN; return x; } int min(int a, int b) { return a < b ? a : b; } int main(void){ // Your code here! int elaps = 0, c; int i, q; P u; scanf("%d %d", &n, &q); for (i = 1; i<=n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } head = 1; tail = n + 1; while ( head != tail ){ u = dequeue(); c = min(q, u.t); u.t -= c; elaps += c; if ( u.t > 0) enqueue(u); else{ printf("%s %d\n", u.name, elaps); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253205/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253205/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @Q = dso_local global [100005 x %struct.pp] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not25 = icmp slt i32 %0, 1 br i1 %cmp.not25, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not27 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not27, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end ] %elaps.028 = phi i32 [ 0, %while.body.lr.ph ], [ %add9, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !13 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !16 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %cond.i store i32 %sub, ptr %t6, align 4, !tbaa !16 %add9 = add nsw i32 %cond.i, %elaps.028 %cmp11 = icmp sgt i32 %sub, 0 br i1 %cmp11, label %if.then, label %if.else if.then: ; preds = %while.body %idxprom.i21 = sext i32 %3 to i64 %arrayidx.i22 = getelementptr inbounds [100005 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i21 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i22, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i23 = add nsw i32 %3, 1 %rem.i24 = srem i32 %add.i23, 100005 store i32 %rem.i24, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add9) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre31 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %7 = phi i32 [ %.pre31, %if.else ], [ %rem.i24, %if.then ] %8 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !18 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14} !14 = distinct !{!14, !15, !"dequeue: %agg.result"} !15 = distinct !{!15, !"dequeue"} !16 = !{!17, !6, i64 100} !17 = !{!"pp", !7, i64 0, !6, i64 100} !18 = distinct !{!18, !12}
#include<stdio.h> int main(){ int i, n, q, total=0, remain, first = 0, tail = 0, time[100000], dis[100000]; char name[100000][10]; scanf("%d %d", &n, &q); if(n > 0 && n <= 100000 && q >= 1 && q <= 1000){ for(i = 0; i < n; i++){ scanf("%s %d", name[i], &time[i]); dis[i] = 1; } remain = n; tail = n - 1; while(remain != 0){ time[first] = time[first] - q; if(time[first] < 0){ total += (q + time[first]); time[first] = 0; }else{ total += q; } if(time[first] == 0){ printf("%s %d\n", name[first], total); remain--; dis[tail] += dis[first]; dis[first] = 0; first = tail; first += dis[tail]; if(first >= n){ first = first - n; } }else{ tail = first; first += dis[first]; if(first >= n) first = first - n; } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253249/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253249/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %q = alloca i32, align 4 %time = alloca [100000 x i32], align 16 %dis = alloca [100000 x i32], align 16 %name = alloca [100000 x [10 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %time) #3 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %dis) #3 call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %name) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4 %1 = add i32 %0, -1 %or.cond = icmp ult i32 %1, 100000 %2 = load i32, ptr %q, align 4 %cmp3 = icmp sgt i32 %2, 0 %or.cond60 = select i1 %or.cond, i1 %cmp3, i1 false %cmp5 = icmp slt i32 %2, 1001 %or.cond61 = select i1 %or.cond60, i1 %cmp5, i1 false br i1 %or.cond61, label %for.body, label %if.end59 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100000 x [10 x i8]], ptr %name, i64 0, i64 %indvars.iv %arrayidx8 = getelementptr inbounds [100000 x i32], ptr %time, i64 0, i64 %indvars.iv %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx8) %arrayidx11 = getelementptr inbounds [100000 x i32], ptr %dis, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx11, align 4, !tbaa !5 %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 %cmp6 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp6, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp12.not97 = icmp eq i32 %3, 0 br i1 %cmp12.not97, label %if.end59, label %while.body.preheader while.body.preheader: ; preds = %for.end %.pre = add nsw i32 %3, -1 br label %while.body while.body: ; preds = %while.body.preheader, %if.end58 %5 = phi i32 [ %13, %if.end58 ], [ %3, %while.body.preheader ] %tail.0101 = phi i32 [ %tail.1, %if.end58 ], [ %.pre, %while.body.preheader ] %first.0100 = phi i32 [ %first.1, %if.end58 ], [ 0, %while.body.preheader ] %remain.099 = phi i32 [ %remain.1, %if.end58 ], [ %3, %while.body.preheader ] %total.098 = phi i32 [ %total.193, %if.end58 ], [ 0, %while.body.preheader ] %idxprom13 = sext i32 %first.0100 to i64 %arrayidx14 = getelementptr inbounds [100000 x i32], ptr %time, i64 0, i64 %idxprom13 %6 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %7 = load i32, ptr %q, align 4, !tbaa !5 %sub15 = sub nsw i32 %6, %7 store i32 %sub15, ptr %arrayidx14, align 4, !tbaa !5 %cmp20 = icmp slt i32 %sub15, 0 br i1 %cmp20, label %if.end.thread, label %if.end if.end.thread: ; preds = %while.body store i32 0, ptr %arrayidx14, align 4, !tbaa !5 %total.191 = add nsw i32 %6, %total.098 br label %if.then31 if.end: ; preds = %while.body %total.1 = add nsw i32 %7, %total.098 %cmp30 = icmp eq i32 %6, %7 br i1 %cmp30, label %if.then31, label %if.else50 if.then31: ; preds = %if.end.thread, %if.end %total.194 = phi i32 [ %total.191, %if.end.thread ], [ %total.1, %if.end ] %arrayidx33 = getelementptr inbounds [100000 x [10 x i8]], ptr %name, i64 0, i64 %idxprom13 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %arrayidx33, i32 noundef %total.194) %dec = add nsw i32 %remain.099, -1 %arrayidx37 = getelementptr inbounds [100000 x i32], ptr %dis, i64 0, i64 %idxprom13 %8 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %idxprom38 = sext i32 %tail.0101 to i64 %arrayidx39 = getelementptr inbounds [100000 x i32], ptr %dis, i64 0, i64 %idxprom38 %9 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %add40 = add nsw i32 %9, %8 store i32 %add40, ptr %arrayidx39, align 4, !tbaa !5 store i32 0, ptr %arrayidx37, align 4, !tbaa !5 %10 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %add45 = add nsw i32 %10, %tail.0101 %11 = load i32, ptr %n, align 4, !tbaa !5 %cmp46.not = icmp slt i32 %add45, %11 %sub48 = select i1 %cmp46.not, i32 0, i32 %11 %spec.select = sub nsw i32 %add45, %sub48 br label %if.end58 if.else50: ; preds = %if.end %arrayidx52 = getelementptr inbounds [100000 x i32], ptr %dis, i64 0, i64 %idxprom13 %12 = load i32, ptr %arrayidx52, align 4, !tbaa !5 %add53 = add nsw i32 %12, %first.0100 %cmp54.not = icmp slt i32 %add53, %5 %sub56 = select i1 %cmp54.not, i32 0, i32 %5 %spec.select89 = sub nsw i32 %add53, %sub56 br label %if.end58 if.end58: ; preds = %if.else50, %if.then31 %13 = phi i32 [ %11, %if.then31 ], [ %5, %if.else50 ] %total.193 = phi i32 [ %total.194, %if.then31 ], [ %total.1, %if.else50 ] %remain.1 = phi i32 [ %dec, %if.then31 ], [ %remain.099, %if.else50 ] %first.1 = phi i32 [ %spec.select, %if.then31 ], [ %spec.select89, %if.else50 ] %tail.1 = phi i32 [ %tail.0101, %if.then31 ], [ %first.0100, %if.else50 ] %cmp12.not = icmp eq i32 %remain.1, 0 br i1 %cmp12.not, label %if.end59, label %while.body, !llvm.loop !11 if.end59: ; preds = %if.end58, %for.end, %entry call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %name) #3 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %dis) #3 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %time) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN+1]; int head, tail, n; void enqueue(P); P dequeue(void); int main(){ int elaps = 0, c; int i, q; P u; scanf("%d %d", &n, &q); for ( i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); } head=1,tail=n+1; while(head!=tail){ u=dequeue(); if(q>u.t){ c=u.t; }else{ c=q; } u.t-=c; elaps+=c; if(u.t>0){ enqueue(u); }else{ printf("%s %d\n",u.name,elaps); } } return 0; } void enqueue(P x){ Q[tail]=x; /*tail++;*/ tail=(tail+1)%LEN; } P dequeue(){ P x=Q[head]; /*head++;*/ head=(head+1)%LEN; return x; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253292/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253292/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @Q = dso_local global [100006 x %struct.pp] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @head = dso_local local_unnamed_addr global i32 0, align 4 @tail = dso_local local_unnamed_addr global i32 0, align 4 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not30 = icmp slt i32 %0, 1 br i1 %cmp.not30, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 1, ptr @head, align 4, !tbaa !5 %add = add nsw i32 %.lcssa, 1 store i32 %add, ptr @tail, align 4, !tbaa !5 %cmp5.not32 = icmp eq i32 %.lcssa, 0 br i1 %cmp5.not32, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %t6 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end18 %3 = phi i32 [ %add, %while.body.lr.ph ], [ %7, %if.end18 ] %4 = phi i32 [ 1, %while.body.lr.ph ], [ %8, %if.end18 ] %elaps.033 = phi i32 [ 0, %while.body.lr.ph ], [ %add10, %if.end18 ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, i64 104, i1 false) %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 100005 store i32 %rem.i, ptr @head, align 4, !tbaa !5, !noalias !11 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = load i32, ptr %t6, align 4, !tbaa !14 %. = call i32 @llvm.smin.i32(i32 %5, i32 %6) %sub = sub nsw i32 %6, %. store i32 %sub, ptr %t6, align 4, !tbaa !14 %add10 = add nsw i32 %., %elaps.033 %cmp12 = icmp sgt i32 %sub, 0 br i1 %cmp12, label %if.then13, label %if.else14 if.then13: ; preds = %while.body %idxprom.i26 = sext i32 %3 to i64 %arrayidx.i27 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i26 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i27, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i28 = add nsw i32 %3, 1 %rem.i29 = srem i32 %add.i28, 100005 store i32 %rem.i29, ptr @tail, align 4, !tbaa !5 br label %if.end18 if.else14: ; preds = %while.body %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add10) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre36 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end18 if.end18: ; preds = %if.else14, %if.then13 %7 = phi i32 [ %.pre36, %if.else14 ], [ %rem.i29, %if.then13 ] %8 = phi i32 [ %.pre, %if.else14 ], [ %rem.i, %if.then13 ] %cmp5.not = icmp eq i32 %8, %7 br i1 %cmp5.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %if.end18, %for.end call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #3 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !17 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #3 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !17 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 100005 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12} !12 = distinct !{!12, !13, !"dequeue: %agg.result"} !13 = distinct !{!13, !"dequeue"} !14 = !{!15, !6, i64 100} !15 = !{!"pp", !7, i64 0, !6, i64 100} !16 = distinct !{!16, !10} !17 = !{i64 0, i64 100, !18, i64 100, i64 4, !5} !18 = !{!7, !7, i64 0}
#include<stdio.h> #include<stdlib.h> #define LEN 100005 typedef struct pp{ char name[100]; int t; }P; P Q[LEN+1]; int head=0, tail=0, n; void enqueue(P x){ Q[tail]=x; if(tail+1==n){ tail=0; } else{ tail++; } } P dequeue(){ P x; x=Q[head]; if(head+1==n){ head=0; } else{ head++; } return x; } int main(){ int elaps = 0, c; int i, q,m; P u; scanf("%d %d", &n, &q); for ( i = 1; i <= n; i++){ scanf("%s", Q[i].name); scanf("%d", &Q[i].t); enqueue(Q[i]); } m=n; while(1){ u=dequeue(); if(u.t<=0); else if(u.t<=q){ elaps+=u.t; printf("%s %d\n",u.name,elaps); m--; if(m==0) break; } else{ u.t-=q; elaps+=q; enqueue(u); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253335/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253335/source.c" target datalayout = "e-m:e-p270: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.pp = type { [100 x i8], i32 } @head = dso_local local_unnamed_addr global i32 0, align 4 @tail = dso_local local_unnamed_addr global i32 0, align 4 @Q = dso_local global [100006 x %struct.pp] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @enqueue(ptr nocapture noundef readonly byval(%struct.pp) align 8 %x) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, ptr noundef nonnull align 8 dereferenceable(104) %x, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp eq i32 %add, %1 %.add = select i1 %cmp, i32 0, i32 %add store i32 %.add, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @dequeue(ptr noalias nocapture writeonly sret(%struct.pp) align 4 %agg.result) local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %agg.result, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false), !tbaa.struct !9 %add = add nsw i32 %0, 1 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp eq i32 %add, %1 %.add = select i1 %cmp, i32 0, i32 %add store i32 %.add, ptr @head, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %q = alloca i32, align 4 %u = alloca %struct.pp, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %u) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %q) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp.not44 = icmp slt i32 %0, 1 br i1 %cmp.not44, label %while.cond.preheader, label %for.body while.cond.preheader: ; preds = %for.body, %entry %.pre50 = phi i32 [ %0, %entry ], [ %2, %for.body ] %t7 = getelementptr inbounds %struct.pp, ptr %u, i64 0, i32 1 br label %while.cond.outer for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %t = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %indvars.iv, i32 1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t) %1 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom.i = sext i32 %1 to i64 %arrayidx.i = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx, i64 104, i1 false) %add.i = add nsw i32 %1, 1 %2 = load i32, ptr @n, align 4, !tbaa !5 %cmp.i = icmp eq i32 %add.i, %2 %.add.i = select i1 %cmp.i, i32 0, i32 %add.i store i32 %.add.i, ptr @tail, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = sext i32 %2 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !11 while.cond: ; preds = %while.cond.outer52, %while.cond %4 = phi i32 [ %.add.i37, %while.cond ], [ %.ph53, %while.cond.outer52 ] %idxprom.i33 = sext i32 %4 to i64 %arrayidx.i34 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %u, ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i34, i64 104, i1 false) %add.i35 = add nsw i32 %4, 1 %cmp.i36 = icmp eq i32 %add.i35, %.ph %.add.i37 = select i1 %cmp.i36, i32 0, i32 %add.i35 %5 = load i32, ptr %t7, align 4, !tbaa !13 %cmp8 = icmp slt i32 %5, 1 br i1 %cmp8, label %while.cond, label %if.else if.else: ; preds = %while.cond %cmp10.not = icmp sgt i32 %5, %6 br i1 %cmp10.not, label %if.else18, label %if.then11 if.then11: ; preds = %if.else store i32 %.add.i37, ptr @head, align 4, !tbaa !5, !noalias !15 %add = add nsw i32 %5, %elaps.0.ph54 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %u, i32 noundef %add) %dec = add nsw i32 %m.0.ph, -1 %cmp16 = icmp eq i32 %dec, 0 %.pre49 = load i32, ptr @n, align 4, !tbaa !5 br i1 %cmp16, label %while.end, label %while.cond.outer while.cond.outer: ; preds = %if.then11, %while.cond.preheader %.ph = phi i32 [ %.pre49, %if.then11 ], [ %.pre50, %while.cond.preheader ] %elaps.0.ph = phi i32 [ %add, %if.then11 ], [ 0, %while.cond.preheader ] %m.0.ph = phi i32 [ %dec, %if.then11 ], [ %.pre50, %while.cond.preheader ] %.ph51 = load i32, ptr @head, align 4, !tbaa !5, !noalias !15 %6 = load i32, ptr %q, align 4, !tbaa !5 %tail.promoted = load i32, ptr @tail, align 4, !tbaa !5 br label %while.cond.outer52 while.cond.outer52: ; preds = %while.cond.outer, %if.else18 %.add.i4359 = phi i32 [ %tail.promoted, %while.cond.outer ], [ %.add.i43, %if.else18 ] %.ph53 = phi i32 [ %.ph51, %while.cond.outer ], [ %.add.i37, %if.else18 ] %elaps.0.ph54 = phi i32 [ %elaps.0.ph, %while.cond.outer ], [ %add20, %if.else18 ] br label %while.cond if.else18: ; preds = %if.else %sub = sub nsw i32 %5, %6 store i32 %sub, ptr %t7, align 4, !tbaa !13 %add20 = add nsw i32 %6, %elaps.0.ph54 %idxprom.i39 = sext i32 %.add.i4359 to i64 %arrayidx.i40 = getelementptr inbounds [100006 x %struct.pp], ptr @Q, i64 0, i64 %idxprom.i39 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %arrayidx.i40, ptr noundef nonnull align 8 dereferenceable(104) %u, i64 104, i1 false) %add.i41 = add nsw i32 %.add.i4359, 1 %cmp.i42 = icmp eq i32 %add.i41, %.ph %.add.i43 = select i1 %cmp.i42, i32 0, i32 %add.i41 store i32 %.add.i43, ptr @tail, align 4, !tbaa !5 br label %while.cond.outer52 while.end: ; preds = %if.then11 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %u) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 100, !10, i64 100, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = !{!14, !6, i64 100} !14 = !{!"pp", !7, i64 0, !6, i64 100} !15 = !{!16} !16 = distinct !{!16, !17, !"dequeue: %agg.result"} !17 = distinct !{!17, !"dequeue"}
#include <stdio.h> #define len 1000001 typedef struct process { char name[11]; int time; } P; P origin[len]; int head, tail; void push(P x) { origin[tail] = x; tail = (tail + 1) % len; } P pop() { P x = origin[head]; head = (head + 1) % len; return x; } int ismin(int a, int b) { return a < b ? a : b; } int main() { int sum = 0, ptime; int n, q; int i; P quene; scanf("%d %d", &n, &q); for (i = 0; i < n; i++) { scanf("%s %d", origin[i].name, &origin[i].time); } head = 0; tail = n; while (head != tail) { quene = pop(); ptime = ismin(q, quene.time); quene.time -= ptime; sum += ptime; if (quene.time > 0) { push(quene); } else { printf("%s %d\n", quene.name, sum); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253379/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253379/source.c" target datalayout = "e-m:e-p270: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.process = type { [11 x i8], i32 } @origin = dso_local global [1000001 x %struct.process] zeroinitializer, align 16 @tail = dso_local local_unnamed_addr global i32 0, align 4 @head = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%s %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @push(i64 %x.coerce0, i64 %x.coerce1) local_unnamed_addr #0 { entry: %0 = load i32, ptr @tail, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [1000001 x %struct.process], ptr @origin, i64 0, i64 %idxprom store i64 %x.coerce0, ptr %arrayidx, align 16, !tbaa.struct !9 %x.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 store i64 %x.coerce1, ptr %x.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !11 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 1000001 store i32 %rem, ptr @tail, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local { i64, i64 } @pop() local_unnamed_addr #0 { entry: %0 = load i32, ptr @head, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [1000001 x %struct.process], ptr @origin, i64 0, i64 %idxprom %retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 16, !tbaa.struct !9 %retval.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 %retval.sroa.2.0.copyload = load i64, ptr %retval.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !11 %add = add nsw i32 %0, 1 %rem = srem i32 %add, 1000001 store i32 %rem, ptr @head, align 4, !tbaa !5 %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %retval.sroa.0.0.copyload, 0 %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.2.0.copyload, 1 ret { i64, i64 } %.fca.1.insert } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ismin(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %cond } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %q = alloca i32, align 4 %quene = alloca %struct.process, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %quene) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp23 = icmp sgt i32 %0, 0 br i1 %cmp23, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000001 x %struct.process], ptr @origin, i64 0, i64 %indvars.iv %time = getelementptr inbounds [1000001 x %struct.process], ptr @origin, i64 0, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %time) %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, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] store i32 0, ptr @head, align 4, !tbaa !5 store i32 %.lcssa, ptr @tail, align 4, !tbaa !5 %cmp4.not25 = icmp eq i32 %.lcssa, 0 br i1 %cmp4.not25, label %while.end, label %while.body.lr.ph while.body.lr.ph: ; preds = %for.end %tmp.sroa.4.0.quene.sroa_idx = getelementptr inbounds i8, ptr %quene, i64 8 %time6 = getelementptr inbounds %struct.process, ptr %quene, i64 0, i32 1 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %3 = phi i32 [ %.lcssa, %while.body.lr.ph ], [ %9, %if.end ] %4 = phi i32 [ 0, %while.body.lr.ph ], [ %10, %if.end ] %sum.026 = phi i32 [ 0, %while.body.lr.ph ], [ %add, %if.end ] %idxprom.i = sext i32 %4 to i64 %arrayidx.i = getelementptr inbounds [1000001 x %struct.process], ptr @origin, i64 0, i64 %idxprom.i %retval.sroa.0.0.copyload.i = load i64, ptr %arrayidx.i, align 16, !tbaa.struct !9 %retval.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 8 %retval.sroa.2.0.copyload.i = load i64, ptr %retval.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !11 %add.i = add nsw i32 %4, 1 %rem.i = srem i32 %add.i, 1000001 store i32 %rem.i, ptr @head, align 4, !tbaa !5 store i64 %retval.sroa.0.0.copyload.i, ptr %quene, align 8, !tbaa.struct !9 store i64 %retval.sroa.2.0.copyload.i, ptr %tmp.sroa.4.0.quene.sroa_idx, align 8, !tbaa.struct !11 %5 = load i32, ptr %q, align 4, !tbaa !5 %6 = lshr i64 %retval.sroa.2.0.copyload.i, 32 %7 = trunc i64 %6 to i32 %cond.i = call i32 @llvm.smin.i32(i32 %5, i32 %7) %sub = sub nsw i32 %7, %cond.i store i32 %sub, ptr %time6, align 4, !tbaa !14 %add = add nsw i32 %cond.i, %sum.026 %cmp10 = icmp sgt i32 %sub, 0 br i1 %cmp10, label %if.then, label %if.else if.then: ; preds = %while.body %8 = load i64, ptr %tmp.sroa.4.0.quene.sroa_idx, align 8 %idxprom.i19 = sext i32 %3 to i64 %arrayidx.i20 = getelementptr inbounds [1000001 x %struct.process], ptr @origin, i64 0, i64 %idxprom.i19 store i64 %retval.sroa.0.0.copyload.i, ptr %arrayidx.i20, align 16, !tbaa.struct !9 %x.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i20, i64 8 store i64 %8, ptr %x.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !11 %add.i21 = add nsw i32 %3, 1 %rem.i22 = srem i32 %add.i21, 1000001 store i32 %rem.i22, ptr @tail, align 4, !tbaa !5 br label %if.end if.else: ; preds = %while.body %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %quene, i32 noundef %add) %.pre = load i32, ptr @head, align 4, !tbaa !5 %.pre29 = load i32, ptr @tail, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %9 = phi i32 [ %.pre29, %if.else ], [ %rem.i22, %if.then ] %10 = phi i32 [ %.pre, %if.else ], [ %rem.i, %if.then ] %cmp4.not = icmp eq i32 %10, %9 br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !16 while.end: ; preds = %if.end, %for.end call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %quene) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i64 0, i64 11, !10, i64 12, i64 4, !5} !10 = !{!7, !7, i64 0} !11 = !{i64 0, i64 3, !10, i64 4, i64 4, !5} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = !{!15, !6, i64 12} !15 = !{!"process", !7, i64 0, !6, i64 12} !16 = distinct !{!16, !13}
#include<stdio.h> int main(void){ int n,m; char s[55][55]; int i,j,k,c; int row,ans=2500,count; scanf("%d%d",&n,&m); for(i=0;i<n;i++) scanf("%s",s[i]); for(i=1;i<=n-2;i++){ for(j=1;i+j<=n-1;j++){ row=0;count=0; for(k=0;k<i;k++){ for(c=0;c<m;c++){ if(s[row][c]!='W') count++; } row++; } for(k=0;k<j;k++){ for(c=0;c<m;c++){ if(s[row][c]!='B') count++; } row++; } for(k=0;k<n-i-j;k++){ for(c=0;c<m;c++){ if(s[row][c]!='R') count++; } row++; } if(count<ans) ans=count; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253421/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253421/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %s = alloca [55 x [55 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 3025, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp128 = icmp sgt i32 %0, 0 br i1 %cmp128, label %for.body, label %for.end90 for.cond2.preheader: ; preds = %for.body %cmp3.not164 = icmp slt i32 %4, 3 br i1 %cmp3.not164, label %for.end90, label %for.cond5.preheader.lr.ph for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %1 = load i32, ptr %m, align 4 %cmp13130 = icmp slt i32 %1, 1 %2 = add nsw i32 %4, -1 %3 = zext i32 %4 to i64 %wide.trip.count212 = zext i32 %2 to i64 %wide.trip.count = zext i32 %1 to i64 %wide.trip.count188 = zext i32 %1 to i64 %wide.trip.count200 = zext i32 %1 to i64 %min.iters.check250 = icmp ult i32 %1, 8 %n.vec253 = and i64 %wide.trip.count, 4294967288 %cmp.n255 = icmp eq i64 %n.vec253, %wide.trip.count %min.iters.check233 = icmp ult i32 %1, 8 %n.vec236 = and i64 %wide.trip.count, 4294967288 %cmp.n238 = icmp eq i64 %n.vec236, %wide.trip.count %min.iters.check = icmp ult i32 %1, 8 %n.vec = and i64 %wide.trip.count, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.inc88 %indvars.iv206 = phi i32 [ %2, %for.cond5.preheader.lr.ph ], [ %indvars.iv.next207, %for.inc88 ] %indvars.iv178 = phi i64 [ 1, %for.cond5.preheader.lr.ph ], [ %indvars.iv.next179, %for.inc88 ] %ans.0166 = phi i32 [ 2500, %for.cond5.preheader.lr.ph ], [ %ans.1.lcssa, %for.inc88 ] %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1 %cmp7.not.not159 = icmp ult i64 %indvars.iv.next179, %3 br i1 %cmp7.not.not159, label %for.cond9.preheader.preheader, label %for.inc88 for.cond9.preheader.preheader: ; preds = %for.cond5.preheader %wide.trip.count208 = zext i32 %indvars.iv206 to i64 %6 = trunc i64 %indvars.iv.next179 to i32 %7 = trunc i64 %indvars.iv178 to i32 %8 = and i64 %indvars.iv178, 4294967295 br label %for.cond9.preheader for.cond9.preheader: ; preds = %for.cond9.preheader.preheader, %for.end80 %indvars.iv192 = phi i64 [ 1, %for.cond9.preheader.preheader ], [ %indvars.iv.next193, %for.end80 ] %add162 = phi i32 [ %6, %for.cond9.preheader.preheader ], [ %add, %for.end80 ] %ans.1161 = phi i32 [ %ans.0166, %for.cond9.preheader.preheader ], [ %spec.select127, %for.end80 ] br i1 %cmp13130, label %for.end80, label %for.cond12.preheader.us for.cond12.preheader.us: ; preds = %for.cond9.preheader, %for.cond12.for.end24_crit_edge.us %indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.cond12.for.end24_crit_edge.us ], [ 0, %for.cond9.preheader ] %count.0136.us = phi i32 [ %spec.select.us.lcssa, %for.cond12.for.end24_crit_edge.us ], [ 0, %for.cond9.preheader ] br i1 %min.iters.check250, label %for.body14.us.preheader, label %vector.ph251 vector.ph251: ; preds = %for.cond12.preheader.us %9 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.0136.us, i64 0 br label %vector.body256 vector.body256: ; preds = %vector.body256, %vector.ph251 %index257 = phi i64 [ 0, %vector.ph251 ], [ %index.next262, %vector.body256 ] %vec.phi258 = phi <4 x i32> [ %9, %vector.ph251 ], [ %16, %vector.body256 ] %vec.phi259 = phi <4 x i32> [ zeroinitializer, %vector.ph251 ], [ %17, %vector.body256 ] %10 = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv176, i64 %index257 %wide.load260 = load <4 x i8>, ptr %10, align 1, !tbaa !11 %11 = getelementptr inbounds i8, ptr %10, i64 4 %wide.load261 = load <4 x i8>, ptr %11, align 1, !tbaa !11 %12 = icmp ne <4 x i8> %wide.load260, <i8 87, i8 87, i8 87, i8 87> %13 = icmp ne <4 x i8> %wide.load261, <i8 87, i8 87, i8 87, i8 87> %14 = zext <4 x i1> %12 to <4 x i32> %15 = zext <4 x i1> %13 to <4 x i32> %16 = add <4 x i32> %vec.phi258, %14 %17 = add <4 x i32> %vec.phi259, %15 %index.next262 = add nuw i64 %index257, 8 %18 = icmp eq i64 %index.next262, %n.vec253 br i1 %18, label %middle.block248, label %vector.body256, !llvm.loop !12 middle.block248: ; preds = %vector.body256 %bin.rdx263 = add <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx263) br i1 %cmp.n255, label %for.cond12.for.end24_crit_edge.us, label %for.body14.us.preheader for.body14.us.preheader: ; preds = %for.cond12.preheader.us, %middle.block248 %indvars.iv173.ph = phi i64 [ 0, %for.cond12.preheader.us ], [ %n.vec253, %middle.block248 ] %count.1132.us.ph = phi i32 [ %count.0136.us, %for.cond12.preheader.us ], [ %19, %middle.block248 ] br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %for.body14.us %indvars.iv173 = phi i64 [ %indvars.iv.next174, %for.body14.us ], [ %indvars.iv173.ph, %for.body14.us.preheader ] %count.1132.us = phi i32 [ %spec.select.us, %for.body14.us ], [ %count.1132.us.ph, %for.body14.us.preheader ] %arrayidx18.us = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv176, i64 %indvars.iv173 %20 = load i8, ptr %arrayidx18.us, align 1, !tbaa !11 %cmp19.not.us = icmp ne i8 %20, 87 %inc21.us = zext i1 %cmp19.not.us to i32 %spec.select.us = add nsw i32 %count.1132.us, %inc21.us %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1 %exitcond.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count br i1 %exitcond.not, label %for.cond12.for.end24_crit_edge.us, label %for.body14.us, !llvm.loop !15 for.cond12.for.end24_crit_edge.us: ; preds = %for.body14.us, %middle.block248 %spec.select.us.lcssa = phi i32 [ %19, %middle.block248 ], [ %spec.select.us, %for.body14.us ] %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1 %exitcond184.not = icmp eq i64 %indvars.iv.next177, %indvars.iv178 br i1 %exitcond184.not, label %for.cond29.preheader, label %for.cond12.preheader.us, !llvm.loop !16 for.cond29.preheader: ; preds = %for.cond12.for.end24_crit_edge.us br i1 %cmp13130, label %for.end80, label %for.cond33.preheader.us.preheader for.cond33.preheader.us.preheader: ; preds = %for.cond29.preheader %21 = add nuw i64 %indvars.iv178, %indvars.iv192 %wide.trip.count195 = and i64 %21, 4294967295 br label %for.cond33.preheader.us for.cond33.preheader.us: ; preds = %for.cond33.preheader.us.preheader, %for.cond33.for.end49_crit_edge.us %indvars.iv190 = phi i64 [ %8, %for.cond33.preheader.us.preheader ], [ %indvars.iv.next191, %for.cond33.for.end49_crit_edge.us ] %count.3144.us = phi i32 [ %spec.select.us.lcssa, %for.cond33.preheader.us.preheader ], [ %spec.select125.us.lcssa, %for.cond33.for.end49_crit_edge.us ] br i1 %min.iters.check233, label %for.body36.us.preheader, label %vector.ph234 vector.ph234: ; preds = %for.cond33.preheader.us %22 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.3144.us, i64 0 br label %vector.body239 vector.body239: ; preds = %vector.body239, %vector.ph234 %index240 = phi i64 [ 0, %vector.ph234 ], [ %index.next245, %vector.body239 ] %vec.phi241 = phi <4 x i32> [ %22, %vector.ph234 ], [ %29, %vector.body239 ] %vec.phi242 = phi <4 x i32> [ zeroinitializer, %vector.ph234 ], [ %30, %vector.body239 ] %23 = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv190, i64 %index240 %wide.load243 = load <4 x i8>, ptr %23, align 1, !tbaa !11 %24 = getelementptr inbounds i8, ptr %23, i64 4 %wide.load244 = load <4 x i8>, ptr %24, align 1, !tbaa !11 %25 = icmp ne <4 x i8> %wide.load243, <i8 66, i8 66, i8 66, i8 66> %26 = icmp ne <4 x i8> %wide.load244, <i8 66, i8 66, i8 66, i8 66> %27 = zext <4 x i1> %25 to <4 x i32> %28 = zext <4 x i1> %26 to <4 x i32> %29 = add <4 x i32> %vec.phi241, %27 %30 = add <4 x i32> %vec.phi242, %28 %index.next245 = add nuw i64 %index240, 8 %31 = icmp eq i64 %index.next245, %n.vec236 br i1 %31, label %middle.block231, label %vector.body239, !llvm.loop !17 middle.block231: ; preds = %vector.body239 %bin.rdx246 = add <4 x i32> %30, %29 %32 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx246) br i1 %cmp.n238, label %for.cond33.for.end49_crit_edge.us, label %for.body36.us.preheader for.body36.us.preheader: ; preds = %for.cond33.preheader.us, %middle.block231 %indvars.iv185.ph = phi i64 [ 0, %for.cond33.preheader.us ], [ %n.vec236, %middle.block231 ] %count.4140.us.ph = phi i32 [ %count.3144.us, %for.cond33.preheader.us ], [ %32, %middle.block231 ] br label %for.body36.us for.body36.us: ; preds = %for.body36.us.preheader, %for.body36.us %indvars.iv185 = phi i64 [ %indvars.iv.next186, %for.body36.us ], [ %indvars.iv185.ph, %for.body36.us.preheader ] %count.4140.us = phi i32 [ %spec.select125.us, %for.body36.us ], [ %count.4140.us.ph, %for.body36.us.preheader ] %arrayidx40.us = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv190, i64 %indvars.iv185 %33 = load i8, ptr %arrayidx40.us, align 1, !tbaa !11 %cmp42.not.us = icmp ne i8 %33, 66 %inc45.us = zext i1 %cmp42.not.us to i32 %spec.select125.us = add nsw i32 %count.4140.us, %inc45.us %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1 %exitcond189.not = icmp eq i64 %indvars.iv.next186, %wide.trip.count188 br i1 %exitcond189.not, label %for.cond33.for.end49_crit_edge.us, label %for.body36.us, !llvm.loop !18 for.cond33.for.end49_crit_edge.us: ; preds = %for.body36.us, %middle.block231 %spec.select125.us.lcssa = phi i32 [ %32, %middle.block231 ], [ %spec.select125.us, %for.body36.us ] %indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1 %exitcond196.not = icmp eq i64 %indvars.iv.next191, %wide.trip.count195 br i1 %exitcond196.not, label %for.cond54.preheader, label %for.cond33.preheader.us, !llvm.loop !19 for.cond54.preheader: ; preds = %for.cond33.for.end49_crit_edge.us %sub56 = sub i32 %4, %add162 %cmp57152 = icmp slt i32 %sub56, 1 %brmerge = select i1 %cmp57152, i1 true, i1 %cmp13130 br i1 %brmerge, label %for.end80, label %for.cond60.preheader.us.preheader for.cond60.preheader.us.preheader: ; preds = %for.cond54.preheader %34 = add nuw i64 %indvars.iv192, %indvars.iv178 %35 = and i64 %34, 4294967295 br label %for.cond60.preheader.us for.cond60.preheader.us: ; preds = %for.cond60.preheader.us.preheader, %for.cond60.for.end76_crit_edge.us %indvars.iv202 = phi i64 [ %35, %for.cond60.preheader.us.preheader ], [ %indvars.iv.next203, %for.cond60.for.end76_crit_edge.us ] %count.6155.us = phi i32 [ %spec.select125.us.lcssa, %for.cond60.preheader.us.preheader ], [ %spec.select126.us.lcssa, %for.cond60.for.end76_crit_edge.us ] %k.2153.us = phi i32 [ 0, %for.cond60.preheader.us.preheader ], [ %inc79.us, %for.cond60.for.end76_crit_edge.us ] br i1 %min.iters.check, label %for.body63.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond60.preheader.us %36 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.6155.us, 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> [ %36, %vector.ph ], [ %43, %vector.body ] %vec.phi229 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %44, %vector.body ] %37 = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv202, i64 %index %wide.load = load <4 x i8>, ptr %37, align 1, !tbaa !11 %38 = getelementptr inbounds i8, ptr %37, i64 4 %wide.load230 = load <4 x i8>, ptr %38, align 1, !tbaa !11 %39 = icmp ne <4 x i8> %wide.load, <i8 82, i8 82, i8 82, i8 82> %40 = icmp ne <4 x i8> %wide.load230, <i8 82, i8 82, i8 82, i8 82> %41 = zext <4 x i1> %39 to <4 x i32> %42 = zext <4 x i1> %40 to <4 x i32> %43 = add <4 x i32> %vec.phi, %41 %44 = add <4 x i32> %vec.phi229, %42 %index.next = add nuw i64 %index, 8 %45 = icmp eq i64 %index.next, %n.vec br i1 %45, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %44, %43 %46 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond60.for.end76_crit_edge.us, label %for.body63.us.preheader for.body63.us.preheader: ; preds = %for.cond60.preheader.us, %middle.block %indvars.iv197.ph = phi i64 [ 0, %for.cond60.preheader.us ], [ %n.vec, %middle.block ] %count.7150.us.ph = phi i32 [ %count.6155.us, %for.cond60.preheader.us ], [ %46, %middle.block ] br label %for.body63.us for.body63.us: ; preds = %for.body63.us.preheader, %for.body63.us %indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.body63.us ], [ %indvars.iv197.ph, %for.body63.us.preheader ] %count.7150.us = phi i32 [ %spec.select126.us, %for.body63.us ], [ %count.7150.us.ph, %for.body63.us.preheader ] %arrayidx67.us = getelementptr inbounds [55 x [55 x i8]], ptr %s, i64 0, i64 %indvars.iv202, i64 %indvars.iv197 %47 = load i8, ptr %arrayidx67.us, align 1, !tbaa !11 %cmp69.not.us = icmp ne i8 %47, 82 %inc72.us = zext i1 %cmp69.not.us to i32 %spec.select126.us = add nsw i32 %count.7150.us, %inc72.us %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1 %exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count200 br i1 %exitcond201.not, label %for.cond60.for.end76_crit_edge.us, label %for.body63.us, !llvm.loop !21 for.cond60.for.end76_crit_edge.us: ; preds = %for.body63.us, %middle.block %spec.select126.us.lcssa = phi i32 [ %46, %middle.block ], [ %spec.select126.us, %for.body63.us ] %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1 %inc79.us = add nuw nsw i32 %k.2153.us, 1 %cmp57.us = icmp slt i32 %inc79.us, %sub56 br i1 %cmp57.us, label %for.cond60.preheader.us, label %for.end80, !llvm.loop !22 for.end80: ; preds = %for.cond60.for.end76_crit_edge.us, %for.cond54.preheader, %for.cond9.preheader, %for.cond29.preheader %count.6.lcssa = phi i32 [ %spec.select125.us.lcssa, %for.cond54.preheader ], [ %spec.select.us.lcssa, %for.cond29.preheader ], [ 0, %for.cond9.preheader ], [ %spec.select126.us.lcssa, %for.cond60.for.end76_crit_edge.us ] %spec.select127 = call i32 @llvm.smin.i32(i32 %count.6.lcssa, i32 %ans.1161) %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1 %indvars = trunc i64 %indvars.iv.next193 to i32 %add = add nuw nsw i32 %indvars, %7 %exitcond209.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count208 br i1 %exitcond209.not, label %for.inc88, label %for.cond9.preheader, !llvm.loop !23 for.inc88: ; preds = %for.end80, %for.cond5.preheader %ans.1.lcssa = phi i32 [ %ans.0166, %for.cond5.preheader ], [ %spec.select127, %for.end80 ] %indvars.iv.next207 = add i32 %indvars.iv206, -1 %exitcond213.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count212 br i1 %exitcond213.not, label %for.end90, label %for.cond5.preheader, !llvm.loop !24 for.end90: ; preds = %for.inc88, %entry, %for.cond2.preheader %ans.0.lcssa = phi i32 [ 2500, %for.cond2.preheader ], [ 2500, %entry ], [ %ans.1.lcssa, %for.inc88 ] %call91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 3025, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!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, !14, !13} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !13, !14} !18 = distinct !{!18, !10, !14, !13} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10, !13, !14} !21 = distinct !{!21, !10, !14, !13} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10}
#include <stdio.h> //#include<math.h> #include<string.h> int main() { char ch[10001]; long int n,z,i; scanf("%ld %s", &n, &ch); for(i=0;ch[i]!='\0';i++){ z = ((ch[i]-65)+n)%26; printf("%c",z+65); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld %s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %ch = alloca [10001 x i8], align 16 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 10001, ptr nonnull %ch) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %ch) %0 = load i8, ptr %ch, align 16, !tbaa !5 %cmp.not11 = icmp eq i8 %0, 0 br i1 %cmp.not11, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %1 = phi i8 [ %5, %for.body ], [ %0, %entry ] %i.012 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %conv = sext i8 %1 to i64 %sub = add nsw i64 %conv, -65 %2 = load i64, ptr %n, align 8, !tbaa !8 %add = add nsw i64 %sub, %2 %rem = srem i64 %add, 26 %3 = trunc i64 %rem to i32 %4 = add nsw i32 %3, 65 %putchar10 = call i32 @putchar(i32 %4) %inc = add nuw nsw i64 %i.012, 1 %arrayidx = getelementptr inbounds [10001 x i8], ptr %ch, i64 0, i64 %inc %5 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp.not = icmp eq i8 %5, 0 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 10001, ptr nonnull %ch) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"long", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
//b.c B - ROT N #include<stdio.h> int main(void){ int n; scanf("%d",&n); char msg[100000]; scanf("%s",msg); for(int i=0;msg[i]!='\0';++i){ int in = (msg[i] - 'A' + n)%26; msg[i] = in + 'A'; } printf("%s",msg); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253522/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253522/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %msg = alloca [100000 x i8], align 16 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) call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %msg) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %msg) %0 = load i8, ptr %msg, align 16, !tbaa !5 %cmp.not15 = icmp eq i8 %0, 0 br i1 %cmp.not15, label %for.cond.cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %n, align 4, !tbaa !8 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %msg) call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %msg) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %2 = phi i8 [ %0, %for.body.lr.ph ], [ %4, %for.body ] %arrayidx17 = phi ptr [ %msg, %for.body.lr.ph ], [ %arrayidx, %for.body ] %conv = sext i8 %2 to i32 %sub = add nsw i32 %conv, -65 %add = add nsw i32 %sub, %1 %rem = srem i32 %add, 26 %3 = trunc i32 %rem to i8 %conv7 = add nsw i8 %3, 65 store i8 %conv7, ptr %arrayidx17, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [100000 x i8], ptr %msg, 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.cond.cleanup, label %for.body, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !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 num,i; char string[10001]; scanf("%d%s",&num,&string); for(i=0;string[i]!='\0';i++){ string[i]+=num; if(string[i]>'Z'){ string[i]-=('Z'-'A'+1); } } printf("%s",string); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253566/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253566/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %string = alloca [10001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3 call void @llvm.lifetime.start.p0(i64 10001, ptr nonnull %string) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %string) %0 = load i8, ptr %string, align 16, !tbaa !5 %cmp.not20 = icmp eq i8 %0, 0 br i1 %cmp.not20, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %num, align 4, !tbaa !8 %2 = trunc i32 %1 to i8 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 ] %3 = phi i8 [ %0, %for.body.lr.ph ], [ %4, %for.body ] %arrayidx22 = phi ptr [ %string, %for.body.lr.ph ], [ %arrayidx, %for.body ] %conv5 = add i8 %3, %2 %cmp9 = icmp sgt i8 %conv5, 90 %sub = add i8 %conv5, -26 %spec.select = select i1 %cmp9, i8 %sub, i8 %conv5 store i8 %spec.select, ptr %arrayidx22, align 1, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [10001 x i8], ptr %string, 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.end, label %for.body, !llvm.loop !10 for.end: ; preds = %for.body, %entry %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %string) call void @llvm.lifetime.end.p0(i64 10001, ptr nonnull %string) #3 call void @llvm.lifetime.end.p0(i64 4, 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 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main() { char S[10001]; int i, N; scanf("%d", &N); scanf("%s", S); for(i = 0; i < strlen(S); i++) S[i] = 'A' + ((S[i] - 'A' + N) % 26); printf("%s\n", S); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253609/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253609/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %S = alloca [10001 x i8], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 10001, ptr nonnull %S) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S) %char0 = load i8, ptr %S, align 16 %cmp16.not = icmp eq i8 %char0, 0 br i1 %cmp16.not, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 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 ] %arrayidx = getelementptr inbounds [10001 x i8], ptr %S, i64 0, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv5 = sext i8 %1 to i32 %sub = add nsw i32 %conv5, -65 %add = add nsw i32 %sub, %0 %rem = srem i32 %add, 26 %2 = trunc i32 %rem to i8 %conv7 = add nsw i8 %2, 65 store i8 %conv7, ptr %arrayidx, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6 %cmp = icmp ugt i64 %call3, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10 for.end: ; preds = %for.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %S) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.end.p0(i64 10001, ptr nonnull %S) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <string.h> int main(void) { int n; char aa; char a = 'A'; char s[10001]; scanf("%d", &n); scanf("%s", &s); int l = strlen(s); for (int i=0; i<l; i++) { aa = s[i] + n; if (aa >= 91) { aa -= 26; } s[i] = aa; } printf("%s", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253667/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253667/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca [10001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 10001, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %conv = trunc i64 %call2 to i32 %cmp20 = icmp sgt i32 %conv, 0 br i1 %cmp20, label %iter.check, label %for.cond.cleanup iter.check: ; preds = %entry %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = trunc i32 %0 to i8 %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check23 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check23, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.mod.vf = and i64 %call2, 31 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf %broadcast.splatinsert = insertelement <16 x i8> poison, i8 %1, i64 0 %broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds [10001 x i8], ptr %s, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %2, align 16, !tbaa !9 %3 = getelementptr inbounds i8, ptr %2, i64 16 %wide.load24 = load <16 x i8>, ptr %3, align 16, !tbaa !9 %4 = add <16 x i8> %wide.load, %broadcast.splat %5 = add <16 x i8> %wide.load24, %broadcast.splat %6 = icmp sgt <16 x i8> %4, <i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90> %7 = icmp sgt <16 x i8> %5, <i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90> %8 = add <16 x i8> %4, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26> %9 = add <16 x i8> %5, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26> %10 = select <16 x i1> %6, <16 x i8> %8, <16 x i8> %4 %11 = select <16 x i1> %7, <16 x i8> %9, <16 x i8> %5 store <16 x i8> %10, ptr %2, align 16, !tbaa !9 store <16 x i8> %11, ptr %3, align 16, !tbaa !9 %index.next = add nuw i64 %index, 32 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.mod.vf25 = and i64 %call2, 7 %n.vec26 = sub nsw i64 %wide.trip.count, %n.mod.vf25 %broadcast.splatinsert30 = insertelement <8 x i8> poison, i8 %1, i64 0 %broadcast.splat31 = shufflevector <8 x i8> %broadcast.splatinsert30, <8 x i8> poison, <8 x i32> zeroinitializer br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index28 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next32, %vec.epilog.vector.body ] %13 = getelementptr inbounds [10001 x i8], ptr %s, i64 0, i64 %index28 %wide.load29 = load <8 x i8>, ptr %13, align 1, !tbaa !9 %14 = add <8 x i8> %wide.load29, %broadcast.splat31 %15 = icmp sgt <8 x i8> %14, <i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90, i8 90> %16 = add <8 x i8> %14, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26> %17 = select <8 x i1> %15, <8 x i8> %16, <8 x i8> %14 store <8 x i8> %17, ptr %13, align 1, !tbaa !9 %index.next32 = add nuw i64 %index28, 8 %18 = icmp eq i64 %index.next32, %n.vec26 br i1 %18, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n27 = icmp eq i64 %n.mod.vf25, 0 br i1 %cmp.n27, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec26, %vec.epilog.middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 10001, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %arrayidx = getelementptr inbounds [10001 x i8], ptr %s, i64 0, i64 %indvars.iv %19 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv5 = add i8 %19, %1 %cmp7 = icmp sgt i8 %conv5, 90 %sub = add i8 %conv5, -26 %spec.select = select i1 %cmp7, i8 %sub, i8 %conv5 store i8 %spec.select, ptr %arrayidx, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11, !12, !13} !15 = distinct !{!15, !11, !13, !12}
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { int n; char tmp; char *s = malloc(sizeof(char)*10000); scanf("%d %s", &n, s); for (int i = 0; i < strlen(s); i++) { tmp = s[i]; if (s[i] + n > 'Z') { s[i] = 'A' + (tmp + n - 'Z') - 1; }else { s[i] = tmp + n; } } printf("%s\n", s); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253717/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253717/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = tail call noalias dereferenceable_or_null(10000) ptr @malloc(i64 noundef 10000) #7 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef %call) %char0 = load i8, ptr %call, align 1 %cmp35.not = icmp eq i8 %char0, 0 br i1 %cmp35.not, label %for.cond.cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %0 = load i32, ptr %n, align 4, !tbaa !5 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) %call) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i8, ptr %call, i64 %indvars.iv %1 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv6 = sext i8 %1 to i32 %add = add nsw i32 %0, %conv6 %cmp7 = icmp sgt i32 %add, 90 %sub12 = add i32 %add, 230 %storemerge.in = select i1 %cmp7, i32 %sub12, i32 %add %storemerge = trunc i32 %storemerge.in to i8 store i8 %storemerge, ptr %arrayidx, align 1, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call) #8 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-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 } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
// AOJ 2104: Country Road // 2017.9.30 bal4u@uu // 2017.11.7 retry #include <stdio.h> #include <string.h> int f[1000001]; // for data input char buf[800000], *p; int getint() { int n = 0; while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf); return n; } int main() { int t, n, k, i, ans; int x0, x, dx, min, max; fgets(p=buf, 10, stdin), t = getint(); while (t--) { fgets(p=buf, 20, stdin), n = getint(), p++, k = getint(); fgets(p=buf, sizeof(buf), stdin); if (k >= n) { puts("0"); continue; } memset(f, 0, sizeof(f)); min = 1000000, max = 0; for (n--, x0 = getint(), i = 0; i < n; i++, x0 = x) { p++, x = getint(); dx = x - x0, f[dx]++; if (dx < min) min = dx; if (dx > max) max = dx; } for (ans = 0, i = n-k+1, x = min; i > 0; x++) { if (f[x] > 0) { if (i < f[x]) f[x] = i; ans += x*f[x], i -= f[x]; } } printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253760/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253760/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @p = dso_local local_unnamed_addr global ptr null, align 8 @buf = dso_local global [800000 x i8] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [2 x i8] c"0\00", align 1 @f = dso_local local_unnamed_addr global [1000001 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @getint() local_unnamed_addr #0 { entry: %p.promoted = load ptr, ptr @p, align 8, !tbaa !5 %0 = load i8, ptr %p.promoted, align 1, !tbaa !9 %cmp8 = icmp sgt i8 %0, 47 br i1 %cmp8, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %n.010 = phi i32 [ %add4, %while.body ], [ 0, %entry ] %incdec.ptr79 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ] %add = mul i32 %n.010, 10 %incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr79, i64 1 store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5 %1 = load i8, ptr %incdec.ptr79, align 1, !tbaa !9 %2 = and i8 %1, 15 %and = zext i8 %2 to i32 %add4 = add nsw i32 %add, %and %3 = load i8, ptr %incdec.ptr, align 1, !tbaa !9 %cmp = icmp sgt i8 %3, 47 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10 while.end: ; preds = %while.body, %entry %n.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %while.body ] ret i32 %n.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: store ptr @buf, ptr @p, align 8, !tbaa !5 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %0) %p.promoted.i = load ptr, ptr @p, align 8, !tbaa !5 %1 = load i8, ptr %p.promoted.i, align 1, !tbaa !9 %cmp8.i = icmp sgt i8 %1, 47 br i1 %cmp8.i, label %while.body.i, label %while.end while.body.i: ; preds = %entry, %while.body.i %n.010.i = phi i32 [ %add4.i, %while.body.i ], [ 0, %entry ] %incdec.ptr79.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %p.promoted.i, %entry ] %add.i = mul i32 %n.010.i, 10 %incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr79.i, i64 1 store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !5 %2 = load i8, ptr %incdec.ptr79.i, align 1, !tbaa !9 %3 = and i8 %2, 15 %and.i = zext i8 %3 to i32 %add4.i = add nsw i32 %add.i, %and.i %4 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !9 %cmp.i = icmp sgt i8 %4, 47 br i1 %cmp.i, label %while.body.i, label %getint.exit, !llvm.loop !10 getint.exit: ; preds = %while.body.i %tobool.not130 = icmp eq i32 %add4.i, 0 br i1 %tobool.not130, label %while.end, label %while.body while.body: ; preds = %getint.exit, %while.cond.backedge %dec131.in = phi i32 [ %dec131, %while.cond.backedge ], [ %add4.i, %getint.exit ] %dec131 = add nsw i32 %dec131.in, -1 store ptr @buf, ptr @p, align 8, !tbaa !5 %5 = load ptr, ptr @stdin, align 8, !tbaa !5 %call2 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 20, ptr noundef %5) %p.promoted.i68 = load ptr, ptr @p, align 8, !tbaa !5 %6 = load i8, ptr %p.promoted.i68, align 1, !tbaa !9 %cmp8.i69 = icmp sgt i8 %6, 47 br i1 %cmp8.i69, label %while.body.i71, label %getint.exit79 while.body.i71: ; preds = %while.body, %while.body.i71 %n.010.i72 = phi i32 [ %add4.i77, %while.body.i71 ], [ 0, %while.body ] %incdec.ptr79.i73 = phi ptr [ %incdec.ptr.i75, %while.body.i71 ], [ %p.promoted.i68, %while.body ] %add.i74 = mul i32 %n.010.i72, 10 %incdec.ptr.i75 = getelementptr inbounds i8, ptr %incdec.ptr79.i73, i64 1 store ptr %incdec.ptr.i75, ptr @p, align 8, !tbaa !5 %7 = load i8, ptr %incdec.ptr79.i73, align 1, !tbaa !9 %8 = and i8 %7, 15 %and.i76 = zext i8 %8 to i32 %add4.i77 = add nsw i32 %add.i74, %and.i76 %9 = load i8, ptr %incdec.ptr.i75, align 1, !tbaa !9 %cmp.i78 = icmp sgt i8 %9, 47 br i1 %cmp.i78, label %while.body.i71, label %getint.exit79, !llvm.loop !10 getint.exit79: ; preds = %while.body.i71, %while.body %10 = phi ptr [ %p.promoted.i68, %while.body ], [ %incdec.ptr.i75, %while.body.i71 ] %n.0.lcssa.i70 = phi i32 [ 0, %while.body ], [ %add4.i77, %while.body.i71 ] %incdec.ptr = getelementptr inbounds i8, ptr %10, i64 1 store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5 %11 = load i8, ptr %incdec.ptr, align 1, !tbaa !9 %cmp8.i81 = icmp sgt i8 %11, 47 br i1 %cmp8.i81, label %while.body.i83, label %getint.exit91 while.body.i83: ; preds = %getint.exit79, %while.body.i83 %n.010.i84 = phi i32 [ %add4.i89, %while.body.i83 ], [ 0, %getint.exit79 ] %incdec.ptr79.i85 = phi ptr [ %incdec.ptr.i87, %while.body.i83 ], [ %incdec.ptr, %getint.exit79 ] %add.i86 = mul i32 %n.010.i84, 10 %incdec.ptr.i87 = getelementptr inbounds i8, ptr %incdec.ptr79.i85, i64 1 store ptr %incdec.ptr.i87, ptr @p, align 8, !tbaa !5 %12 = load i8, ptr %incdec.ptr79.i85, align 1, !tbaa !9 %13 = and i8 %12, 15 %and.i88 = zext i8 %13 to i32 %add4.i89 = add nsw i32 %add.i86, %and.i88 %14 = load i8, ptr %incdec.ptr.i87, align 1, !tbaa !9 %cmp.i90 = icmp sgt i8 %14, 47 br i1 %cmp.i90, label %while.body.i83, label %getint.exit91, !llvm.loop !10 getint.exit91: ; preds = %while.body.i83, %getint.exit79 %n.0.lcssa.i82 = phi i32 [ 0, %getint.exit79 ], [ %add4.i89, %while.body.i83 ] store ptr @buf, ptr @p, align 8, !tbaa !5 %15 = load ptr, ptr @stdin, align 8, !tbaa !5 %call5 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 800000, ptr noundef %15) %cmp.not = icmp slt i32 %n.0.lcssa.i82, %n.0.lcssa.i70 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %getint.exit91 %call6 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str) br label %while.cond.backedge while.cond.backedge: ; preds = %if.then, %for.end43 %tobool.not = icmp eq i32 %dec131, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12 if.end: ; preds = %getint.exit91 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000004) @f, i8 0, i64 4000004, i1 false) %p.promoted.i92 = load ptr, ptr @p, align 8, !tbaa !5 %16 = load i8, ptr %p.promoted.i92, align 1, !tbaa !9 %cmp8.i93 = icmp sgt i8 %16, 47 br i1 %cmp8.i93, label %while.body.i95, label %getint.exit103 while.body.i95: ; preds = %if.end, %while.body.i95 %n.010.i96 = phi i32 [ %add4.i101, %while.body.i95 ], [ 0, %if.end ] %incdec.ptr79.i97 = phi ptr [ %incdec.ptr.i99, %while.body.i95 ], [ %p.promoted.i92, %if.end ] %add.i98 = mul i32 %n.010.i96, 10 %incdec.ptr.i99 = getelementptr inbounds i8, ptr %incdec.ptr79.i97, i64 1 store ptr %incdec.ptr.i99, ptr @p, align 8, !tbaa !5 %17 = load i8, ptr %incdec.ptr79.i97, align 1, !tbaa !9 %18 = and i8 %17, 15 %and.i100 = zext i8 %18 to i32 %add4.i101 = add nsw i32 %add.i98, %and.i100 %19 = load i8, ptr %incdec.ptr.i99, align 1, !tbaa !9 %cmp.i102 = icmp sgt i8 %19, 47 br i1 %cmp.i102, label %while.body.i95, label %getint.exit103, !llvm.loop !10 getint.exit103: ; preds = %while.body.i95, %if.end %p.promoted = phi ptr [ %p.promoted.i92, %if.end ], [ %incdec.ptr.i99, %while.body.i95 ] %n.0.lcssa.i94 = phi i32 [ 0, %if.end ], [ %add4.i101, %while.body.i95 ] %cmp9118 = icmp sgt i32 %n.0.lcssa.i70, 1 br i1 %cmp9118, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %getint.exit103 %20 = add i32 %n.0.lcssa.i70, -2 br label %for.body for.body: ; preds = %for.body.preheader, %getint.exit115 %min.0122 = phi i32 [ %spec.select, %getint.exit115 ], [ 1000000, %for.body.preheader ] %x0.0121 = phi i32 [ %n.0.lcssa.i106, %getint.exit115 ], [ %n.0.lcssa.i94, %for.body.preheader ] %i.0120 = phi i32 [ %inc18, %getint.exit115 ], [ 0, %for.body.preheader ] %incdec.ptr.i111116119 = phi ptr [ %incdec.ptr.i111117, %getint.exit115 ], [ %p.promoted, %for.body.preheader ] %incdec.ptr10 = getelementptr inbounds i8, ptr %incdec.ptr.i111116119, i64 1 store ptr %incdec.ptr10, ptr @p, align 8, !tbaa !5 %21 = load i8, ptr %incdec.ptr10, align 1, !tbaa !9 %cmp8.i105 = icmp sgt i8 %21, 47 br i1 %cmp8.i105, label %while.body.i107, label %getint.exit115 while.body.i107: ; preds = %for.body, %while.body.i107 %n.010.i108 = phi i32 [ %add4.i113, %while.body.i107 ], [ 0, %for.body ] %incdec.ptr79.i109 = phi ptr [ %incdec.ptr.i111, %while.body.i107 ], [ %incdec.ptr10, %for.body ] %add.i110 = mul i32 %n.010.i108, 10 %incdec.ptr.i111 = getelementptr inbounds i8, ptr %incdec.ptr79.i109, i64 1 store ptr %incdec.ptr.i111, ptr @p, align 8, !tbaa !5 %22 = load i8, ptr %incdec.ptr79.i109, align 1, !tbaa !9 %23 = and i8 %22, 15 %and.i112 = zext i8 %23 to i32 %add4.i113 = add nsw i32 %add.i110, %and.i112 %24 = load i8, ptr %incdec.ptr.i111, align 1, !tbaa !9 %cmp.i114 = icmp sgt i8 %24, 47 br i1 %cmp.i114, label %while.body.i107, label %getint.exit115, !llvm.loop !10 getint.exit115: ; preds = %while.body.i107, %for.body %incdec.ptr.i111117 = phi ptr [ %incdec.ptr10, %for.body ], [ %incdec.ptr.i111, %while.body.i107 ] %n.0.lcssa.i106 = phi i32 [ 0, %for.body ], [ %add4.i113, %while.body.i107 ] %sub = sub nsw i32 %n.0.lcssa.i106, %x0.0121 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %idxprom %25 = load i32, ptr %arrayidx, align 4, !tbaa !13 %inc = add nsw i32 %25, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !13 %spec.select = tail call i32 @llvm.smin.i32(i32 %sub, i32 %min.0122) %inc18 = add nuw nsw i32 %i.0120, 1 %exitcond.not = icmp eq i32 %i.0120, %20 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15 for.end: ; preds = %getint.exit115, %getint.exit103 %min.0.lcssa = phi i32 [ 1000000, %getint.exit103 ], [ %spec.select, %getint.exit115 ] %add = sub i32 %n.0.lcssa.i70, %n.0.lcssa.i82 %cmp21124 = icmp sgt i32 %add, 0 br i1 %cmp21124, label %for.body22.preheader, label %for.end43 for.body22.preheader: ; preds = %for.end %26 = sext i32 %min.0.lcssa to i64 br label %for.body22 for.body22: ; preds = %for.body22.preheader, %for.inc41 %indvars.iv = phi i64 [ %26, %for.body22.preheader ], [ %indvars.iv.next, %for.inc41 ] %ans.0126 = phi i32 [ 0, %for.body22.preheader ], [ %ans.1, %for.inc41 ] %i.1125 = phi i32 [ %add, %for.body22.preheader ], [ %i.2, %for.inc41 ] %arrayidx24 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv %27 = load i32, ptr %arrayidx24, align 4, !tbaa !13 %cmp25 = icmp sgt i32 %27, 0 br i1 %cmp25, label %if.then26, label %for.inc41 if.then26: ; preds = %for.body22 %cmp29 = icmp ult i32 %i.1125, %27 br i1 %cmp29, label %if.then30, label %if.end33 if.then30: ; preds = %if.then26 store i32 %i.1125, ptr %arrayidx24, align 4, !tbaa !13 br label %if.end33 if.end33: ; preds = %if.then30, %if.then26 %28 = phi i32 [ %i.1125, %if.then30 ], [ %27, %if.then26 ] %29 = trunc i64 %indvars.iv to i32 %mul = mul nsw i32 %28, %29 %add36 = add nsw i32 %mul, %ans.0126 %sub39 = sub nsw i32 %i.1125, %28 br label %for.inc41 for.inc41: ; preds = %for.body22, %if.end33 %i.2 = phi i32 [ %sub39, %if.end33 ], [ %i.1125, %for.body22 ] %ans.1 = phi i32 [ %add36, %if.end33 ], [ %ans.0126, %for.body22 ] %indvars.iv.next = add i64 %indvars.iv, 1 %cmp21 = icmp sgt i32 %i.2, 0 br i1 %cmp21, label %for.body22, label %for.end43, !llvm.loop !16 for.end43: ; preds = %for.inc41, %for.end %ans.0.lcssa = phi i32 [ 0, %for.end ], [ %ans.1, %for.inc41 ] %call44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) br label %while.cond.backedge while.end: ; preds = %while.cond.backedge, %entry, %getint.exit ret i32 0 } ; 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = !{!14, !14, i64 0} !14 = !{!"int", !7, i64 0} !15 = distinct !{!15, !11} !16 = distinct !{!16, !11}
#include <stdio.h> int main(void) { int N,M,C; scanf("%d%d", &N,&M); scanf("%d", &C); int b[M]; int a[M + 1][N + 1]; int i = 0; while (i < M) { scanf("%d", &b[i]); i++; } i = 0; int j; int ans[N + 1]; int count = 0; while (i < N) { j = 0; while (j < M) { scanf("%d", &a[i][j]); ans[i] = 0; j++; } i++; } i = 0; while (i < N) { j = 0; while (j < M) { // printf("%d*%d\n",a[i][j] , b[j]); ans[i] += a[i][j] * b[j]; j++; } // printf("%d",ans[i]); if (ans[i] + C > 0) count++; i++; } printf("%d", count); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253818/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253818/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %C = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %C) %0 = load i32, ptr %M, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %M, align 4, !tbaa !5 %add = add nsw i32 %3, 1 %4 = zext i32 %add to i64 %5 = load i32, ptr %N, align 4, !tbaa !5 %add2 = add nsw i32 %5, 1 %6 = zext i32 %add2 to i64 %7 = mul nuw i64 %6, %4 %vla3 = alloca i32, i64 %7, align 16 %cmp67 = icmp sgt i32 %3, 0 br i1 %cmp67, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %M, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %while.body, label %while.end.loopexit, !llvm.loop !9 while.end.loopexit: ; preds = %while.body %.pre = load i32, ptr %N, align 4, !tbaa !5 %.pre105 = add nsw i32 %.pre, 1 %.pre106 = zext i32 %.pre105 to i64 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %.pre-phi = phi i64 [ %.pre106, %while.end.loopexit ], [ %6, %entry ] %10 = phi i32 [ %8, %while.end.loopexit ], [ %3, %entry ] %11 = phi i32 [ %.pre, %while.end.loopexit ], [ %5, %entry ] %vla6 = alloca i32, i64 %.pre-phi, align 16 %cmp871 = icmp sgt i32 %11, 0 br i1 %cmp871, label %while.cond10.preheader.lr.ph, label %while.end47 while.cond10.preheader.lr.ph: ; preds = %while.end %12 = icmp sgt i32 %10, 0 br i1 %12, label %while.cond10.preheader, label %while.cond27.preheader.lr.ph.thread while.cond27.preheader.lr.ph.thread: ; preds = %while.cond10.preheader.lr.ph %13 = load i32, ptr %C, align 4, !tbaa !5 br label %while.cond27.preheader.preheader while.cond10.preheader: ; preds = %while.cond10.preheader.lr.ph, %while.end21 %14 = phi i32 [ %47, %while.end21 ], [ %11, %while.cond10.preheader.lr.ph ] %15 = phi i32 [ %48, %while.end21 ], [ %10, %while.cond10.preheader.lr.ph ] %indvars.iv88 = phi i64 [ %indvars.iv.next89, %while.end21 ], [ 0, %while.cond10.preheader.lr.ph ] %cmp1169 = icmp sgt i32 %15, 0 br i1 %cmp1169, label %while.body12.lr.ph, label %while.end21 while.body12.lr.ph: ; preds = %while.cond10.preheader %16 = mul nuw nsw i64 %indvars.iv88, %6 %arrayidx14 = getelementptr inbounds i32, ptr %vla3, i64 %16 %arrayidx19 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv88 br label %while.body12 while.cond24.preheader: ; preds = %while.end21 %cmp2576 = icmp sgt i32 %47, 0 br i1 %cmp2576, label %while.cond27.preheader.lr.ph, label %while.end47 while.cond27.preheader.lr.ph: ; preds = %while.cond24.preheader %cmp2873 = icmp sgt i32 %48, 0 %17 = load i32, ptr %C, align 4, !tbaa !5 br i1 %cmp2873, label %while.cond27.preheader.us.preheader, label %while.cond27.preheader.preheader while.cond27.preheader.preheader: ; preds = %while.cond27.preheader.lr.ph.thread, %while.cond27.preheader.lr.ph %18 = phi i32 [ %13, %while.cond27.preheader.lr.ph.thread ], [ %17, %while.cond27.preheader.lr.ph ] %.lcssa109115 = phi i32 [ %11, %while.cond27.preheader.lr.ph.thread ], [ %47, %while.cond27.preheader.lr.ph ] %wide.trip.count = zext i32 %.lcssa109115 to i64 %min.iters.check = icmp ult i32 %.lcssa109115, 8 br i1 %min.iters.check, label %while.cond27.preheader.preheader147, label %vector.ph vector.ph: ; preds = %while.cond27.preheader.preheader %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %18, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ] %vec.phi124 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ] %19 = getelementptr inbounds i32, ptr %vla6, i64 %index %wide.load = load <4 x i32>, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 %wide.load125 = load <4 x i32>, ptr %20, align 16, !tbaa !5 %21 = add nsw <4 x i32> %broadcast.splat, %wide.load %22 = add nsw <4 x i32> %broadcast.splat, %wide.load125 %23 = icmp sgt <4 x i32> %21, zeroinitializer %24 = icmp sgt <4 x i32> %22, zeroinitializer %25 = zext <4 x i1> %23 to <4 x i32> %26 = zext <4 x i1> %24 to <4 x i32> %27 = add <4 x i32> %vec.phi, %25 %28 = add <4 x i32> %vec.phi124, %26 %index.next = add nuw i64 %index, 8 %29 = icmp eq i64 %index.next, %n.vec br i1 %29, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %28, %27 %30 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %while.end47, label %while.cond27.preheader.preheader147 while.cond27.preheader.preheader147: ; preds = %while.cond27.preheader.preheader, %middle.block %indvars.iv91.ph = phi i64 [ 0, %while.cond27.preheader.preheader ], [ %n.vec, %middle.block ] %count.078.ph = phi i32 [ 0, %while.cond27.preheader.preheader ], [ %30, %middle.block ] br label %while.cond27.preheader while.cond27.preheader.us.preheader: ; preds = %while.cond27.preheader.lr.ph %wide.trip.count102 = zext i32 %47 to i64 %wide.trip.count97 = zext i32 %48 to i64 %min.iters.check128 = icmp ult i32 %48, 8 %n.vec131 = and i64 %wide.trip.count97, 4294967288 %cmp.n133 = icmp eq i64 %n.vec131, %wide.trip.count97 br label %while.cond27.preheader.us while.cond27.preheader.us: ; preds = %while.cond27.preheader.us.preheader, %while.cond27.while.end40_crit_edge.us %indvars.iv99 = phi i64 [ 0, %while.cond27.preheader.us.preheader ], [ %indvars.iv.next100, %while.cond27.while.end40_crit_edge.us ] %count.078.us = phi i32 [ 0, %while.cond27.preheader.us.preheader ], [ %spec.select.us, %while.cond27.while.end40_crit_edge.us ] %31 = mul nuw nsw i64 %indvars.iv99, %6 %arrayidx31.us = getelementptr inbounds i32, ptr %vla3, i64 %31 %arrayidx37.us = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv99 %arrayidx37.promoted.us = load i32, ptr %arrayidx37.us, align 4, !tbaa !5 br i1 %min.iters.check128, label %while.body29.us.preheader, label %vector.ph129 vector.ph129: ; preds = %while.cond27.preheader.us %32 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %arrayidx37.promoted.us, i64 0 br label %vector.body134 vector.body134: ; preds = %vector.body134, %vector.ph129 %index135 = phi i64 [ 0, %vector.ph129 ], [ %index.next142, %vector.body134 ] %vec.phi136 = phi <4 x i32> [ %32, %vector.ph129 ], [ %39, %vector.body134 ] %vec.phi137 = phi <4 x i32> [ zeroinitializer, %vector.ph129 ], [ %40, %vector.body134 ] %33 = getelementptr inbounds i32, ptr %arrayidx31.us, i64 %index135 %wide.load138 = load <4 x i32>, ptr %33, align 4, !tbaa !5 %34 = getelementptr inbounds i32, ptr %33, i64 4 %wide.load139 = load <4 x i32>, ptr %34, align 4, !tbaa !5 %35 = getelementptr inbounds i32, ptr %vla, i64 %index135 %wide.load140 = load <4 x i32>, ptr %35, align 16, !tbaa !5 %36 = getelementptr inbounds i32, ptr %35, i64 4 %wide.load141 = load <4 x i32>, ptr %36, align 16, !tbaa !5 %37 = mul nsw <4 x i32> %wide.load140, %wide.load138 %38 = mul nsw <4 x i32> %wide.load141, %wide.load139 %39 = add <4 x i32> %vec.phi136, %37 %40 = add <4 x i32> %vec.phi137, %38 %index.next142 = add nuw i64 %index135, 8 %41 = icmp eq i64 %index.next142, %n.vec131 br i1 %41, label %middle.block126, label %vector.body134, !llvm.loop !14 middle.block126: ; preds = %vector.body134 %bin.rdx143 = add <4 x i32> %40, %39 %42 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx143) br i1 %cmp.n133, label %while.cond27.while.end40_crit_edge.us, label %while.body29.us.preheader while.body29.us.preheader: ; preds = %while.cond27.preheader.us, %middle.block126 %indvars.iv94.ph = phi i64 [ 0, %while.cond27.preheader.us ], [ %n.vec131, %middle.block126 ] %add3875.us.ph = phi i32 [ %arrayidx37.promoted.us, %while.cond27.preheader.us ], [ %42, %middle.block126 ] br label %while.body29.us while.body29.us: ; preds = %while.body29.us.preheader, %while.body29.us %indvars.iv94 = phi i64 [ %indvars.iv.next95, %while.body29.us ], [ %indvars.iv94.ph, %while.body29.us.preheader ] %add3875.us = phi i32 [ %add38.us, %while.body29.us ], [ %add3875.us.ph, %while.body29.us.preheader ] %arrayidx33.us = getelementptr inbounds i32, ptr %arrayidx31.us, i64 %indvars.iv94 %43 = load i32, ptr %arrayidx33.us, align 4, !tbaa !5 %arrayidx35.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv94 %44 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %mul.us = mul nsw i32 %44, %43 %add38.us = add nsw i32 %add3875.us, %mul.us %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97 br i1 %exitcond98.not, label %while.cond27.while.end40_crit_edge.us, label %while.body29.us, !llvm.loop !15 while.cond27.while.end40_crit_edge.us: ; preds = %while.body29.us, %middle.block126 %add38.us.lcssa = phi i32 [ %42, %middle.block126 ], [ %add38.us, %while.body29.us ] store i32 %add38.us.lcssa, ptr %arrayidx37.us, align 4, !tbaa !5 %add43.us = add nsw i32 %17, %add38.us.lcssa %cmp44.us = icmp sgt i32 %add43.us, 0 %inc45.us = zext i1 %cmp44.us to i32 %spec.select.us = add nuw nsw i32 %count.078.us, %inc45.us %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102 br i1 %exitcond103.not, label %while.end47, label %while.cond27.preheader.us, !llvm.loop !16 while.body12: ; preds = %while.body12.lr.ph, %while.body12 %indvars.iv85 = phi i64 [ 0, %while.body12.lr.ph ], [ %indvars.iv.next86, %while.body12 ] %arrayidx16 = getelementptr inbounds i32, ptr %arrayidx14, i64 %indvars.iv85 %call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx16) store i32 0, ptr %arrayidx19, align 4, !tbaa !5 %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1 %45 = load i32, ptr %M, align 4, !tbaa !5 %46 = sext i32 %45 to i64 %cmp11 = icmp slt i64 %indvars.iv.next86, %46 br i1 %cmp11, label %while.body12, label %while.end21.loopexit, !llvm.loop !17 while.end21.loopexit: ; preds = %while.body12 %.pre104 = load i32, ptr %N, align 4, !tbaa !5 br label %while.end21 while.end21: ; preds = %while.end21.loopexit, %while.cond10.preheader %47 = phi i32 [ %.pre104, %while.end21.loopexit ], [ %14, %while.cond10.preheader ] %48 = phi i32 [ %45, %while.end21.loopexit ], [ %15, %while.cond10.preheader ] %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %49 = sext i32 %47 to i64 %cmp8 = icmp slt i64 %indvars.iv.next89, %49 br i1 %cmp8, label %while.cond10.preheader, label %while.cond24.preheader, !llvm.loop !18 while.cond27.preheader: ; preds = %while.cond27.preheader.preheader147, %while.cond27.preheader %indvars.iv91 = phi i64 [ %indvars.iv.next92, %while.cond27.preheader ], [ %indvars.iv91.ph, %while.cond27.preheader.preheader147 ] %count.078 = phi i32 [ %spec.select, %while.cond27.preheader ], [ %count.078.ph, %while.cond27.preheader.preheader147 ] %arrayidx42 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv91 %50 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %add43 = add nsw i32 %18, %50 %cmp44 = icmp sgt i32 %add43, 0 %inc45 = zext i1 %cmp44 to i32 %spec.select = add nuw nsw i32 %count.078, %inc45 %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %exitcond.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count br i1 %exitcond.not, label %while.end47, label %while.cond27.preheader, !llvm.loop !20 while.end47: ; preds = %while.cond27.preheader, %while.cond27.while.end40_crit_edge.us, %middle.block, %while.end, %while.cond24.preheader %count.0.lcssa = phi i32 [ 0, %while.cond24.preheader ], [ 0, %while.end ], [ %30, %middle.block ], [ %spec.select.us, %while.cond27.while.end40_crit_edge.us ], [ %spec.select, %while.cond27.preheader ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !12, !13} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !19} !19 = !{!"llvm.loop.unswitch.partial.disable"} !20 = distinct !{!20, !10, !13, !12}
#include <stdio.h> int main(void){ int N,M,C; int B[20]; int A; int i,j; int siki=0; int ans=0; scanf("%d%d%d",&N,&M,&C); for(i=0;i<M;i++) scanf("%d",&B[i]); for(j=0;j<N;j++){ for(i=0;i<M;i++){ scanf("%d",&A); siki+=A*B[i]; } siki+=C; if(siki>0) ans++; siki=0; } printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253861/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253861/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %M = alloca i32, align 4 %C = alloca i32, align 4 %B = alloca [20 x i32], align 16 %A = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %B) #3 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 %N, ptr noundef nonnull %M, ptr noundef nonnull %C) %0 = load i32, ptr %M, align 4, !tbaa !5 %cmp30 = icmp sgt i32 %0, 0 br i1 %cmp30, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %6, %for.body ] %2 = load i32, ptr %N, align 4, !tbaa !5 %cmp335 = icmp sgt i32 %2, 0 br i1 %cmp335, label %for.cond5.preheader.lr.ph, label %for.end19 for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %3 = icmp sgt i32 %1, 0 br i1 %3, label %for.cond5.preheader, label %for.cond5.preheader.lr.ph.split.us for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph %4 = load i32, ptr %C, align 4, !tbaa !5 %cmp15.us = icmp sgt i32 %4, 0 %5 = select i1 %cmp15.us, i32 %2, i32 0 br label %for.end19 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %B, 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 %6 = load i32, ptr %M, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.end13 %8 = phi i32 [ %14, %for.end13 ], [ %2, %for.cond5.preheader.lr.ph ] %9 = phi i32 [ %15, %for.end13 ], [ %1, %for.cond5.preheader.lr.ph ] %ans.037 = phi i32 [ %spec.select, %for.end13 ], [ 0, %for.cond5.preheader.lr.ph ] %j.036 = phi i32 [ %inc18, %for.end13 ], [ 0, %for.cond5.preheader.lr.ph ] %cmp632 = icmp sgt i32 %9, 0 br i1 %cmp632, label %for.body7, label %for.end13 for.body7: ; preds = %for.cond5.preheader, %for.body7 %indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body7 ], [ 0, %for.cond5.preheader ] %siki.134 = phi i32 [ %add, %for.body7 ], [ 0, %for.cond5.preheader ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A) %10 = load i32, ptr %A, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [20 x i32], ptr %B, i64 0, i64 %indvars.iv41 %11 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %mul = mul nsw i32 %11, %10 %add = add nsw i32 %mul, %siki.134 %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1 %12 = load i32, ptr %M, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp6 = icmp slt i64 %indvars.iv.next42, %13 br i1 %cmp6, label %for.body7, label %for.end13.loopexit, !llvm.loop !11 for.end13.loopexit: ; preds = %for.body7 %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.end13 for.end13: ; preds = %for.end13.loopexit, %for.cond5.preheader %14 = phi i32 [ %8, %for.cond5.preheader ], [ %.pre, %for.end13.loopexit ] %15 = phi i32 [ %9, %for.cond5.preheader ], [ %12, %for.end13.loopexit ] %siki.1.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ %add, %for.end13.loopexit ] %16 = load i32, ptr %C, align 4, !tbaa !5 %add14 = add nsw i32 %16, %siki.1.lcssa %cmp15 = icmp sgt i32 %add14, 0 %inc16 = zext i1 %cmp15 to i32 %spec.select = add nuw nsw i32 %ans.037, %inc16 %inc18 = add nuw nsw i32 %j.036, 1 %cmp3 = icmp slt i32 %inc18, %14 br i1 %cmp3, label %for.cond5.preheader, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.end13, %for.cond5.preheader.lr.ph.split.us, %for.cond2.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %5, %for.cond5.preheader.lr.ph.split.us ], [ %spec.select, %for.end13 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> int main(){ int n,m,c,i,j,kari,kotae=0; scanf("%d%d%d",&n,&m,&c); int a[m],b[m]; for(i=0;i<m;i++){ scanf("%d",&b[i]); } for(j=0;j<n;j++){ kari=0; for(i=0;i<m;i++){ scanf("%d",&a[i]); kari+=a[i]*b[i]; } if(kari+c>0){ kotae++; } } printf("%d",kotae); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %c) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %m, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla1 = alloca i32, i64 %4, align 16 %cmp36 = icmp sgt i32 %3, 0 br i1 %cmp36, label %for.body, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body, %entry %5 = phi i32 [ %3, %entry ], [ %10, %for.body ] %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp441 = icmp sgt i32 %6, 0 br i1 %cmp441, label %for.cond6.preheader.lr.ph, label %for.end24 for.cond6.preheader.lr.ph: ; preds = %for.cond3.preheader %7 = icmp sgt i32 %5, 0 br i1 %7, label %for.cond6.preheader, label %for.cond6.preheader.lr.ph.split.us for.cond6.preheader.lr.ph.split.us: ; preds = %for.cond6.preheader.lr.ph %8 = load i32, ptr %c, align 4, !tbaa !5 %cmp20.us = icmp sgt i32 %8, 0 %9 = select i1 %cmp20.us, i32 %6, i32 0 br label %for.end24 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %m, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond6.preheader: ; preds = %for.cond6.preheader.lr.ph, %for.end18 %12 = phi i32 [ %18, %for.end18 ], [ %6, %for.cond6.preheader.lr.ph ] %13 = phi i32 [ %19, %for.end18 ], [ %5, %for.cond6.preheader.lr.ph ] %j.043 = phi i32 [ %inc23, %for.end18 ], [ 0, %for.cond6.preheader.lr.ph ] %kotae.042 = phi i32 [ %spec.select, %for.end18 ], [ 0, %for.cond6.preheader.lr.ph ] %cmp738 = icmp sgt i32 %13, 0 br i1 %cmp738, label %for.body8, label %for.end18 for.body8: ; preds = %for.cond6.preheader, %for.body8 %indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.body8 ], [ 0, %for.cond6.preheader ] %kari.039 = phi i32 [ %add, %for.body8 ], [ 0, %for.cond6.preheader ] %arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv47 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10) %14 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv47 %15 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %mul = mul nsw i32 %15, %14 %add = add nsw i32 %mul, %kari.039 %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1 %16 = load i32, ptr %m, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp7 = icmp slt i64 %indvars.iv.next48, %17 br i1 %cmp7, label %for.body8, label %for.end18.loopexit, !llvm.loop !11 for.end18.loopexit: ; preds = %for.body8 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.end18 for.end18: ; preds = %for.end18.loopexit, %for.cond6.preheader %18 = phi i32 [ %12, %for.cond6.preheader ], [ %.pre, %for.end18.loopexit ] %19 = phi i32 [ %13, %for.cond6.preheader ], [ %16, %for.end18.loopexit ] %kari.0.lcssa = phi i32 [ 0, %for.cond6.preheader ], [ %add, %for.end18.loopexit ] %20 = load i32, ptr %c, align 4, !tbaa !5 %add19 = add nsw i32 %20, %kari.0.lcssa %cmp20 = icmp sgt i32 %add19, 0 %inc21 = zext i1 %cmp20 to i32 %spec.select = add nuw nsw i32 %kotae.042, %inc21 %inc23 = add nuw nsw i32 %j.043, 1 %cmp4 = icmp slt i32 %inc23, %18 br i1 %cmp4, label %for.cond6.preheader, label %for.end24, !llvm.loop !12 for.end24: ; preds = %for.end18, %for.cond6.preheader.lr.ph.split.us, %for.cond3.preheader %kotae.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ %9, %for.cond6.preheader.lr.ph.split.us ], [ %spec.select, %for.end18 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %kotae.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> int main(void){ // Your code here! int N,M,C,A,B[20],count=0; scanf("%d",&N); scanf("%d",&M); scanf("%d",&C); for(int i = 0; i < M; i++) scanf("%d",&B[i]); for(int i = 0; i < N; i++) { int sum = C; for(int j = 0; j < M; j++) { scanf("%d",&A); sum += A*B[j]; } if(sum > 0) count++; } printf("%d\n",count); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253948/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253948/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %M = alloca i32, align 4 %C = alloca i32, align 4 %A = alloca i32, align 4 %B = alloca [20 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 %M) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %B) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %0 = load i32, ptr %M, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %for.cond5.preheader for.cond5.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %6, %for.body ] %2 = load i32, ptr %N, align 4, !tbaa !5 %cmp637 = icmp sgt i32 %2, 0 br i1 %cmp637, label %for.body8.lr.ph, label %for.cond.cleanup7 for.body8.lr.ph: ; preds = %for.cond5.preheader %3 = icmp sgt i32 %1, 0 br i1 %3, label %for.body8, label %for.body8.lr.ph.split.us for.body8.lr.ph.split.us: ; preds = %for.body8.lr.ph %4 = load i32, ptr %C, align 4, !tbaa !5 %cmp19.us = icmp sgt i32 %4, 0 %5 = select i1 %cmp19.us, i32 %2, i32 0 br label %for.cond.cleanup7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %B, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %M, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.cond.cleanup7: ; preds = %for.cond.cleanup11, %for.body8.lr.ph.split.us, %for.cond5.preheader %count.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ %5, %for.body8.lr.ph.split.us ], [ %spec.select, %for.cond.cleanup11 ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) call void @llvm.lifetime.end.p0(i64 80, 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 %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 for.body8: ; preds = %for.body8.lr.ph, %for.cond.cleanup11 %8 = phi i32 [ %11, %for.cond.cleanup11 ], [ %2, %for.body8.lr.ph ] %9 = phi i32 [ %12, %for.cond.cleanup11 ], [ %1, %for.body8.lr.ph ] %i4.039 = phi i32 [ %inc22, %for.cond.cleanup11 ], [ 0, %for.body8.lr.ph ] %count.038 = phi i32 [ %spec.select, %for.cond.cleanup11 ], [ 0, %for.body8.lr.ph ] %10 = load i32, ptr %C, align 4, !tbaa !5 %cmp1034 = icmp sgt i32 %9, 0 br i1 %cmp1034, label %for.body12, label %for.cond.cleanup11 for.cond.cleanup11.loopexit: ; preds = %for.body12 %.pre = load i32, ptr %N, align 4, !tbaa !5 br label %for.cond.cleanup11 for.cond.cleanup11: ; preds = %for.cond.cleanup11.loopexit, %for.body8 %11 = phi i32 [ %8, %for.body8 ], [ %.pre, %for.cond.cleanup11.loopexit ] %12 = phi i32 [ %9, %for.body8 ], [ %15, %for.cond.cleanup11.loopexit ] %sum.0.lcssa = phi i32 [ %10, %for.body8 ], [ %add, %for.cond.cleanup11.loopexit ] %cmp19 = icmp sgt i32 %sum.0.lcssa, 0 %inc20 = zext i1 %cmp19 to i32 %spec.select = add nuw nsw i32 %count.038, %inc20 %inc22 = add nuw nsw i32 %i4.039, 1 %cmp6 = icmp slt i32 %inc22, %11 br i1 %cmp6, label %for.body8, label %for.cond.cleanup7, !llvm.loop !11 for.body12: ; preds = %for.body8, %for.body12 %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body12 ], [ 0, %for.body8 ] %sum.035 = phi i32 [ %add, %for.body12 ], [ %10, %for.body8 ] %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %13 = load i32, ptr %A, align 4, !tbaa !5 %arrayidx15 = getelementptr inbounds [20 x i32], ptr %B, i64 0, i64 %indvars.iv43 %14 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %mul = mul nsw i32 %14, %13 %add = add nsw i32 %mul, %sum.035 %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %15 = load i32, ptr %M, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp10 = icmp slt i64 %indvars.iv.next44, %16 br i1 %cmp10, label %for.body12, label %for.cond.cleanup11.loopexit, !llvm.loop !13 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void){ int n,m,c; int d = 0; int h = 0; int sum = 0; scanf("%d %d %d", &n, &m, &c); int b[m]; int a[n][m]; for(int i=0;i<m;i++){ scanf("%d", &b[i]); } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ scanf("%d", &a[i][j]); } } for(int i=0;i<n;i++){ sum = 0; for(int j=0;j<m;j++){ sum += a[i][j] * b[j]; if(j == m-1){ sum += c; if(sum > 0){ h++; } } } } printf("%d\n", h); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_253999/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_253999/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %c) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %5 = load i32, ptr %m, align 4, !tbaa !5 %6 = zext i32 %5 to i64 %7 = mul nuw i64 %6, %4 %vla1 = alloca i32, i64 %7, align 16 %cmp67 = icmp sgt i32 %5, 0 br i1 %cmp67, label %for.body, label %for.cond4.preheader for.cond4.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond4.preheader for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit, %entry %8 = phi i32 [ %11, %for.cond4.preheader.loopexit ], [ %5, %entry ] %9 = phi i32 [ %.pre, %for.cond4.preheader.loopexit ], [ %3, %entry ] %cmp571 = icmp sgt i32 %9, 0 %10 = icmp sgt i32 %8, 0 %or.cond = and i1 %cmp571, %10 br i1 %or.cond, label %for.cond8.preheader, label %for.cond.cleanup26 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = load i32, ptr %m, align 4, !tbaa !5 %12 = sext i32 %11 to i64 %cmp = icmp slt i64 %indvars.iv.next, %12 br i1 %cmp, label %for.body, label %for.cond4.preheader.loopexit, !llvm.loop !9 for.cond8.preheader: ; preds = %for.cond4.preheader, %for.cond.cleanup10 %13 = phi i32 [ %26, %for.cond.cleanup10 ], [ %9, %for.cond4.preheader ] %14 = phi i32 [ %27, %for.cond.cleanup10 ], [ %8, %for.cond4.preheader ] %indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.cond.cleanup10 ], [ 0, %for.cond4.preheader ] %cmp969 = icmp sgt i32 %14, 0 br i1 %cmp969, label %for.body11.lr.ph, label %for.cond.cleanup10 for.body11.lr.ph: ; preds = %for.cond8.preheader %15 = mul nuw nsw i64 %indvars.iv90, %6 %arrayidx13 = getelementptr inbounds i32, ptr %vla1, i64 %15 br label %for.body11 for.cond24.preheader: ; preds = %for.cond.cleanup10 %cmp2578 = icmp sgt i32 %26, 0 br i1 %cmp2578, label %for.cond29.preheader.lr.ph, label %for.cond.cleanup26 for.cond29.preheader.lr.ph: ; preds = %for.cond24.preheader %cmp3073 = icmp sgt i32 %27, 0 %16 = load i32, ptr %c, align 4 br i1 %cmp3073, label %for.cond29.preheader.us.preheader, label %for.cond.cleanup26 for.cond29.preheader.us.preheader: ; preds = %for.cond29.preheader.lr.ph %sub = add nsw i32 %27, -1 %17 = zext i32 %sub to i64 %wide.trip.count99 = zext i32 %26 to i64 %wide.trip.count = zext i32 %27 to i64 %xtraiter = and i64 %wide.trip.count, 1 %18 = icmp eq i32 %27, 1 %unroll_iter = and i64 %wide.trip.count, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond29.preheader.us for.cond29.preheader.us: ; preds = %for.cond29.preheader.us.preheader, %for.cond29.for.cond.cleanup31_crit_edge.us %indvars.iv96 = phi i64 [ 0, %for.cond29.preheader.us.preheader ], [ %indvars.iv.next97, %for.cond29.for.cond.cleanup31_crit_edge.us ] %h.079.us = phi i32 [ 0, %for.cond29.preheader.us.preheader ], [ %h.2.us.lcssa, %for.cond29.for.cond.cleanup31_crit_edge.us ] %19 = mul nuw nsw i64 %indvars.iv96, %6 %arrayidx34.us = getelementptr inbounds i32, ptr %vla1, i64 %19 br i1 %18, label %for.cond29.for.cond.cleanup31_crit_edge.us.unr-lcssa, label %for.body32.us for.body32.us: ; preds = %for.cond29.preheader.us, %for.body32.us %indvars.iv93 = phi i64 [ %indvars.iv.next94.1, %for.body32.us ], [ 0, %for.cond29.preheader.us ] %h.175.us = phi i32 [ %h.2.us.1, %for.body32.us ], [ %h.079.us, %for.cond29.preheader.us ] %sum.074.us = phi i32 [ %sum.1.us.1, %for.body32.us ], [ 0, %for.cond29.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.body32.us ], [ 0, %for.cond29.preheader.us ] %arrayidx36.us = getelementptr inbounds i32, ptr %arrayidx34.us, i64 %indvars.iv93 %20 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %arrayidx38.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv93 %21 = load i32, ptr %arrayidx38.us, align 8, !tbaa !5 %mul.us = mul nsw i32 %21, %20 %add.us = add nsw i32 %mul.us, %sum.074.us %cmp39.us = icmp eq i64 %indvars.iv93, %17 %add40.us = add nsw i32 %16, %add.us %cmp41.us = icmp sgt i32 %add40.us, 0 %sum.1.us = select i1 %cmp39.us, i32 %add40.us, i32 %add.us %narrow = select i1 %cmp39.us, i1 %cmp41.us, i1 false %spec.select.us = zext i1 %narrow to i32 %h.2.us = add nsw i32 %h.175.us, %spec.select.us %indvars.iv.next94 = or i64 %indvars.iv93, 1 %arrayidx36.us.1 = getelementptr inbounds i32, ptr %arrayidx34.us, i64 %indvars.iv.next94 %22 = load i32, ptr %arrayidx36.us.1, align 4, !tbaa !5 %arrayidx38.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next94 %23 = load i32, ptr %arrayidx38.us.1, align 4, !tbaa !5 %mul.us.1 = mul nsw i32 %23, %22 %add.us.1 = add nsw i32 %mul.us.1, %sum.1.us %cmp39.us.1 = icmp eq i64 %indvars.iv.next94, %17 %add40.us.1 = add nsw i32 %16, %add.us.1 %cmp41.us.1 = icmp sgt i32 %add40.us.1, 0 %sum.1.us.1 = select i1 %cmp39.us.1, i32 %add40.us.1, i32 %add.us.1 %narrow.1 = select i1 %cmp39.us.1, i1 %cmp41.us.1, i1 false %spec.select.us.1 = zext i1 %narrow.1 to i32 %h.2.us.1 = add nsw i32 %h.2.us, %spec.select.us.1 %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 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.cond29.for.cond.cleanup31_crit_edge.us.unr-lcssa, label %for.body32.us, !llvm.loop !11 for.cond29.for.cond.cleanup31_crit_edge.us.unr-lcssa: ; preds = %for.body32.us, %for.cond29.preheader.us %h.2.us.lcssa.ph = phi i32 [ undef, %for.cond29.preheader.us ], [ %h.2.us.1, %for.body32.us ] %indvars.iv93.unr = phi i64 [ 0, %for.cond29.preheader.us ], [ %indvars.iv.next94.1, %for.body32.us ] %h.175.us.unr = phi i32 [ %h.079.us, %for.cond29.preheader.us ], [ %h.2.us.1, %for.body32.us ] %sum.074.us.unr = phi i32 [ 0, %for.cond29.preheader.us ], [ %sum.1.us.1, %for.body32.us ] br i1 %lcmp.mod.not, label %for.cond29.for.cond.cleanup31_crit_edge.us, label %for.body32.us.epil for.body32.us.epil: ; preds = %for.cond29.for.cond.cleanup31_crit_edge.us.unr-lcssa %arrayidx36.us.epil = getelementptr inbounds i32, ptr %arrayidx34.us, i64 %indvars.iv93.unr %24 = load i32, ptr %arrayidx36.us.epil, align 4, !tbaa !5 %arrayidx38.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv93.unr %25 = load i32, ptr %arrayidx38.us.epil, align 4, !tbaa !5 %mul.us.epil = mul nsw i32 %25, %24 %add.us.epil = add nsw i32 %mul.us.epil, %sum.074.us.unr %cmp39.us.epil = icmp eq i64 %indvars.iv93.unr, %17 %add40.us.epil = add nsw i32 %16, %add.us.epil %cmp41.us.epil = icmp sgt i32 %add40.us.epil, 0 %narrow.epil = select i1 %cmp39.us.epil, i1 %cmp41.us.epil, i1 false %spec.select.us.epil = zext i1 %narrow.epil to i32 %h.2.us.epil = add nsw i32 %h.175.us.unr, %spec.select.us.epil br label %for.cond29.for.cond.cleanup31_crit_edge.us for.cond29.for.cond.cleanup31_crit_edge.us: ; preds = %for.cond29.for.cond.cleanup31_crit_edge.us.unr-lcssa, %for.body32.us.epil %h.2.us.lcssa = phi i32 [ %h.2.us.lcssa.ph, %for.cond29.for.cond.cleanup31_crit_edge.us.unr-lcssa ], [ %h.2.us.epil, %for.body32.us.epil ] %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99 br i1 %exitcond100.not, label %for.cond.cleanup26, label %for.cond29.preheader.us, !llvm.loop !12 for.cond.cleanup10.loopexit: ; preds = %for.body11 %.pre101 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond.cleanup10 for.cond.cleanup10: ; preds = %for.cond.cleanup10.loopexit, %for.cond8.preheader %26 = phi i32 [ %.pre101, %for.cond.cleanup10.loopexit ], [ %13, %for.cond8.preheader ] %27 = phi i32 [ %29, %for.cond.cleanup10.loopexit ], [ %14, %for.cond8.preheader ] %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %28 = sext i32 %26 to i64 %cmp5 = icmp slt i64 %indvars.iv.next91, %28 br i1 %cmp5, label %for.cond8.preheader, label %for.cond24.preheader, !llvm.loop !13 for.body11: ; preds = %for.body11.lr.ph, %for.body11 %indvars.iv87 = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next88, %for.body11 ] %arrayidx15 = getelementptr inbounds i32, ptr %arrayidx13, i64 %indvars.iv87 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx15) %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %29 = load i32, ptr %m, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp9 = icmp slt i64 %indvars.iv.next88, %30 br i1 %cmp9, label %for.body11, label %for.cond.cleanup10.loopexit, !llvm.loop !15 for.cond.cleanup26: ; preds = %for.cond29.for.cond.cleanup31_crit_edge.us, %for.cond4.preheader, %for.cond29.preheader.lr.ph, %for.cond24.preheader %h.0.lcssa = phi i32 [ 0, %for.cond24.preheader ], [ 0, %for.cond29.preheader.lr.ph ], [ 0, %for.cond4.preheader ], [ %h.2.us.lcssa, %for.cond29.for.cond.cleanup31_crit_edge.us ] %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %h.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.unswitch.partial.disable"} !15 = distinct !{!15, !10}
#include <stdio.h> int main(void) { int n, m, c; int b[20]; int cnt = 0; int i, j; scanf("%d %d %d", &n, &m, &c); for(i=0; i<m; i++) scanf("%d", &b[i]); for(i=0; i<n; i++){ int sum = 0; for(j=0; j<m; j++){ int a; scanf("%d", &a); sum += b[j]*a; } if(sum+c > 0) cnt++; } printf("%d\n", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254040/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254040/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %c = alloca i32, align 4 %b = alloca [20 x i32], align 16 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %c) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %6, %for.body ] %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp334 = icmp sgt i32 %2, 0 br i1 %cmp334, label %for.cond5.preheader.lr.ph, label %for.end19 for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader %3 = icmp sgt i32 %1, 0 br i1 %3, label %for.cond5.preheader, label %for.cond5.preheader.lr.ph.split.us for.cond5.preheader.lr.ph.split.us: ; preds = %for.cond5.preheader.lr.ph %4 = load i32, ptr %c, align 4, !tbaa !5 %cmp15.us = icmp sgt i32 %4, 0 %5 = select i1 %cmp15.us, i32 %2, i32 0 br label %for.end19 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %b, 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 %6 = load i32, ptr %m, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.end13 %8 = phi i32 [ %14, %for.end13 ], [ %2, %for.cond5.preheader.lr.ph ] %9 = phi i32 [ %15, %for.end13 ], [ %1, %for.cond5.preheader.lr.ph ] %i.136 = phi i32 [ %inc18, %for.end13 ], [ 0, %for.cond5.preheader.lr.ph ] %cnt.035 = phi i32 [ %spec.select, %for.end13 ], [ 0, %for.cond5.preheader.lr.ph ] %cmp631 = icmp sgt i32 %9, 0 br i1 %cmp631, label %for.body7, label %for.end13 for.body7: ; preds = %for.cond5.preheader, %for.body7 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body7 ], [ 0, %for.cond5.preheader ] %sum.033 = phi i32 [ %add, %for.body7 ], [ 0, %for.cond5.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %arrayidx10 = getelementptr inbounds [20 x i32], ptr %b, i64 0, i64 %indvars.iv40 %10 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %11 = load i32, ptr %a, align 4, !tbaa !5 %mul = mul nsw i32 %11, %10 %add = add nsw i32 %mul, %sum.033 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %12 = load i32, ptr %m, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp6 = icmp slt i64 %indvars.iv.next41, %13 br i1 %cmp6, label %for.body7, label %for.end13.loopexit, !llvm.loop !11 for.end13.loopexit: ; preds = %for.body7 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.end13 for.end13: ; preds = %for.end13.loopexit, %for.cond5.preheader %14 = phi i32 [ %8, %for.cond5.preheader ], [ %.pre, %for.end13.loopexit ] %15 = phi i32 [ %9, %for.cond5.preheader ], [ %12, %for.end13.loopexit ] %sum.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ %add, %for.end13.loopexit ] %16 = load i32, ptr %c, align 4, !tbaa !5 %add14 = add nsw i32 %16, %sum.0.lcssa %cmp15 = icmp sgt i32 %add14, 0 %inc16 = zext i1 %cmp15 to i32 %spec.select = add nuw nsw i32 %cnt.035, %inc16 %inc18 = add nuw nsw i32 %i.136, 1 %cmp3 = icmp slt i32 %inc18, %14 br i1 %cmp3, label %for.cond5.preheader, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.end13, %for.cond5.preheader.lr.ph.split.us, %for.cond2.preheader %cnt.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ %5, %for.cond5.preheader.lr.ph.split.us ], [ %spec.select, %for.end13 ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> int main(void) { int N; int i; int a = 0, b = 0, ab = 0, ba = 0; int kitaeri; if (scanf("%d", &N) != 1) return 1; for (i = 0; i < N; i++) { char s[16]; int j; if (scanf("%15s", s) != 1) return 1; if (s[0] == 'B') b++; for (j = 0; s[j] != '\0'; j++) { if (s[j] == 'A' && s[j + 1] == 'B') ab++; if (s[j] == 'A' && s[j + 1] == '\0') { a++; if (s[0] == 'B') ba++; } } } kitaeri = a <= b ? a : b; printf("%d\n", ab + (a == ba && b == ba && ba > 0 ? kitaeri - 1 : kitaeri)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254084/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254084/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%15s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %s = alloca [16 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp.not = icmp eq i32 %call, 1 br i1 %cmp.not, label %for.cond.preheader, label %cleanup72 for.cond.preheader: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp1117 = icmp sgt i32 %0, 0 br i1 %cmp1117, label %for.body, label %land.lhs.true60 for.body: ; preds = %for.cond.preheader, %cleanup %ba.0122 = phi i32 [ %ba.1.ph, %cleanup ], [ 0, %for.cond.preheader ] %ab.0121 = phi i32 [ %ab.1.ph145, %cleanup ], [ 0, %for.cond.preheader ] %b.0120 = phi i32 [ %spec.select, %cleanup ], [ 0, %for.cond.preheader ] %a.0119 = phi i32 [ %a.1.ph, %cleanup ], [ 0, %for.cond.preheader ] %i.0118 = phi i32 [ %inc54, %cleanup ], [ 0, %for.cond.preheader ] call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %s) #4 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s) %cmp3.not = icmp eq i32 %call2, 1 br i1 %cmp3.not, label %if.end5, label %cleanup.thread cleanup.thread: ; preds = %for.body call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %s) #4 br label %cleanup72 if.end5: ; preds = %for.body %1 = load i8, ptr %s, align 16, !tbaa !9 %cmp6 = icmp eq i8 %1, 66 %inc = zext i1 %cmp6 to i32 br label %for.cond10.outer for.cond10.outer: ; preds = %if.then41, %if.end5 %.ph = phi i8 [ 0, %if.then41 ], [ %1, %if.end5 ] %indvars.iv.ph = phi i64 [ %3, %if.then41 ], [ 0, %if.end5 ] %a.1.ph = phi i32 [ %inc42, %if.then41 ], [ %a.0119, %if.end5 ] %ab.1.ph = phi i32 [ %spec.select97, %if.then41 ], [ %ab.0121, %if.end5 ] %ba.1.ph = phi i32 [ %spec.select98, %if.then41 ], [ %ba.0122, %if.end5 ] br label %for.cond10.outer142 for.cond10.outer142: ; preds = %for.cond10.outer, %land.lhs.true34 %.ph143 = phi i8 [ %.ph, %for.cond10.outer ], [ %4, %land.lhs.true34 ] %indvars.iv.ph144 = phi i64 [ %indvars.iv.ph, %for.cond10.outer ], [ %3, %land.lhs.true34 ] %ab.1.ph145 = phi i32 [ %ab.1.ph, %for.cond10.outer ], [ %spec.select97, %land.lhs.true34 ] br label %for.cond10 for.cond10: ; preds = %for.cond10.outer142, %for.cond10.for.inc_crit_edge %2 = phi i8 [ %.pre.pre, %for.cond10.for.inc_crit_edge ], [ %.ph143, %for.cond10.outer142 ] %indvars.iv = phi i64 [ %.pre129, %for.cond10.for.inc_crit_edge ], [ %indvars.iv.ph144, %for.cond10.outer142 ] switch i8 %2, label %for.cond10.for.inc_crit_edge [ i8 0, label %cleanup i8 65, label %land.lhs.true34 ] for.cond10.for.inc_crit_edge: ; preds = %for.cond10 %.pre129 = add nuw i64 %indvars.iv, 1 %arrayidx11.phi.trans.insert.phi.trans.insert = getelementptr inbounds [16 x i8], ptr %s, i64 0, i64 %.pre129 %.pre.pre = load i8, ptr %arrayidx11.phi.trans.insert.phi.trans.insert, align 1, !tbaa !9 br label %for.cond10, !llvm.loop !10 land.lhs.true34: ; preds = %for.cond10 %3 = add nuw i64 %indvars.iv, 1 %arrayidx22 = getelementptr inbounds [16 x i8], ptr %s, i64 0, i64 %3 %4 = load i8, ptr %arrayidx22, align 1, !tbaa !9 %cmp24 = icmp eq i8 %4, 66 %inc27 = zext i1 %cmp24 to i32 %spec.select97 = add nsw i32 %ab.1.ph145, %inc27 %cmp39 = icmp eq i8 %4, 0 br i1 %cmp39, label %if.then41, label %for.cond10.outer142, !llvm.loop !10 if.then41: ; preds = %land.lhs.true34 %inc42 = add nsw i32 %a.1.ph, 1 %spec.select98 = add nsw i32 %ba.1.ph, %inc br label %for.cond10.outer, !llvm.loop !10 cleanup: ; preds = %for.cond10 %spec.select = add nuw nsw i32 %b.0120, %inc call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %s) #4 %inc54 = add nuw nsw i32 %i.0118, 1 %5 = load i32, ptr %N, align 4, !tbaa !5 %cmp1 = icmp slt i32 %inc54, %5 br i1 %cmp1, label %for.body, label %for.end55, !llvm.loop !12 for.end55: ; preds = %cleanup %cond = call i32 @llvm.smin.i32(i32 %a.1.ph, i32 %spec.select) %cmp58 = icmp eq i32 %a.1.ph, %ba.1.ph br i1 %cmp58, label %land.lhs.true60, label %cond.end68 land.lhs.true60: ; preds = %for.cond.preheader, %for.end55 %cond141 = phi i32 [ %cond, %for.end55 ], [ 0, %for.cond.preheader ] %ab.0.lcssa140 = phi i32 [ %ab.1.ph145, %for.end55 ], [ 0, %for.cond.preheader ] %b.0.lcssa138 = phi i32 [ %spec.select, %for.end55 ], [ 0, %for.cond.preheader ] %a.0.lcssa137 = phi i32 [ %a.1.ph, %for.end55 ], [ 0, %for.cond.preheader ] %cmp61 = icmp eq i32 %b.0.lcssa138, %a.0.lcssa137 %cmp64 = icmp sgt i32 %a.0.lcssa137, 0 %or.cond = and i1 %cmp61, %cmp64 %sub = sext i1 %or.cond to i32 %spec.select99 = add nsw i32 %cond141, %sub br label %cond.end68 cond.end68: ; preds = %land.lhs.true60, %for.end55 %ab.0.lcssa139 = phi i32 [ %ab.1.ph145, %for.end55 ], [ %ab.0.lcssa140, %land.lhs.true60 ] %cond69 = phi i32 [ %cond, %for.end55 ], [ %spec.select99, %land.lhs.true60 ] %add70 = add nsw i32 %cond69, %ab.0.lcssa139 %call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add70) br label %cleanup72 cleanup72: ; preds = %cleanup.thread, %entry, %cond.end68 %retval.2 = phi i32 [ 0, %cond.end68 ], [ 1, %entry ], [ 1, %cleanup.thread ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 %retval.2 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11}
#include <stdio.h> #include <string.h> int check_ab(char *s, int len) { int count = 0; int flag = 0; for (int i=0; i<len; i++) { if (s[i] == 'A') flag = 1; else if (s[i] == 'B') { if (flag) { count++; flag = 0; } } else flag = 0; } return count; } int main() { int n = 0; scanf("%d\n", &n); int ans = 0; int count1=0, count2=0, count3=0; for (int i=0; i<n; i++) { char s[12]; int len = 0; fgets(s, 12, stdin); if (s[strlen(s)-1] != '\n') len = strlen(s); else len = strlen(s) - 1; ans += check_ab(s, len); if (s[0] == 'B') { if (s[len-1] == 'A') count1++; else count3++; } else if (s[len-1] == 'A') count2++; } int a = count1 + count2; int b = count1 + count3; if (a > b) printf("%d\n", ans + b); else if (b > a) printf("%d\n", ans + a); else { if (a == 0) printf("%d\n", ans); else if (count2 == 0) printf("%d\n", count1 - 1 + ans); else printf("%d\n", ans + a ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254127/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254127/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @check_ab(ptr nocapture noundef readonly %s, i32 noundef %len) local_unnamed_addr #0 { entry: %cmp19 = icmp sgt i32 %len, 0 br i1 %cmp19, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %len to i64 %xtraiter = and i64 %wide.trip.count, 1 %0 = icmp eq i32 %len, 1 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader %count.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %count.1.1, %for.inc.1 ] %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ] %flag.021.unr = phi i32 [ 0, %for.body.preheader ], [ %flag.1.1, %for.inc.1 ] %count.020.unr = phi i32 [ 0, %for.body.preheader ], [ %count.1.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.unr %1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5 %cond = icmp eq i8 %1, 66 %spec.select.epil = add nsw i32 %count.020.unr, %flag.021.unr %spec.select25 = select i1 %cond, i32 %spec.select.epil, i32 %count.020.unr br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %spec.select25, %for.body.epil ] ret i32 %count.0.lcssa for.body: ; preds = %for.inc.1, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ] %flag.021 = phi i32 [ 0, %for.body.preheader.new ], [ %flag.1.1, %for.inc.1 ] %count.020 = phi i32 [ 0, %for.body.preheader.new ], [ %count.1.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 switch i8 %2, label %if.else10 [ i8 65, label %for.inc i8 66, label %if.then8 ] if.then8: ; preds = %for.body %tobool.not = icmp ne i32 %flag.021, 0 %inc = zext i1 %tobool.not to i32 %spec.select = add nsw i32 %count.020, %inc br label %for.inc if.else10: ; preds = %for.body br label %for.inc for.inc: ; preds = %if.then8, %for.body, %if.else10 %count.1 = phi i32 [ %count.020, %if.else10 ], [ %count.020, %for.body ], [ %spec.select, %if.then8 ] %tobool.not.1 = phi i32 [ 0, %if.else10 ], [ 1, %for.body ], [ 0, %if.then8 ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next %3 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %3, label %if.else10.1 [ i8 65, label %for.inc.1 i8 66, label %if.then8.1 ] if.then8.1: ; preds = %for.inc %spec.select.1 = add nsw i32 %count.1, %tobool.not.1 br label %for.inc.1 if.else10.1: ; preds = %for.inc br label %for.inc.1 for.inc.1: ; preds = %if.else10.1, %if.then8.1, %for.inc %count.1.1 = phi i32 [ %count.1, %if.else10.1 ], [ %count.1, %for.inc ], [ %spec.select.1, %if.then8.1 ] %flag.1.1 = phi i32 [ 0, %if.else10.1 ], [ 1, %for.inc ], [ 0, %if.then8.1 ] %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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !8 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i32, align 4 %s = alloca [12 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 store i32 0, ptr %n, align 4, !tbaa !10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %cmp94 = icmp sgt i32 %0, 0 br i1 %cmp94, label %for.body, label %if.end72 for.cond.cleanup: ; preds = %if.end39 %add41 = add nsw i32 %count1.1, %count2.1 %cmp43 = icmp sgt i32 %count2.1, %count3.1 br i1 %cmp43, label %if.then45, label %if.else48 for.body: ; preds = %entry, %if.end39 %ans.099 = phi i32 [ %add, %if.end39 ], [ 0, %entry ] %count1.098 = phi i32 [ %count1.1, %if.end39 ], [ 0, %entry ] %i.097 = phi i32 [ %inc40, %if.end39 ], [ 0, %entry ] %count3.096 = phi i32 [ %count3.1, %if.end39 ], [ 0, %entry ] %count2.095 = phi i32 [ %count2.1, %if.end39 ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #5 %1 = load ptr, ptr @stdin, align 8, !tbaa !12 %call1 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 12, ptr noundef %1) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %sub = add i64 %call3, -1 %arrayidx = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %sub %2 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp4.not = icmp eq i8 %2, 10 %sub.call3 = select i1 %cmp4.not, i64 %sub, i64 %call3 %len.0 = trunc i64 %sub.call3 to i32 %cmp19.i = icmp sgt i32 %len.0, 0 br i1 %cmp19.i, label %for.body.preheader.i, label %check_ab.exit for.body.preheader.i: ; preds = %for.body %wide.trip.count.i = and i64 %sub.call3, 4294967295 %xtraiter = and i64 %sub.call3, 1 %3 = icmp eq i64 %wide.trip.count.i, 1 br i1 %3, label %check_ab.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = sub nsw i64 %wide.trip.count.i, %xtraiter br label %for.body.i for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %flag.021.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %flag.1.i.1, %for.inc.i.1 ] %count.020.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %count.1.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 i8, ptr %s, i64 %indvars.iv.i %4 = load i8, ptr %arrayidx.i, align 1, !tbaa !5 switch i8 %4, label %if.else10.i [ i8 65, label %for.inc.i i8 66, label %if.then8.i ] if.then8.i: ; preds = %for.body.i %tobool.not.i = icmp ne i32 %flag.021.i, 0 %inc.i = zext i1 %tobool.not.i to i32 %spec.select.i = add nsw i32 %count.020.i, %inc.i br label %for.inc.i if.else10.i: ; preds = %for.body.i br label %for.inc.i for.inc.i: ; preds = %if.else10.i, %if.then8.i, %for.body.i %count.1.i = phi i32 [ %count.020.i, %if.else10.i ], [ %count.020.i, %for.body.i ], [ %spec.select.i, %if.then8.i ] %tobool.not.i.1 = phi i32 [ 0, %if.else10.i ], [ 1, %for.body.i ], [ 0, %if.then8.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx.i.1 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next.i %5 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5 switch i8 %5, label %if.else10.i.1 [ i8 65, label %for.inc.i.1 i8 66, label %if.then8.i.1 ] if.then8.i.1: ; preds = %for.inc.i %spec.select.i.1 = add nsw i32 %count.1.i, %tobool.not.i.1 br label %for.inc.i.1 if.else10.i.1: ; preds = %for.inc.i br label %for.inc.i.1 for.inc.i.1: ; preds = %if.else10.i.1, %if.then8.i.1, %for.inc.i %count.1.i.1 = phi i32 [ %count.1.i, %if.else10.i.1 ], [ %count.1.i, %for.inc.i ], [ %spec.select.i.1, %if.then8.i.1 ] %flag.1.i.1 = phi i32 [ 0, %if.else10.i.1 ], [ 1, %for.inc.i ], [ 0, %if.then8.i.1 ] %indvars.iv.next.i.1 = add nuw 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 %check_ab.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8 check_ab.exit.loopexit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.preheader.i %count.1.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %count.1.i.1, %for.inc.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ] %flag.021.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %flag.1.i.1, %for.inc.i.1 ] %count.020.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %count.1.i.1, %for.inc.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %check_ab.exit, label %for.body.i.epil for.body.i.epil: ; preds = %check_ab.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i.unr %6 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5 %cond = icmp eq i8 %6, 66 br i1 %cond, label %if.then8.i.epil, label %check_ab.exit if.then8.i.epil: ; preds = %for.body.i.epil %tobool.not.i.epil = icmp ne i32 %flag.021.i.unr, 0 %inc.i.epil = zext i1 %tobool.not.i.epil to i32 %spec.select.i.epil = add nsw i32 %count.020.i.unr, %inc.i.epil br label %check_ab.exit check_ab.exit: ; preds = %for.body.i.epil, %check_ab.exit.loopexit.unr-lcssa, %if.then8.i.epil, %for.body %count.0.lcssa.i = phi i32 [ 0, %for.body ], [ %count.1.i.lcssa.ph, %check_ab.exit.loopexit.unr-lcssa ], [ %spec.select.i.epil, %if.then8.i.epil ], [ %count.020.i.unr, %for.body.i.epil ] %add = add nsw i32 %count.0.lcssa.i, %ans.099 %7 = load i8, ptr %s, align 1, !tbaa !5 %cmp17 = icmp eq i8 %7, 66 %sub20 = shl i64 %sub.call3, 32 %sext93 = add i64 %sub20, -4294967296 %idxprom = ashr exact i64 %sext93, 32 %arrayidx21 = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %idxprom %8 = load i8, ptr %arrayidx21, align 1, !tbaa !5 %cmp23 = icmp eq i8 %8, 65 br i1 %cmp17, label %if.then19, label %if.else29 if.then19: ; preds = %check_ab.exit br i1 %cmp23, label %if.then25, label %if.else26 if.then25: ; preds = %if.then19 %inc = add nsw i32 %count1.098, 1 br label %if.end39 if.else26: ; preds = %if.then19 %inc27 = add nsw i32 %count3.096, 1 br label %if.end39 if.else29: ; preds = %check_ab.exit %inc37 = zext i1 %cmp23 to i32 %spec.select = add nsw i32 %count2.095, %inc37 br label %if.end39 if.end39: ; preds = %if.else29, %if.then25, %if.else26 %count2.1 = phi i32 [ %count2.095, %if.then25 ], [ %count2.095, %if.else26 ], [ %spec.select, %if.else29 ] %count3.1 = phi i32 [ %count3.096, %if.then25 ], [ %inc27, %if.else26 ], [ %count3.096, %if.else29 ] %count1.1 = phi i32 [ %inc, %if.then25 ], [ %count1.098, %if.else26 ], [ %count1.098, %if.else29 ] call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #5 %inc40 = add nuw nsw i32 %i.097, 1 %9 = load i32, ptr %n, align 4, !tbaa !10 %cmp = icmp slt i32 %inc40, %9 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !14 if.then45: ; preds = %for.cond.cleanup %add42 = add i32 %add, %count1.1 %add46 = add i32 %add42, %count3.1 br label %if.end72 if.else48: ; preds = %for.cond.cleanup %cmp49 = icmp sgt i32 %count3.1, %count2.1 br i1 %cmp49, label %if.then51, label %if.else54 if.then51: ; preds = %if.else48 %add52 = add nsw i32 %add, %add41 br label %if.end72 if.else54: ; preds = %if.else48 %cmp55 = icmp eq i32 %add41, 0 br i1 %cmp55, label %if.end72, label %if.else59 if.else59: ; preds = %if.else54 %cmp60 = icmp eq i32 %count2.1, 0 br i1 %cmp60, label %if.then62, label %if.else66 if.then62: ; preds = %if.else59 %sub63 = add i32 %add, %count1.1 %add64 = add i32 %sub63, -1 br label %if.end72 if.else66: ; preds = %if.else59 %add67 = add nsw i32 %add, %add41 br label %if.end72 if.end72: ; preds = %if.else54, %entry, %if.then51, %if.then62, %if.else66, %if.then45 %add52.sink = phi i32 [ %add52, %if.then51 ], [ %add64, %if.then62 ], [ %add67, %if.else66 ], [ %add46, %if.then45 ], [ %add, %if.else54 ], [ 0, %entry ] %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add52.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree 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 = !{!11, !11, i64 0} !11 = !{!"int", !6, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"any pointer", !6, i64 0} !14 = distinct !{!14, !9}
#include <stdio.h> #include <stdlib.h> typedef struct {int id, solved, penalty;} Team; int compare(const void *a, const void *b) { const Team ta = *(Team *)a, tb = *(Team *)b; if (ta.solved != tb.solved) return tb.solved - ta.solved; if (ta.penalty != tb.penalty) return ta.penalty - tb.penalty; return ta.id - tb.id; } int main(void) { int i; int t, p, r; while (scanf("%d %d %d", &t, &p, &r), t) { Team team[50] = {0}; int wrong[50][10] = {0}; for (i = 0; i < t; i++) team[i].id = i + 1; for (i = 0; i < r; i++) { int tid, pid, t; char mes[10]; scanf("%d %d %d %s", &tid, &pid, &t, mes); tid--; pid--; if (mes[0] == 'C') { team[tid].solved++; team[tid].penalty += wrong[tid][pid] * 1200 + t; } else wrong[tid][pid]++; } qsort(team, t, sizeof(Team), &compare); for (i = 0; i < t; i++) printf("%d %d %d\n", team[i].id, team[i].solved, team[i].penalty); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254185/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254185/source.c" target datalayout = "e-m:e-p270: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.Team = type { i32, i32, i32 } @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %s\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %ta.sroa.0.0.copyload = load i32, ptr %a, align 4, !tbaa.struct !5 %ta.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %a, i64 4 %ta.sroa.4.0.copyload = load i32, ptr %ta.sroa.4.0..sroa_idx, align 4, !tbaa.struct !10 %ta.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %a, i64 8 %ta.sroa.6.0.copyload = load i32, ptr %ta.sroa.6.0..sroa_idx, align 4, !tbaa.struct !11 %tb.sroa.0.0.copyload = load i32, ptr %b, align 4, !tbaa.struct !5 %tb.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %b, i64 4 %tb.sroa.4.0.copyload = load i32, ptr %tb.sroa.4.0..sroa_idx, align 4, !tbaa.struct !10 %tb.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %b, i64 8 %tb.sroa.6.0.copyload = load i32, ptr %tb.sroa.6.0..sroa_idx, align 4, !tbaa.struct !11 %cmp.not = icmp eq i32 %ta.sroa.4.0.copyload, %tb.sroa.4.0.copyload br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %sub = sub nsw i32 %tb.sroa.4.0.copyload, %ta.sroa.4.0.copyload br label %cleanup if.end: ; preds = %entry %cmp5.not = icmp eq i32 %ta.sroa.6.0.copyload, %tb.sroa.6.0.copyload br i1 %cmp5.not, label %if.end10, label %if.then6 if.then6: ; preds = %if.end %sub9 = sub nsw i32 %ta.sroa.6.0.copyload, %tb.sroa.6.0.copyload br label %cleanup if.end10: ; preds = %if.end %sub12 = sub nsw i32 %ta.sroa.0.0.copyload, %tb.sroa.0.0.copyload br label %cleanup cleanup: ; preds = %if.end10, %if.then6, %if.then %retval.0 = phi i32 [ %sub, %if.then ], [ %sub9, %if.then6 ], [ %sub12, %if.end10 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %t = alloca i32, align 4 %p = alloca i32, align 4 %r = alloca i32, align 4 %team = alloca [50 x %struct.Team], align 16 %wrong = alloca [50 x [10 x i32]], align 16 %tid = alloca i32, align 4 %pid = alloca i32, align 4 %t4 = alloca i32, align 4 %mes = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6 %call64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %p, ptr noundef nonnull %r) %0 = load i32, ptr %t, align 4, !tbaa !6 %tobool.not65 = icmp eq i32 %0, 0 br i1 %tobool.not65, label %while.end, label %while.body while.body: ; preds = %entry, %for.end47 %1 = phi i32 [ %25, %for.end47 ], [ %0, %entry ] call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %team) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(600) %team, i8 0, i64 600, i1 false) call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %wrong) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000) %wrong, i8 0, i64 2000, i1 false) %cmp58 = icmp sgt i32 %1, 0 br i1 %cmp58, label %for.body.preheader, label %for.cond1.preheader for.body.preheader: ; preds = %while.body %wide.trip.count = zext i32 %1 to i64 %xtraiter = and i64 %wide.trip.count, 3 %2 = icmp ult i32 %1, 4 br i1 %2, label %for.cond1.preheader.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body for.cond1.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond1.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond1.preheader.loopexit.unr-lcssa, %for.body.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond1.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond1.preheader.loopexit.unr-lcssa ] %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %arrayidx.epil = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv.epil %3 = trunc i64 %indvars.iv.next.epil to i32 store i32 %3, ptr %arrayidx.epil, align 4, !tbaa !12 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond1.preheader, label %for.body.epil, !llvm.loop !14 for.cond1.preheader: ; preds = %for.cond1.preheader.loopexit.unr-lcssa, %for.body.epil, %while.body %4 = load i32, ptr %r, align 4, !tbaa !6 %cmp260 = icmp sgt i32 %4, 0 br i1 %cmp260, label %for.body3, label %for.end28 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv %5 = trunc i64 %indvars.iv.next to i32 store i32 %5, ptr %arrayidx, align 16, !tbaa !12 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx.1 = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv.next %6 = trunc i64 %indvars.iv.next.1 to i32 store i32 %6, ptr %arrayidx.1, align 4, !tbaa !12 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx.2 = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv.next.1 %7 = trunc i64 %indvars.iv.next.2 to i32 store i32 %7, ptr %arrayidx.2, align 8, !tbaa !12 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %arrayidx.3 = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv.next.2 %8 = trunc i64 %indvars.iv.next.3 to i32 store i32 %8, ptr %arrayidx.3, align 4, !tbaa !12 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond1.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !16 for.body3: ; preds = %for.cond1.preheader, %if.end %i.161 = phi i32 [ %inc27, %if.end ], [ 0, %for.cond1.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tid) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pid) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t4) #6 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %mes) #6 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tid, ptr noundef nonnull %pid, ptr noundef nonnull %t4, ptr noundef nonnull %mes) %9 = load i32, ptr %tid, align 4, !tbaa !6 %dec = add nsw i32 %9, -1 %10 = load i32, ptr %pid, align 4, !tbaa !6 %dec6 = add nsw i32 %10, -1 %11 = load i8, ptr %mes, align 1, !tbaa !18 %cmp8 = icmp eq i8 %11, 67 %idxprom10 = sext i32 %dec to i64 br i1 %cmp8, label %if.then, label %if.else if.then: ; preds = %for.body3 %solved = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %idxprom10, i32 1 %12 = load i32, ptr %solved, align 4, !tbaa !19 %inc12 = add nsw i32 %12, 1 store i32 %inc12, ptr %solved, align 4, !tbaa !19 %idxprom15 = sext i32 %dec6 to i64 %arrayidx16 = getelementptr inbounds [50 x [10 x i32]], ptr %wrong, i64 0, i64 %idxprom10, i64 %idxprom15 %13 = load i32, ptr %arrayidx16, align 4, !tbaa !6 %mul = mul nsw i32 %13, 1200 %14 = load i32, ptr %t4, align 4, !tbaa !6 %add17 = add nsw i32 %mul, %14 %penalty = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %idxprom10, i32 2 %15 = load i32, ptr %penalty, align 4, !tbaa !20 br label %if.end if.else: ; preds = %for.body3 %idxprom23 = sext i32 %dec6 to i64 %arrayidx24 = getelementptr inbounds [50 x [10 x i32]], ptr %wrong, i64 0, i64 %idxprom10, i64 %idxprom23 %16 = load i32, ptr %arrayidx24, align 4, !tbaa !6 br label %if.end if.end: ; preds = %if.else, %if.then %.sink70 = phi i32 [ 1, %if.else ], [ %15, %if.then ] %.sink = phi i32 [ %16, %if.else ], [ %add17, %if.then ] %arrayidx24.sink = phi ptr [ %arrayidx24, %if.else ], [ %penalty, %if.then ] %inc25 = add nsw i32 %.sink, %.sink70 store i32 %inc25, ptr %arrayidx24.sink, align 4, !tbaa !6 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %mes) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t4) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pid) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tid) #6 %inc27 = add nuw nsw i32 %i.161, 1 %17 = load i32, ptr %r, align 4, !tbaa !6 %cmp2 = icmp slt i32 %inc27, %17 br i1 %cmp2, label %for.body3, label %for.end28.loopexit, !llvm.loop !21 for.end28.loopexit: ; preds = %if.end %.pre = load i32, ptr %t, align 4, !tbaa !6 br label %for.end28 for.end28: ; preds = %for.end28.loopexit, %for.cond1.preheader %18 = phi i32 [ %.pre, %for.end28.loopexit ], [ %1, %for.cond1.preheader ] %conv30 = sext i32 %18 to i64 call void @qsort(ptr noundef nonnull %team, i64 noundef %conv30, i64 noundef 12, ptr noundef nonnull @compare) #6 %19 = load i32, ptr %t, align 4, !tbaa !6 %cmp3262 = icmp sgt i32 %19, 0 br i1 %cmp3262, label %for.body34, label %for.end47 for.body34: ; preds = %for.end28, %for.body34 %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body34 ], [ 0, %for.end28 ] %arrayidx36 = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv67 %20 = load i32, ptr %arrayidx36, align 4, !tbaa !12 %solved40 = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv67, i32 1 %21 = load i32, ptr %solved40, align 4, !tbaa !19 %penalty43 = getelementptr inbounds [50 x %struct.Team], ptr %team, i64 0, i64 %indvars.iv67, i32 2 %22 = load i32, ptr %penalty43, align 4, !tbaa !20 %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20, i32 noundef %21, i32 noundef %22) %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %23 = load i32, ptr %t, align 4, !tbaa !6 %24 = sext i32 %23 to i64 %cmp32 = icmp slt i64 %indvars.iv.next68, %24 br i1 %cmp32, label %for.body34, label %for.end47, !llvm.loop !22 for.end47: ; preds = %for.body34, %for.end28 call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %wrong) #6 call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %team) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %p, ptr noundef nonnull %r) %25 = load i32, ptr %t, align 4, !tbaa !6 %tobool.not = icmp eq i32 %25, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23 while.end: ; preds = %for.end47, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6} !6 = !{!7, !7, i64 0} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{i64 0, i64 4, !6, i64 4, i64 4, !6} !11 = !{i64 0, i64 4, !6} !12 = !{!13, !7, i64 0} !13 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.mustprogress"} !18 = !{!8, !8, i64 0} !19 = !{!13, !7, i64 4} !20 = !{!13, !7, i64 8} !21 = distinct !{!21, !17} !22 = distinct !{!22, !17} !23 = distinct !{!23, !17}
#include<stdio.h> #include<math.h> int main(void) { int X,i,j,flag=0; scanf("%d", &X); for (i = 1; i <=330; i++) { for (j = -330; j <= i; j++) { if (powl(i,5) - powl(j,5) == X) { printf("%d %d\n", i, j); flag=1; break; } } if(flag==1) break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254235/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254235/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc15 %indvars.iv = phi i32 [ 2, %entry ], [ %indvars.iv.next, %for.inc15 ] %i.028 = phi i32 [ 1, %entry ], [ %inc16, %for.inc15 ] %conv = sitofp i32 %i.028 to x86_fp80 br label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.inc %j.027 = phi i32 [ -330, %for.cond1.preheader ], [ %inc, %for.inc ] %call4 = call x86_fp80 @powl(x86_fp80 noundef %conv, x86_fp80 noundef 0xK4001A000000000000000) #4 %conv5 = sitofp i32 %j.027 to x86_fp80 %call6 = call x86_fp80 @powl(x86_fp80 noundef %conv5, x86_fp80 noundef 0xK4001A000000000000000) #4 %sub = fsub x86_fp80 %call4, %call6 %0 = load i32, ptr %X, align 4, !tbaa !5 %conv7 = sitofp i32 %0 to x86_fp80 %cmp8 = fcmp oeq x86_fp80 %sub, %conv7 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %for.body3 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.028, i32 noundef %j.027) br label %for.end17 for.inc: ; preds = %for.body3 %inc = add nsw i32 %j.027, 1 %exitcond.not = icmp eq i32 %inc, %indvars.iv br i1 %exitcond.not, label %for.inc15, label %for.body3, !llvm.loop !9 for.inc15: ; preds = %for.inc %inc16 = add nuw nsw i32 %i.028, 1 %indvars.iv.next = add nuw nsw i32 %indvars.iv, 1 %exitcond31.not = icmp eq i32 %indvars.iv.next, 332 br i1 %exitcond31.not, label %for.end17, label %for.cond1.preheader, !llvm.loop !11 for.end17: ; preds = %for.inc15, %if.then 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 nofree nounwind willreturn memory(write) declare x86_fp80 @powl(x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define MIN(x,y) ((x)<(y)?(x):(y)) #define MAX(x,y) ((x)<(y)?(y):(x)) #define MOD 1000000007LL //#define MOD 998244353LL //#define MOD 1000000009LL const long long INF = 1LL << 60; typedef long long ll; int main(){ ll X; scanf("%lld",&X); ll A, B; for(A = 0;A<10000;A++){ for(B=A-1;B>(-10000);B--) if((A*A*A*A*A)-(B*B*B*B*B) == X) break; if((A*A*A*A*A)-(B*B*B*B*B) == X) break; } printf("%lld %lld\n",A,B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254286/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254286/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @INF = dso_local local_unnamed_addr constant i64 1152921504606846976, align 8 @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\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) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X) %0 = load i64, ptr %X, align 8 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc25 %A.053 = phi i64 [ 0, %entry ], [ %inc, %for.inc25 ] %1 = mul i64 %A.053, %A.053 %2 = mul i64 %1, %A.053 %mul6 = mul i64 %2, %1 br label %for.cond1 for.cond1: ; preds = %for.cond1.preheader, %for.body3 %B.1.in = phi i64 [ %B.1, %for.body3 ], [ %A.053, %for.cond1.preheader ] %cmp2 = icmp sgt i64 %B.1.in, -9999 br i1 %cmp2, label %for.body3, label %for.end for.body3: ; preds = %for.cond1 %B.1 = add nsw i64 %B.1.in, -1 %3 = mul i64 %B.1, %B.1 %4 = mul i64 %3, %B.1 %mul10 = mul i64 %4, %3 %sub11 = sub nsw i64 %mul6, %mul10 %cmp12 = icmp eq i64 %sub11, %0 br i1 %cmp12, label %for.end, label %for.cond1, !llvm.loop !5 for.end: ; preds = %for.body3, %for.cond1 %B.1.lcssa = phi i64 [ -10000, %for.cond1 ], [ %B.1, %for.body3 ] %5 = mul i64 %B.1.lcssa, %B.1.lcssa %6 = mul i64 %5, %B.1.lcssa %mul20 = mul i64 %6, %5 %sub21 = sub nsw i64 %mul6, %mul20 %cmp22 = icmp eq i64 %sub21, %0 br i1 %cmp22, label %for.end26, label %for.inc25 for.inc25: ; preds = %for.end %inc = add nuw nsw i64 %A.053, 1 %exitcond.not = icmp eq i64 %inc, 10000 br i1 %exitcond.not, label %for.end26, label %for.cond1.preheader, !llvm.loop !7 for.end26: ; preds = %for.end, %for.inc25 %A.0.lcssa = phi i64 [ %A.053, %for.end ], [ 10000, %for.inc25 ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %A.0.lcssa, i64 noundef %B.1.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6}
#include<stdio.h> #include<stdlib.h> int main() { int x,i,j,flag; int a[2005]; scanf("%d",&x); flag=0; if(x==1){ printf("1 0"); return 0; } for(i=-1000;i<=1000;i++){ a[i+1000]=i*i*i*i*i; } for(i=0;i<2000;i++) { for(j=0;j<2000;j++) { if(a[i]-a[j]==x) { printf("%d %d",i-1000,j-1000); return 0; } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254329/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254329/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"1 0\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %a = alloca [2005 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3 call void @llvm.lifetime.start.p0(i64 8020, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 1 br i1 %cmp, label %if.then, label %vector.body vector.body: ; preds = %entry, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %entry ] %vec.ind = phi <4 x i32> [ %vec.ind.next, %vector.body ], [ <i32 -1000, i32 -999, i32 -998, i32 -997>, %entry ] %1 = mul <4 x i32> %vec.ind, %vec.ind %2 = mul <4 x i32> %1, %vec.ind %3 = mul <4 x i32> %2, %1 %4 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %index store <4 x i32> %3, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 4 %vec.ind.next = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %5 = icmp eq i64 %index.next, 2000 br i1 %5, label %for.body, label %vector.body, !llvm.loop !9 if.then: ; preds = %entry %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %cleanup for.body: ; preds = %vector.body %arrayidx = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 2000 store i32 -1530494976, ptr %arrayidx, align 16, !tbaa !5 br label %for.cond9.preheader for.cond9.preheader: ; preds = %for.body, %for.inc25 %indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.inc25 ], [ 0, %for.body ] %arrayidx13 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %indvars.iv59 %6 = load i32, ptr %arrayidx13, align 4, !tbaa !5 br label %for.body11 for.body11: ; preds = %for.inc22.4, %for.cond9.preheader %indvars.iv55 = phi i64 [ 0, %for.cond9.preheader ], [ %indvars.iv.next56.4, %for.inc22.4 ] %arrayidx15 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %indvars.iv55 %7 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %sub = sub nsw i32 %6, %7 %cmp16 = icmp eq i32 %sub, %0 br i1 %cmp16, label %if.then17, label %for.inc22 if.then17: ; preds = %for.inc22.3, %for.inc22.2, %for.inc22.1, %for.inc22, %for.body11 %indvars.iv55.lcssa = phi i64 [ %indvars.iv55, %for.body11 ], [ %indvars.iv.next56, %for.inc22 ], [ %indvars.iv.next56.1, %for.inc22.1 ], [ %indvars.iv.next56.2, %for.inc22.2 ], [ %indvars.iv.next56.3, %for.inc22.3 ] %8 = trunc i64 %indvars.iv59 to i32 %9 = trunc i64 %indvars.iv55.lcssa to i32 %sub18 = add nsw i32 %8, -1000 %sub19 = add nsw i32 %9, -1000 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub18, i32 noundef %sub19) br label %cleanup for.inc22: ; preds = %for.body11 %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 %arrayidx15.1 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %indvars.iv.next56 %10 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5 %sub.1 = sub nsw i32 %6, %10 %cmp16.1 = icmp eq i32 %sub.1, %0 br i1 %cmp16.1, label %if.then17, label %for.inc22.1 for.inc22.1: ; preds = %for.inc22 %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2 %arrayidx15.2 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %indvars.iv.next56.1 %11 = load i32, ptr %arrayidx15.2, align 4, !tbaa !5 %sub.2 = sub nsw i32 %6, %11 %cmp16.2 = icmp eq i32 %sub.2, %0 br i1 %cmp16.2, label %if.then17, label %for.inc22.2 for.inc22.2: ; preds = %for.inc22.1 %indvars.iv.next56.2 = add nuw nsw i64 %indvars.iv55, 3 %arrayidx15.3 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %indvars.iv.next56.2 %12 = load i32, ptr %arrayidx15.3, align 4, !tbaa !5 %sub.3 = sub nsw i32 %6, %12 %cmp16.3 = icmp eq i32 %sub.3, %0 br i1 %cmp16.3, label %if.then17, label %for.inc22.3 for.inc22.3: ; preds = %for.inc22.2 %indvars.iv.next56.3 = add nuw nsw i64 %indvars.iv55, 4 %arrayidx15.4 = getelementptr inbounds [2005 x i32], ptr %a, i64 0, i64 %indvars.iv.next56.3 %13 = load i32, ptr %arrayidx15.4, align 4, !tbaa !5 %sub.4 = sub nsw i32 %6, %13 %cmp16.4 = icmp eq i32 %sub.4, %0 br i1 %cmp16.4, label %if.then17, label %for.inc22.4 for.inc22.4: ; preds = %for.inc22.3 %indvars.iv.next56.4 = add nuw nsw i64 %indvars.iv55, 5 %exitcond58.not.4 = icmp eq i64 %indvars.iv.next56.4, 2000 br i1 %exitcond58.not.4, label %for.inc25, label %for.body11, !llvm.loop !13 for.inc25: ; preds = %for.inc22.4 %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %exitcond62.not = icmp eq i64 %indvars.iv.next60, 2000 br i1 %exitcond62.not, label %cleanup, label %for.cond9.preheader, !llvm.loop !14 cleanup: ; preds = %for.inc25, %if.then17, %if.then call void @llvm.lifetime.end.p0(i64 8020, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #include <math.h> #define ll long long #define rep(i,l,r)for(ll i=l;i<r;i++) int main(){ ll n; while(scanf("%lld",&n),n){ n*=2; ll k=sqrt(n); if(k*k==n)k--; while(n%k||k%2==(n/k)%2)k--; ll x=(n/k-(k-1))/2; printf("%lld %lld\n",x,k); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254400/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254400/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %tobool.not28 = icmp eq i64 %0, 0 br i1 %tobool.not28, label %while.end17, label %while.body while.body: ; preds = %entry, %while.end %1 = phi i64 [ %3, %while.end ], [ %0, %entry ] %mul = shl nsw i64 %1, 1 store i64 %mul, ptr %n, align 8, !tbaa !5 %conv = sitofp i64 %mul to double %call1 = call double @sqrt(double noundef %conv) #4 %conv2 = fptosi double %call1 to i64 %mul3 = mul nsw i64 %conv2, %conv2 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp eq i64 %mul3, %2 %dec = sext i1 %cmp to i64 %spec.select = add nsw i64 %dec, %conv2 br label %while.cond5 while.cond5: ; preds = %while.body11, %while.body %k.1 = phi i64 [ %spec.select, %while.body ], [ %dec12, %while.body11 ] %rem = srem i64 %2, %k.1 %div = sdiv i64 %2, %k.1 %tobool6.not = icmp eq i64 %rem, 0 br i1 %tobool6.not, label %lor.rhs, label %while.body11 lor.rhs: ; preds = %while.cond5 %rem7 = srem i64 %k.1, 2 %rem8 = srem i64 %div, 2 %cmp9 = icmp eq i64 %rem7, %rem8 br i1 %cmp9, label %while.body11, label %while.end while.body11: ; preds = %while.cond5, %lor.rhs %dec12 = add nsw i64 %k.1, -1 br label %while.cond5, !llvm.loop !9 while.end: ; preds = %lor.rhs %reass.sub = sub i64 %div, %k.1 %sub14 = add i64 %reass.sub, 1 %div15 = sdiv i64 %sub14, 2 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div15, i64 noundef %k.1) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %3 = load i64, ptr %n, align 8, !tbaa !5 %tobool.not = icmp eq i64 %3, 0 br i1 %tobool.not, label %while.end17, label %while.body, !llvm.loop !11 while.end17: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <math.h> int main(void) { int x, h; while (scanf("%d %d", &x, &h), x + h != 0){ printf("%.6f\n", x * x + x * sqrt(4 * h * h + x * x)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254444/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254444/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%.6f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %h = 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 %h) #5 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %h) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %h, align 4, !tbaa !5 %add11 = sub i32 0, %1 %cmp.not12 = icmp eq i32 %0, %add11 br i1 %cmp.not12, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %2 = phi i32 [ %6, %while.body ], [ %1, %entry ] %3 = phi i32 [ %5, %while.body ], [ %0, %entry ] %mul = mul nsw i32 %3, %3 %conv = sitofp i32 %mul to double %conv1 = sitofp i32 %3 to double %mul2 = shl nsw i32 %2, 2 %mul3 = mul nsw i32 %mul2, %2 %add5 = add nsw i32 %mul3, %mul %conv6 = sitofp i32 %add5 to double %call7 = call double @sqrt(double noundef %conv6) #5 %4 = call double @llvm.fmuladd.f64(double %conv1, double %call7, double %conv) %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %4) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %h) %5 = load i32, ptr %x, align 4, !tbaa !5 %6 = load i32, ptr %h, align 4, !tbaa !5 %add = sub i32 0, %6 %cmp.not = icmp eq i32 %5, %add br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress 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"}
#include <stdio.h> #include <math.h> int main(void) { int x, h; double s; while(1){ scanf("%d", &x); scanf("%d", &h); if(x==0&&h==0) break; s = x*x + x * sqrt(x*x + 4.0*h*h); printf("%f\n", s); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254488/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %h = 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 %h) #5 %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call114 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp15 = icmp eq i32 %0, 0 %1 = load i32, ptr %h, align 4 %cmp216 = icmp eq i32 %1, 0 %or.cond17 = select i1 %cmp15, i1 %cmp216, i1 false br i1 %or.cond17, label %while.end, label %if.end if.end: ; preds = %entry, %if.end %2 = phi i32 [ %7, %if.end ], [ %1, %entry ] %3 = phi i32 [ %6, %if.end ], [ %0, %entry ] %mul = mul nsw i32 %3, %3 %conv = sitofp i32 %mul to double %conv3 = sitofp i32 %3 to double %conv6 = sitofp i32 %2 to double %mul7 = fmul double %conv6, 4.000000e+00 %4 = call double @llvm.fmuladd.f64(double %mul7, double %conv6, double %conv) %call10 = call double @sqrt(double noundef %4) #5 %5 = call double @llvm.fmuladd.f64(double %conv3, double %call10, double %conv) %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %5) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h) %6 = load i32, ptr %x, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 %7 = load i32, ptr %h, align 4 %cmp2 = icmp eq i32 %7, 0 %or.cond = select i1 %cmp, i1 %cmp2, i1 false br i1 %or.cond, label %while.end, label %if.end while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #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 nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress 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"}
#include<stdio.h> #include<math.h> int main(void){ double x,h,s,work1,work2; while(scanf("%lf%lf",&x,&h)){ if(x==0 && h==0)break; work1=h*h+x*x/4; work2=sqrt(work1); printf("%f\n",2*work2*x+x*x); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254552/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254552/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf%lf\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca double, align 8 %h = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #5 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %h) %tobool.not8 = icmp eq i32 %call7, 0 br i1 %tobool.not8, label %while.end, label %while.body while.body: ; preds = %entry, %if.end %0 = load double, ptr %x, align 8, !tbaa !5 %cmp = fcmp oeq double %0, 0.000000e+00 %1 = load double, ptr %h, align 8 %cmp1 = fcmp oeq double %1, 0.000000e+00 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %if.end if.end: ; preds = %while.body %mul2 = fmul double %0, %0 %div = fmul double %mul2, 2.500000e-01 %2 = call double @llvm.fmuladd.f64(double %1, double %1, double %div) %call3 = call double @sqrt(double noundef %2) #5 %mul = fmul double %call3, 2.000000e+00 %3 = load double, ptr %x, align 8, !tbaa !5 %mul5 = fmul double %3, %3 %4 = call double @llvm.fmuladd.f64(double %mul, double %3, double %mul5) %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %4) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %h) %tobool.not = icmp eq i32 %call, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end, %while.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 8, 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double 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 nosync nounwind speculatable willreturn memory(none) } attributes #4 = { 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 #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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a,b,c,n,m,i; int d; while(scanf("%d %d %d",&a,&b,&c),a||b||c){ if(a<b){ if(b>c)b=c; } else if(a>c)a=c; d=a*a+b*b; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&m); if((m+m)*(m+m)>d)printf("OK\n"); else printf("NA\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254596/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254596/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NA\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"OK\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 %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call29 = 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 %tobool30 = icmp ne i32 %0, 0 %1 = load i32, ptr %b, align 4 %tobool131 = icmp ne i32 %1, 0 %or.cond32 = select i1 %tobool30, i1 true, i1 %tobool131 %2 = load i32, ptr %c, align 4 %tobool233 = icmp ne i32 %2, 0 %or.cond2234 = select i1 %or.cond32, i1 true, i1 %tobool233 br i1 %or.cond2234, label %while.body, label %while.end while.cond.loopexit: ; preds = %for.body, %if.end8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %3 = load i32, ptr %a, align 4, !tbaa !5 %tobool = icmp ne i32 %3, 0 %4 = load i32, ptr %b, align 4 %tobool1 = icmp ne i32 %4, 0 %or.cond = select i1 %tobool, i1 true, i1 %tobool1 %5 = load i32, ptr %c, align 4 %tobool2 = icmp ne i32 %5, 0 %or.cond22 = select i1 %or.cond, i1 true, i1 %tobool2 br i1 %or.cond22, label %while.body, label %while.end, !llvm.loop !9 while.body: ; preds = %entry, %while.cond.loopexit %6 = phi i32 [ %5, %while.cond.loopexit ], [ %2, %entry ] %7 = phi i32 [ %4, %while.cond.loopexit ], [ %1, %entry ] %8 = phi i32 [ %3, %while.cond.loopexit ], [ %0, %entry ] %cmp = icmp slt i32 %8, %7 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %while.body %cmp3 = icmp sgt i32 %7, %6 br i1 %cmp3, label %if.then4, label %if.end8 if.then4: ; preds = %if.then store i32 %6, ptr %b, align 4, !tbaa !5 br label %if.end8 if.else: ; preds = %while.body %cmp5 = icmp sgt i32 %8, %6 br i1 %cmp5, label %if.then6, label %if.end8 if.then6: ; preds = %if.else store i32 %6, ptr %a, align 4, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.else, %if.then6, %if.then, %if.then4 %9 = phi i32 [ %7, %if.else ], [ %7, %if.then6 ], [ %7, %if.then ], [ %6, %if.then4 ] %10 = phi i32 [ %8, %if.else ], [ %6, %if.then6 ], [ %8, %if.then ], [ %8, %if.then4 ] %mul = mul nsw i32 %10, %10 %mul9 = mul nsw i32 %9, %9 %add = add nuw nsw i32 %mul9, %mul %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %11 = load i32, ptr %n, align 4, !tbaa !5 %cmp1127 = icmp sgt i32 %11, 0 br i1 %cmp1127, label %for.body, label %while.cond.loopexit for.body: ; preds = %if.end8, %for.body %i.028 = phi i32 [ %inc, %for.body ], [ 0, %if.end8 ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m) %12 = load i32, ptr %m, align 4, !tbaa !5 %add13 = shl nsw i32 %12, 1 %mul15 = mul nsw i32 %add13, %add13 %cmp16 = icmp ugt i32 %mul15, %add %str.4.str = select i1 %cmp16, ptr @str.4, ptr @str %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) %inc = add nuw nsw i32 %i.028, 1 %13 = load i32, ptr %n, align 4, !tbaa !5 %cmp11 = icmp slt i32 %inc, %13 br i1 %cmp11, label %for.body, label %while.cond.loopexit, !llvm.loop !11 while.end: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 he, wi, hi; int i; int n; int x; float p = 3.14; while (1){ scanf("%d %d %d", &he, &wi, &hi); if (he == 0 && wi == 0 && hi == 0){ break; } scanf("%d", &n); for (i = 0; i < n; i++){ scanf("%d", &x); if ((wi * wi) + (hi * hi) < (x * 2) * (x * 2)){ printf("OK\n"); } else { printf("NA\n"); } } } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254660/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254660/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NA\00", align 1 @str.4 = private unnamed_addr constant [3 x i8] c"OK\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %he = alloca i32, align 4 %wi = alloca i32, align 4 %hi = alloca i32, align 4 %n = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %he) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %wi) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hi) #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 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %he, ptr noundef nonnull %wi, ptr noundef nonnull %hi) %0 = load i32, ptr %he, align 4, !tbaa !5 %cmp22 = icmp eq i32 %0, 0 %1 = load i32, ptr %wi, align 4 %cmp123 = icmp eq i32 %1, 0 %or.cond24 = select i1 %cmp22, i1 %cmp123, i1 false %2 = load i32, ptr %hi, align 4 %cmp325 = icmp eq i32 %2, 0 %or.cond1626 = select i1 %or.cond24, i1 %cmp325, i1 false br i1 %or.cond1626, label %while.end, label %if.end while.cond.loopexit: ; preds = %for.body, %if.end %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %he, ptr noundef nonnull %wi, ptr noundef nonnull %hi) %3 = load i32, ptr %he, align 4, !tbaa !5 %cmp = icmp eq i32 %3, 0 %4 = load i32, ptr %wi, align 4 %cmp1 = icmp eq i32 %4, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %5 = load i32, ptr %hi, align 4 %cmp3 = icmp eq i32 %5, 0 %or.cond16 = select i1 %or.cond, i1 %cmp3, i1 false br i1 %or.cond16, label %while.end, label %if.end if.end: ; preds = %entry, %while.cond.loopexit %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n) %6 = load i32, ptr %n, align 4, !tbaa !5 %cmp519 = icmp sgt i32 %6, 0 br i1 %cmp519, label %for.body, label %while.cond.loopexit for.body: ; preds = %if.end, %for.body %i.020 = phi i32 [ %inc, %for.body ], [ 0, %if.end ] %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %7 = load i32, ptr %wi, align 4, !tbaa !5 %mul = mul nsw i32 %7, %7 %8 = load i32, ptr %hi, align 4, !tbaa !5 %mul7 = mul nsw i32 %8, %8 %add = add nuw nsw i32 %mul7, %mul %9 = load i32, ptr %x, align 4, !tbaa !5 %mul8 = shl nsw i32 %9, 1 %mul10 = mul nsw i32 %mul8, %mul8 %cmp11 = icmp ult i32 %add, %mul10 %str.4.str = select i1 %cmp11, ptr @str.4, ptr @str %puts18 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) %inc = add nuw nsw i32 %i.020, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %10 br i1 %cmp5, label %for.body, label %while.cond.loopexit, !llvm.loop !9 while.end: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hi) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %wi) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %he) #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(){ double a,b,c,d,e,f,g,h,k,n,y[1000],x[1000]; int i,j=0; while(scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)!=EOF){ //printf("%f%f%f",a,b,c); g=c*d; h=a*f; k=g-h; g=b*d; h=a*e; n=g-h; y[j]=k/n; if(y[j]>=-0.0004&&y[j]<=0)y[j]=0; // if(y[j]>=0){ // y[j]=y[j]+0.0005; // }else{ // y[j]=y[j]-0.0005; // } g=b*f; h=c*e; k=g-h; g=b*d; h=a*e; n=g-h; x[j]=k/n; if(x[j]>=-0.0004&&x[j]<=0)x[j]=0; // if(x[j]>=0){ // x[j]=x[j]+0.0005; // }else{ // x[j]=x[j]-0.0005; // } j++; } for(i=0;i<j;i++){ printf("%.3f %.3f\n",x[i],y[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254710/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254710/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [19 x i8] c"%lf%lf%lf%lf%lf%lf\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\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 %c = alloca double, align 8 %d = alloca double, align 8 %e = alloca double, align 8 %f = alloca double, align 8 %y = alloca [1000 x double], align 16 %x = alloca [1000 x double], 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 void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #3 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %y) #3 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %x) #3 %call62 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not63 = icmp eq i32 %call62, -1 br i1 %cmp.not63, label %for.end, label %while.body for.cond.preheader: ; preds = %while.body %0 = and i64 %indvars.iv.next, 4294967295 %cmp3365.not = icmp eq i64 %0, 0 br i1 %cmp3365.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %1 = load double, ptr %c, align 8, !tbaa !5 %2 = load double, ptr %d, align 8, !tbaa !5 %3 = load double, ptr %a, align 8, !tbaa !5 %4 = load double, ptr %f, align 8, !tbaa !5 %5 = load double, ptr %b, align 8, !tbaa !5 %6 = load double, ptr %e, align 8, !tbaa !5 %7 = insertelement <2 x double> poison, double %2, i64 0 %8 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> zeroinitializer %9 = insertelement <2 x double> poison, double %1, i64 0 %10 = insertelement <2 x double> %9, double %5, i64 1 %11 = fmul <2 x double> %8, %10 %12 = insertelement <2 x double> poison, double %3, i64 0 %13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer %14 = insertelement <2 x double> poison, double %4, i64 0 %15 = insertelement <2 x double> %14, double %6, i64 1 %16 = fmul <2 x double> %13, %15 %17 = fsub <2 x double> %11, %16 %arrayidx = getelementptr inbounds [1000 x double], ptr %y, i64 0, i64 %indvars.iv %mul13 = fmul double %4, %5 %mul14 = fmul double %1, %6 %sub15 = fsub double %mul13, %mul14 %arrayidx21 = getelementptr inbounds [1000 x double], ptr %x, i64 0, i64 %indvars.iv %18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> <i32 poison, i32 0> %19 = insertelement <2 x double> %18, double %sub15, i64 0 %20 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> <i32 1, i32 1> %21 = fdiv <2 x double> %19, %20 %22 = extractelement <2 x double> %21, i64 1 %cmp10 = fcmp ugt double %22, 0.000000e+00 %23 = fcmp ult <2 x double> %21, <double -4.000000e-04, double -4.000000e-04> %24 = extractelement <2 x i1> %23, i64 1 %or.cond = or i1 %24, %cmp10 %spec.store.select = select i1 %or.cond, double %22, double 0.000000e+00 store double %spec.store.select, ptr %arrayidx, align 8 %25 = extractelement <2 x double> %21, i64 0 %cmp28 = fcmp ugt double %25, 0.000000e+00 %26 = extractelement <2 x i1> %23, i64 0 %or.cond60 = or i1 %26, %cmp28 %spec.store.select61 = select i1 %or.cond60, double %25, double 0.000000e+00 store double %spec.store.select61, ptr %arrayidx21, align 8 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv68 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next69, %for.body ] %arrayidx35 = getelementptr inbounds [1000 x double], ptr %x, i64 0, i64 %indvars.iv68 %27 = load double, ptr %arrayidx35, align 8, !tbaa !5 %arrayidx37 = getelementptr inbounds [1000 x double], ptr %y, i64 0, i64 %indvars.iv68 %28 = load double, ptr %arrayidx37, align 8, !tbaa !5 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %27, double noundef %28) %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1 %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %entry, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %x) #3 call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %y) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #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 = !{!"double", !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 <math.h> double roundPoint4(double x) { x = x * 1000; if (x >= 0.0) { return floor(x + 0.5)/ 1000; } else { return -1.0 * floor(fabs(x) + 0.5) / 1000; } } int main (int ac, char **av ) { while (feof(stdin) == 0) { double a , b , c, d, e, f = 0; fscanf(stdin, "%lf %lf %lf %lf %lf %lf\n", &a, &b, &c, &d, &e, &f); double x,y = 0.0; double div = a*e-b*d; if (fabs(div) == 0) { x = 0.0; y = 0.0; } else{ x = ((e * c - f * b) / (a*e-b*d)); y = ((c * d - a * f) / (b*d-a*e)); } if (x == 0) { x =0;} if (y ==0) { y =0;} fprintf(stdout, "%.3f %.3f\n", x, y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254754/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254754/source.c" target datalayout = "e-m:e-p270: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 [25 x i8] c"%lf %lf %lf %lf %lf %lf\0A\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local double @roundPoint4(double noundef %x) local_unnamed_addr #0 { entry: %mul = fmul double %x, 1.000000e+03 %cmp = fcmp ult double %mul, 0.000000e+00 %0 = tail call double @llvm.fabs.f64(double %mul) %.sink = select i1 %cmp, double %0, double %mul %.sink7 = select i1 %cmp, double -1.000000e+03, double 1.000000e+03 %add1 = fadd double %.sink, 5.000000e-01 %1 = tail call double @llvm.floor.f64(double %add1) %div3 = fdiv double %1, %.sink7 ret double %div3 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.floor.f64(double) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fabs.f64(double) #1 ; Function Attrs: nounwind uwtable define dso_local i32 @main(i32 noundef %ac, ptr nocapture noundef readnone %av) local_unnamed_addr #2 { entry: %a = alloca double, align 8 %b = alloca double, align 8 %c = alloca double, align 8 %d = alloca double, align 8 %e = alloca double, align 8 %f = alloca double, align 8 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call23 = tail call i32 @feof(ptr noundef %0) #7 %cmp24 = icmp eq i32 %call23, 0 br i1 %cmp24, label %while.body, label %while.end while.body: ; preds = %entry, %if.end call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #7 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #7 store double 0.000000e+00, ptr %f, align 8, !tbaa !9 %1 = load ptr, ptr @stdin, align 8, !tbaa !5 %call1 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %1, ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %f) #7 %2 = load double, ptr %a, align 8, !tbaa !9 %3 = load double, ptr %e, align 8, !tbaa !9 %4 = load double, ptr %b, align 8, !tbaa !9 %5 = load double, ptr %d, align 8, !tbaa !9 %6 = fneg double %4 %neg = fmul double %5, %6 %7 = call double @llvm.fmuladd.f64(double %2, double %3, double %neg) %cmp3 = fcmp oeq double %7, 0.000000e+00 br i1 %cmp3, label %if.end, label %if.else if.else: ; preds = %while.body %8 = load double, ptr %c, align 8, !tbaa !9 %9 = load double, ptr %f, align 8, !tbaa !9 %10 = insertelement <2 x double> poison, double %2, i64 0 %11 = insertelement <2 x double> %10, double %9, i64 1 %12 = fneg <2 x double> %11 %13 = insertelement <2 x double> poison, double %9, i64 0 %14 = insertelement <2 x double> %13, double %4, i64 1 %15 = fmul <2 x double> %14, %12 %16 = insertelement <2 x double> poison, double %8, i64 0 %17 = insertelement <2 x double> %16, double %3, i64 1 %18 = insertelement <2 x double> poison, double %5, i64 0 %19 = insertelement <2 x double> %18, double %8, i64 1 %20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> %19, <2 x double> %15) %21 = extractelement <2 x double> %12, i64 0 %neg12 = fmul double %3, %21 %22 = call double @llvm.fmuladd.f64(double %4, double %5, double %neg12) %23 = insertelement <2 x double> poison, double %22, i64 0 %24 = insertelement <2 x double> %23, double %7, i64 1 %25 = fdiv <2 x double> %20, %24 br label %if.end if.end: ; preds = %while.body, %if.else %26 = phi <2 x double> [ %25, %if.else ], [ zeroinitializer, %while.body ] %27 = extractelement <2 x double> %26, i64 1 %cmp14 = fcmp oeq double %27, 0.000000e+00 %x.1 = select i1 %cmp14, double 0.000000e+00, double %27 %28 = extractelement <2 x double> %26, i64 0 %cmp17 = fcmp oeq double %28, 0.000000e+00 %y.1 = select i1 %cmp17, double 0.000000e+00, double %28 %29 = load ptr, ptr @stdout, align 8, !tbaa !5 %call20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.1, double noundef %x.1, double noundef %y.1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #7 %30 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call i32 @feof(ptr noundef %30) #7 %cmp = icmp eq i32 %call, 0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %if.end, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #1 ; Function Attrs: nofree nounwind declare noundef i32 @fprintf(ptr nocapture noundef, 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) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"double", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b,c,d,e,f; double x,y; while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f)!=EOF) { y=(double)(a*f-c*d)/(a*e-b*d); x=(double)(c-b*y)/a; printf("%.3lf %.3lf\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254798/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254798/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%.3lf %.3lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = alloca i32, align 4 %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #4 %call13 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not14 = icmp eq i32 %call13, -1 br i1 %cmp.not14, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %f, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %mul1 = mul nsw i32 %3, %2 %sub = sub nsw i32 %mul, %mul1 %conv = sitofp i32 %sub to double %4 = load i32, ptr %e, align 4, !tbaa !5 %mul2 = mul nsw i32 %4, %0 %5 = load i32, ptr %b, align 4, !tbaa !5 %mul3 = mul nsw i32 %5, %3 %sub4 = sub nsw i32 %mul2, %mul3 %conv5 = sitofp i32 %sub4 to double %div = fdiv double %conv, %conv5 %conv6 = sitofp i32 %2 to double %conv7 = sitofp i32 %5 to double %neg = fneg double %conv7 %6 = call double @llvm.fmuladd.f64(double %neg, double %div, double %conv6) %conv9 = sitofp i32 %0 to double %div10 = fdiv double %6, %conv9 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div10, double noundef %div) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; double x = 0.0, y = 0.0; while(scanf("%lf %lf %lf %lf %lf %lf", &a, &b , &c , &d , &e , &f) != EOF) { y = ((d * c) - (a * f)) / ((d * b) - (a * e)); x = (c - (b * y)) / a; printf("%0.3f %0.3f\n", x, y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254840/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254840/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf %lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%0.3f %0.3f\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 %c = alloca double, align 8 %d = alloca double, align 8 %e = alloca double, align 8 %f = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 store double 0.000000e+00, ptr %a, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 store double 0.000000e+00, ptr %b, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #5 store double 0.000000e+00, ptr %c, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5 store double 0.000000e+00, ptr %d, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #5 store double 0.000000e+00, ptr %e, align 8, !tbaa !5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #5 store double 0.000000e+00, ptr %f, align 8, !tbaa !5 %call8 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load double, ptr %d, align 8, !tbaa !5 %1 = load double, ptr %c, align 8, !tbaa !5 %2 = load double, ptr %a, align 8, !tbaa !5 %3 = load double, ptr %f, align 8, !tbaa !5 %4 = fneg double %2 %5 = load double, ptr %b, align 8, !tbaa !5 %6 = load double, ptr %e, align 8, !tbaa !5 %7 = insertelement <2 x double> poison, double %3, i64 0 %8 = insertelement <2 x double> %7, double %6, i64 1 %9 = insertelement <2 x double> poison, double %4, i64 0 %10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer %11 = fmul <2 x double> %8, %10 %12 = insertelement <2 x double> poison, double %0, i64 0 %13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer %14 = insertelement <2 x double> poison, double %1, i64 0 %15 = insertelement <2 x double> %14, double %5, i64 1 %16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> %11) %17 = extractelement <2 x double> %16, i64 0 %18 = extractelement <2 x double> %16, i64 1 %div = fdiv double %17, %18 %neg4 = fneg double %5 %19 = call double @llvm.fmuladd.f64(double %neg4, double %div, double %1) %div5 = fdiv double %19, %2 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div5, double noundef %div) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <string.h> #include <stdio.h> #include <stdlib.h> int main() { float a, b, c, d, e, f; float x, y; while ( scanf( "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f ) != EOF ) { x = (float)(( c*e - f*b ) / ( e*a - b*d )); y = (float)(( d*c - a*f ) / ( d*b - a*e )); if ( -0.0005 <= x && x <= 0 ) x = 0; if ( -0.0005 <= y && y <= 0 ) y = 0; fprintf( stdout, "%.3f %.3f\n", x, y ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254884/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254884/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%f %f %f %f %f %f\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca float, align 4 %b = alloca float, align 4 %c = alloca float, align 4 %d = alloca float, align 4 %e = alloca float, align 4 %f = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #4 %call30 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not31 = icmp eq i32 %call30, -1 br i1 %cmp.not31, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load float, ptr %c, align 4, !tbaa !5 %1 = load float, ptr %e, align 4, !tbaa !5 %2 = load float, ptr %f, align 4, !tbaa !5 %3 = load float, ptr %b, align 4, !tbaa !5 %4 = load float, ptr %a, align 4, !tbaa !5 %5 = load float, ptr %d, align 4, !tbaa !5 %6 = insertelement <2 x float> poison, float %2, i64 0 %7 = insertelement <2 x float> %6, float %3, i64 1 %8 = fneg <2 x float> %7 %9 = insertelement <2 x float> poison, float %3, i64 0 %10 = insertelement <2 x float> %9, float %5, i64 1 %11 = fmul <2 x float> %10, %8 %12 = insertelement <2 x float> poison, float %0, i64 0 %13 = insertelement <2 x float> %12, float %1, i64 1 %14 = insertelement <2 x float> poison, float %1, i64 0 %15 = insertelement <2 x float> %14, float %4, i64 1 %16 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %13, <2 x float> %15, <2 x float> %11) %17 = fneg float %4 %18 = insertelement <2 x float> %6, float %1, i64 1 %19 = insertelement <2 x float> poison, float %17, i64 0 %20 = shufflevector <2 x float> %19, <2 x float> poison, <2 x i32> zeroinitializer %21 = fmul <2 x float> %18, %20 %22 = insertelement <2 x float> poison, float %5, i64 0 %23 = shufflevector <2 x float> %22, <2 x float> poison, <2 x i32> zeroinitializer %24 = insertelement <2 x float> %12, float %3, i64 1 %25 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %23, <2 x float> %24, <2 x float> %21) %26 = shufflevector <2 x float> %25, <2 x float> %16, <2 x i32> <i32 0, i32 2> %27 = shufflevector <2 x float> %25, <2 x float> %16, <2 x i32> <i32 1, i32 3> %28 = fdiv <2 x float> %26, %27 %29 = extractelement <2 x float> %28, i64 1 %conv = fpext float %29 to double %cmp9 = fcmp oge double %conv, -5.000000e-04 %30 = fcmp ole <2 x float> %28, zeroinitializer %31 = extractelement <2 x i1> %30, i64 1 %or.cond = and i1 %31, %cmp9 %32 = extractelement <2 x float> %28, i64 0 %conv13 = fpext float %32 to double %cmp14 = fcmp oge double %conv13, -5.000000e-04 %33 = extractelement <2 x i1> %30, i64 0 %or.cond24 = and i1 %33, %cmp14 %34 = load ptr, ptr @stdout, align 8, !tbaa !9 %conv21 = select i1 %or.cond, double 0.000000e+00, double %conv %conv22 = select i1 %or.cond24, double 0.000000e+00, double %conv13 %call23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.1, double noundef %conv21, double noundef %conv22) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_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 <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #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 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
/* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004 Simultaneous Equation */ #include <stdio.h> int main(void) { int a,b,c,d,e,f; double x=0,y=0; while (scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF) { /* ????????? ax + by = c ...???1 dx + ey = f ...???2 ???2????????????(a/d)?????????????????????????????????????????¨y??????????????? ax + e(a/d)y = f(a/d) ...???2' (b - ea/d) y = (c - fa/d) ...???1 - ???2' ???2????????????(b/e)?????????????????????????????????????????¨x??????????????? d(b/e)x + by = f(b/e) ...???2'' (a - db/e) x = (c - fb/e) ...???1 - ???2'' */ x = (double) (c*e - b*f) / (a*e - b*d); y = (double) (c*d - a*f) / (b*d - a*e); /* -0????????????????????? */ if (x == -0) { x = 0; } if (y == -0) { y = 0; } printf("%.3lf %.3lf\n", x, y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254927/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254927/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%.3lf %.3lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = alloca i32, align 4 %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3 %call24 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not25 = icmp eq i32 %call24, -1 br i1 %cmp.not25, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %e, align 4, !tbaa !5 %mul = mul nsw i32 %1, %0 %2 = load i32, ptr %b, align 4, !tbaa !5 %3 = load i32, ptr %f, align 4, !tbaa !5 %mul1 = mul nsw i32 %3, %2 %sub = sub nsw i32 %mul, %mul1 %conv = sitofp i32 %sub to double %4 = load i32, ptr %a, align 4, !tbaa !5 %mul2 = mul nsw i32 %4, %1 %5 = load i32, ptr %d, align 4, !tbaa !5 %mul3 = mul nsw i32 %5, %2 %sub4 = sub nsw i32 %mul2, %mul3 %conv5 = sitofp i32 %sub4 to double %div = fdiv double %conv, %conv5 %mul6 = mul nsw i32 %5, %0 %mul7 = mul nsw i32 %4, %3 %sub8 = sub nsw i32 %mul6, %mul7 %conv9 = sitofp i32 %sub8 to double %sub12 = sub nsw i32 %mul3, %mul2 %conv13 = sitofp i32 %sub12 to double %div14 = fdiv double %conv9, %conv13 %cmp15 = fcmp oeq double %div, 0.000000e+00 %x.0 = select i1 %cmp15, double 0.000000e+00, double %div %cmp17 = fcmp oeq double %div14, 0.000000e+00 %y.0 = select i1 %cmp17, double 0.000000e+00, double %div14 %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %x.0, double noundef %y.0) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { float a,b,c,d,e,f; double x,y; while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF &&(a>=-1000&&a<=1000)&&(b>=-1000&&b<=1000)&&(c>=-1000&&c<=1000)&&(d>=-1000&&d<=1000)&&(e>=-1000&&e<=1000)&&(f>=-1000&&f<=1000)) { x=(e*c-b*f)/(e*a-b*d); y=(d*c-a*f)/(d*b-a*e); if(x==-0.000) x=0.000; if(y==-0.000) y=0.000; printf("%.3f %.3f\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_254970/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_254970/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%f%f%f%f%f%f\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca float, align 4 %b = alloca float, align 4 %c = alloca float, align 4 %d = alloca float, align 4 %e = alloca float, align 4 %f = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #4 br label %while.cond while.cond: ; preds = %while.body, %entry %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp = icmp ne i32 %call, -1 %0 = load float, ptr %a, align 4 %cmp1 = fcmp oge float %0, -1.000000e+03 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %cmp3 = fcmp ole float %0, 1.000000e+03 %or.cond40 = select i1 %or.cond, i1 %cmp3, i1 false %1 = load float, ptr %b, align 4 %cmp5 = fcmp oge float %1, -1.000000e+03 %or.cond41 = select i1 %or.cond40, i1 %cmp5, i1 false %cmp7 = fcmp ole float %1, 1.000000e+03 %or.cond42 = select i1 %or.cond41, i1 %cmp7, i1 false %2 = load float, ptr %c, align 4 %cmp9 = fcmp oge float %2, -1.000000e+03 %or.cond43 = select i1 %or.cond42, i1 %cmp9, i1 false %cmp11 = fcmp ole float %2, 1.000000e+03 %or.cond44 = select i1 %or.cond43, i1 %cmp11, i1 false %3 = load float, ptr %d, align 4 %cmp13 = fcmp oge float %3, -1.000000e+03 %or.cond45 = select i1 %or.cond44, i1 %cmp13, i1 false %cmp15 = fcmp ole float %3, 1.000000e+03 %or.cond46 = select i1 %or.cond45, i1 %cmp15, i1 false %4 = load float, ptr %e, align 4 %cmp17 = fcmp oge float %4, -1.000000e+03 %or.cond47 = select i1 %or.cond46, i1 %cmp17, i1 false %cmp19 = fcmp ole float %4, 1.000000e+03 %or.cond48 = select i1 %or.cond47, i1 %cmp19, i1 false br i1 %or.cond48, label %land.rhs, label %while.end land.rhs: ; preds = %while.cond %5 = load float, ptr %f, align 4 %cmp20 = fcmp oge float %5, -1.000000e+03 %cmp22 = fcmp ole float %5, 1.000000e+03 %6 = and i1 %cmp20, %cmp22 br i1 %6, label %while.body, label %while.end while.body: ; preds = %land.rhs %7 = fneg float %1 %8 = insertelement <2 x float> poison, float %5, i64 0 %9 = insertelement <2 x float> %8, float %3, i64 1 %10 = insertelement <2 x float> poison, float %7, i64 0 %11 = shufflevector <2 x float> %10, <2 x float> poison, <2 x i32> zeroinitializer %12 = fmul <2 x float> %9, %11 %13 = insertelement <2 x float> poison, float %4, i64 0 %14 = shufflevector <2 x float> %13, <2 x float> poison, <2 x i32> zeroinitializer %15 = insertelement <2 x float> poison, float %2, i64 0 %16 = insertelement <2 x float> %15, float %0, i64 1 %17 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %14, <2 x float> %16, <2 x float> %12) %18 = fneg float %0 %19 = insertelement <2 x float> %8, float %4, i64 1 %20 = insertelement <2 x float> poison, float %18, i64 0 %21 = shufflevector <2 x float> %20, <2 x float> poison, <2 x i32> zeroinitializer %22 = fmul <2 x float> %19, %21 %23 = insertelement <2 x float> poison, float %3, i64 0 %24 = shufflevector <2 x float> %23, <2 x float> poison, <2 x i32> zeroinitializer %25 = insertelement <2 x float> %15, float %1, i64 1 %26 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %24, <2 x float> %25, <2 x float> %22) %27 = shufflevector <2 x float> %26, <2 x float> %17, <2 x i32> <i32 0, i32 2> %28 = shufflevector <2 x float> %26, <2 x float> %17, <2 x i32> <i32 1, i32 3> %29 = fdiv <2 x float> %27, %28 %30 = extractelement <2 x float> %29, i64 1 %conv = fpext float %30 to double %31 = extractelement <2 x float> %29, i64 0 %conv32 = fpext float %31 to double %32 = fcmp oeq <2 x float> %29, zeroinitializer %33 = extractelement <2 x i1> %32, i64 1 %x.0 = select i1 %33, double 0.000000e+00, double %conv %34 = extractelement <2 x i1> %32, i64 0 %y.0 = select i1 %34, double 0.000000e+00, double %conv32 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %x.0, double noundef %y.0) br label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond, %land.rhs call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { double a,b,c,d,e,f,x,y; while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF) { y=(a*f-c*d)/(a*e-b*d); x=(c-b*y)/a; printf("%.3f %.3f\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255012/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255012/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf %lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\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 %c = alloca double, align 8 %d = alloca double, align 8 %e = alloca double, align 8 %f = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #5 %call8 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not9 = icmp eq i32 %call8, -1 br i1 %cmp.not9, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load double, ptr %a, align 8, !tbaa !5 %1 = load double, ptr %f, align 8, !tbaa !5 %2 = load double, ptr %c, align 8, !tbaa !5 %3 = load double, ptr %d, align 8, !tbaa !5 %4 = load double, ptr %e, align 8, !tbaa !5 %5 = load double, ptr %b, align 8, !tbaa !5 %6 = insertelement <2 x double> poison, double %2, i64 0 %7 = insertelement <2 x double> %6, double %5, i64 1 %8 = fneg <2 x double> %7 %9 = insertelement <2 x double> poison, double %3, i64 0 %10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer %11 = fmul <2 x double> %10, %8 %12 = insertelement <2 x double> poison, double %0, i64 0 %13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer %14 = insertelement <2 x double> poison, double %1, i64 0 %15 = insertelement <2 x double> %14, double %4, i64 1 %16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> %11) %17 = extractelement <2 x double> %16, i64 0 %18 = extractelement <2 x double> %16, i64 1 %div = fdiv double %17, %18 %19 = extractelement <2 x double> %8, i64 1 %20 = call double @llvm.fmuladd.f64(double %19, double %div, double %2) %div5 = fdiv double %20, %0 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div5, double noundef %div) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #include<string.h> double i,j,a,b,c,d,e,f; double x,y; int main(){ /*while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){ x=(c*e-f*b)/(a*e-d*b); y=(c-a*x)/b; printf("%.3lf %.3lf\n",x,y); }*/ while (scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF) { y = (c * d - a * f) / (b * d - e * a); x = (c - (b * y)) / a; printf("%.3lf %.3lf\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255056/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255056/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf %lf %lf %lf\00", align 1 @a = dso_local global double 0.000000e+00, align 8 @b = dso_local global double 0.000000e+00, align 8 @c = dso_local global double 0.000000e+00, align 8 @d = dso_local global double 0.000000e+00, align 8 @e = dso_local global double 0.000000e+00, align 8 @f = dso_local global double 0.000000e+00, align 8 @y = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @x = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @.str.1 = private unnamed_addr constant [13 x i8] c"%.3lf %.3lf\0A\00", align 1 @i = dso_local local_unnamed_addr global double 0.000000e+00, align 8 @j = dso_local local_unnamed_addr global double 0.000000e+00, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call7 = tail 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, ptr noundef nonnull @e, ptr noundef nonnull @f) %cmp.not8 = icmp eq i32 %call7, -1 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load double, ptr @c, align 8, !tbaa !5 %1 = load double, ptr @d, align 8, !tbaa !5 %2 = load double, ptr @a, align 8, !tbaa !5 %3 = load double, ptr @f, align 8, !tbaa !5 %4 = load double, ptr @b, align 8, !tbaa !5 %5 = load double, ptr @e, align 8, !tbaa !5 %6 = insertelement <2 x double> poison, double %2, i64 0 %7 = insertelement <2 x double> %6, double %5, i64 1 %8 = fneg <2 x double> %7 %9 = insertelement <2 x double> poison, double %3, i64 0 %10 = insertelement <2 x double> %9, double %2, i64 1 %11 = fmul <2 x double> %10, %8 %12 = insertelement <2 x double> poison, double %0, i64 0 %13 = insertelement <2 x double> %12, double %4, i64 1 %14 = insertelement <2 x double> poison, double %1, i64 0 %15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer %16 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> %11) %17 = extractelement <2 x double> %16, i64 0 %18 = extractelement <2 x double> %16, i64 1 %div = fdiv double %17, %18 store double %div, ptr @y, align 8, !tbaa !5 %neg4 = fneg double %4 %19 = tail call double @llvm.fmuladd.f64(double %neg4, double %div, double %0) %div5 = fdiv double %19, %2 store double %div5, ptr @x, align 8, !tbaa !5 %call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div5, double noundef %div) %call = tail 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, ptr noundef nonnull @e, ptr noundef nonnull @f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ float a,b,c,d,e,f,x,y; while(scanf("%f %f %f %f %f %f",&a,&b,&c,&d,&e,&f)!=EOF){ y=(a*f-d*c)/(a*e-d*b); x=(c-b*y)/a; printf("%5.3f %5.3f\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255106/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255106/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%f %f %f %f %f %f\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%5.3f %5.3f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca float, align 4 %b = alloca float, align 4 %c = alloca float, align 4 %d = alloca float, align 4 %e = alloca float, align 4 %f = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 %call9 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not10 = icmp eq i32 %call9, -1 br i1 %cmp.not10, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load float, ptr %a, align 4, !tbaa !5 %1 = load float, ptr %f, align 4, !tbaa !5 %2 = load float, ptr %d, align 4, !tbaa !5 %3 = load float, ptr %c, align 4, !tbaa !5 %4 = fneg float %2 %5 = load float, ptr %e, align 4, !tbaa !5 %6 = load float, ptr %b, align 4, !tbaa !5 %7 = insertelement <2 x float> poison, float %3, i64 0 %8 = insertelement <2 x float> %7, float %6, i64 1 %9 = insertelement <2 x float> poison, float %4, i64 0 %10 = shufflevector <2 x float> %9, <2 x float> poison, <2 x i32> zeroinitializer %11 = fmul <2 x float> %8, %10 %12 = insertelement <2 x float> poison, float %0, i64 0 %13 = shufflevector <2 x float> %12, <2 x float> poison, <2 x i32> zeroinitializer %14 = insertelement <2 x float> poison, float %1, i64 0 %15 = insertelement <2 x float> %14, float %5, i64 1 %16 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %13, <2 x float> %15, <2 x float> %11) %17 = extractelement <2 x float> %16, i64 0 %18 = extractelement <2 x float> %16, i64 1 %div = fdiv float %17, %18 %neg4 = fneg float %6 %19 = call float @llvm.fmuladd.f32(float %neg4, float %div, float %3) %div5 = fdiv float %19, %0 %conv = fpext float %div5 to double %conv6 = fpext float %div to double %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv, double noundef %conv6) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare float @llvm.fmuladd.f32(float, float, float) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !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> double calcY(int a,int b,int c,int d,int e,int f){ return (double)(c*d-a*f)/(b*d-a*e); } double calcX(int a,int b,int c,int d,int e,int f){ return (double)(c-b*calcY(a,b,c,d,e,f))/a; } int main(){ int a,b,c,d,e,f; while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){ printf("%.3lf %.3lf\n",calcX(a,b,c,d,e,f),calcY(a,b,c,d,e,f)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255164/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255164/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%.3lf %.3lf\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @calcY(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f) local_unnamed_addr #0 { entry: %mul = mul nsw i32 %d, %c %mul1 = mul nsw i32 %f, %a %sub = sub nsw i32 %mul, %mul1 %conv = sitofp i32 %sub to double %mul2 = mul nsw i32 %d, %b %mul3 = mul nsw i32 %e, %a %sub4 = sub nsw i32 %mul2, %mul3 %conv5 = sitofp i32 %sub4 to double %div = fdiv double %conv, %conv5 ret double %div } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local double @calcX(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e, i32 noundef %f) local_unnamed_addr #1 { entry: %conv = sitofp i32 %c to double %conv1 = sitofp i32 %b to double %mul.i = mul nsw i32 %d, %c %mul1.i = mul nsw i32 %f, %a %sub.i = sub nsw i32 %mul.i, %mul1.i %conv.i = sitofp i32 %sub.i to double %mul2.i = mul nsw i32 %d, %b %mul3.i = mul nsw i32 %e, %a %sub4.i = sub nsw i32 %mul2.i, %mul3.i %conv5.i = sitofp i32 %sub4.i to double %div.i = fdiv double %conv.i, %conv5.i %neg = fneg double %conv1 %0 = tail call double @llvm.fmuladd.f64(double %neg, double %div.i, double %conv) %conv2 = sitofp i32 %a to double %div = fdiv double %0, %conv2 ret double %div } ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 %e = alloca i32, align 4 %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #6 %call6 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not7 = icmp eq i32 %call6, -1 br i1 %cmp.not7, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %4 = load i32, ptr %e, align 4, !tbaa !5 %5 = load i32, ptr %f, align 4, !tbaa !5 %conv.i = sitofp i32 %2 to double %conv1.i = sitofp i32 %1 to double %mul.i.i = mul nsw i32 %3, %2 %mul1.i.i = mul nsw i32 %5, %0 %sub.i.i = sub nsw i32 %mul.i.i, %mul1.i.i %conv.i.i = sitofp i32 %sub.i.i to double %mul2.i.i = mul nsw i32 %3, %1 %mul3.i.i = mul nsw i32 %4, %0 %sub4.i.i = sub nsw i32 %mul2.i.i, %mul3.i.i %conv5.i.i = sitofp i32 %sub4.i.i to double %div.i.i = fdiv double %conv.i.i, %conv5.i.i %neg.i = fneg double %conv1.i %6 = call double @llvm.fmuladd.f64(double %neg.i, double %div.i.i, double %conv.i) %conv2.i = sitofp i32 %0 to double %div.i = fdiv double %6, %conv2.i %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div.i, double noundef %div.i.i) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #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) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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(){ float a, b, c, d, e, f; float x, y; int ix, iy; while ( 6 == scanf( "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f ) ) { y = ( a * f - c * d ) / ( a * e - b * d ); x = ( c - b * y ) / a; ix = ( int )( x * 10000.0 ); iy = ( int )( y * 10000.0 ); ix += ( ix > 0 ) ? 5 : -5; iy += ( iy > 0 ) ? 5 : -5; ix /= 10; iy /= 10; x = ( float )ix; y = ( float )iy; x /= 1000.0; y /= 1000.0; printf( "%.3f %.3f\n", x, y ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255207/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%f %f %f %f %f %f\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca float, align 4 %b = alloca float, align 4 %c = alloca float, align 4 %d = alloca float, align 4 %e = alloca float, align 4 %f = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 %call40 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp41 = icmp eq i32 %call40, 6 br i1 %cmp41, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %0 = load float, ptr %a, align 4, !tbaa !5 %1 = load float, ptr %f, align 4, !tbaa !5 %2 = load float, ptr %c, align 4, !tbaa !5 %3 = load float, ptr %d, align 4, !tbaa !5 %4 = load float, ptr %e, align 4, !tbaa !5 %5 = load float, ptr %b, align 4, !tbaa !5 %6 = insertelement <2 x float> poison, float %2, i64 0 %7 = insertelement <2 x float> %6, float %5, i64 1 %8 = fneg <2 x float> %7 %9 = insertelement <2 x float> poison, float %3, i64 0 %10 = shufflevector <2 x float> %9, <2 x float> poison, <2 x i32> zeroinitializer %11 = fmul <2 x float> %10, %8 %12 = insertelement <2 x float> poison, float %0, i64 0 %13 = shufflevector <2 x float> %12, <2 x float> poison, <2 x i32> zeroinitializer %14 = insertelement <2 x float> poison, float %1, i64 0 %15 = insertelement <2 x float> %14, float %4, i64 1 %16 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %13, <2 x float> %15, <2 x float> %11) %17 = extractelement <2 x float> %16, i64 0 %18 = extractelement <2 x float> %16, i64 1 %19 = extractelement <2 x float> %8, i64 1 %div = fdiv float %17, %18 %20 = call float @llvm.fmuladd.f32(float %19, float %div, float %2) %div5 = fdiv float %20, %0 %21 = insertelement <2 x float> poison, float %div, i64 0 %22 = insertelement <2 x float> %21, float %div5, i64 1 %23 = fpext <2 x float> %22 to <2 x double> %24 = fmul <2 x double> %23, <double 1.000000e+04, double 1.000000e+04> %25 = fptosi <2 x double> %24 to <2 x i32> %26 = icmp sgt <2 x i32> %25, zeroinitializer %27 = extractelement <2 x i1> %26, i64 1 %cond = select i1 %27, i32 5, i32 -5 %28 = extractelement <2 x i32> %25, i64 1 %add = add nsw i32 %cond, %28 %29 = extractelement <2 x i1> %26, i64 0 %cond14 = select i1 %29, i32 5, i32 -5 %30 = extractelement <2 x i32> %25, i64 0 %add15 = add nsw i32 %cond14, %30 %div16 = sdiv i32 %add, 10 %div17 = sdiv i32 %add15, 10 %conv18 = sitofp i32 %div16 to float %conv19 = sitofp i32 %div17 to float %conv22 = fdiv float %conv18, 1.000000e+03 %conv25 = fdiv float %conv19, 1.000000e+03 %conv26 = fpext float %conv22 to double %conv27 = fpext float %conv25 to double %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv26, double noundef %conv27) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp = icmp eq i32 %call, 6 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare float @llvm.fmuladd.f32(float, float, float) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { double a,b,c,d,e,f,n,m,x,y; while((scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f))!=EOF){ y=(a*f-c*d)/(a*e-d*b); x=c/a-b*y/a; y=1000*y; x=1000*x; if(y>=0) y=y+0.5; else if(x>=0) x=x+0.5; else if(y<0) y=y-0.5; else if(x<0) x=x-0.5; y=(int)y; x=(int)x; y=y/1000; x=x/1000; printf("%.3lf %.3lf\n",x,y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255258/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255258/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf %lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%.3lf %.3lf\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 %c = alloca double, align 8 %d = alloca double, align 8 %e = alloca double, align 8 %f = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #4 %call44 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not45 = icmp eq i32 %call44, -1 br i1 %cmp.not45, label %while.end, label %while.body while.body: ; preds = %entry, %if.end22 %0 = load double, ptr %a, align 8, !tbaa !5 %1 = load double, ptr %f, align 8, !tbaa !5 %2 = load double, ptr %c, align 8, !tbaa !5 %3 = load double, ptr %d, align 8, !tbaa !5 %4 = load double, ptr %e, align 8, !tbaa !5 %5 = load double, ptr %b, align 8, !tbaa !5 %6 = insertelement <2 x double> poison, double %2, i64 0 %7 = insertelement <2 x double> %6, double %3, i64 1 %8 = fneg <2 x double> %7 %9 = insertelement <2 x double> poison, double %3, i64 0 %10 = insertelement <2 x double> %9, double %5, i64 1 %11 = fmul <2 x double> %10, %8 %12 = insertelement <2 x double> poison, double %0, i64 0 %13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer %14 = insertelement <2 x double> poison, double %1, i64 0 %15 = insertelement <2 x double> %14, double %4, i64 1 %16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %15, <2 x double> %11) %17 = extractelement <2 x double> %16, i64 0 %18 = extractelement <2 x double> %16, i64 1 %div = fdiv double %17, %18 %div4 = fdiv double %2, %0 %mul = fmul double %5, %div %div5 = fdiv double %mul, %0 %sub = fsub double %div4, %div5 %mul6 = fmul double %div, 1.000000e+03 %mul7 = fmul double %sub, 1.000000e+03 %cmp8 = fcmp ult double %mul6, 0.000000e+00 br i1 %cmp8, label %if.else, label %if.then if.then: ; preds = %while.body %add = fadd double %mul6, 5.000000e-01 br label %if.end22 if.else: ; preds = %while.body %cmp9 = fcmp ult double %mul7, 0.000000e+00 br i1 %cmp9, label %if.else12, label %if.then10 if.then10: ; preds = %if.else %add11 = fadd double %mul7, 5.000000e-01 br label %if.end22 if.else12: ; preds = %if.else %cmp13 = fcmp olt double %mul6, 0.000000e+00 br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.else12 %sub15 = fadd double %mul6, -5.000000e-01 br label %if.end22 if.else16: ; preds = %if.else12 %cmp17 = fcmp olt double %mul7, 0.000000e+00 br i1 %cmp17, label %if.then18, label %if.end22 if.then18: ; preds = %if.else16 %sub19 = fadd double %mul7, -5.000000e-01 br label %if.end22 if.end22: ; preds = %if.then10, %if.else16, %if.then18, %if.then14, %if.then %x.0 = phi double [ %mul7, %if.then ], [ %add11, %if.then10 ], [ %mul7, %if.then14 ], [ %sub19, %if.then18 ], [ %mul7, %if.else16 ] %y.0 = phi double [ %add, %if.then ], [ %mul6, %if.then10 ], [ %sub15, %if.then14 ], [ %mul6, %if.then18 ], [ %mul6, %if.else16 ] %conv = fptosi double %y.0 to i32 %conv23 = sitofp i32 %conv to double %conv24 = fptosi double %x.0 to i32 %conv25 = sitofp i32 %conv24 to double %div26 = fdiv double %conv23, 1.000000e+03 %div27 = fdiv double %conv25, 1.000000e+03 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div27, double noundef %div26) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %if.end22, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #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 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(int argc, const char * argv[]) { double a[3], b[3]; double x = 0, y = 0; double fa[2], fb[2]; while (scanf("%lf %lf %lf %lf %lf %lf", &a[0], &a[1], &a[2], &b[0], &b[1], &b[2]) != EOF) { fa[0] = a[1] * b[0]; fa[1] = a[2] * b[0]; fb[0] = b[1] * a[0]; fb[1] = b[2] * a[0]; y = (fa[1] - fb[1]) / (fa[0] - fb[0]); x = (a[2] - a[1] * y) / a[0]; printf("%0.3f %0.3f\n", x, y); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255300/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255300/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf %lf %lf %lf\00", align 1 @.str.1 = private unnamed_addr constant [13 x i8] c"%0.3f %0.3f\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 [3 x double], align 16 %b = alloca [3 x double], align 16 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %b) #4 %arrayidx1 = getelementptr inbounds [3 x double], ptr %a, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [3 x double], ptr %a, i64 0, i64 2 %arrayidx4 = getelementptr inbounds [3 x double], ptr %b, i64 0, i64 1 %arrayidx5 = getelementptr inbounds [3 x double], ptr %b, i64 0, i64 2 %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5) %cmp.not34 = icmp eq i32 %call33, -1 br i1 %cmp.not34, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load <2 x double>, ptr %b, align 16 %1 = load double, ptr %a, align 16, !tbaa !5 %2 = load <2 x double>, ptr %arrayidx1, align 8, !tbaa !5 %3 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> zeroinitializer %4 = fmul <2 x double> %2, %3 %5 = load <2 x double>, ptr %arrayidx4, align 8, !tbaa !5 %6 = insertelement <2 x double> poison, double %1, i64 0 %7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer %8 = fmul <2 x double> %5, %7 %9 = fsub <2 x double> %4, %8 %10 = extractelement <2 x double> %9, i64 0 %11 = extractelement <2 x double> %9, i64 1 %div = fdiv double %11, %10 %12 = extractelement <2 x double> %2, i64 0 %neg = fneg double %12 %13 = extractelement <2 x double> %2, i64 1 %14 = call double @llvm.fmuladd.f64(double %neg, double %div, double %13) %div30 = fdiv double %14, %1 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div30, double noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { float a, b, c, d, e, f; float aa, bb, cc, dd, ee, ff; float x, y; while (scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF){ aa = a * d; bb = b * d; cc = c * d; dd = d * a; ee = e * a; ff = f * a; bb -= ee; cc -= ff; cc /= bb; y = cc; c -= b * y; c /= a; x = c; printf("%.3f %.3f\n", x, y); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255344/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255344/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%f %f %f %f %f %f\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca float, align 4 %b = alloca float, align 4 %c = alloca float, align 4 %d = alloca float, align 4 %e = alloca float, align 4 %f = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #4 %call15 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not16 = icmp eq i32 %call15, -1 br i1 %cmp.not16, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %0 = load float, ptr %a, align 4, !tbaa !5 %1 = load float, ptr %d, align 4, !tbaa !5 %2 = load float, ptr %b, align 4, !tbaa !5 %3 = load float, ptr %c, align 4, !tbaa !5 %4 = load float, ptr %e, align 4, !tbaa !5 %5 = load float, ptr %f, align 4, !tbaa !5 %6 = insertelement <2 x float> poison, float %1, i64 0 %7 = shufflevector <2 x float> %6, <2 x float> poison, <2 x i32> zeroinitializer %8 = insertelement <2 x float> poison, float %3, i64 0 %9 = insertelement <2 x float> %8, float %2, i64 1 %10 = fmul <2 x float> %7, %9 %11 = insertelement <2 x float> poison, float %0, i64 0 %12 = shufflevector <2 x float> %11, <2 x float> poison, <2 x i32> zeroinitializer %13 = insertelement <2 x float> poison, float %5, i64 0 %14 = insertelement <2 x float> %13, float %4, i64 1 %15 = fmul <2 x float> %12, %14 %16 = fsub <2 x float> %10, %15 %17 = extractelement <2 x float> %16, i64 0 %18 = extractelement <2 x float> %16, i64 1 %div = fdiv float %17, %18 %neg = fneg float %2 %19 = call float @llvm.fmuladd.f32(float %neg, float %div, float %3) %div8 = fdiv float %19, %0 store float %div8, ptr %c, align 4, !tbaa !5 %conv = fpext float %div8 to double %conv9 = fpext float %div to double %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv, double noundef %conv9) %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare float @llvm.fmuladd.f32(float, float, float) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> int main() { float a, b, c, d, e, f; for (;;) { int i = scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f); if (i != 6) break; if (a * e - b * d == 0) { printf("%.3f %.3f\n", 1.0, 1.0); } else { c = c / a; b = b / a; a = a / a; f = f - d * c; e = e - d * b; d = d - d * a; f = f / e; e = e / e; c = c - b * f; b = b - b * e; printf("%.3f %.3f\n", c, f); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255388/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255388/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [18 x i8] c"%f %f %f %f %f %f\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%.3f %.3f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca float, align 4 %b = alloca float, align 4 %c = alloca float, align 4 %d = alloca float, align 4 %e = alloca float, align 4 %f = alloca float, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5 %call25 = 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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not26 = icmp eq i32 %call25, 6 br i1 %cmp.not26, label %if.end, label %for.end if.end: ; preds = %entry, %cleanup %0 = load float, ptr %a, align 4, !tbaa !5 %1 = load float, ptr %e, align 4, !tbaa !5 %2 = load float, ptr %b, align 4, !tbaa !5 %3 = load float, ptr %d, align 4, !tbaa !5 %4 = fneg float %2 %neg = fmul float %3, %4 %5 = call float @llvm.fmuladd.f32(float %0, float %1, float %neg) %cmp2 = fcmp oeq float %5, 0.000000e+00 br i1 %cmp2, label %if.then3, label %if.else if.then3: ; preds = %if.end %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef 1.000000e+00, double noundef 1.000000e+00) br label %cleanup if.else: ; preds = %if.end %6 = load float, ptr %c, align 4, !tbaa !5 %div6 = fdiv float %0, %0 store float %div6, ptr %a, align 4, !tbaa !5 %7 = load float, ptr %f, align 4, !tbaa !5 %neg7 = fneg float %3 %8 = insertelement <2 x float> poison, float %6, i64 0 %9 = insertelement <2 x float> %8, float %2, i64 1 %10 = insertelement <2 x float> poison, float %0, i64 0 %11 = shufflevector <2 x float> %10, <2 x float> poison, <2 x i32> zeroinitializer %12 = fdiv <2 x float> %9, %11 %13 = insertelement <2 x float> poison, float %neg7, i64 0 %14 = shufflevector <2 x float> %13, <2 x float> poison, <2 x i32> zeroinitializer %15 = insertelement <2 x float> poison, float %7, i64 0 %16 = insertelement <2 x float> %15, float %1, i64 1 %17 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %14, <2 x float> %12, <2 x float> %16) %18 = call float @llvm.fmuladd.f32(float %neg7, float %div6, float %3) store float %18, ptr %d, align 4, !tbaa !5 %19 = extractelement <2 x float> %17, i64 0 %20 = extractelement <2 x float> %17, i64 1 %div10 = fdiv float %19, %20 store float %div10, ptr %f, align 4, !tbaa !5 %div11 = fdiv float %20, %20 store float %div11, ptr %e, align 4, !tbaa !5 %21 = extractelement <2 x float> %12, i64 1 %neg12 = fneg float %21 %22 = extractelement <2 x float> %12, i64 0 %23 = call float @llvm.fmuladd.f32(float %neg12, float %div10, float %22) store float %23, ptr %c, align 4, !tbaa !5 %24 = call float @llvm.fmuladd.f32(float %neg12, float %div11, float %21) store float %24, ptr %b, align 4, !tbaa !5 %conv = fpext float %23 to double %conv14 = fpext float %div10 to double %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv, double noundef %conv14) br label %cleanup cleanup: ; preds = %if.then3, %if.else %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, ptr noundef nonnull %e, ptr noundef nonnull %f) %cmp.not = icmp eq i32 %call, 6 br i1 %cmp.not, label %if.end, label %for.end for.end: ; preds = %cleanup, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare float @llvm.fmuladd.f32(float, float, float) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
// AOJ 2021: Princess in Danger // 2017.12.11 bal4u@uu #include <stdio.h> #include <string.h> #define MAX 10000 typedef struct { int t, node; } QUE; QUE que[MAX]; int qsize; #define PARENT(i) ((i)>>1) #define LEFT(i) ((i)<<1) #define RIGHT(i) (((i)<<1)+1) void min_heapify(int i) { int l, r, min; QUE qt; l = LEFT(i), r = RIGHT(i); if (l < qsize && que[l].t < que[i].t) min = l; else min = i; if (r < qsize && que[r].t < que[min].t) min = r; if (min != i) { qt = que[i], que[i] = que[min], que[min] = qt; min_heapify(min); } } void deq() { que[0] = que[--qsize]; min_heapify(0); } void enq(int n, int t) { int i, min; QUE qt; i = qsize++; que[i].node = n, que[i].t = t; while (i > 0 && que[min = PARENT(i)].t > que[i].t) { qt = que[i], que[i] = que[min], que[min] = qt; i = min; } } #define INF 0x07070707 typedef struct { int to[70], t[70]; } TBL; TBL tbl[10200]; int len[10200]; int f[101]; int dist[10200]; void dijkstra(int start) { int i, s, t, e, d; memset(dist, INF, sizeof(dist)); qsize = 0; dist[start] = 0; enq(start, 0); while (qsize) { s = que[0].node, t = que[0].t; deq(); if (dist[s] < t) continue; for (i = 0; i < len[s]; i++) { e = tbl[s].to[i], d = dist[s] + tbl[s].t[i]; if (d < dist[e]) dist[e] = d, enq(e, d); } } } char buf[400], *p; int getint() { int n = 0; while (*p >= '0') n = 10*n + (*p++ & 0xf); p++; return n; } int main() { int n, m, l, k, a, h, i, j, ans; int x, y, t, u, v, u2, v2, m1; while (fgets(p=buf, 60, stdin) && *p != '0') { n = getint(), m = getint(), l = getint(); k = getint(), a = getint(), h = getint(); m1 = m+1; if (l > 0) { fgets(p=buf, sizeof(buf), stdin); for (i = 0; i < l; i++) f[i] = getint(); } f[l++] = a, f[l++] = h; memset(len, 0, sizeof(len)); while (k--) { fgets(p=buf, 20, stdin); x = getint()*m1, y = getint()*m1, t = getint(); for (j = t; j <= m; j++) { u = x + j, v = y + j; u2 = u - t, v2 = v - t; i = len[u]++, tbl[u].to[i] = v2, tbl[u].t[i] = t; i = len[v]++, tbl[v].to[i] = u2, tbl[v].t[i] = t; } } for (i = 0; i < l; i++) { u = f[i]*m1; for (j = 0; j < m; j++) { v = u+j, v2 = v+1; t = len[v]++, tbl[v].to[t] = v2, tbl[v].t[t] = 1; } } dijkstra(a*m1+m); ans = INF; m1 *= h; for (i = 0; i <= m; i++) if (dist[m1+i] < ans) ans = dist[m1+i]; if (ans == INF) puts("Help!"); else printf("%d\n", ans); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255430/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255430/source.c" target datalayout = "e-m:e-p270: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.QUE = type { i32, i32 } %struct.TBL = type { [70 x i32], [70 x i32] } @qsize = dso_local local_unnamed_addr global i32 0, align 4 @que = dso_local local_unnamed_addr global [10000 x %struct.QUE] zeroinitializer, align 16 @dist = dso_local local_unnamed_addr global [10200 x i32] zeroinitializer, align 16 @len = dso_local local_unnamed_addr global [10200 x i32] zeroinitializer, align 16 @tbl = dso_local local_unnamed_addr global [10200 x %struct.TBL] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global ptr null, align 8 @buf = dso_local global [400 x i8] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [6 x i8] c"Help!\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 { entry: %0 = load i32, ptr @qsize, align 4, !tbaa !5 br label %tailrecurse tailrecurse: ; preds = %if.then18, %entry %i.tr = phi i32 [ %i, %entry ], [ %min.1, %if.then18 ] %shl = shl i32 %i.tr, 1 %add = or i32 %shl, 1 %cmp = icmp slt i32 %shl, %0 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %tailrecurse %idxprom = sext i32 %shl to i64 %arrayidx = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 16, !tbaa !9 %idxprom2 = sext i32 %i.tr to i64 %arrayidx3 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2 %2 = load i32, ptr %arrayidx3, align 8, !tbaa !9 %cmp5 = icmp slt i32 %1, %2 br i1 %cmp5, label %if.end, label %if.else if.else: ; preds = %land.lhs.true, %tailrecurse br label %if.end if.end: ; preds = %land.lhs.true, %if.else %min.0 = phi i32 [ %i.tr, %if.else ], [ %shl, %land.lhs.true ] %cmp6 = icmp slt i32 %add, %0 br i1 %cmp6, label %land.lhs.true7, label %if.end16 land.lhs.true7: ; preds = %if.end %idxprom8 = sext i32 %add to i64 %arrayidx9 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8 %3 = load i32, ptr %arrayidx9, align 8, !tbaa !9 %idxprom11 = sext i32 %min.0 to i64 %arrayidx12 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11 %4 = load i32, ptr %arrayidx12, align 8, !tbaa !9 %cmp14 = icmp slt i32 %3, %4 %spec.select = select i1 %cmp14, i32 %add, i32 %min.0 br label %if.end16 if.end16: ; preds = %land.lhs.true7, %if.end %min.1 = phi i32 [ %min.0, %if.end ], [ %spec.select, %land.lhs.true7 ] %cmp17.not = icmp eq i32 %min.1, %i.tr br i1 %cmp17.not, label %if.end27, label %if.then18 if.then18: ; preds = %if.end16 %idxprom19 = sext i32 %i.tr to i64 %arrayidx20 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19 %5 = load i64, ptr %arrayidx20, align 8 %idxprom23 = sext i32 %min.1 to i64 %arrayidx24 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23 %6 = load i64, ptr %arrayidx24, align 8 store i64 %6, ptr %arrayidx20, align 8 store i64 %5, ptr %arrayidx24, align 8 br label %tailrecurse if.end27: ; preds = %if.end16 ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @deq() local_unnamed_addr #0 { entry: %0 = load i32, ptr @qsize, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr @qsize, align 4, !tbaa !5 %idxprom = sext i32 %dec to i64 %arrayidx = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8 store i64 %1, ptr @que, align 16 %2 = trunc i64 %1 to i32 br label %tailrecurse.i tailrecurse.i: ; preds = %if.then18.i, %entry %i.tr.i = phi i32 [ 0, %entry ], [ %min.1.i, %if.then18.i ] %shl.i = shl i32 %i.tr.i, 1 %add.i = or i32 %shl.i, 1 %cmp.i = icmp slt i32 %shl.i, %dec br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i land.lhs.true.i: ; preds = %tailrecurse.i %idxprom.i = sext i32 %shl.i to i64 %arrayidx.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i %3 = load i32, ptr %arrayidx.i, align 16, !tbaa !9 %cmp5.i = icmp slt i32 %3, %2 br i1 %cmp5.i, label %if.end.i, label %if.else.i if.else.i: ; preds = %land.lhs.true.i, %tailrecurse.i br label %if.end.i if.end.i: ; preds = %if.else.i, %land.lhs.true.i %min.0.i = phi i32 [ %i.tr.i, %if.else.i ], [ %shl.i, %land.lhs.true.i ] %cmp6.i = icmp slt i32 %add.i, %dec br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end16.i land.lhs.true7.i: ; preds = %if.end.i %idxprom8.i = sext i32 %add.i to i64 %arrayidx9.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i %4 = load i32, ptr %arrayidx9.i, align 8, !tbaa !9 %idxprom11.i = sext i32 %min.0.i to i64 %arrayidx12.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i %5 = load i32, ptr %arrayidx12.i, align 8, !tbaa !9 %cmp14.i = icmp slt i32 %4, %5 %spec.select.i = select i1 %cmp14.i, i32 %add.i, i32 %min.0.i br label %if.end16.i if.end16.i: ; preds = %land.lhs.true7.i, %if.end.i %min.1.i = phi i32 [ %min.0.i, %if.end.i ], [ %spec.select.i, %land.lhs.true7.i ] %cmp17.not.i = icmp eq i32 %min.1.i, %i.tr.i br i1 %cmp17.not.i, label %min_heapify.exit, label %if.then18.i if.then18.i: ; preds = %if.end16.i %idxprom19.i = sext i32 %i.tr.i to i64 %arrayidx20.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i %idxprom23.i = sext i32 %min.1.i to i64 %arrayidx24.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i %6 = load i64, ptr %arrayidx24.i, align 8 store i64 %6, ptr %arrayidx20.i, align 8 store i64 %1, ptr %arrayidx24.i, align 8 br label %tailrecurse.i min_heapify.exit: ; preds = %if.end16.i ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @enq(i32 noundef %n, i32 noundef %t) local_unnamed_addr #0 { entry: %0 = load i32, ptr @qsize, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @qsize, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom %node = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1 store i32 %n, ptr %node, align 4, !tbaa !11 store i32 %t, ptr %arrayidx, align 8, !tbaa !9 %cmp27 = icmp sgt i32 %0, 0 br i1 %cmp27, label %land.rhs.preheader, label %while.end land.rhs.preheader: ; preds = %entry %idxprom7.phi.trans.insert = zext i32 %0 to i64 %arrayidx8.phi.trans.insert = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.phi.trans.insert %.pre = load i32, ptr %arrayidx8.phi.trans.insert, align 8, !tbaa !9 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %1 = phi i32 [ %5, %while.body ], [ %.pre, %land.rhs.preheader ] %i.028 = phi i32 [ %shr, %while.body ], [ %0, %land.rhs.preheader ] %shr = lshr i32 %i.028, 1 %idxprom4 = zext i32 %shr to i64 %arrayidx5 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4 %2 = load i32, ptr %arrayidx5, align 8, !tbaa !9 %cmp10 = icmp sgt i32 %2, %1 br i1 %cmp10, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = zext i32 %i.028 to i64 %arrayidx8 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7 %3 = load i64, ptr %arrayidx8, align 8 %4 = load i64, ptr %arrayidx5, align 8 store i64 %4, ptr %arrayidx8, align 8 store i64 %3, ptr %arrayidx5, align 8 %cmp.not = icmp ult i32 %i.028, 2 %5 = trunc i64 %3 to i32 br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12 while.end: ; preds = %land.rhs, %while.body, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dijkstra(i32 noundef %start) local_unnamed_addr #1 { enq.exit: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40800) @dist, i8 7, i64 40800, i1 false) store i32 0, ptr @qsize, align 4, !tbaa !5 %idxprom = sext i32 %start to i64 %arrayidx = getelementptr inbounds [10200 x i32], ptr @dist, i64 0, i64 %idxprom store i32 0, ptr %arrayidx, align 4, !tbaa !5 store i32 %start, ptr getelementptr inbounds ([10000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !11 store i32 0, ptr @que, align 16, !tbaa !9 br label %while.body while.condthread-pre-split: ; preds = %for.inc, %for.cond.preheader, %deq.exit %qsize.promoted64 = phi i32 [ %dec.i, %deq.exit ], [ %dec.i, %for.cond.preheader ], [ %inc.i3858, %for.inc ] %tobool.not = icmp eq i32 %qsize.promoted64, 0 br i1 %tobool.not, label %while.end, label %while.body while.body: ; preds = %enq.exit, %while.condthread-pre-split %0 = phi i32 [ 1, %enq.exit ], [ %qsize.promoted64, %while.condthread-pre-split ] %1 = load i32, ptr getelementptr inbounds ([10000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !11 %2 = load i32, ptr @que, align 16, !tbaa !9 %dec.i = add nsw i32 %0, -1 %idxprom.i36 = sext i32 %dec.i to i64 %arrayidx.i37 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i36 %3 = load i64, ptr %arrayidx.i37, align 8 store i64 %3, ptr @que, align 16 %4 = trunc i64 %3 to i32 br label %tailrecurse.i.i tailrecurse.i.i: ; preds = %if.then18.i.i, %while.body %i.tr.i.i = phi i32 [ 0, %while.body ], [ %min.1.i.i, %if.then18.i.i ] %shl.i.i = shl i32 %i.tr.i.i, 1 %add.i.i = or i32 %shl.i.i, 1 %cmp.i.i = icmp slt i32 %shl.i.i, %dec.i br i1 %cmp.i.i, label %land.lhs.true.i.i, label %if.else.i.i land.lhs.true.i.i: ; preds = %tailrecurse.i.i %idxprom.i.i = sext i32 %shl.i.i to i64 %arrayidx.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i.i %5 = load i32, ptr %arrayidx.i.i, align 16, !tbaa !9 %cmp5.i.i = icmp slt i32 %5, %4 br i1 %cmp5.i.i, label %if.end.i.i, label %if.else.i.i if.else.i.i: ; preds = %land.lhs.true.i.i, %tailrecurse.i.i br label %if.end.i.i if.end.i.i: ; preds = %if.else.i.i, %land.lhs.true.i.i %min.0.i.i = phi i32 [ %i.tr.i.i, %if.else.i.i ], [ %shl.i.i, %land.lhs.true.i.i ] %cmp6.i.i = icmp slt i32 %add.i.i, %dec.i br i1 %cmp6.i.i, label %land.lhs.true7.i.i, label %if.end16.i.i land.lhs.true7.i.i: ; preds = %if.end.i.i %idxprom8.i.i = sext i32 %add.i.i to i64 %arrayidx9.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i.i %6 = load i32, ptr %arrayidx9.i.i, align 8, !tbaa !9 %idxprom11.i.i = sext i32 %min.0.i.i to i64 %arrayidx12.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i.i %7 = load i32, ptr %arrayidx12.i.i, align 8, !tbaa !9 %cmp14.i.i = icmp slt i32 %6, %7 %spec.select.i.i = select i1 %cmp14.i.i, i32 %add.i.i, i32 %min.0.i.i br label %if.end16.i.i if.end16.i.i: ; preds = %land.lhs.true7.i.i, %if.end.i.i %min.1.i.i = phi i32 [ %min.0.i.i, %if.end.i.i ], [ %spec.select.i.i, %land.lhs.true7.i.i ] %cmp17.not.i.i = icmp eq i32 %min.1.i.i, %i.tr.i.i br i1 %cmp17.not.i.i, label %deq.exit, label %if.then18.i.i if.then18.i.i: ; preds = %if.end16.i.i %idxprom19.i.i = sext i32 %i.tr.i.i to i64 %arrayidx20.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i.i %idxprom23.i.i = sext i32 %min.1.i.i to i64 %arrayidx24.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i.i %8 = load i64, ptr %arrayidx24.i.i, align 8 store i64 %8, ptr %arrayidx20.i.i, align 8 store i64 %3, ptr %arrayidx24.i.i, align 8 br label %tailrecurse.i.i deq.exit: ; preds = %if.end16.i.i %idxprom1 = sext i32 %1 to i64 %arrayidx2 = getelementptr inbounds [10200 x i32], ptr @dist, i64 0, i64 %idxprom1 %9 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp slt i32 %9, %2 br i1 %cmp, label %while.condthread-pre-split, label %for.cond.preheader, !llvm.loop !14 for.cond.preheader: ; preds = %deq.exit %arrayidx4 = getelementptr inbounds [10200 x i32], ptr @len, i64 0, i64 %idxprom1 %10 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp560 = icmp sgt i32 %10, 0 br i1 %cmp560, label %for.body.lr.ph, label %while.condthread-pre-split, !llvm.loop !14 for.body.lr.ph: ; preds = %for.cond.preheader %arrayidx7 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %idxprom1 %wide.trip.count = zext i32 %10 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %inc.i385961 = phi i32 [ %dec.i, %for.body.lr.ph ], [ %inc.i3858, %for.inc ] %arrayidx9 = getelementptr inbounds [70 x i32], ptr %arrayidx7, i64 0, i64 %indvars.iv %11 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %12 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %idxprom1, i32 1, i64 %indvars.iv %13 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %add = add nsw i32 %13, %12 %idxprom17 = sext i32 %11 to i64 %arrayidx18 = getelementptr inbounds [10200 x i32], ptr @dist, i64 0, i64 %idxprom17 %14 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp slt i32 %add, %14 br i1 %cmp19, label %if.then20, label %for.inc if.then20: ; preds = %for.body store i32 %add, ptr %arrayidx18, align 4, !tbaa !5 %inc.i38 = add nsw i32 %inc.i385961, 1 %idxprom.i39 = sext i32 %inc.i385961 to i64 %arrayidx.i40 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i39 %node.i41 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i39, i32 1 store i32 %11, ptr %node.i41, align 4, !tbaa !11 store i32 %add, ptr %arrayidx.i40, align 8, !tbaa !9 %cmp27.i42 = icmp sgt i32 %inc.i385961, 0 br i1 %cmp27.i42, label %land.rhs.preheader.i43, label %for.inc land.rhs.preheader.i43: ; preds = %if.then20 %idxprom7.phi.trans.insert.i44 = zext i32 %inc.i385961 to i64 %arrayidx8.phi.trans.insert.i45 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.phi.trans.insert.i44 %.pre.i46 = load i32, ptr %arrayidx8.phi.trans.insert.i45, align 8, !tbaa !9 br label %land.rhs.i47 land.rhs.i47: ; preds = %while.body.i53, %land.rhs.preheader.i43 %15 = phi i32 [ %19, %while.body.i53 ], [ %.pre.i46, %land.rhs.preheader.i43 ] %i.028.i48 = phi i32 [ %shr.i49, %while.body.i53 ], [ %inc.i385961, %land.rhs.preheader.i43 ] %shr.i49 = lshr i32 %i.028.i48, 1 %idxprom4.i50 = zext i32 %shr.i49 to i64 %arrayidx5.i51 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom4.i50 %16 = load i32, ptr %arrayidx5.i51, align 8, !tbaa !9 %cmp10.i52 = icmp sgt i32 %16, %15 br i1 %cmp10.i52, label %while.body.i53, label %for.inc while.body.i53: ; preds = %land.rhs.i47 %idxprom7.i54 = zext i32 %i.028.i48 to i64 %arrayidx8.i55 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom7.i54 %17 = load i64, ptr %arrayidx8.i55, align 8 %18 = load i64, ptr %arrayidx5.i51, align 8 store i64 %18, ptr %arrayidx8.i55, align 8 store i64 %17, ptr %arrayidx5.i51, align 8 %cmp.not.i56 = icmp ult i32 %i.028.i48, 2 %19 = trunc i64 %17 to i32 br i1 %cmp.not.i56, label %for.inc, label %land.rhs.i47, !llvm.loop !12 for.inc: ; preds = %while.body.i53, %land.rhs.i47, %if.then20, %for.body %inc.i3858 = phi i32 [ %inc.i38, %if.then20 ], [ %inc.i385961, %for.body ], [ %inc.i38, %land.rhs.i47 ], [ %inc.i38, %while.body.i53 ] %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 %while.condthread-pre-split, label %for.body, !llvm.loop !15 while.end: ; preds = %while.condthread-pre-split store i32 0, ptr @qsize, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local i32 @getint() local_unnamed_addr #3 { entry: %p.promoted = load ptr, ptr @p, align 8, !tbaa !16 %0 = load i8, ptr %p.promoted, align 1, !tbaa !18 %cmp6 = icmp sgt i8 %0, 47 br i1 %cmp6, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %n.08 = phi i32 [ %add, %while.body ], [ 0, %entry ] %incdec.ptr57 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ] %mul = mul nsw i32 %n.08, 10 %incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr57, i64 1 store ptr %incdec.ptr, ptr @p, align 8, !tbaa !16 %1 = load i8, ptr %incdec.ptr57, align 1, !tbaa !18 %2 = and i8 %1, 15 %and = zext i8 %2 to i32 %add = add nsw i32 %mul, %and %3 = load i8, ptr %incdec.ptr, align 1, !tbaa !18 %cmp = icmp sgt i8 %3, 47 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !19 while.end: ; preds = %while.body, %entry %n.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %.lcssa = phi ptr [ %p.promoted, %entry ], [ %incdec.ptr, %while.body ] %incdec.ptr3 = getelementptr inbounds i8, ptr %.lcssa, i64 1 store ptr %incdec.ptr3, ptr @p, align 8, !tbaa !16 ret i32 %n.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: store ptr @buf, ptr @p, align 8, !tbaa !16 %0 = load ptr, ptr @stdin, align 8, !tbaa !16 %call318 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 60, ptr noundef %0) %tobool.not319 = icmp eq ptr %call318, null br i1 %tobool.not319, label %while.end121, label %land.rhs land.rhs: ; preds = %entry, %if.end120 %1 = load ptr, ptr @p, align 8, !tbaa !16 %2 = load i8, ptr %1, align 1, !tbaa !18 %cmp.not = icmp eq i8 %2, 48 br i1 %cmp.not, label %while.end121, label %while.body while.body: ; preds = %land.rhs %cmp6.i = icmp sgt i8 %2, 47 br i1 %cmp6.i, label %while.body.i, label %getint.exit while.body.i: ; preds = %while.body, %while.body.i %incdec.ptr57.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %1, %while.body ] %incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr57.i, i64 1 store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !16 %3 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !18 %cmp.i = icmp sgt i8 %3, 47 br i1 %cmp.i, label %while.body.i, label %getint.exit, !llvm.loop !19 getint.exit: ; preds = %while.body.i, %while.body %.lcssa.i = phi ptr [ %1, %while.body ], [ %incdec.ptr.i, %while.body.i ] %incdec.ptr3.i = getelementptr inbounds i8, ptr %.lcssa.i, i64 1 store ptr %incdec.ptr3.i, ptr @p, align 8, !tbaa !16 %4 = load i8, ptr %incdec.ptr3.i, align 1, !tbaa !18 %cmp6.i178 = icmp sgt i8 %4, 47 br i1 %cmp6.i178, label %while.body.i182, label %getint.exit190 while.body.i182: ; preds = %getint.exit, %while.body.i182 %n.08.i183 = phi i32 [ %add.i188, %while.body.i182 ], [ 0, %getint.exit ] %incdec.ptr57.i184 = phi ptr [ %incdec.ptr.i186, %while.body.i182 ], [ %incdec.ptr3.i, %getint.exit ] %mul.i185 = mul nsw i32 %n.08.i183, 10 %incdec.ptr.i186 = getelementptr inbounds i8, ptr %incdec.ptr57.i184, i64 1 store ptr %incdec.ptr.i186, ptr @p, align 8, !tbaa !16 %5 = load i8, ptr %incdec.ptr57.i184, align 1, !tbaa !18 %6 = and i8 %5, 15 %and.i187 = zext i8 %6 to i32 %add.i188 = add nsw i32 %mul.i185, %and.i187 %7 = load i8, ptr %incdec.ptr.i186, align 1, !tbaa !18 %cmp.i189 = icmp sgt i8 %7, 47 br i1 %cmp.i189, label %while.body.i182, label %getint.exit190, !llvm.loop !19 getint.exit190: ; preds = %while.body.i182, %getint.exit %n.0.lcssa.i179 = phi i32 [ 0, %getint.exit ], [ %add.i188, %while.body.i182 ] %8 = phi ptr [ %.lcssa.i, %getint.exit ], [ %incdec.ptr57.i184, %while.body.i182 ] %incdec.ptr3.i181 = getelementptr inbounds i8, ptr %8, i64 2 store ptr %incdec.ptr3.i181, ptr @p, align 8, !tbaa !16 %9 = load i8, ptr %incdec.ptr3.i181, align 1, !tbaa !18 %cmp6.i192 = icmp sgt i8 %9, 47 br i1 %cmp6.i192, label %while.body.i196, label %getint.exit204 while.body.i196: ; preds = %getint.exit190, %while.body.i196 %n.08.i197 = phi i32 [ %add.i202, %while.body.i196 ], [ 0, %getint.exit190 ] %incdec.ptr57.i198 = phi ptr [ %incdec.ptr.i200, %while.body.i196 ], [ %incdec.ptr3.i181, %getint.exit190 ] %mul.i199 = mul nsw i32 %n.08.i197, 10 %incdec.ptr.i200 = getelementptr inbounds i8, ptr %incdec.ptr57.i198, i64 1 store ptr %incdec.ptr.i200, ptr @p, align 8, !tbaa !16 %10 = load i8, ptr %incdec.ptr57.i198, align 1, !tbaa !18 %11 = and i8 %10, 15 %and.i201 = zext i8 %11 to i32 %add.i202 = add nsw i32 %mul.i199, %and.i201 %12 = load i8, ptr %incdec.ptr.i200, align 1, !tbaa !18 %cmp.i203 = icmp sgt i8 %12, 47 br i1 %cmp.i203, label %while.body.i196, label %getint.exit204, !llvm.loop !19 getint.exit204: ; preds = %while.body.i196, %getint.exit190 %n.0.lcssa.i193 = phi i32 [ 0, %getint.exit190 ], [ %add.i202, %while.body.i196 ] %.lcssa.i194 = phi ptr [ %incdec.ptr3.i181, %getint.exit190 ], [ %incdec.ptr.i200, %while.body.i196 ] %incdec.ptr3.i195 = getelementptr inbounds i8, ptr %.lcssa.i194, i64 1 store ptr %incdec.ptr3.i195, ptr @p, align 8, !tbaa !16 %13 = load i8, ptr %incdec.ptr3.i195, align 1, !tbaa !18 %cmp6.i206 = icmp sgt i8 %13, 47 br i1 %cmp6.i206, label %while.body.i210, label %getint.exit218 while.body.i210: ; preds = %getint.exit204, %while.body.i210 %n.08.i211 = phi i32 [ %add.i216, %while.body.i210 ], [ 0, %getint.exit204 ] %incdec.ptr57.i212 = phi ptr [ %incdec.ptr.i214, %while.body.i210 ], [ %incdec.ptr3.i195, %getint.exit204 ] %mul.i213 = mul nsw i32 %n.08.i211, 10 %incdec.ptr.i214 = getelementptr inbounds i8, ptr %incdec.ptr57.i212, i64 1 store ptr %incdec.ptr.i214, ptr @p, align 8, !tbaa !16 %14 = load i8, ptr %incdec.ptr57.i212, align 1, !tbaa !18 %15 = and i8 %14, 15 %and.i215 = zext i8 %15 to i32 %add.i216 = add nsw i32 %mul.i213, %and.i215 %16 = load i8, ptr %incdec.ptr.i214, align 1, !tbaa !18 %cmp.i217 = icmp sgt i8 %16, 47 br i1 %cmp.i217, label %while.body.i210, label %getint.exit218, !llvm.loop !19 getint.exit218: ; preds = %while.body.i210, %getint.exit204 %n.0.lcssa.i207 = phi i32 [ 0, %getint.exit204 ], [ %add.i216, %while.body.i210 ] %17 = phi ptr [ %.lcssa.i194, %getint.exit204 ], [ %incdec.ptr57.i212, %while.body.i210 ] %incdec.ptr3.i209 = getelementptr inbounds i8, ptr %17, i64 2 store ptr %incdec.ptr3.i209, ptr @p, align 8, !tbaa !16 %18 = load i8, ptr %incdec.ptr3.i209, align 1, !tbaa !18 %cmp6.i220 = icmp sgt i8 %18, 47 br i1 %cmp6.i220, label %while.body.i224, label %getint.exit232 while.body.i224: ; preds = %getint.exit218, %while.body.i224 %n.08.i225 = phi i32 [ %add.i230, %while.body.i224 ], [ 0, %getint.exit218 ] %incdec.ptr57.i226 = phi ptr [ %incdec.ptr.i228, %while.body.i224 ], [ %incdec.ptr3.i209, %getint.exit218 ] %mul.i227 = mul nsw i32 %n.08.i225, 10 %incdec.ptr.i228 = getelementptr inbounds i8, ptr %incdec.ptr57.i226, i64 1 store ptr %incdec.ptr.i228, ptr @p, align 8, !tbaa !16 %19 = load i8, ptr %incdec.ptr57.i226, align 1, !tbaa !18 %20 = and i8 %19, 15 %and.i229 = zext i8 %20 to i32 %add.i230 = add nsw i32 %mul.i227, %and.i229 %21 = load i8, ptr %incdec.ptr.i228, align 1, !tbaa !18 %cmp.i231 = icmp sgt i8 %21, 47 br i1 %cmp.i231, label %while.body.i224, label %getint.exit232, !llvm.loop !19 getint.exit232: ; preds = %while.body.i224, %getint.exit218 %n.0.lcssa.i221 = phi i32 [ 0, %getint.exit218 ], [ %add.i230, %while.body.i224 ] %.lcssa.i222 = phi ptr [ %incdec.ptr3.i209, %getint.exit218 ], [ %incdec.ptr.i228, %while.body.i224 ] %incdec.ptr3.i223 = getelementptr inbounds i8, ptr %.lcssa.i222, i64 1 store ptr %incdec.ptr3.i223, ptr @p, align 8, !tbaa !16 %22 = load i8, ptr %incdec.ptr3.i223, align 1, !tbaa !18 %cmp6.i234 = icmp sgt i8 %22, 47 br i1 %cmp6.i234, label %while.body.i238, label %getint.exit246 while.body.i238: ; preds = %getint.exit232, %while.body.i238 %n.08.i239 = phi i32 [ %add.i244, %while.body.i238 ], [ 0, %getint.exit232 ] %incdec.ptr57.i240 = phi ptr [ %incdec.ptr.i242, %while.body.i238 ], [ %incdec.ptr3.i223, %getint.exit232 ] %mul.i241 = mul nsw i32 %n.08.i239, 10 %incdec.ptr.i242 = getelementptr inbounds i8, ptr %incdec.ptr57.i240, i64 1 store ptr %incdec.ptr.i242, ptr @p, align 8, !tbaa !16 %23 = load i8, ptr %incdec.ptr57.i240, align 1, !tbaa !18 %24 = and i8 %23, 15 %and.i243 = zext i8 %24 to i32 %add.i244 = add nsw i32 %mul.i241, %and.i243 %25 = load i8, ptr %incdec.ptr.i242, align 1, !tbaa !18 %cmp.i245 = icmp sgt i8 %25, 47 br i1 %cmp.i245, label %while.body.i238, label %getint.exit246, !llvm.loop !19 getint.exit246: ; preds = %while.body.i238, %getint.exit232 %n.0.lcssa.i235 = phi i32 [ 0, %getint.exit232 ], [ %add.i244, %while.body.i238 ] %26 = phi ptr [ %.lcssa.i222, %getint.exit232 ], [ %incdec.ptr57.i240, %while.body.i238 ] %incdec.ptr3.i237 = getelementptr inbounds i8, ptr %26, i64 2 store ptr %incdec.ptr3.i237, ptr @p, align 8, !tbaa !16 %add = add i32 %n.0.lcssa.i179, 1 %cmp8 = icmp sgt i32 %n.0.lcssa.i193, 0 br i1 %cmp8, label %if.then, label %if.end if.then: ; preds = %getint.exit246 store ptr @buf, ptr @p, align 8, !tbaa !16 %27 = load ptr, ptr @stdin, align 8, !tbaa !16 %call10 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 400, ptr noundef %27) %p.promoted = load ptr, ptr @p, align 8, !tbaa !16 %wide.trip.count = zext i32 %n.0.lcssa.i193 to i64 br label %for.body for.body: ; preds = %if.then, %getint.exit260 %indvars.iv = phi i64 [ 0, %if.then ], [ %indvars.iv.next, %getint.exit260 ] %incdec.ptr.i256303304 = phi ptr [ %p.promoted, %if.then ], [ %incdec.ptr3.i251, %getint.exit260 ] %28 = load i8, ptr %incdec.ptr.i256303304, align 1, !tbaa !18 %cmp6.i248 = icmp sgt i8 %28, 47 br i1 %cmp6.i248, label %while.body.i252, label %getint.exit260 while.body.i252: ; preds = %for.body, %while.body.i252 %n.08.i253 = phi i32 [ %add.i258, %while.body.i252 ], [ 0, %for.body ] %incdec.ptr57.i254 = phi ptr [ %incdec.ptr.i256, %while.body.i252 ], [ %incdec.ptr.i256303304, %for.body ] %mul.i255 = mul nsw i32 %n.08.i253, 10 %incdec.ptr.i256 = getelementptr inbounds i8, ptr %incdec.ptr57.i254, i64 1 store ptr %incdec.ptr.i256, ptr @p, align 8, !tbaa !16 %29 = load i8, ptr %incdec.ptr57.i254, align 1, !tbaa !18 %30 = and i8 %29, 15 %and.i257 = zext i8 %30 to i32 %add.i258 = add nsw i32 %mul.i255, %and.i257 %31 = load i8, ptr %incdec.ptr.i256, align 1, !tbaa !18 %cmp.i259 = icmp sgt i8 %31, 47 br i1 %cmp.i259, label %while.body.i252, label %getint.exit260, !llvm.loop !19 getint.exit260: ; preds = %while.body.i252, %for.body %n.0.lcssa.i249 = phi i32 [ 0, %for.body ], [ %add.i258, %while.body.i252 ] %.lcssa.i250 = phi ptr [ %incdec.ptr.i256303304, %for.body ], [ %incdec.ptr.i256, %while.body.i252 ] %incdec.ptr3.i251 = getelementptr inbounds i8, ptr %.lcssa.i250, i64 1 store ptr %incdec.ptr3.i251, ptr @p, align 8, !tbaa !16 %arrayidx = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv store i32 %n.0.lcssa.i249, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %if.end, label %for.body, !llvm.loop !20 if.end: ; preds = %getint.exit260, %getint.exit246 %inc14 = add nsw i32 %n.0.lcssa.i193, 1 %idxprom15 = sext i32 %n.0.lcssa.i193 to i64 %arrayidx16 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom15 store i32 %n.0.lcssa.i221, ptr %arrayidx16, align 4, !tbaa !5 %idxprom18 = sext i32 %inc14 to i64 %arrayidx19 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom18 store i32 %n.0.lcssa.i235, ptr %arrayidx19, align 4, !tbaa !5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40800) @len, i8 0, i64 40800, i1 false) %tobool21.not309 = icmp eq i32 %n.0.lcssa.i207, 0 br i1 %tobool21.not309, label %for.cond63.preheader, label %while.body22 while.cond20.loopexit: ; preds = %for.body31, %getint.exit302 %tobool21.not = icmp eq i32 %dec310, 0 br i1 %tobool21.not, label %for.cond63.preheader, label %while.body22, !llvm.loop !21 for.cond63.preheader: ; preds = %while.cond20.loopexit, %if.end %cmp64313 = icmp sgt i32 %n.0.lcssa.i193, -2 br i1 %cmp64313, label %for.body66.lr.ph, label %for.end94 for.body66.lr.ph: ; preds = %for.cond63.preheader %cmp71311 = icmp sgt i32 %n.0.lcssa.i179, 0 %32 = add i32 %n.0.lcssa.i193, 2 %wide.trip.count339 = zext i32 %32 to i64 %wide.trip.count334 = zext i32 %n.0.lcssa.i179 to i64 br label %for.body66 while.body22: ; preds = %if.end, %while.cond20.loopexit %dec310.in = phi i32 [ %dec310, %while.cond20.loopexit ], [ %n.0.lcssa.i207, %if.end ] %dec310 = add nsw i32 %dec310.in, -1 store ptr @buf, ptr @p, align 8, !tbaa !16 %33 = load ptr, ptr @stdin, align 8, !tbaa !16 %call23 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 20, ptr noundef %33) %p.promoted.i261 = load ptr, ptr @p, align 8, !tbaa !16 %34 = load i8, ptr %p.promoted.i261, align 1, !tbaa !18 %cmp6.i262 = icmp sgt i8 %34, 47 br i1 %cmp6.i262, label %while.body.i266, label %getint.exit274 while.body.i266: ; preds = %while.body22, %while.body.i266 %n.08.i267 = phi i32 [ %add.i272, %while.body.i266 ], [ 0, %while.body22 ] %incdec.ptr57.i268 = phi ptr [ %incdec.ptr.i270, %while.body.i266 ], [ %p.promoted.i261, %while.body22 ] %mul.i269 = mul nsw i32 %n.08.i267, 10 %incdec.ptr.i270 = getelementptr inbounds i8, ptr %incdec.ptr57.i268, i64 1 store ptr %incdec.ptr.i270, ptr @p, align 8, !tbaa !16 %35 = load i8, ptr %incdec.ptr57.i268, align 1, !tbaa !18 %36 = and i8 %35, 15 %and.i271 = zext i8 %36 to i32 %add.i272 = add nsw i32 %mul.i269, %and.i271 %37 = load i8, ptr %incdec.ptr.i270, align 1, !tbaa !18 %cmp.i273 = icmp sgt i8 %37, 47 br i1 %cmp.i273, label %while.body.i266, label %getint.exit274, !llvm.loop !19 getint.exit274: ; preds = %while.body.i266, %while.body22 %n.0.lcssa.i263 = phi i32 [ 0, %while.body22 ], [ %add.i272, %while.body.i266 ] %.lcssa.i264 = phi ptr [ %p.promoted.i261, %while.body22 ], [ %incdec.ptr.i270, %while.body.i266 ] %incdec.ptr3.i265 = getelementptr inbounds i8, ptr %.lcssa.i264, i64 1 store ptr %incdec.ptr3.i265, ptr @p, align 8, !tbaa !16 %mul = mul nsw i32 %n.0.lcssa.i263, %add %38 = load i8, ptr %incdec.ptr3.i265, align 1, !tbaa !18 %cmp6.i276 = icmp sgt i8 %38, 47 br i1 %cmp6.i276, label %while.body.i280, label %getint.exit288 while.body.i280: ; preds = %getint.exit274, %while.body.i280 %n.08.i281 = phi i32 [ %add.i286, %while.body.i280 ], [ 0, %getint.exit274 ] %incdec.ptr57.i282 = phi ptr [ %incdec.ptr.i284, %while.body.i280 ], [ %incdec.ptr3.i265, %getint.exit274 ] %mul.i283 = mul nsw i32 %n.08.i281, 10 %incdec.ptr.i284 = getelementptr inbounds i8, ptr %incdec.ptr57.i282, i64 1 store ptr %incdec.ptr.i284, ptr @p, align 8, !tbaa !16 %39 = load i8, ptr %incdec.ptr57.i282, align 1, !tbaa !18 %40 = and i8 %39, 15 %and.i285 = zext i8 %40 to i32 %add.i286 = add nsw i32 %mul.i283, %and.i285 %41 = load i8, ptr %incdec.ptr.i284, align 1, !tbaa !18 %cmp.i287 = icmp sgt i8 %41, 47 br i1 %cmp.i287, label %while.body.i280, label %getint.exit288, !llvm.loop !19 getint.exit288: ; preds = %while.body.i280, %getint.exit274 %n.0.lcssa.i277 = phi i32 [ 0, %getint.exit274 ], [ %add.i286, %while.body.i280 ] %42 = phi ptr [ %.lcssa.i264, %getint.exit274 ], [ %incdec.ptr57.i282, %while.body.i280 ] %incdec.ptr3.i279 = getelementptr inbounds i8, ptr %42, i64 2 store ptr %incdec.ptr3.i279, ptr @p, align 8, !tbaa !16 %mul26 = mul nsw i32 %n.0.lcssa.i277, %add %43 = load i8, ptr %incdec.ptr3.i279, align 1, !tbaa !18 %cmp6.i290 = icmp sgt i8 %43, 47 br i1 %cmp6.i290, label %while.body.i294, label %getint.exit302 while.body.i294: ; preds = %getint.exit288, %while.body.i294 %n.08.i295 = phi i32 [ %add.i300, %while.body.i294 ], [ 0, %getint.exit288 ] %incdec.ptr57.i296 = phi ptr [ %incdec.ptr.i298, %while.body.i294 ], [ %incdec.ptr3.i279, %getint.exit288 ] %mul.i297 = mul nsw i32 %n.08.i295, 10 %incdec.ptr.i298 = getelementptr inbounds i8, ptr %incdec.ptr57.i296, i64 1 store ptr %incdec.ptr.i298, ptr @p, align 8, !tbaa !16 %44 = load i8, ptr %incdec.ptr57.i296, align 1, !tbaa !18 %45 = and i8 %44, 15 %and.i299 = zext i8 %45 to i32 %add.i300 = add nsw i32 %mul.i297, %and.i299 %46 = load i8, ptr %incdec.ptr.i298, align 1, !tbaa !18 %cmp.i301 = icmp sgt i8 %46, 47 br i1 %cmp.i301, label %while.body.i294, label %getint.exit302, !llvm.loop !19 getint.exit302: ; preds = %while.body.i294, %getint.exit288 %n.0.lcssa.i291 = phi i32 [ 0, %getint.exit288 ], [ %add.i300, %while.body.i294 ] %.lcssa.i292 = phi ptr [ %incdec.ptr3.i279, %getint.exit288 ], [ %incdec.ptr.i298, %while.body.i294 ] %incdec.ptr3.i293 = getelementptr inbounds i8, ptr %.lcssa.i292, i64 1 store ptr %incdec.ptr3.i293, ptr @p, align 8, !tbaa !16 %cmp29.not306 = icmp sgt i32 %n.0.lcssa.i291, %n.0.lcssa.i179 br i1 %cmp29.not306, label %while.cond20.loopexit, label %for.body31.preheader for.body31.preheader: ; preds = %getint.exit302 %47 = sext i32 %n.0.lcssa.i291 to i64 %48 = sext i32 %mul to i64 %49 = sext i32 %mul26 to i64 br label %for.body31 for.body31: ; preds = %for.body31.preheader, %for.body31 %indvars.iv321 = phi i64 [ %47, %for.body31.preheader ], [ %indvars.iv.next322, %for.body31 ] %50 = add nsw i64 %indvars.iv321, %48 %51 = add nsw i64 %indvars.iv321, %49 %arrayidx36 = getelementptr inbounds [10200 x i32], ptr @len, i64 0, i64 %50 %52 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %inc37 = add nsw i32 %52, 1 store i32 %inc37, ptr %arrayidx36, align 4, !tbaa !5 %arrayidx39 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %50 %idxprom40 = sext i32 %52 to i64 %arrayidx41 = getelementptr inbounds [70 x i32], ptr %arrayidx39, i64 0, i64 %idxprom40 %53 = trunc i64 %51 to i32 %54 = sub i32 %53, %n.0.lcssa.i291 store i32 %54, ptr %arrayidx41, align 4, !tbaa !5 %arrayidx46 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %50, i32 1, i64 %idxprom40 store i32 %n.0.lcssa.i291, ptr %arrayidx46, align 4, !tbaa !5 %arrayidx48 = getelementptr inbounds [10200 x i32], ptr @len, i64 0, i64 %51 %55 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %inc49 = add nsw i32 %55, 1 store i32 %inc49, ptr %arrayidx48, align 4, !tbaa !5 %arrayidx51 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %51 %idxprom53 = sext i32 %55 to i64 %arrayidx54 = getelementptr inbounds [70 x i32], ptr %arrayidx51, i64 0, i64 %idxprom53 %56 = trunc i64 %50 to i32 %57 = sub i32 %56, %n.0.lcssa.i291 store i32 %57, ptr %arrayidx54, align 4, !tbaa !5 %arrayidx59 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %51, i32 1, i64 %idxprom53 store i32 %n.0.lcssa.i291, ptr %arrayidx59, align 4, !tbaa !5 %indvars.iv.next322 = add nsw i64 %indvars.iv321, 1 %lftr.wideiv = trunc i64 %indvars.iv.next322 to i32 %exitcond328.not = icmp eq i32 %add, %lftr.wideiv br i1 %exitcond328.not, label %while.cond20.loopexit, label %for.body31, !llvm.loop !22 for.body66: ; preds = %for.body66.lr.ph, %for.inc92 %indvars.iv336 = phi i64 [ 0, %for.body66.lr.ph ], [ %indvars.iv.next337, %for.inc92 ] br i1 %cmp71311, label %for.body73.preheader, label %for.inc92 for.body73.preheader: ; preds = %for.body66 %arrayidx68 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv336 %58 = load i32, ptr %arrayidx68, align 4, !tbaa !5 %mul69 = mul nsw i32 %58, %add %59 = sext i32 %mul69 to i64 br label %for.body73 for.body73: ; preds = %for.body73.preheader, %for.body73 %indvars.iv329 = phi i64 [ 0, %for.body73.preheader ], [ %indvars.iv.next330, %for.body73 ] %60 = add nsw i64 %indvars.iv329, %59 %arrayidx77 = getelementptr inbounds [10200 x i32], ptr @len, i64 0, i64 %60 %61 = load i32, ptr %arrayidx77, align 4, !tbaa !5 %inc78 = add nsw i32 %61, 1 store i32 %inc78, ptr %arrayidx77, align 4, !tbaa !5 %arrayidx80 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %60 %idxprom82 = sext i32 %61 to i64 %arrayidx83 = getelementptr inbounds [70 x i32], ptr %arrayidx80, i64 0, i64 %idxprom82 %62 = trunc i64 %60 to i32 %63 = add i32 %62, 1 store i32 %63, ptr %arrayidx83, align 4, !tbaa !5 %arrayidx88 = getelementptr inbounds [10200 x %struct.TBL], ptr @tbl, i64 0, i64 %60, i32 1, i64 %idxprom82 store i32 1, ptr %arrayidx88, align 4, !tbaa !5 %indvars.iv.next330 = add nuw nsw i64 %indvars.iv329, 1 %exitcond335.not = icmp eq i64 %indvars.iv.next330, %wide.trip.count334 br i1 %exitcond335.not, label %for.inc92, label %for.body73, !llvm.loop !23 for.inc92: ; preds = %for.body73, %for.body66 %indvars.iv.next337 = add nuw nsw i64 %indvars.iv336, 1 %exitcond340 = icmp eq i64 %indvars.iv.next337, %wide.trip.count339 br i1 %exitcond340, label %for.end94, label %for.body66, !llvm.loop !24 for.end94: ; preds = %for.inc92, %for.cond63.preheader %mul95 = mul nsw i32 %n.0.lcssa.i221, %add %add96 = add nsw i32 %mul95, %n.0.lcssa.i179 tail call void @dijkstra(i32 noundef %add96) %cmp99.not315 = icmp slt i32 %n.0.lcssa.i179, 0 br i1 %cmp99.not315, label %if.then117, label %for.body101.preheader for.body101.preheader: ; preds = %for.end94 %mul97 = mul nsw i32 %n.0.lcssa.i235, %add %64 = sext i32 %mul97 to i64 %wide.trip.count345 = zext i32 %add to i64 %min.iters.check = icmp ult i32 %add, 8 br i1 %min.iters.check, label %for.body101.preheader351, label %vector.ph vector.ph: ; preds = %for.body101.preheader %n.vec = and i64 %wide.trip.count345, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 117901063, i32 117901063, i32 117901063, i32 117901063>, %vector.ph ], [ %68, %vector.body ] %vec.phi349 = phi <4 x i32> [ <i32 117901063, i32 117901063, i32 117901063, i32 117901063>, %vector.ph ], [ %69, %vector.body ] %65 = add nsw i64 %index, %64 %66 = getelementptr inbounds [10200 x i32], ptr @dist, i64 0, i64 %65 %wide.load = load <4 x i32>, ptr %66, align 4, !tbaa !5 %67 = getelementptr inbounds i32, ptr %66, i64 4 %wide.load350 = load <4 x i32>, ptr %67, align 4, !tbaa !5 %68 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %69 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load350, <4 x i32> %vec.phi349) %index.next = add nuw i64 %index, 8 %70 = icmp eq i64 %index.next, %n.vec br i1 %70, label %middle.block, label %vector.body, !llvm.loop !25 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %68, <4 x i32> %69) %71 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count345 br i1 %cmp.n, label %for.end114, label %for.body101.preheader351 for.body101.preheader351: ; preds = %for.body101.preheader, %middle.block %indvars.iv341.ph = phi i64 [ 0, %for.body101.preheader ], [ %n.vec, %middle.block ] %ans.0316.ph = phi i32 [ 117901063, %for.body101.preheader ], [ %71, %middle.block ] br label %for.body101 for.body101: ; preds = %for.body101.preheader351, %for.body101 %indvars.iv341 = phi i64 [ %indvars.iv.next342, %for.body101 ], [ %indvars.iv341.ph, %for.body101.preheader351 ] %ans.0316 = phi i32 [ %spec.select, %for.body101 ], [ %ans.0316.ph, %for.body101.preheader351 ] %72 = add nsw i64 %indvars.iv341, %64 %arrayidx104 = getelementptr inbounds [10200 x i32], ptr @dist, i64 0, i64 %72 %73 = load i32, ptr %arrayidx104, align 4, !tbaa !5 %spec.select = tail call i32 @llvm.smin.i32(i32 %73, i32 %ans.0316) %indvars.iv.next342 = add nuw nsw i64 %indvars.iv341, 1 %exitcond346.not = icmp eq i64 %indvars.iv.next342, %wide.trip.count345 br i1 %exitcond346.not, label %for.end114, label %for.body101, !llvm.loop !28 for.end114: ; preds = %for.body101, %middle.block %spec.select.lcssa = phi i32 [ %71, %middle.block ], [ %spec.select, %for.body101 ] %cmp115 = icmp eq i32 %spec.select.lcssa, 117901063 br i1 %cmp115, label %if.then117, label %if.else if.then117: ; preds = %for.end94, %for.end114 %call118 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str) br label %if.end120 if.else: ; preds = %for.end114 %call119 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.lcssa) br label %if.end120 if.end120: ; preds = %if.else, %if.then117 store ptr @buf, ptr @p, align 8, !tbaa !16 %74 = load ptr, ptr @stdin, align 8, !tbaa !16 %call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 60, ptr noundef %74) %tobool.not = icmp eq ptr %call, null br i1 %tobool.not, label %while.end121, label %land.rhs, !llvm.loop !29 while.end121: ; preds = %land.rhs, %if.end120, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #6 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 = !{!10, !6, i64 0} !10 = !{!"", !6, i64 0, !6, i64 4} !11 = !{!10, !6, i64 4} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13} !15 = distinct !{!15, !13} !16 = !{!17, !17, i64 0} !17 = !{!"any pointer", !7, i64 0} !18 = !{!7, !7, i64 0} !19 = distinct !{!19, !13} !20 = distinct !{!20, !13} !21 = distinct !{!21, !13} !22 = distinct !{!22, !13} !23 = distinct !{!23, !13} !24 = distinct !{!24, !13} !25 = distinct !{!25, !13, !26, !27} !26 = !{!"llvm.loop.isvectorized", i32 1} !27 = !{!"llvm.loop.unroll.runtime.disable"} !28 = distinct !{!28, !13, !27, !26} !29 = distinct !{!29, !13}
#include<stdio.h> #include<string.h> #include<stdlib.h> #define rep(i,n) for(int i=0;i<(n);i++) int cmpint(const void *a,const void *b){ return *(int *)b-*(int *)a; } int main(){ int n,k; int x[100]; scanf("%d%d",&n,&k); rep(i,n){ scanf("%d",&x[i]); } int cnt=0; rep(i,n){ if((x[i])<=k-x[i]){ cnt+=2*x[i]; }else{ cnt+=2*(k-x[i]); } } printf("%d\n",cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_255474/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_255474/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: 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 [100 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 400, ptr nonnull %x) #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 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %cmp434 = icmp sgt i32 %14, 0 br i1 %cmp434, label %for.body6.lr.ph, label %for.cond.cleanup5 for.body6.lr.ph: ; preds = %for.cond3.preheader %1 = load i32, ptr %k, align 4, !tbaa !5 %wide.trip.count = zext i32 %14 to i64 %min.iters.check = icmp ult i32 %14, 8 br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph vector.ph: ; preds = %for.body6.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ] %vec.phi45 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ] %2 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load46 = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = sub nsw <4 x i32> %broadcast.splat, %wide.load %5 = sub nsw <4 x i32> %broadcast.splat, %wide.load46 %6 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %4) %7 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load46, <4 x i32> %5) %8 = shl nsw <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1> %9 = shl nsw <4 x i32> %7, <i32 1, i32 1, i32 1, i32 1> %10 = add <4 x i32> %8, %vec.phi %11 = add <4 x i32> %9, %vec.phi45 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %11, %10 %13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader for.body6.preheader: ; preds = %for.body6.lr.ph, %middle.block %indvars.iv40.ph = phi i64 [ 0, %for.body6.lr.ph ], [ %n.vec, %middle.block ] %cnt.035.ph = phi i32 [ 0, %for.body6.lr.ph ], [ %13, %middle.block ] br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 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 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp = icmp slt i64 %indvars.iv.next, %15 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13 for.cond.cleanup5: ; preds = %for.body6, %middle.block, %entry, %for.cond3.preheader %cnt.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %13, %middle.block ], [ %cnt.1, %for.body6 ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 400, 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 for.body6: ; preds = %for.body6.preheader, %for.body6 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body6 ], [ %indvars.iv40.ph, %for.body6.preheader ] %cnt.035 = phi i32 [ %cnt.1, %for.body6 ], [ %cnt.035.ph, %for.body6.preheader ] %arrayidx8 = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv40 %16 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %sub = sub nsw i32 %1, %16 %sub. = call i32 @llvm.smin.i32(i32 %16, i32 %sub) %mul.pn = shl nsw i32 %sub., 1 %cnt.1 = add nsw i32 %mul.pn, %cnt.035 %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}