Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define N 100 #define IN (1<<21) #define O 0 #define I 1 void dijkstra(void); int n,A[N][N]; int main(){ int i,j,s,u,v,c,k; scanf("%d",&n); for(i=O;i<n;i++){ for(j=O;j<n;j++){ A[i][j]=IN; } } for(i=O;i<n;i++){ scanf("%d%d",&u,&k); for(j=O;j<k;j++){ scanf("%d%d",&v,&c); A[u][v]=c; } } dijkstra(); return 0; } void dijkstra(){ int i,u,v,m,a=O,d[N],color[N]; for(i=O;i<n;i++){ d[i]=IN; color[i]=WHITE; } d[O]=O; color[O]=GRAY; while(I){ m=IN; u=-I; for(i=O;i<n;i++){ if(m>d[i] && color[i]!=BLACK){ u=i; m=d[i]; } } if(u==-I){ break; } color[u]=BLACK; for(v=O;v<n;v++){ if(color[v]!=BLACK && A[u][v]!=IN){ if(d[v]>d[u]+A[u][v]){ d[v]=d[u]+A[u][v]; color[v]=GRAY; } } } } for(i=O;i<n;i++){ printf("%d %d\n",i,(d[i]== IN?-I:d[i])); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222188/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222188/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @A = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %c = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp37 = icmp sgt i32 %0, 0 br i1 %cmp37, label %for.cond1.preheader.us.preheader, label %for.end26 for.cond1.preheader.us.preheader: ; preds = %entry %wide.trip.count47 = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 %n.vec = and i64 %wide.trip.count47, 4294967288 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count47 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc6_crit_edge.us %indvars.iv44 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next45, %for.cond1.for.inc6_crit_edge.us ] br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.body vector.body: ; preds = %for.cond1.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond1.preheader.us ] %1 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv44, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %2, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond1.for.inc6_crit_edge.us, label %for.body3.us.preheader for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ] br label %for.body3.us for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.us ], [ %indvars.iv.ph, %for.body3.us.preheader ] %arrayidx5.us = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv44, i64 %indvars.iv store i32 2097152, ptr %arrayidx5.us, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count47 br i1 %exitcond.not, label %for.cond1.for.inc6_crit_edge.us, label %for.body3.us, !llvm.loop !13 for.cond1.for.inc6_crit_edge.us: ; preds = %for.body3.us, %middle.block %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1 %exitcond48.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count47 br i1 %exitcond48.not, label %for.cond9.preheader, label %for.cond1.preheader.us, !llvm.loop !14 for.cond9.preheader: ; preds = %for.cond1.for.inc6_crit_edge.us br i1 %cmp37, label %for.body11, label %for.end26 for.body11: ; preds = %for.cond9.preheader, %for.inc24 %i.142 = phi i32 [ %inc25, %for.inc24 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp1439 = icmp sgt i32 %4, 0 br i1 %cmp1439, label %for.body15, label %for.inc24 for.body15: ; preds = %for.body11, %for.body15 %j.140 = phi i32 [ %inc22, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %c) %5 = load i32, ptr %c, align 4, !tbaa !5 %6 = load i32, ptr %u, align 4, !tbaa !5 %idxprom17 = sext i32 %6 to i64 %7 = load i32, ptr %v, align 4, !tbaa !5 %idxprom19 = sext i32 %7 to i64 %arrayidx20 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom17, i64 %idxprom19 store i32 %5, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.140, 1 %8 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %8 br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !15 for.inc24: ; preds = %for.body15, %for.body11 %inc25 = add nuw nsw i32 %i.142, 1 %9 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc25, %9 br i1 %cmp10, label %for.body11, label %for.end26, !llvm.loop !16 for.end26: ; preds = %for.inc24, %entry, %for.cond9.preheader call void @dijkstra() call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @dijkstra() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #4 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp106 = icmp sgt i32 %.fr, 0 br i1 %cmp106, label %for.body.preheader, label %for.end73 for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader165, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %1, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader165 for.body.preheader165: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader165, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader165 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 2097152, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !18 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 store i32 1, ptr %color, align 16, !tbaa !5 br i1 %cmp106, label %while.cond.us.preheader, label %for.end73 while.cond.us.preheader: ; preds = %for.end %wide.trip.count154 = zext i32 %.fr to i64 %wide.trip.count159 = zext i32 %.fr to i64 br label %for.body7.us for.end18.us: ; preds = %for.inc16.us %cmp19.us = icmp eq i32 %u.1.us, -1 br i1 %cmp19.us, label %for.cond63.preheader, label %if.end21.us if.end21.us: ; preds = %for.end18.us %idxprom22.us = sext i32 %u.1.us to i64 %arrayidx23.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom22.us store i32 2, ptr %arrayidx23.us, align 4, !tbaa !5 %arrayidx40.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %idxprom22.us br label %for.body26.us for.body26.us: ; preds = %if.end21.us, %for.inc60.us %indvars.iv156 = phi i64 [ 0, %if.end21.us ], [ %indvars.iv.next157, %for.inc60.us ] %arrayidx28.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv156 %6 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %cmp29.not.us = icmp eq i32 %6, 2 br i1 %cmp29.not.us, label %for.inc60.us, label %land.lhs.true30.us land.lhs.true30.us: ; preds = %for.body26.us %arrayidx34.us = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom22.us, i64 %indvars.iv156 %7 = load i32, ptr %arrayidx34.us, align 4, !tbaa !5 %cmp35.not.us = icmp eq i32 %7, 2097152 br i1 %cmp35.not.us, label %for.inc60.us, label %if.then36.us if.then36.us: ; preds = %land.lhs.true30.us %arrayidx38.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv156 %8 = load i32, ptr %arrayidx38.us, align 4, !tbaa !5 %9 = load i32, ptr %arrayidx40.us, align 4, !tbaa !5 %add.us = add nsw i32 %9, %7 %cmp45.us = icmp sgt i32 %8, %add.us br i1 %cmp45.us, label %if.then46.us, label %for.inc60.us if.then46.us: ; preds = %if.then36.us store i32 %add.us, ptr %arrayidx38.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx28.us, align 4, !tbaa !5 br label %for.inc60.us for.inc60.us: ; preds = %if.then46.us, %if.then36.us, %land.lhs.true30.us, %for.body26.us %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1 %exitcond160.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count159 br i1 %exitcond160.not, label %for.body7.us.backedge, label %for.body26.us, !llvm.loop !19 for.body7.us: ; preds = %for.body7.us.backedge, %while.cond.us.preheader %indvars.iv151 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv151.be, %for.body7.us.backedge ] %m.0110.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %m.0110.us.be, %for.body7.us.backedge ] %u.0109.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0109.us.be, %for.body7.us.backedge ] %arrayidx9.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv151 %10 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp sgt i32 %m.0110.us, %10 br i1 %cmp10.us, label %land.lhs.true.us, label %for.inc16.us land.lhs.true.us: ; preds = %for.body7.us %arrayidx12.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv151 %11 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.not.us = icmp eq i32 %11, 2 %12 = trunc i64 %indvars.iv151 to i32 %spec.select.us = select i1 %cmp13.not.us, i32 %u.0109.us, i32 %12 %spec.select104.us = select i1 %cmp13.not.us, i32 %m.0110.us, i32 %10 br label %for.inc16.us for.inc16.us: ; preds = %land.lhs.true.us, %for.body7.us %u.1.us = phi i32 [ %u.0109.us, %for.body7.us ], [ %spec.select.us, %land.lhs.true.us ] %m.1.us = phi i32 [ %m.0110.us, %for.body7.us ], [ %spec.select104.us, %land.lhs.true.us ] %indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1 %exitcond155.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count154 br i1 %exitcond155.not, label %for.end18.us, label %for.body7.us.backedge for.body7.us.backedge: ; preds = %for.inc60.us, %for.inc16.us %indvars.iv151.be = phi i64 [ %indvars.iv.next152, %for.inc16.us ], [ 0, %for.inc60.us ] %m.0110.us.be = phi i32 [ %m.1.us, %for.inc16.us ], [ 2097152, %for.inc60.us ] %u.0109.us.be = phi i32 [ %u.1.us, %for.inc16.us ], [ -1, %for.inc60.us ] br label %for.body7.us, !llvm.loop !19 for.cond63.preheader: ; preds = %for.end18.us %cmp64142 = icmp sgt i32 %.fr, 0 br i1 %cmp64142, label %for.body65, label %for.end73 for.body65: ; preds = %for.cond63.preheader, %for.body65 %indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.body65 ], [ 0, %for.cond63.preheader ] %arrayidx67 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv161 %13 = load i32, ptr %arrayidx67, align 4, !tbaa !5 %cmp68 = icmp eq i32 %13, 2097152 %spec.select105 = select i1 %cmp68, i32 -1, i32 %13 %14 = trunc i64 %indvars.iv161 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14, i32 noundef %spec.select105) %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %15 = load i32, ptr @n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp64 = icmp slt i64 %indvars.iv.next162, %16 br i1 %cmp64, label %for.body65, label %for.end73, !llvm.loop !20 for.end73: ; preds = %for.body65, %entry, %for.end, %for.cond63.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !11, !12} !18 = distinct !{!18, !10, !12, !11} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include<stdio.h> #include<limits.h> #define MAX 100 int ar[MAX][MAX],color[MAX],d[MAX],pi[MAX]; void dijkstra(int,int); int main(){ int n,m,i,j,s,t,num; for(i=0;i<MAX;i++){ for(j=0;j<MAX;j++){ ar[i][j]=1000000; } } scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d",&num,&m); for(j=0;j<m;j++){ scanf("%d %d",&s,&t); ar[i][s]=t; } } dijkstra(n,0); for(i=0;i<n;i++){ printf("%d %d\n",i,d[i]); } } void dijkstra(int w,int s){ int i,j,mincost,u; for(i=0;i<w;i++){ d[i]=INT_MAX; pi[i]=-1; color[i]=0; } d[s]=0; while(1){ mincost=INT_MAX; for(i=0;i<w;i++){ if(color[i]!=1&&d[i]<mincost){ mincost=d[i]; u=i; } } if(mincost==INT_MAX){ break; } color[u]=1; for(j=0;j<w;j++){ if(color[j]!=1&&(d[u]+ar[u][j])<d[j]){ pi[j]=u; d[j]=d[u]+ar[u][j]; } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222230/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222230/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @ar = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @pi = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %s = alloca i32, align 4 %t = alloca i32, align 4 %num = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #6 br label %vector.ph vector.ph: ; preds = %vector.ph, %entry %indvars.iv59 = phi i64 [ 0, %entry ], [ %indvars.iv.next60, %vector.ph ] %0 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 0 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %0, align 16, !tbaa !5 %1 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 8 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 12 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 16 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 20 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 24 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 28 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 32 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 36 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 40 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 44 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 48 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %12, align 16, !tbaa !5 %13 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 52 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %13, align 16, !tbaa !5 %14 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 56 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %14, align 16, !tbaa !5 %15 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 60 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %15, align 16, !tbaa !5 %16 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 64 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %16, align 16, !tbaa !5 %17 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 68 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 72 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %18, align 16, !tbaa !5 %19 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 76 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 80 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %20, align 16, !tbaa !5 %21 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 84 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %21, align 16, !tbaa !5 %22 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 88 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %22, align 16, !tbaa !5 %23 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 92 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %23, align 16, !tbaa !5 %24 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv59, i64 96 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %24, align 16, !tbaa !5 %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1 %exitcond62.not = icmp eq i64 %indvars.iv.next60, 100 br i1 %exitcond62.not, label %for.end8, label %vector.ph, !llvm.loop !9 for.end8: ; preds = %vector.ph %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %25 = load i32, ptr %n, align 4, !tbaa !5 %cmp1053 = icmp sgt i32 %25, 0 br i1 %cmp1053, label %for.body11, label %dijkstra.exit.thread for.body11: ; preds = %for.end8, %for.inc24 %indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.inc24 ], [ 0, %for.end8 ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %num, ptr noundef nonnull %m) %26 = load i32, ptr %m, align 4, !tbaa !5 %cmp1451 = icmp sgt i32 %26, 0 br i1 %cmp1451, label %for.body15, label %for.inc24 for.body15: ; preds = %for.body11, %for.body15 %j.152 = phi i32 [ %inc22, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s, ptr noundef nonnull %t) %27 = load i32, ptr %t, align 4, !tbaa !5 %28 = load i32, ptr %s, align 4, !tbaa !5 %idxprom19 = sext i32 %28 to i64 %arrayidx20 = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %indvars.iv63, i64 %idxprom19 store i32 %27, ptr %arrayidx20, align 4, !tbaa !5 %inc22 = add nuw nsw i32 %j.152, 1 %29 = load i32, ptr %m, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc22, %29 br i1 %cmp14, label %for.body15, label %for.inc24, !llvm.loop !11 for.inc24: ; preds = %for.body15, %for.body11 %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %30 = load i32, ptr %n, align 4, !tbaa !5 %31 = sext i32 %30 to i64 %cmp10 = icmp slt i64 %indvars.iv.next64, %31 br i1 %cmp10, label %for.body11, label %for.end26, !llvm.loop !12 for.end26: ; preds = %for.inc24 %cmp84.i = icmp sgt i32 %30, 0 br i1 %cmp84.i, label %for.body.preheader.i, label %dijkstra.exit.thread dijkstra.exit.thread: ; preds = %for.end26, %for.end8 store i32 0, ptr @d, align 16, !tbaa !5 br label %for.end35 for.body.preheader.i: ; preds = %for.end26 %32 = zext i32 %30 to i64 %33 = shl nuw nsw i64 %32, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @pi, i8 -1, i64 %33, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %33, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %30, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph75 vector.ph75: ; preds = %for.body.preheader.i %n.vec = and i64 %32, 4294967288 br label %vector.body77 vector.body77: ; preds = %vector.body77, %vector.ph75 %index78 = phi i64 [ 0, %vector.ph75 ], [ %index.next79, %vector.body77 ] %34 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index78 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %34, align 16, !tbaa !5 %35 = getelementptr inbounds i32, ptr %34, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %35, align 16, !tbaa !5 %index.next79 = add nuw i64 %index78, 8 %36 = icmp eq i64 %index.next79, %n.vec br i1 %36, label %middle.block73, label %vector.body77, !llvm.loop !13 middle.block73: ; preds = %vector.body77 %cmp.n = icmp eq i64 %n.vec, %32 br i1 %cmp.n, label %while.cond.us.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block73 %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block73 ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv.i store i32 2147483647, ptr %arrayidx.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %32 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !16 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block73 store i32 0, ptr @d, align 16, !tbaa !5 br label %for.body9.us.i for.end20.us.i: ; preds = %for.inc18.us.i %cmp21.us.i = icmp eq i32 %mincost.1.us.i, 2147483647 br i1 %cmp21.us.i, label %dijkstra.exit, label %if.end23.us.i if.end23.us.i: ; preds = %for.end20.us.i %idxprom24.us.i = sext i32 %u.2.us.i to i64 %arrayidx25.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom24.us.i store i32 1, ptr %arrayidx25.us.i, align 4, !tbaa !5 %arrayidx34.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom24.us.i br label %for.body28.us.i for.body28.us.i: ; preds = %for.inc55.us.i, %if.end23.us.i %indvars.iv129.i = phi i64 [ 0, %if.end23.us.i ], [ %indvars.iv.next130.i, %for.inc55.us.i ] %arrayidx30.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv129.i %37 = load i32, ptr %arrayidx30.us.i, align 4, !tbaa !5 %cmp31.not.us.i = icmp eq i32 %37, 1 br i1 %cmp31.not.us.i, label %for.inc55.us.i, label %land.lhs.true32.us.i land.lhs.true32.us.i: ; preds = %for.body28.us.i %38 = load i32, ptr %arrayidx34.us.i, align 4, !tbaa !5 %arrayidx38.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %idxprom24.us.i, i64 %indvars.iv129.i %39 = load i32, ptr %arrayidx38.us.i, align 4, !tbaa !5 %add.us.i = add nsw i32 %39, %38 %arrayidx40.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv129.i %40 = load i32, ptr %arrayidx40.us.i, align 4, !tbaa !5 %cmp41.us.i = icmp slt i32 %add.us.i, %40 br i1 %cmp41.us.i, label %if.then42.us.i, label %for.inc55.us.i if.then42.us.i: ; preds = %land.lhs.true32.us.i %arrayidx44.us.i = getelementptr inbounds [100 x i32], ptr @pi, i64 0, i64 %indvars.iv129.i store i32 %u.2.us.i, ptr %arrayidx44.us.i, align 4, !tbaa !5 store i32 %add.us.i, ptr %arrayidx40.us.i, align 4, !tbaa !5 br label %for.inc55.us.i for.inc55.us.i: ; preds = %if.then42.us.i, %land.lhs.true32.us.i, %for.body28.us.i %indvars.iv.next130.i = add nuw nsw i64 %indvars.iv129.i, 1 %exitcond133.not.i = icmp eq i64 %indvars.iv.next130.i, %32 br i1 %exitcond133.not.i, label %for.body9.us.i.backedge, label %for.body28.us.i, !llvm.loop !17 for.body9.us.i: ; preds = %for.body9.us.i.backedge, %while.cond.us.preheader.i %indvars.iv124.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv124.i.be, %for.body9.us.i.backedge ] %u.189.us.i = phi i32 [ undef, %while.cond.us.preheader.i ], [ %u.2.us.i, %for.body9.us.i.backedge ] %mincost.088.us.i = phi i32 [ 2147483647, %while.cond.us.preheader.i ], [ %mincost.088.us.i.be, %for.body9.us.i.backedge ] %arrayidx11.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv124.i %41 = load i32, ptr %arrayidx11.us.i, align 4, !tbaa !5 %cmp12.not.us.i = icmp eq i32 %41, 1 br i1 %cmp12.not.us.i, label %for.inc18.us.i, label %land.lhs.true.us.i land.lhs.true.us.i: ; preds = %for.body9.us.i %arrayidx14.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv124.i %42 = load i32, ptr %arrayidx14.us.i, align 4, !tbaa !5 %cmp15.us.i = icmp slt i32 %42, %mincost.088.us.i %spec.select.us.i = call i32 @llvm.smin.i32(i32 %42, i32 %mincost.088.us.i) %43 = trunc i64 %indvars.iv124.i to i32 %spec.select83.us.i = select i1 %cmp15.us.i, i32 %43, i32 %u.189.us.i br label %for.inc18.us.i for.inc18.us.i: ; preds = %land.lhs.true.us.i, %for.body9.us.i %mincost.1.us.i = phi i32 [ %mincost.088.us.i, %for.body9.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %u.2.us.i = phi i32 [ %u.189.us.i, %for.body9.us.i ], [ %spec.select83.us.i, %land.lhs.true.us.i ] %indvars.iv.next125.i = add nuw nsw i64 %indvars.iv124.i, 1 %exitcond128.not.i = icmp eq i64 %indvars.iv.next125.i, %32 br i1 %exitcond128.not.i, label %for.end20.us.i, label %for.body9.us.i.backedge for.body9.us.i.backedge: ; preds = %for.inc55.us.i, %for.inc18.us.i %indvars.iv124.i.be = phi i64 [ %indvars.iv.next125.i, %for.inc18.us.i ], [ 0, %for.inc55.us.i ] %mincost.088.us.i.be = phi i32 [ %mincost.1.us.i, %for.inc18.us.i ], [ 2147483647, %for.inc55.us.i ] br label %for.body9.us.i, !llvm.loop !17 dijkstra.exit: ; preds = %for.end20.us.i br i1 %cmp84.i, label %for.body29, label %for.end35 for.body29: ; preds = %dijkstra.exit, %for.body29 %indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body29 ], [ 0, %dijkstra.exit ] %arrayidx31 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv66 %44 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %45 = trunc i64 %indvars.iv66 to i32 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %45, i32 noundef %44) %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %46 = load i32, ptr %n, align 4, !tbaa !5 %47 = sext i32 %46 to i64 %cmp28 = icmp slt i64 %indvars.iv.next67, %47 br i1 %cmp28, label %for.body29, label %for.end35, !llvm.loop !18 for.end35: ; preds = %for.body29, %dijkstra.exit.thread, %dijkstra.exit call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dijkstra(i32 noundef %w, i32 noundef %s) local_unnamed_addr #3 { entry: %cmp84 = icmp sgt i32 %w, 0 br i1 %cmp84, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %entry %idxprom5134 = sext i32 %s to i64 %arrayidx6135 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom5134 store i32 0, ptr %arrayidx6135, align 4, !tbaa !5 br label %while.end for.body.preheader: ; preds = %entry %0 = zext i32 %w to i64 %1 = shl nuw nsw i64 %0, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pi, i8 -1, i64 %1, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %1, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %w, 8 br i1 %min.iters.check, label %for.body.preheader136, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %0, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %0 br i1 %cmp.n, label %for.end, label %for.body.preheader136 for.body.preheader136: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader136, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader136 ] %arrayidx = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv store i32 2147483647, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !20 for.end: ; preds = %for.body, %middle.block %idxprom5 = sext i32 %s to i64 %arrayidx6 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom5 store i32 0, ptr %arrayidx6, align 4, !tbaa !5 br i1 %cmp84, label %while.cond.us.preheader, label %while.end while.cond.us.preheader: ; preds = %for.end %wide.trip.count127 = zext i32 %w to i64 %wide.trip.count132 = zext i32 %w to i64 br label %for.body9.us for.end20.us: ; preds = %for.inc18.us %cmp21.us = icmp eq i32 %mincost.1.us, 2147483647 br i1 %cmp21.us, label %while.end, label %if.end23.us if.end23.us: ; preds = %for.end20.us %idxprom24.us = sext i32 %u.2.us to i64 %arrayidx25.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom24.us store i32 1, ptr %arrayidx25.us, align 4, !tbaa !5 %arrayidx34.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom24.us br label %for.body28.us for.body28.us: ; preds = %if.end23.us, %for.inc55.us %indvars.iv129 = phi i64 [ 0, %if.end23.us ], [ %indvars.iv.next130, %for.inc55.us ] %arrayidx30.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv129 %5 = load i32, ptr %arrayidx30.us, align 4, !tbaa !5 %cmp31.not.us = icmp eq i32 %5, 1 br i1 %cmp31.not.us, label %for.inc55.us, label %land.lhs.true32.us land.lhs.true32.us: ; preds = %for.body28.us %6 = load i32, ptr %arrayidx34.us, align 4, !tbaa !5 %arrayidx38.us = getelementptr inbounds [100 x [100 x i32]], ptr @ar, i64 0, i64 %idxprom24.us, i64 %indvars.iv129 %7 = load i32, ptr %arrayidx38.us, align 4, !tbaa !5 %add.us = add nsw i32 %7, %6 %arrayidx40.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv129 %8 = load i32, ptr %arrayidx40.us, align 4, !tbaa !5 %cmp41.us = icmp slt i32 %add.us, %8 br i1 %cmp41.us, label %if.then42.us, label %for.inc55.us if.then42.us: ; preds = %land.lhs.true32.us %arrayidx44.us = getelementptr inbounds [100 x i32], ptr @pi, i64 0, i64 %indvars.iv129 store i32 %u.2.us, ptr %arrayidx44.us, align 4, !tbaa !5 store i32 %add.us, ptr %arrayidx40.us, align 4, !tbaa !5 br label %for.inc55.us for.inc55.us: ; preds = %if.then42.us, %land.lhs.true32.us, %for.body28.us %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 %exitcond133.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count132 br i1 %exitcond133.not, label %for.body9.us.backedge, label %for.body28.us, !llvm.loop !17 for.body9.us: ; preds = %for.body9.us.backedge, %while.cond.us.preheader %indvars.iv124 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv124.be, %for.body9.us.backedge ] %u.189.us = phi i32 [ undef, %while.cond.us.preheader ], [ %u.2.us, %for.body9.us.backedge ] %mincost.088.us = phi i32 [ 2147483647, %while.cond.us.preheader ], [ %mincost.088.us.be, %for.body9.us.backedge ] %arrayidx11.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv124 %9 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.not.us = icmp eq i32 %9, 1 br i1 %cmp12.not.us, label %for.inc18.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body9.us %arrayidx14.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv124 %10 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.us = icmp slt i32 %10, %mincost.088.us %spec.select.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.088.us) %11 = trunc i64 %indvars.iv124 to i32 %spec.select83.us = select i1 %cmp15.us, i32 %11, i32 %u.189.us br label %for.inc18.us for.inc18.us: ; preds = %land.lhs.true.us, %for.body9.us %mincost.1.us = phi i32 [ %mincost.088.us, %for.body9.us ], [ %spec.select.us, %land.lhs.true.us ] %u.2.us = phi i32 [ %u.189.us, %for.body9.us ], [ %spec.select83.us, %land.lhs.true.us ] %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1 %exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count127 br i1 %exitcond128.not, label %for.end20.us, label %for.body9.us.backedge for.body9.us.backedge: ; preds = %for.inc55.us, %for.inc18.us %indvars.iv124.be = phi i64 [ %indvars.iv.next125, %for.inc18.us ], [ 0, %for.inc55.us ] %mincost.088.us.be = phi i32 [ %mincost.1.us, %for.inc18.us ], [ 2147483647, %for.inc55.us ] br label %for.body9.us, !llvm.loop !17 while.end: ; preds = %for.end20.us, %for.end.thread, %for.end ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !14, !15} !20 = distinct !{!20, !10, !15, !14}
#include<stdio.h> #define N 100 #define MAX 1000000 #define W 0 #define Gr 1 #define B 2 int n,G[N][N],ws,way[N],iro[N]; int saitan(); int main(){ int i,j,l,tar,k,v,c; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&tar,&k); way[i]=MAX; iro[i]=W; for(l=0;l<n;l++) G[i][l]=MAX; for(j=0;j<k;j++){ scanf("%d %d",&v,&c); G[tar][v]=c; } } saitan(); return 0; } int saitan(){ int i,j,tar,ws,min; way[0]=0; iro[0]=W; while(1){ min = MAX; tar=-1; for(i=0;i<n;i++){ if(min > way[i] && iro[i] != B){ tar=i; min = way[i]; } } if(tar==-1) break; iro[tar]=B; for(j=0;j<n;j++){ if(iro[j]!=B && G[tar][j] != MAX){ if(way[j] > way[tar] + G[tar][j]){ way[j]=G[tar][j] + way[tar]; iro[j]=Gr; } } } } for(i=0;i<n;i++){ printf("%d %d\n",i,way[i]==MAX ? -1 :way[i]); } return ws; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222274/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222274/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @way = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @iro = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @G = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 @ws = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %tar = alloca i32, align 4 %k = alloca i32, align 4 %v = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tar) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp37 = icmp sgt i32 %0, 0 br i1 %cmp37, label %for.body, label %for.end24 for.body: ; preds = %entry, %for.inc22 %indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.inc22 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tar, ptr noundef nonnull %k) %arrayidx = getelementptr inbounds [100 x i32], ptr @way, i64 0, i64 %indvars.iv40 store i32 1000000, ptr %arrayidx, align 4, !tbaa !5 %arrayidx3 = getelementptr inbounds [100 x i32], ptr @iro, i64 0, i64 %indvars.iv40 store i32 0, ptr %arrayidx3, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp533 = icmp sgt i32 %1, 0 br i1 %cmp533, label %for.body6.preheader, label %for.cond11.preheader for.body6.preheader: ; preds = %for.body %wide.trip.count = zext i32 %1 to i64 %min.iters.check = icmp ult i32 %1, 8 br i1 %min.iters.check, label %for.body6.preheader43, label %vector.ph vector.ph: ; preds = %for.body6.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %2 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv40, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %3, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond11.preheader, label %for.body6.preheader43 for.body6.preheader43: ; preds = %for.body6.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ] br label %for.body6 for.cond11.preheader: ; preds = %for.body6, %middle.block, %for.body %5 = load i32, ptr %k, align 4, !tbaa !5 %cmp1235 = icmp sgt i32 %5, 0 br i1 %cmp1235, label %for.body13, label %for.inc22 for.body6: ; preds = %for.body6.preheader43, %for.body6 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ %indvars.iv.ph, %for.body6.preheader43 ] %arrayidx10 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv40, i64 %indvars.iv store i32 1000000, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond11.preheader, label %for.body6, !llvm.loop !13 for.body13: ; preds = %for.cond11.preheader, %for.body13 %j.036 = phi i32 [ %inc20, %for.body13 ], [ 0, %for.cond11.preheader ] %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %c) %6 = load i32, ptr %c, align 4, !tbaa !5 %7 = load i32, ptr %tar, align 4, !tbaa !5 %idxprom15 = sext i32 %7 to i64 %8 = load i32, ptr %v, align 4, !tbaa !5 %idxprom17 = sext i32 %8 to i64 %arrayidx18 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom15, i64 %idxprom17 store i32 %6, ptr %arrayidx18, align 4, !tbaa !5 %inc20 = add nuw nsw i32 %j.036, 1 %9 = load i32, ptr %k, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc20, %9 br i1 %cmp12, label %for.body13, label %for.inc22.loopexit, !llvm.loop !14 for.inc22.loopexit: ; preds = %for.body13 %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %for.inc22.loopexit, %for.cond11.preheader %10 = phi i32 [ %.pre, %for.inc22.loopexit ], [ %1, %for.cond11.preheader ] %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1 %11 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next41, %11 br i1 %cmp, label %for.body, label %for.end24, !llvm.loop !15 for.end24: ; preds = %for.inc22, %entry %call25 = call i32 @saitan() call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tar) #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 uwtable define dso_local i32 @saitan() local_unnamed_addr #0 { entry: store i32 0, ptr @way, align 16, !tbaa !5 store i32 0, ptr @iro, align 16, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp90 = icmp sgt i32 %.fr, 0 br i1 %cmp90, label %while.cond.us.preheader, label %for.end61 while.cond.us.preheader: ; preds = %entry %wide.trip.count131 = zext i32 %.fr to i64 %wide.trip.count136 = zext i32 %.fr to i64 br label %for.body.us for.end.us: ; preds = %for.inc.us %cmp7.us = icmp eq i32 %tar.1.us, -1 br i1 %cmp7.us, label %for.cond51.preheader, label %if.end9.us if.end9.us: ; preds = %for.end.us %idxprom10.us = sext i32 %tar.1.us to i64 %arrayidx11.us = getelementptr inbounds [100 x i32], ptr @iro, i64 0, i64 %idxprom10.us store i32 2, ptr %arrayidx11.us, align 4, !tbaa !5 %arrayidx28.us = getelementptr inbounds [100 x i32], ptr @way, i64 0, i64 %idxprom10.us br label %for.body14.us for.body14.us: ; preds = %if.end9.us, %for.inc48.us %indvars.iv133 = phi i64 [ 0, %if.end9.us ], [ %indvars.iv.next134, %for.inc48.us ] %arrayidx16.us = getelementptr inbounds [100 x i32], ptr @iro, i64 0, i64 %indvars.iv133 %1 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5 %cmp17.not.us = icmp eq i32 %1, 2 br i1 %cmp17.not.us, label %for.inc48.us, label %land.lhs.true18.us land.lhs.true18.us: ; preds = %for.body14.us %arrayidx22.us = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom10.us, i64 %indvars.iv133 %2 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %cmp23.not.us = icmp eq i32 %2, 1000000 br i1 %cmp23.not.us, label %for.inc48.us, label %if.then24.us if.then24.us: ; preds = %land.lhs.true18.us %arrayidx26.us = getelementptr inbounds [100 x i32], ptr @way, i64 0, i64 %indvars.iv133 %3 = load i32, ptr %arrayidx26.us, align 4, !tbaa !5 %4 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %add.us = add nsw i32 %4, %2 %cmp33.us = icmp sgt i32 %3, %add.us br i1 %cmp33.us, label %if.then34.us, label %for.inc48.us if.then34.us: ; preds = %if.then24.us store i32 %add.us, ptr %arrayidx26.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx16.us, align 4, !tbaa !5 br label %for.inc48.us for.inc48.us: ; preds = %if.then34.us, %if.then24.us, %land.lhs.true18.us, %for.body14.us %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136 br i1 %exitcond137.not, label %for.body.us.backedge, label %for.body14.us, !llvm.loop !16 for.body.us: ; preds = %for.body.us.backedge, %while.cond.us.preheader %indvars.iv128 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv128.be, %for.body.us.backedge ] %min.093.us = phi i32 [ 1000000, %while.cond.us.preheader ], [ %min.093.us.be, %for.body.us.backedge ] %tar.091.us = phi i32 [ -1, %while.cond.us.preheader ], [ %tar.091.us.be, %for.body.us.backedge ] %arrayidx.us = getelementptr inbounds [100 x i32], ptr @way, i64 0, i64 %indvars.iv128 %5 = load i32, ptr %arrayidx.us, align 4, !tbaa !5 %cmp1.us = icmp sgt i32 %min.093.us, %5 br i1 %cmp1.us, label %land.lhs.true.us, label %for.inc.us land.lhs.true.us: ; preds = %for.body.us %arrayidx3.us = getelementptr inbounds [100 x i32], ptr @iro, i64 0, i64 %indvars.iv128 %6 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5 %cmp4.not.us = icmp eq i32 %6, 2 %7 = trunc i64 %indvars.iv128 to i32 %spec.select.us = select i1 %cmp4.not.us, i32 %tar.091.us, i32 %7 %spec.select88.us = select i1 %cmp4.not.us, i32 %min.093.us, i32 %5 br label %for.inc.us for.inc.us: ; preds = %land.lhs.true.us, %for.body.us %tar.1.us = phi i32 [ %tar.091.us, %for.body.us ], [ %spec.select.us, %land.lhs.true.us ] %min.1.us = phi i32 [ %min.093.us, %for.body.us ], [ %spec.select88.us, %land.lhs.true.us ] %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131 br i1 %exitcond132.not, label %for.end.us, label %for.body.us.backedge for.body.us.backedge: ; preds = %for.inc48.us, %for.inc.us %indvars.iv128.be = phi i64 [ %indvars.iv.next129, %for.inc.us ], [ 0, %for.inc48.us ] %min.093.us.be = phi i32 [ %min.1.us, %for.inc.us ], [ 1000000, %for.inc48.us ] %tar.091.us.be = phi i32 [ %tar.1.us, %for.inc.us ], [ -1, %for.inc48.us ] br label %for.body.us, !llvm.loop !16 for.cond51.preheader: ; preds = %for.end.us %cmp52124 = icmp sgt i32 %.fr, 0 br i1 %cmp52124, label %for.body53, label %for.end61 for.body53: ; preds = %for.cond51.preheader, %for.body53 %indvars.iv138 = phi i64 [ %indvars.iv.next139, %for.body53 ], [ 0, %for.cond51.preheader ] %arrayidx55 = getelementptr inbounds [100 x i32], ptr @way, i64 0, i64 %indvars.iv138 %8 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %cmp56 = icmp eq i32 %8, 1000000 %spec.select89 = select i1 %cmp56, i32 -1, i32 %8 %9 = trunc i64 %indvars.iv138 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9, i32 noundef %spec.select89) %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1 %10 = load i32, ptr @n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp52 = icmp slt i64 %indvars.iv.next139, %11 br i1 %cmp52, label %for.body53, label %for.end61, !llvm.loop !17 for.end61: ; preds = %for.body53, %entry, %for.cond51.preheader ret i32 undef } ; 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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #define MAX 9 int main(void) { int n, cnt, limit; int x, y, v; int result[MAX][MAX]; int test_cnt; test_cnt = 0; while(scanf("%d", &n), n) { limit = n - 1; cnt = 1; x = y = 0; result[0][0] = cnt; while(n != 1) { if(x == limit) { v = -1; result[++y][x] = ++cnt; } else if(y == 0) { v = -1; result[y][++x] = ++cnt; } else if(y == limit) { v = 1; result[y][++x] = ++cnt; } else if(x == 0) { v = 1; result[++y][x] = ++cnt; } if((x == limit) && (y == limit)) break; y+= -v; x+= v; result[y][x] = ++cnt; } printf("Case %d:\n", ++test_cnt); for(y=0; y < n; y++) { for(x=0; x < n; x++) { printf("%3d", result[y][x]); } printf("\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222317/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222317/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"Case %d:\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%3d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %result = alloca [9 x [9 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 324, ptr nonnull %result) #4 %call106 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not107 = icmp eq i32 %0, 0 br i1 %tobool.not107, label %while.end65, label %while.body while.cond.loopexit: ; preds = %for.end, %while.end %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %1, 0 br i1 %tobool.not, label %while.end65, label %while.body, !llvm.loop !9 while.body: ; preds = %entry, %while.cond.loopexit %2 = phi i32 [ %1, %while.cond.loopexit ], [ %0, %entry ] %test_cnt.0109 = phi i32 [ %inc49, %while.cond.loopexit ], [ 0, %entry ] %v.0108 = phi i32 [ %v.3, %while.cond.loopexit ], [ undef, %entry ] %sub = add nsw i32 %2, -1 store i32 1, ptr %result, align 16, !tbaa !5 %cmp.not = icmp eq i32 %2, 1 br i1 %cmp.not, label %while.end, label %while.body3.preheader while.body3.preheader: ; preds = %while.body %idxprom21 = sext i32 %sub to i64 %idxprom7 = sext i32 %sub to i64 br label %while.body3 while.body3: ; preds = %if.end41, %while.body3.preheader %v.1100 = phi i32 [ %v.2, %if.end41 ], [ %v.0108, %while.body3.preheader ] %y.099 = phi i32 [ %add, %if.end41 ], [ 0, %while.body3.preheader ] %x.098 = phi i32 [ %add43, %if.end41 ], [ 0, %while.body3.preheader ] %cnt.097 = phi i32 [ %inc44, %if.end41 ], [ 1, %while.body3.preheader ] %cmp4 = icmp eq i32 %x.098, %sub br i1 %cmp4, label %if.then, label %if.else if.then: ; preds = %while.body3 %inc = add nsw i32 %cnt.097, 1 %inc5 = add nsw i32 %y.099, 1 %idxprom = sext i32 %inc5 to i64 %arrayidx8 = getelementptr inbounds [9 x [9 x i32]], ptr %result, i64 0, i64 %idxprom, i64 %idxprom7 store i32 %inc, ptr %arrayidx8, align 4, !tbaa !5 br label %if.end37 if.else: ; preds = %while.body3 %cmp9 = icmp eq i32 %y.099, 0 br i1 %cmp9, label %if.then10, label %if.else17 if.then10: ; preds = %if.else %inc11 = add nsw i32 %cnt.097, 1 %inc14 = add nsw i32 %x.098, 1 %idxprom15 = sext i32 %inc14 to i64 %arrayidx16 = getelementptr inbounds [9 x i32], ptr %result, i64 0, i64 %idxprom15 store i32 %inc11, ptr %arrayidx16, align 4, !tbaa !5 br label %if.end37 if.else17: ; preds = %if.else %cmp18 = icmp eq i32 %y.099, %sub br i1 %cmp18, label %if.then19, label %if.else26 if.then19: ; preds = %if.else17 %inc20 = add nsw i32 %cnt.097, 1 %inc23 = add nsw i32 %x.098, 1 %idxprom24 = sext i32 %inc23 to i64 %arrayidx25 = getelementptr inbounds [9 x [9 x i32]], ptr %result, i64 0, i64 %idxprom21, i64 %idxprom24 store i32 %inc20, ptr %arrayidx25, align 4, !tbaa !5 br label %if.end37 if.else26: ; preds = %if.else17 %cmp27 = icmp eq i32 %x.098, 0 br i1 %cmp27, label %if.then28, label %if.end37 if.then28: ; preds = %if.else26 %inc29 = add nsw i32 %cnt.097, 1 %inc30 = add nsw i32 %y.099, 1 %idxprom31 = sext i32 %inc30 to i64 %arrayidx32 = getelementptr inbounds [9 x [9 x i32]], ptr %result, i64 0, i64 %idxprom31 store i32 %inc29, ptr %arrayidx32, align 4, !tbaa !5 br label %if.end37 if.end37: ; preds = %if.then10, %if.else26, %if.then28, %if.then19, %if.then %cnt.1 = phi i32 [ %inc, %if.then ], [ %inc11, %if.then10 ], [ %inc20, %if.then19 ], [ %inc29, %if.then28 ], [ %cnt.097, %if.else26 ] %x.1 = phi i32 [ %sub, %if.then ], [ %inc14, %if.then10 ], [ %inc23, %if.then19 ], [ 0, %if.then28 ], [ %x.098, %if.else26 ] %y.1 = phi i32 [ %inc5, %if.then ], [ 0, %if.then10 ], [ %sub, %if.then19 ], [ %inc30, %if.then28 ], [ %y.099, %if.else26 ] %v.2 = phi i32 [ -1, %if.then ], [ -1, %if.then10 ], [ 1, %if.then19 ], [ 1, %if.then28 ], [ %v.1100, %if.else26 ] %cmp38 = icmp eq i32 %x.1, %sub %cmp39 = icmp eq i32 %y.1, %sub %or.cond = and i1 %cmp38, %cmp39 br i1 %or.cond, label %while.end, label %if.end41 if.end41: ; preds = %if.end37 %add = sub i32 %y.1, %v.2 %add43 = add nsw i32 %v.2, %x.1 %inc44 = add nsw i32 %cnt.1, 1 %idxprom45 = sext i32 %add to i64 %idxprom47 = sext i32 %add43 to i64 %arrayidx48 = getelementptr inbounds [9 x [9 x i32]], ptr %result, i64 0, i64 %idxprom45, i64 %idxprom47 store i32 %inc44, ptr %arrayidx48, align 4, !tbaa !5 br label %while.body3 while.end: ; preds = %if.end37, %while.body %v.3 = phi i32 [ %v.0108, %while.body ], [ %v.2, %if.end37 ] %inc49 = add nuw nsw i32 %test_cnt.0109, 1 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc49) %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp51104 = icmp sgt i32 %3, 0 br i1 %cmp51104, label %for.cond52.preheader, label %while.cond.loopexit for.cond52.preheader: ; preds = %while.end, %for.end %4 = phi i32 [ %8, %for.end ], [ %3, %while.end ] %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.end ], [ 0, %while.end ] %cmp53102 = icmp sgt i32 %4, 0 br i1 %cmp53102, label %for.body54, label %for.end for.body54: ; preds = %for.cond52.preheader, %for.body54 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body54 ], [ 0, %for.cond52.preheader ] %arrayidx58 = getelementptr inbounds [9 x [9 x i32]], ptr %result, i64 0, i64 %indvars.iv111, i64 %indvars.iv %5 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp53 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp53, label %for.body54, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body54, %for.cond52.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp51 = icmp slt i64 %indvars.iv.next112, %9 br i1 %cmp51, label %for.cond52.preheader, label %while.cond.loopexit, !llvm.loop !12 while.end65: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 324, ptr nonnull %result) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> int main(void) { char a[15],b[15],c[15]; int x,y; scanf("%s %s %d %d %s",&a,&b,&x,&y,&c); if((strcmp(a,c)==0)) x--; if((strcmp(b,c)==0)) y--; printf("%d %d",x,y); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222368/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222368/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%s %s %d %d %s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [15 x i8], align 1 %b = alloca [15 x i8], align 1 %c = alloca [15 x i8], align 1 %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %c) %call2 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %c) #5 %cmp = icmp eq i32 %call2, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %0 = load i32, ptr %x, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr %x, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %c) #5 %cmp6 = icmp eq i32 %call5, 0 %.pre = load i32, ptr %y, align 4, !tbaa !5 br i1 %cmp6, label %if.then7, label %if.end9 if.then7: ; preds = %if.end %dec8 = add nsw i32 %.pre, -1 store i32 %dec8, ptr %y, align 4, !tbaa !5 br label %if.end9 if.end9: ; preds = %if.then7, %if.end %1 = phi i32 [ %dec8, %if.then7 ], [ %.pre, %if.end ] %2 = load i32, ptr %x, align 4, !tbaa !5 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 15, 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 nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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"}
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<stdbool.h> #include<assert.h> typedef long long ll; typedef long double ld; #define rep(i,l,r)for(ll i=(l);i<(r);i++) #define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k)) #define rrep(i,l,r)for(ll i=(l);i>=(r);i--) #define INF (1LL<<60) #define MOD1 1000000007 #define MOD2 998244353 #define MAX_N (1 << 17) #define YES printf("Yes\n") #define NO printf("No\n") #define PN printf("\n") #define charsize 100005 //10^5+5 void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;} ll max2(ll a,ll b){return a>=b?a:b;} ll min2(ll a,ll b){return a>=b?b:a;} ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;} ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;} ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;} ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;} ll ABS(ll a){return a>=0?a:(-a);} ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;} ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} ll mod(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;} int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;} int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;} void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);} void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);} typedef struct{ ll a , b;}fr; int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;} int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;} void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);} void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);} int main(void){ char s[20],t[20],u[20]; ll a,b; scanf("%s%s%lld%lld%s",s,t,&a,&b,u); if(strcmp(s,u)==0){ printf("%lld %lld\n",a-1,b); }else{ printf("%lld %lld\n",a,b-1); } // printf("%lld\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222418/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222418/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%s%s%lld%lld%s\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 { entry: %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 store i64 %1, ptr %b, align 8, !tbaa !5 store i64 %0, ptr %a, align 8, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 { entry: %cmp.not = icmp sgt i64 %a, %b %cmp1.not = icmp sgt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 { entry: %cmp.not = icmp slt i64 %a, %b %cmp1.not = icmp slt i64 %a, %c %or.cond = or i1 %cmp.not, %cmp1.not %cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c) %cond6 = select i1 %or.cond, i64 %cond, i64 %a ret i64 %cond6 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 { entry: %cmp5 = icmp sgt i64 %n, 0 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ] %b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6) %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13 } ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 { entry: %cmp5 = icmp sgt i64 %n, 0 br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i64 %n, 4 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %n, -4 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i64, ptr %a, i64 %index %wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5 %1 = getelementptr inbounds i64, ptr %0, i64 2 %wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5 %2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load) %3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9) %index.next = add nuw i64 %index, 4 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3) %5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %n br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ] ret i64 %b.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ] %b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07 %6 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6) %inc = add nuw nsw i64 %i.07, 1 %exitcond.not = icmp eq i64 %inc, %n br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 { entry: %cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true) ret i64 %cond } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %cmp3 = icmp sgt i64 %b, 0 br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %c.04.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %c.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %c.04, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %cond.end, label %cond.true cond.true: ; preds = %entry, %cond.true %b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %cond.end, label %cond.true cond.end: ; preds = %cond.true, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ] ret i64 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i cond.true.i: ; preds = %entry, %cond.true.i %b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ] %rem.i = srem i64 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i64 %rem.i, 0 br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i gcd.exit: ; preds = %cond.true.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ] %div = sdiv i64 %a, %a.tr.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @mod(i64 noundef %n) local_unnamed_addr #5 { entry: %cmp = icmp slt i64 %n, 0 br i1 %cmp, label %cond.true, label %cond.end cond.true: ; preds = %entry %n.nonneg = sub i64 0, %n %0 = urem i64 %n.nonneg, 1000000007 %1 = add nsw i64 %0, %n %mul = sub i64 1000000007, %1 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ] %add1 = add nsw i64 %cond, %n %rem = srem i64 %add1, 1000000007 ret i64 %rem } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #6 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = zext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 -1, i32 %cond ret i32 %cond2 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #6 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp sgt i64 %0, %1 %cond = sext i1 %cmp1 to i32 %cond2 = select i1 %cmp, i32 1, i32 %cond ret i32 %cond2 } ; Function Attrs: nofree nounwind uwtable define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #12 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #12 ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 { entry: %0 = load i64, ptr %p, align 8, !tbaa !19 %1 = load i64, ptr %q, align 8, !tbaa !19 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 { entry: %0 = load i64, ptr %q, align 8, !tbaa !19 %1 = load i64, ptr %p, align 8, !tbaa !19 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #12 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #12 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %s = alloca [20 x i8], align 16 %t = alloca [20 x i8], align 16 %u = alloca [20 x i8], align 16 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #12 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %t) #12 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %u) #12 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #12 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #12 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %u) %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %u) #13 %cmp = icmp eq i32 %call5, 0 %0 = load i64, ptr %a, align 8, !tbaa !5 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %sub = add nsw i64 %0, -1 %1 = load i64, ptr %b, align 8, !tbaa !5 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub, i64 noundef %1) br label %if.end if.else: ; preds = %entry %2 = load i64, ptr %b, align 8, !tbaa !5 %sub7 = add nsw i64 %2, -1 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %0, i64 noundef %sub7) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #12 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #12 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %u) #12 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %t) #12 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #12 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #10 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #11 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #10 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #12 = { nounwind } attributes #13 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !10} !19 = !{!20, !6, i64 0} !20 = !{!"", !6, i64 0, !6, i64 8}
#include <stdio.h> #include <string.h> int main(void){ char S[11],T[11],U[11]; int A,B,i,j; scanf("%s %s",S,T); scanf("%d %d",&A,&B); scanf("%s",U); if(strcmp(S,U)==0){ printf("%d %d\n",A-1,B); } if(strcmp(T,U)==0){ printf("%d %d\n",A,B-1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222469/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222469/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = 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: %S = alloca [11 x i8], align 1 %T = alloca [11 x i8], align 1 %U = alloca [11 x i8], align 1 %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %S) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %U) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %T) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %U) %call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(1) %U) #5 %cmp = icmp eq i32 %call7, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %0 = load i32, ptr %A, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %B, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub, i32 noundef %1) br label %if.end if.end: ; preds = %if.then, %entry %call11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %T, ptr noundef nonnull dereferenceable(1) %U) #5 %cmp12 = icmp eq i32 %call11, 0 br i1 %cmp12, label %if.then13, label %if.end16 if.then13: ; preds = %if.end %2 = load i32, ptr %A, align 4, !tbaa !5 %3 = load i32, ptr %B, align 4, !tbaa !5 %sub14 = add nsw i32 %3, -1 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %2, i32 noundef %sub14) br label %if.end16 if.end16: ; preds = %if.then13, %if.end call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %U) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %T) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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"}
#include <stdio.h> #include <memory.h> #include <ctype.h> #include <stdlib.h> #include <string.h> int main(void){ char s[256], t[256]; int a, b; char u[256]; scanf("%s %s", s, t); scanf("%d %d", &a, &b); scanf("%s", u); if (strcmp(t,u)){ a = a - 1; } else{ b = b - 1; } printf("%d %d\n", a, b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222533/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222533/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = 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: %s = alloca [256 x i8], align 16 %t = alloca [256 x i8], align 16 %a = alloca i32, align 4 %b = alloca i32, align 4 %u = alloca [256 x i8], align 16 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %t) #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 256, ptr nonnull %u) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u) %call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %u) #5 %tobool.not = icmp eq i32 %call7, 0 br i1 %tobool.not, label %if.else, label %if.then if.then: ; preds = %entry %0 = load i32, ptr %a, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 store i32 %sub, ptr %a, align 4, !tbaa !5 %.pre10 = load i32, ptr %b, align 4, !tbaa !5 br label %if.end if.else: ; preds = %entry %1 = load i32, ptr %b, align 4, !tbaa !5 %sub8 = add nsw i32 %1, -1 store i32 %sub8, ptr %b, align 4, !tbaa !5 %.pre = load i32, ptr %a, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %2 = phi i32 [ %sub8, %if.else ], [ %.pre10, %if.then ] %3 = phi i32 [ %.pre, %if.else ], [ %sub, %if.then ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %3, i32 noundef %2) call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %u) #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 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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"}
#include <stdio.h> #include <string.h> void main() { char s[10],t[10],u[10]; int m,n; scanf("%s %s",s,t); scanf("%d %d",&m,&n); scanf("%s",u); if(strcmp(u,s)==0) printf("%d %d",m-1,n); else printf("%d %d",m,n-1); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222599/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222599/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local void @main() local_unnamed_addr #0 { entry: %s = alloca [10 x i8], align 1 %t = alloca [10 x i8], align 1 %u = alloca [10 x i8], align 1 %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %u) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #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 %s, ptr noundef nonnull %t) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u) %call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %u, ptr noundef nonnull dereferenceable(1) %s) #5 %cmp = icmp eq i32 %call7, 0 %0 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %sub = add nsw i32 %0, -1 %1 = load i32, ptr %n, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub, i32 noundef %1) br label %if.end if.else: ; preds = %entry %2 = load i32, ptr %n, align 4, !tbaa !5 %sub9 = add nsw i32 %2, -1 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %sub9) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %u) #4 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #4 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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"}
#include <stdio.h> #include <string.h> int main(void) { char S[11]; char T[11]; char U[11]; int A; int B; scanf("%s %s", S, T); scanf("%d %d", &A, &B); scanf("%s", U); if (strcmp(S, U) == 0) A -= 1; else if (strcmp(T, U) == 0) B -= 1; printf("%d %d\n", A, B); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222641/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222641/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = 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: %S = alloca [11 x i8], align 1 %T = alloca [11 x i8], align 1 %U = alloca [11 x i8], align 1 %A = alloca i32, align 4 %B = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %S) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %U) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %T) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %U) %call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(1) %U) #5 %cmp = icmp eq i32 %call7, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %0 = load i32, ptr %A, align 4, !tbaa !5 %sub = add nsw i32 %0, -1 store i32 %sub, ptr %A, align 4, !tbaa !5 %.pre = load i32, ptr %B, align 4, !tbaa !5 br label %if.end14 if.else: ; preds = %entry %call10 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %T, ptr noundef nonnull dereferenceable(1) %U) #5 %cmp11 = icmp eq i32 %call10, 0 %.pre16 = load i32, ptr %B, align 4, !tbaa !5 br i1 %cmp11, label %if.then12, label %if.end14 if.then12: ; preds = %if.else %sub13 = add nsw i32 %.pre16, -1 store i32 %sub13, ptr %B, align 4, !tbaa !5 br label %if.end14 if.end14: ; preds = %if.else, %if.then12, %if.then %1 = phi i32 [ %.pre16, %if.else ], [ %sub13, %if.then12 ], [ %.pre, %if.then ] %2 = load i32, ptr %A, align 4, !tbaa !5 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %2, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %U) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %T) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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"}
#include<stdio.h> #include<stdlib.h> #include<string.h> #define ll long long #define N 100000 const int MOD = 1000000007; int main(void) { char a[50] = { "\0" }, b[50] = { "\0" }; char c[50] = { "\0" }; int a1 = 0, b1 = 0; scanf("%s %s", a, b); scanf("%d %d", &a1, &b1); scanf("%s", c); if (!strcmp(a, c)) { a1--; } else { b1--; } printf("%d %d", a1, b1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222692/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222692/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @MOD = dso_local local_unnamed_addr constant i32 1000000007, align 4 @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = 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: %a = alloca [50 x i8], align 16 %b = alloca [50 x i8], align 16 %c = alloca [50 x i8], align 16 %a1 = alloca i32, align 4 %b1 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50) %a, i8 0, i64 50, i1 false) call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50) %b, i8 0, i64 50, i1 false) call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50) %c, i8 0, i64 50, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a1) #5 store i32 0, ptr %a1, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b1) #5 store i32 0, ptr %b1, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a1, ptr noundef nonnull %b1) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %c) %call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %c) #6 %tobool.not = icmp eq i32 %call7, 0 br i1 %tobool.not, label %if.then, label %if.else if.then: ; preds = %entry %0 = load i32, ptr %a1, align 4, !tbaa !5 %dec = add nsw i32 %0, -1 store i32 %dec, ptr %a1, align 4, !tbaa !5 %.pre10 = load i32, ptr %b1, align 4, !tbaa !5 br label %if.end if.else: ; preds = %entry %1 = load i32, ptr %b1, align 4, !tbaa !5 %dec8 = add nsw i32 %1, -1 store i32 %dec8, ptr %b1, align 4, !tbaa !5 %.pre = load i32, ptr %a1, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.else, %if.then %2 = phi i32 [ %dec8, %if.else ], [ %.pre10, %if.then ] %3 = phi i32 [ %.pre, %if.else ], [ %dec, %if.then ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b1) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a1) #5 call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %c) #5 call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <inttypes.h> #include <math.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { intmax_t A, B; char S[11], T[11], U[11]; intmax_t ans = 0; scanf("%s%s", S, T); scanf("%jd%jd", &A, &B); scanf("%s", U); if (strcmp(S, U) == 0) { A -= 1; } if (strcmp(T, U) == 0) { B -= 1; } printf("%jd %jd\n", A, B); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222735/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222735/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%jd%jd\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.3 = private unnamed_addr constant [9 x i8] c"%jd %jd\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 %S = alloca [11 x i8], align 1 %T = alloca [11 x i8], align 1 %U = alloca [11 x i8], align 1 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 11, ptr nonnull %S) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %T) #4 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %U) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %T) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %B) %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %U) %call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(1) %U) #5 %cmp = icmp eq i32 %call7, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %0 = load i64, ptr %A, align 8, !tbaa !5 %sub = add nsw i64 %0, -1 store i64 %sub, ptr %A, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %call10 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %T, ptr noundef nonnull dereferenceable(1) %U) #5 %cmp11 = icmp eq i32 %call10, 0 %.pre = load i64, ptr %B, align 8, !tbaa !5 br i1 %cmp11, label %if.then12, label %if.end14 if.then12: ; preds = %if.end %sub13 = add nsw i64 %.pre, -1 store i64 %sub13, ptr %B, align 8, !tbaa !5 br label %if.end14 if.end14: ; preds = %if.then12, %if.end %1 = phi i64 [ %sub13, %if.then12 ], [ %.pre, %if.end ] %2 = load i64, ptr %A, align 8, !tbaa !5 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %2, i64 noundef %1) call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %U) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %T) #4 call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %S) #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: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int mysqrt(int n) { int left,right; long long mid; if(n==0)return 0; if(n<0)return -1; left=1;right=n; while(left<=right) { mid=(left+right)/2; if(mid*mid==n)return mid; else if(mid*mid<n)left=mid+1; else right=mid-1; } return left-1; } int main(void) { int query; int max; int sum; int i; while(1) { scanf("%d",&query); if(query==0)break; sum=1; max=mysqrt(query); for(i=2;i<=max;i++) { if(query%i==0) { sum+=i+query/i; } } if(max*max==query)sum-=max; if(sum==query)puts("perfect number"); else if(sum<query)puts("deficient number"); else puts("abundant number"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222779/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222779/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [15 x i8] c"perfect number\00", align 1 @.str.2 = private unnamed_addr constant [17 x i8] c"deficient number\00", align 1 @.str.3 = private unnamed_addr constant [16 x i8] c"abundant number\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @mysqrt(i32 noundef %n) local_unnamed_addr #0 { entry: %cmp = icmp eq i32 %n, 0 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %cmp1 = icmp slt i32 %n, 0 br i1 %cmp1, label %cleanup, label %while.body.lr.ph while.body.lr.ph: ; preds = %if.end %conv5 = zext i32 %n to i64 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.else %right.040 = phi i32 [ %n, %while.body.lr.ph ], [ %right.1, %if.else ] %left.039 = phi i32 [ 1, %while.body.lr.ph ], [ %left.1, %if.else ] %add = add nsw i32 %right.040, %left.039 %div = sdiv i32 %add, 2 %conv = sext i32 %div to i64 %mul = mul nsw i64 %conv, %conv %cmp6 = icmp eq i64 %mul, %conv5 br i1 %cmp6, label %cleanup, label %if.else if.else: ; preds = %while.body %cmp12 = icmp ult i64 %mul, %conv5 %add15 = add nsw i32 %div, 1 %sub = add nsw i32 %div, -1 %left.1 = select i1 %cmp12, i32 %add15, i32 %left.039 %right.1 = select i1 %cmp12, i32 %right.040, i32 %sub %cmp4.not = icmp sgt i32 %left.1, %right.1 br i1 %cmp4.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.else %sub21 = add nsw i32 %left.1, -1 br label %cleanup cleanup: ; preds = %while.body, %if.end, %entry, %while.end %retval.0 = phi i32 [ %sub21, %while.end ], [ 0, %entry ], [ -1, %if.end ], [ %div, %while.body ] 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: %query = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %query) #4 %call35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %query) %0 = load i32, ptr %query, align 4, !tbaa !7 %cmp36 = icmp eq i32 %0, 0 br i1 %cmp36, label %while.end, label %if.end.i if.end.i: ; preds = %entry, %for.end %1 = phi i32 [ %2, %for.end ], [ %0, %entry ] %cmp1.i = icmp slt i32 %1, 0 br i1 %cmp1.i, label %for.end, label %while.body.lr.ph.i while.body.lr.ph.i: ; preds = %if.end.i %conv5.i = zext i32 %1 to i64 br label %while.body.i while.body.i: ; preds = %if.else.i, %while.body.lr.ph.i %right.040.i = phi i32 [ %1, %while.body.lr.ph.i ], [ %right.1.i, %if.else.i ] %left.039.i = phi i32 [ 1, %while.body.lr.ph.i ], [ %left.1.i, %if.else.i ] %add.i = add nsw i32 %left.039.i, %right.040.i %div.i = sdiv i32 %add.i, 2 %conv.i = sext i32 %div.i to i64 %mul.i = mul nsw i64 %conv.i, %conv.i %cmp6.i = icmp eq i64 %mul.i, %conv5.i br i1 %cmp6.i, label %mysqrt.exit, label %if.else.i if.else.i: ; preds = %while.body.i %cmp12.i = icmp ult i64 %mul.i, %conv5.i %add15.i = add nsw i32 %div.i, 1 %sub.i = add nsw i32 %div.i, -1 %left.1.i = select i1 %cmp12.i, i32 %add15.i, i32 %left.039.i %right.1.i = select i1 %cmp12.i, i32 %right.040.i, i32 %sub.i %cmp4.not.i = icmp sgt i32 %left.1.i, %right.1.i br i1 %cmp4.not.i, label %while.end.i, label %while.body.i, !llvm.loop !5 while.end.i: ; preds = %if.else.i %sub21.i = add nsw i32 %left.1.i, -1 br label %mysqrt.exit mysqrt.exit: ; preds = %while.body.i, %while.end.i %retval.0.i = phi i32 [ %sub21.i, %while.end.i ], [ %div.i, %while.body.i ] %cmp2.not32 = icmp slt i32 %retval.0.i, 2 br i1 %cmp2.not32, label %for.end, label %for.body for.body: ; preds = %mysqrt.exit, %for.body %i.034 = phi i32 [ %inc, %for.body ], [ 2, %mysqrt.exit ] %sum.033 = phi i32 [ %sum.1, %for.body ], [ 1, %mysqrt.exit ] %rem = srem i32 %1, %i.034 %div = sdiv i32 %1, %i.034 %cmp3 = icmp eq i32 %rem, 0 %add = add i32 %i.034, %sum.033 %add5 = add i32 %add, %div %sum.1 = select i1 %cmp3, i32 %add5, i32 %sum.033 %inc = add nuw i32 %i.034, 1 %exitcond.not = icmp eq i32 %i.034, %retval.0.i br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %if.end.i, %mysqrt.exit %retval.0.i40 = phi i32 [ %retval.0.i, %mysqrt.exit ], [ -1, %if.end.i ], [ %retval.0.i, %for.body ] %sum.0.lcssa = phi i32 [ 1, %mysqrt.exit ], [ 1, %if.end.i ], [ %sum.1, %for.body ] %mul = mul nsw i32 %retval.0.i40, %retval.0.i40 %cmp7 = icmp eq i32 %mul, %1 %sub = select i1 %cmp7, i32 %retval.0.i40, i32 0 %spec.select = sub nsw i32 %sum.0.lcssa, %sub %cmp10 = icmp eq i32 %spec.select, %1 %cmp13 = icmp slt i32 %spec.select, %1 %.str.2..str.3 = select i1 %cmp13, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp10, ptr @.str.1, ptr %.str.2..str.3 %call15 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %query) %2 = load i32, ptr %query, align 4, !tbaa !7 %cmp = icmp eq i32 %2, 0 br i1 %cmp, label %while.end, label %if.end.i while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %query) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include<stdio.h> int main() { int n; scanf("%d", &n); int i, j; int a[1003][1003]; for (i = 0; i < n; i++) { for (j = 0; j < n - 1; j++) { scanf("%d", &a[i][j]); a[i][j]--; } } int ans = 0; int p[1003]; for (i = 0; i < n; i++) p[i] = 0; int c; int count = 0; int r[1003]; while (count < n * (n - 1) / 2) { c = 0; for (i = 0; i < n; i++) r[i] = 0; for (i = 0; i < n; i++) { if (r[i] == 0) { if (p[i] < n - 1) { if (r[a[i][p[i]]] == 0) { if (a[a[i][p[i]]][p[a[i][p[i]]]] == i) { c = 1; r[i] = 1; r[a[i][p[i]]] = 1; p[a[i][p[i]]]++; p[i]++; count++; } } } } } if (c == 0) { ans = -1; break; } ans++; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222843/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222843/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1003 x [1003 x i32]], align 16 %p = alloca [1003 x i32], align 16 %r = alloca [1003 x i32], 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) call void @llvm.lifetime.start.p0(i64 4024036, ptr nonnull %a) #4 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp142 = icmp sgt i32 %0, 0 br i1 %cmp142, label %for.cond1.preheader.lr.ph, label %for.end21.thread for.cond1.preheader.lr.ph: ; preds = %entry %.not = icmp eq i32 %0, 1 br i1 %.not, label %for.end13.thread, label %for.cond1.preheader for.end13.thread: ; preds = %for.cond1.preheader.lr.ph call void @llvm.lifetime.start.p0(i64 4012, ptr nonnull %p) #4 br label %for.body16.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc11 %1 = phi i32 [ %5, %for.inc11 ], [ %0, %for.cond1.preheader.lr.ph ] %indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.inc11 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2140 = icmp sgt i32 %1, 1 br i1 %cmp2140, label %for.body3, label %for.inc11 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [1003 x [1003 x i32]], ptr %a, i64 0, i64 %indvars.iv189, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %arrayidx5, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %3, -1 %4 = sext i32 %sub to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc11, !llvm.loop !9 for.inc11: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next190, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.inc11 call void @llvm.lifetime.start.p0(i64 4012, ptr nonnull %p) #4 %cmp15144 = icmp sgt i32 %5, 0 br i1 %cmp15144, label %for.body16.preheader, label %for.end21 for.body16.preheader: ; preds = %for.end13.thread, %for.end13 %.lcssa204 = phi i32 [ 1, %for.end13.thread ], [ %5, %for.end13 ] %7 = zext i32 %.lcssa204 to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %p, i8 0, i64 %8, i1 false), !tbaa !5 br label %for.end21 for.end21: ; preds = %for.body16.preheader, %for.end13 %cmp15144205 = phi i1 [ false, %for.body16.preheader ], [ true, %for.end13 ] %.lcssa203 = phi i32 [ %.lcssa204, %for.body16.preheader ], [ %5, %for.end13 ] call void @llvm.lifetime.start.p0(i64 4012, ptr nonnull %r) #4 %sub22 = add nsw i32 %.lcssa203, -1 %mul = mul nsw i32 %sub22, %.lcssa203 %mul.fr = freeze i32 %mul %div235245 = lshr i32 %mul.fr, 1 %cmp23154 = icmp slt i32 %mul.fr, 2 %brmerge = or i1 %cmp23154, %cmp15144205 %not.cmp23154 = xor i1 %cmp23154, true %.mux = sext i1 %not.cmp23154 to i32 br i1 %brmerge, label %while.end, label %for.cond24.preheader.us.preheader for.end21.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 4012, ptr nonnull %p) #4 call void @llvm.lifetime.start.p0(i64 4012, ptr nonnull %r) #4 %sub22212 = add nsw i32 %0, -1 %mul213 = mul nsw i32 %sub22212, %0 %mul.fr214 = freeze i32 %mul213 %cmp23154216 = icmp sgt i32 %mul.fr214, 1 %spec.select = sext i1 %cmp23154216 to i32 br label %while.end for.cond24.preheader.us.preheader: ; preds = %for.end21 %9 = zext i32 %.lcssa203 to i64 %10 = shl nuw nsw i64 %9, 2 br label %for.cond32.preheader.us if.end104.us: ; preds = %for.inc99.us.thread, %for.cond32.for.end101_crit_edge.us %count.2.us230234 = phi i32 [ %count.1151.us.ph, %for.cond32.for.end101_crit_edge.us ], [ %inc95.us, %for.inc99.us.thread ] %inc105.us = add nuw nsw i32 %ans.0155.us, 1 %cmp23.us = icmp slt i32 %count.2.us230234, %div235245 br i1 %cmp23.us, label %for.cond32.preheader.us, label %while.end, !llvm.loop !13 for.body34.us: ; preds = %for.body34.us.outer, %for.inc99.us %indvars.iv198 = phi i64 [ %indvars.iv.next199, %for.inc99.us ], [ %indvars.iv198.ph, %for.body34.us.outer ] %arrayidx36.us = getelementptr inbounds [1003 x i32], ptr %r, i64 0, i64 %indvars.iv198 %11 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %cmp37.us = icmp eq i32 %11, 0 br i1 %cmp37.us, label %if.then.us, label %for.inc99.us if.then.us: ; preds = %for.body34.us %arrayidx39.us = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %indvars.iv198 %12 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp41.us = icmp slt i32 %12, %sub22 br i1 %cmp41.us, label %if.then42.us, label %for.inc99.us if.then42.us: ; preds = %if.then.us %idxprom47.us = sext i32 %12 to i64 %arrayidx48.us = getelementptr inbounds [1003 x [1003 x i32]], ptr %a, i64 0, i64 %indvars.iv198, i64 %idxprom47.us %13 = load i32, ptr %arrayidx48.us, align 4, !tbaa !5 %idxprom49.us = sext i32 %13 to i64 %arrayidx50.us = getelementptr inbounds [1003 x i32], ptr %r, i64 0, i64 %idxprom49.us %14 = load i32, ptr %arrayidx50.us, align 4, !tbaa !5 %cmp51.us = icmp eq i32 %14, 0 br i1 %cmp51.us, label %if.then52.us, label %for.inc99.us if.then52.us: ; preds = %if.then42.us %arrayidx68.us = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %idxprom49.us %15 = load i32, ptr %arrayidx68.us, align 4, !tbaa !5 %idxprom69.us = sext i32 %15 to i64 %arrayidx70.us = getelementptr inbounds [1003 x [1003 x i32]], ptr %a, i64 0, i64 %idxprom49.us, i64 %idxprom69.us %16 = load i32, ptr %arrayidx70.us, align 4, !tbaa !5 %17 = zext i32 %16 to i64 %cmp71.us = icmp eq i64 %indvars.iv198, %17 br i1 %cmp71.us, label %for.inc99.us.thread, label %for.inc99.us for.inc99.us: ; preds = %if.then52.us, %if.then42.us, %if.then.us, %for.body34.us %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1 %exitcond.not = icmp eq i64 %indvars.iv.next199, %9 br i1 %exitcond.not, label %for.cond32.for.end101_crit_edge.us, label %for.body34.us, !llvm.loop !14 for.inc99.us.thread: ; preds = %if.then52.us %arrayidx36.us.le = getelementptr inbounds [1003 x i32], ptr %r, i64 0, i64 %indvars.iv198 %arrayidx39.us.le = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %indvars.iv198 %arrayidx50.us.le = getelementptr inbounds [1003 x i32], ptr %r, i64 0, i64 %idxprom49.us %arrayidx68.us.le = getelementptr inbounds [1003 x i32], ptr %p, i64 0, i64 %idxprom49.us store i32 1, ptr %arrayidx36.us.le, align 4, !tbaa !5 store i32 1, ptr %arrayidx50.us.le, align 4, !tbaa !5 %inc91.us = add nsw i32 %15, 1 store i32 %inc91.us, ptr %arrayidx68.us.le, align 4, !tbaa !5 %18 = load i32, ptr %arrayidx39.us.le, align 4, !tbaa !5 %inc94.us = add nsw i32 %18, 1 store i32 %inc94.us, ptr %arrayidx39.us.le, align 4, !tbaa !5 %inc95.us = add nsw i32 %count.1151.us.ph, 1 %indvars.iv.next199227 = add nuw nsw i64 %indvars.iv198, 1 %exitcond.not228 = icmp eq i64 %indvars.iv.next199227, %9 br i1 %exitcond.not228, label %if.end104.us, label %for.body34.us.outer, !llvm.loop !14 for.cond32.preheader.us: ; preds = %for.cond24.preheader.us.preheader, %if.end104.us %count.0156.us = phi i32 [ %count.2.us230234, %if.end104.us ], [ 0, %for.cond24.preheader.us.preheader ] %ans.0155.us = phi i32 [ %inc105.us, %if.end104.us ], [ 0, %for.cond24.preheader.us.preheader ] call void @llvm.memset.p0.i64(ptr nonnull align 16 %r, i8 0, i64 %10, i1 false), !tbaa !5 br label %for.body34.us.outer for.body34.us.outer: ; preds = %for.inc99.us.thread, %for.cond32.preheader.us %indvars.iv198.ph = phi i64 [ %indvars.iv.next199227, %for.inc99.us.thread ], [ 0, %for.cond32.preheader.us ] %count.1151.us.ph = phi i32 [ %inc95.us, %for.inc99.us.thread ], [ %count.0156.us, %for.cond32.preheader.us ] %cmp102.us = phi i1 [ false, %for.inc99.us.thread ], [ true, %for.cond32.preheader.us ] br label %for.body34.us for.cond32.for.end101_crit_edge.us: ; preds = %for.inc99.us br i1 %cmp102.us, label %while.end, label %if.end104.us while.end: ; preds = %if.end104.us, %for.cond32.for.end101_crit_edge.us, %for.end21.thread, %for.end21 %ans.1 = phi i32 [ %.mux, %for.end21 ], [ %spec.select, %for.end21.thread ], [ -1, %for.cond32.for.end101_crit_edge.us ], [ %inc105.us, %if.end104.us ] %call106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1) call void @llvm.lifetime.end.p0(i64 4012, ptr nonnull %r) #4 call void @llvm.lifetime.end.p0(i64 4012, ptr nonnull %p) #4 call void @llvm.lifetime.end.p0(i64 4024036, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> int main(){ int n; scanf("%d", &n); int k = 0; int x = 0; while(x < n){ x += 1000; k += 1; } printf("%d\n", 1000 * k - n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222894/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222894/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %.fr9 = freeze i32 %0 %cmp5 = icmp sgt i32 %.fr9, 0 br i1 %cmp5, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %1 = add nsw i32 %.fr9, -1 %2 = urem i32 %1, 1000 %3 = sub nuw nsw i32 %1, %2 %4 = add nuw i32 %3, 1000 br label %while.end while.end: ; preds = %while.body.preheader, %entry %k.0.lcssa = phi i32 [ 0, %entry ], [ %4, %while.body.preheader ] %sub = sub nsw i32 %k.0.lcssa, %.fr9 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main(){ int N,x=0,y=0; scanf("%d",&N); if(N % 1000 != 0){ x = N / 1000; x+=1; y = (x*1000) - N;} else{ y = 0; } printf("%d",y); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222937/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222937/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %.fr = freeze i32 %0 %rem = srem i32 %.fr, 1000 %cmp.not = icmp eq i32 %rem, 0 %sub = sub nsw i32 1000, %rem %y.0 = select i1 %cmp.not, i32 0, i32 %sub %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %y.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int n; scanf("%d", &n); while (n > 0) { n -= 1000; } printf("%d\n", n * -1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_222980/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_222980/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %.pr = load i32, ptr %n, align 4, !tbaa !5 %cmp2 = icmp sgt i32 %.pr, 0 br i1 %cmp2, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %entry %0 = add nuw i32 %.pr, 999 %smin = call i32 @llvm.smin.i32(i32 %.pr, i32 1000) %1 = sub nuw i32 %0, %smin %.fr = freeze i32 %1 %2 = urem i32 %.fr, 1000 %.neg = sub i32 %2, %.fr %3 = add nsw i32 %.pr, -1000 %4 = add i32 %.neg, %3 store i32 %4, ptr %n, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.body.preheader, %entry %.lcssa = phi i32 [ %4, %while.body.preheader ], [ %.pr, %entry ] %mul = sub nsw i32 0, %.lcssa %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main (void){ int n, o; scanf("%d", &n); if(n % 1000==0){ o = 0; }else{ o = ((n/1000)+1)*1000-n; } printf("%d\n", o); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223022/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223022/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %.fr = freeze i32 %0 %rem = srem i32 %.fr, 1000 %cmp = icmp eq i32 %rem, 0 %sub = sub nsw i32 1000, %rem %o.0 = select i1 %cmp, i32 0, i32 %sub %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %o.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n; scanf("%d",&n); int r = n % 1000; if(r == 0){ printf("%d",r); } else{ int f = 1000 - r; printf("%d",f); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223066/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223066/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, 1000 %cmp = icmp eq i32 %rem, 0 %sub = sub nsw i32 1000, %rem %sub.sink = select i1 %cmp, i32 0, i32 %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int N; scanf("%d", &N); if ((N%1000)!=0){ printf("%d\n",1000-(N%1000)); } else{ printf("0\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223109/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223109/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %rem = srem i32 %0, 1000 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %if.else, label %if.then if.then: ; preds = %entry %sub = sub nsw i32 1000, %rem %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) br label %if.end if.else: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n, ans=0; scanf("%d", &n); if(n%1000){ ans = 1000-(n%1000); } printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223152/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223152/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, 1000 %tobool.not = icmp eq i32 %rem, 0 %sub = sub nsw i32 1000, %rem %spec.select = select i1 %tobool.not, i32 0, i32 %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int N,i; scanf("%d",&N); if(N<1000) { printf("%d\n",1000-N); return 0; } for(i=1;i<=10;i++){ if(i*1000>=N){ printf("%d\n",i*1000-N); return 0; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223196/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223196/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %or.cond = icmp slt i32 %0, 1001 br i1 %or.cond, label %cleanup.sink.split, label %for.cond for.cond: ; preds = %entry %cmp3.not.1 = icmp ugt i32 %0, 2000 br i1 %cmp3.not.1, label %for.cond.1, label %cleanup.sink.split for.cond.1: ; preds = %for.cond %cmp3.not.2 = icmp ugt i32 %0, 3000 br i1 %cmp3.not.2, label %for.cond.2, label %cleanup.sink.split for.cond.2: ; preds = %for.cond.1 %cmp3.not.3 = icmp ugt i32 %0, 4000 br i1 %cmp3.not.3, label %for.cond.3, label %cleanup.sink.split for.cond.3: ; preds = %for.cond.2 %cmp3.not.4 = icmp ugt i32 %0, 5000 br i1 %cmp3.not.4, label %for.cond.4, label %cleanup.sink.split for.cond.4: ; preds = %for.cond.3 %cmp3.not.5 = icmp ugt i32 %0, 6000 br i1 %cmp3.not.5, label %for.cond.5, label %cleanup.sink.split for.cond.5: ; preds = %for.cond.4 %cmp3.not.6 = icmp ugt i32 %0, 7000 br i1 %cmp3.not.6, label %for.cond.6, label %cleanup.sink.split for.cond.6: ; preds = %for.cond.5 %cmp3.not.7 = icmp ugt i32 %0, 8000 br i1 %cmp3.not.7, label %for.cond.7, label %cleanup.sink.split for.cond.7: ; preds = %for.cond.6 %cmp3.not.8 = icmp ugt i32 %0, 9000 br i1 %cmp3.not.8, label %for.cond.8, label %cleanup.sink.split for.cond.8: ; preds = %for.cond.7 %cmp3.not.9 = icmp ugt i32 %0, 10000 br i1 %cmp3.not.9, label %cleanup, label %cleanup.sink.split cleanup.sink.split: ; preds = %for.cond, %for.cond.1, %for.cond.2, %for.cond.3, %for.cond.4, %for.cond.5, %for.cond.6, %for.cond.7, %for.cond.8, %entry %mul.lcssa.sink = phi i32 [ 1000, %entry ], [ 2000, %for.cond ], [ 3000, %for.cond.1 ], [ 4000, %for.cond.2 ], [ 5000, %for.cond.3 ], [ 6000, %for.cond.4 ], [ 7000, %for.cond.5 ], [ 8000, %for.cond.6 ], [ 9000, %for.cond.7 ], [ 10000, %for.cond.8 ] %sub6 = sub nsw i32 %mul.lcssa.sink, %0 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub6) br label %cleanup cleanup: ; preds = %cleanup.sink.split, %for.cond.8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> void main() { int N,l,change; scanf("%d",&N); l=N%1000; change=1000-l; if(l!=0){ printf("%d\n",change); } if(l==0){ printf("%d",0); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223246/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223246/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %rem = srem i32 %0, 1000 %cond = icmp eq i32 %rem, 0 br i1 %cond, label %if.then3, label %if.then if.then: ; preds = %entry %sub = sub nsw i32 1000, %rem %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) br label %if.end5 if.then3: ; preds = %entry %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 0) br label %if.end5 if.end5: ; preds = %if.then, %if.then3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main (void) { int N,k1000,A; scanf("%d",&N); k1000 = N/1000*1000; //1000の位 A = N - k1000; //1000の位を外した値(100の位以下の数字だけ) if(A == 0){ printf("%d\n",A); } else{ printf("%d\n",1000 - A); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223303/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223303/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %.fr = freeze i32 %0 %1 = srem i32 %.fr, 1000 %cmp = icmp eq i32 %1, 0 %sub2 = sub nsw i32 1000, %1 %sub2.sink = select i1 %cmp, i32 0, i32 %sub2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> int main(){ int money; char str[256]; fgets(str, 256, stdin); money = atoi(str) % 1000; if(money != 0){ money = 1000 - money; } printf("%d",money); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223347/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223347/source.c" target datalayout = "e-m:e-p270: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 [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [256 x i8], align 16 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %str) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 256, ptr noundef %0) %call.i = call i64 @strtol(ptr nocapture noundef nonnull %str, ptr noundef null, i32 noundef 10) #4 %conv.i = trunc i64 %call.i to i32 %rem = srem i32 %conv.i, 1000 %cmp.not = icmp eq i32 %rem, 0 %sub = sub nsw i32 1000, %rem %spec.select = select i1 %cmp.not, i32 0, i32 %sub %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %str) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int N; int otsuri = 0; scanf("%d", &N); otsuri = 1000 - N; while (otsuri < 0) { otsuri = otsuri + 1000; } printf("%d\n", otsuri); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223390/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223390/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %sub = sub i32 1000, %0 %smax = call i32 @llvm.smax.i32(i32 %sub, i32 0) %1 = add i32 %0, %smax %2 = add i32 %1, -1000 %3 = icmp ne i32 %2, 0 %umin = zext i1 %3 to i32 %4 = sub i32 %2, %umin %5 = udiv i32 %4, 1000 %6 = add nuw nsw i32 %5, %umin %7 = mul i32 %6, 1000 %8 = add i32 %7, 1000 %9 = sub i32 %8, %0 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int N; if (scanf("%d", &N) != 1) return 1; printf("%d\n", N % 1000 == 0 ? 0 : 1000 - (N % 1000)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223433/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223433/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %cmp.not = icmp eq i32 %call, 1 br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry %0 = load i32, ptr %N, align 4, !tbaa !5 %rem = srem i32 %0, 1000 %cmp1 = icmp eq i32 %rem, 0 %sub = sub nsw i32 1000, %rem %spec.select = select i1 %cmp1, i32 0, i32 %sub %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) br label %cleanup cleanup: ; preds = %entry, %if.end %retval.0 = phi i32 [ 0, %if.end ], [ 1, %entry ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n; scanf("%d",&n); n=n%1000; if (n>0) printf("%d\n",1000-n); else puts("0"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223477/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223477/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, 1000 store i32 %rem, ptr %n, align 4, !tbaa !5 %cmp = icmp sgt i32 %rem, 0 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %sub = sub nuw nsw i32 1000, %rem %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) br label %if.end if.else: ; preds = %entry %call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %if.end if.end: ; preds = %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { int n = 0; scanf("%i",&n); int value = 0; long long int sum =0; int min = 999999999; for (int i = 0;i<n;i++) { scanf("%i",&value); sum = sum + value; if (value < min && value%2 != 0) min = value; } if (sum%2 != 0) sum = sum - min; printf("%lld",sum); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22352/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22352/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%i\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %value = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 store i32 0, ptr %n, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value) #3 store i32 0, ptr %value, align 4, !tbaa !5 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp18 = icmp sgt i32 %0, 0 br i1 %cmp18, label %for.body, label %for.cond.cleanup for.cond.cleanup.loopexit: ; preds = %for.body %1 = sext i32 %min.1 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.cond.cleanup.loopexit ] %min.0.lcssa = phi i64 [ 999999999, %entry ], [ %1, %for.cond.cleanup.loopexit ] %2 = and i64 %sum.0.lcssa, 1 %cmp7.not = icmp eq i64 %2, 0 %sub = select i1 %cmp7.not, i64 0, i64 %min.0.lcssa %sum.1 = sub nsw i64 %sum.0.lcssa, %sub %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %entry, %for.body %i.021 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %min.020 = phi i32 [ %min.1, %for.body ], [ 999999999, %entry ] %sum.019 = phi i64 [ %add, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value) %3 = load i32, ptr %value, align 4, !tbaa !5 %conv = sext i32 %3 to i64 %add = add nsw i64 %sum.019, %conv %cmp2 = icmp sge i32 %3, %min.020 %4 = and i32 %3, 1 %cmp4.not = icmp eq i32 %4, 0 %or.cond = or i1 %cmp2, %cmp4.not %min.1 = select i1 %or.cond, i32 %min.020, i32 %3 %inc = add nuw nsw i32 %i.021, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main() { int sum = 0; int a,b,c,d,e,f; scanf("%d %d %d %d %d %d",&a,&b,&c,&f,&d,&e); sum = a + b*5 + c*10+f*50 + d*100+e*500; // printf("sum = %d\n",sum); if(sum >= 1000) printf("1\n"); else printf("0\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223563/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223563/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [2 x i8] c"0\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %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 %f, ptr noundef nonnull %d, ptr noundef nonnull %e) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %mul = mul nsw i32 %1, 5 %add = add nsw i32 %mul, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %mul1 = mul nsw i32 %2, 10 %add2 = add nsw i32 %add, %mul1 %3 = load i32, ptr %f, align 4, !tbaa !5 %mul3 = mul nsw i32 %3, 50 %add4 = add nsw i32 %add2, %mul3 %4 = load i32, ptr %d, align 4, !tbaa !5 %mul5 = mul nsw i32 %4, 100 %add6 = add nsw i32 %add4, %mul5 %5 = load i32, ptr %e, align 4, !tbaa !5 %mul7 = mul nsw i32 %5, 500 %add8 = add nsw i32 %add6, %mul7 %cmp = icmp sgt i32 %add8, 999 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int sum=0, c1,c5,c10,c50,c100,c500; scanf("%d %d %d %d %d %d",&c1,&c5,&c10,&c50,&c100,&c500); sum+=c1*1+c5*5+c10*10+c50*50+c100*100+c500*500; if(sum<1000)printf("0\n"); else printf("1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223606/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223606/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c1 = alloca i32, align 4 %c5 = alloca i32, align 4 %c10 = alloca i32, align 4 %c50 = alloca i32, align 4 %c100 = alloca i32, align 4 %c500 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c5) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c10) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c50) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c100) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c500) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c1, ptr noundef nonnull %c5, ptr noundef nonnull %c10, ptr noundef nonnull %c50, ptr noundef nonnull %c100, ptr noundef nonnull %c500) %0 = load i32, ptr %c1, align 4, !tbaa !5 %1 = load i32, ptr %c5, align 4, !tbaa !5 %mul1 = mul nsw i32 %1, 5 %add = add nsw i32 %mul1, %0 %2 = load i32, ptr %c10, align 4, !tbaa !5 %mul2 = mul nsw i32 %2, 10 %add3 = add nsw i32 %add, %mul2 %3 = load i32, ptr %c50, align 4, !tbaa !5 %mul4 = mul nsw i32 %3, 50 %add5 = add nsw i32 %add3, %mul4 %4 = load i32, ptr %c100, align 4, !tbaa !5 %mul6 = mul nsw i32 %4, 100 %add7 = add nsw i32 %add5, %mul6 %5 = load i32, ptr %c500, align 4, !tbaa !5 %mul8 = mul nsw i32 %5, 500 %add9 = add nsw i32 %add7, %mul8 %cmp = icmp slt i32 %add9, 1000 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c500) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c100) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c50) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c10) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c5) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <inttypes.h> int main(void){ int n; scanf("%d", &n); uint64_t min_un_even = 0; uint64_t tmp; uint64_t sum = 0; for(int i = 0; i < n; i++){ scanf("%" PRIu64, &tmp); sum += tmp; if((!min_un_even || min_un_even > tmp) && (tmp % 2)) min_un_even = tmp; } if(sum % 2) sum -= min_un_even; printf("%" PRIu64"\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22365/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22365/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lu\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %tmp = alloca i64, align 8 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 8, ptr nonnull %tmp) #3 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %min_un_even.0.lcssa = phi i64 [ 0, %entry ], [ %min_un_even.1, %for.body ] %sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] %rem4 = and i64 %sum.0.lcssa, 1 %tobool5.not = icmp eq i64 %rem4, 0 %sub = select i1 %tobool5.not, i64 0, i64 %min_un_even.0.lcssa %spec.select = sub i64 %sum.0.lcssa, %sub %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tmp) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body: ; preds = %entry, %for.body %i.019 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %sum.018 = phi i64 [ %add, %for.body ], [ 0, %entry ] %min_un_even.017 = phi i64 [ %min_un_even.1, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp) %1 = load i64, ptr %tmp, align 8 %2 = freeze i64 %1 %add = add i64 %2, %sum.018 %3 = add i64 %min_un_even.017, -1 %or.cond.not = icmp ult i64 %3, %2 %rem = and i64 %2, 1 %tobool3.not = icmp eq i64 %rem, 0 %4 = or i1 %or.cond.not, %tobool3.not %min_un_even.1 = select i1 %4, i64 %min_un_even.017, i64 %2 %inc = add nuw nsw i32 %i.019, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int c1,c5,c10,c50,c100,c500; scanf("%d %d %d %d %d %d",&c1,&c5,&c10,&c50,&c100,&c500); if(c1+c5*5+c10*10+c50*50+c100*100+c500*500>=1000)printf("1\n"); else printf("0\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223693/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [2 x i8] c"0\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c1 = alloca i32, align 4 %c5 = alloca i32, align 4 %c10 = alloca i32, align 4 %c50 = alloca i32, align 4 %c100 = alloca i32, align 4 %c500 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c5) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c10) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c50) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c100) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c500) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c1, ptr noundef nonnull %c5, ptr noundef nonnull %c10, ptr noundef nonnull %c50, ptr noundef nonnull %c100, ptr noundef nonnull %c500) %0 = load i32, ptr %c1, align 4, !tbaa !5 %1 = load i32, ptr %c5, align 4, !tbaa !5 %mul = mul nsw i32 %1, 5 %add = add nsw i32 %mul, %0 %2 = load i32, ptr %c10, align 4, !tbaa !5 %mul1 = mul nsw i32 %2, 10 %add2 = add nsw i32 %add, %mul1 %3 = load i32, ptr %c50, align 4, !tbaa !5 %mul3 = mul nsw i32 %3, 50 %add4 = add nsw i32 %add2, %mul3 %4 = load i32, ptr %c100, align 4, !tbaa !5 %mul5 = mul nsw i32 %4, 100 %add6 = add nsw i32 %add4, %mul5 %5 = load i32, ptr %c500, align 4, !tbaa !5 %mul7 = mul nsw i32 %5, 500 %add8 = add nsw i32 %add6, %mul7 %cmp = icmp sgt i32 %add8, 999 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c500) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c100) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c50) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c10) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c5) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c1) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int p,m,c; scanf("%d%d%d",&p,&m,&c); printf("%d\n",p+m+c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223736/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223736/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca i32, align 4 %m = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %m, ptr noundef nonnull %c) %0 = load i32, ptr %p, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add1) 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 %p) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int n,a[1000000],i;long long s=0,min=10000000000; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d",&a[i]);s+=a[i];if(a[i]%2!=0&&a[i]<=min)min=a[i];} if(s%2==0)printf("%lld",s); else printf("%lld",s-min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22378/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22378/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp33 = icmp sgt i32 %0, 0 br i1 %cmp33, label %for.body, label %if.end22 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %min.036 = phi i64 [ %min.1, %for.body ], [ 10000000000, %entry ] %s.035 = phi i64 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %conv = sext i32 %1 to i64 %add = add nsw i64 %s.035, %conv %2 = and i32 %1, 1 %cmp6.not = icmp eq i32 %2, 0 %cmp11.not = icmp slt i64 %min.036, %conv %or.cond = select i1 %cmp6.not, i1 true, i1 %cmp11.not %min.1 = select i1 %or.cond, i64 %min.036, i64 %conv %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %5 = and i64 %add, 1 %cmp17 = icmp eq i64 %5, 0 %sub = select i1 %cmp17, i64 0, i64 %min.1 %spec.select = sub nsw i64 %add, %sub br label %if.end22 if.end22: ; preds = %for.end, %entry %sub.sink = phi i64 [ 0, %entry ], [ %spec.select, %for.end ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub.sink) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int p,m,c,sum=0; scanf("%d %d %d",&p,&m,&c); sum=p+m+c; printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223822/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca i32, align 4 %m = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %m, ptr noundef nonnull %c) %0 = load i32, ptr %p, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add1) 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 %p) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ long long s=0,n,i,k,a,b,c; scanf("%lld %lld",&n,&k); if(k==0){ printf("%lld\n",n*n); return 0; } for(i=k+1;i<=n;i++){ a=i-k; b=(n+1)/i; c=b*i; c=n-c-k+1; s+=a*b; if(c>0)s+=c; //printf("%lld %lld %lld %lld\n",i,a,b,c); } printf("%lld\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_223873/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_223873/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %k = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i64, ptr %k, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 0 %1 = load i64, ptr %n, align 8, !tbaa !5 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp2.not.not33 = icmp slt i64 %0, %1 br i1 %cmp2.not.not33, label %for.body.lr.ph, label %cleanup for.body.lr.ph: ; preds = %for.cond.preheader %add3 = add nsw i64 %1, 1 %.neg32 = sub i64 %1, %0 br label %for.body if.then: ; preds = %entry %mul = mul nsw i64 %1, %1 br label %cleanup for.body: ; preds = %for.body.lr.ph, %for.body %s.035 = phi i64 [ 0, %for.body.lr.ph ], [ %s.1, %for.body ] %i.0.in34 = phi i64 [ %0, %for.body.lr.ph ], [ %i.0, %for.body ] %i.0.neg = xor i64 %i.0.in34, -1 %i.0 = add nsw i64 %i.0.in34, 1 %sub = sub nsw i64 %i.0, %0 %div = sdiv i64 %add3, %i.0 %mul4.neg36 = mul i64 %div, %i.0.neg %sub6 = add i64 %.neg32, %mul4.neg36 %mul8 = mul nsw i64 %div, %sub %add9 = add nsw i64 %mul8, %s.035 %add7 = add nsw i64 %sub6, 1 %cmp1031 = icmp slt i64 %sub6, 0 %add12 = select i1 %cmp1031, i64 0, i64 %add7 %s.1 = add nsw i64 %add9, %add12 %exitcond.not = icmp eq i64 %i.0, %1 br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9 cleanup: ; preds = %for.body, %for.cond.preheader, %if.then %s.0.lcssa.sink = phi i64 [ %mul, %if.then ], [ 0, %for.cond.preheader ], [ %s.1, %for.body ] %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %s.0.lcssa.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int w1,h1,w2,h2; scanf("%d%d%d%d", &w1,&h1,&w2,&h2); int n = 2*(h2+1)+w2; int m = 2*(h1+1)+w1; n = n+m+w1-w2; printf("%d\n", n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22396/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22396/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %w1 = alloca i32, align 4 %h1 = alloca i32, align 4 %w2 = alloca i32, align 4 %h2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w2) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w1, ptr noundef nonnull %h1, ptr noundef nonnull %w2, ptr noundef nonnull %h2) %0 = load i32, ptr %h2, align 4, !tbaa !5 %1 = load i32, ptr %h1, align 4, !tbaa !5 %2 = load i32, ptr %w1, align 4, !tbaa !5 %reass.add = add i32 %1, %0 %reass.add9 = add i32 %reass.add, %2 %reass.mul10 = shl i32 %reass.add9, 1 %sub = add i32 %reass.mul10, 4 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h1) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int count(int turi); int main(void) { int n; int ans; while (1){ scanf("%d", &n); if (n == 0){ return (0); } n = 1000 - n; ans = count(n); printf("%d\n", ans); } } int count(int turi) { int i = 5; int koin[6] = {1, 5, 10, 50, 100, 500}; int count = 0; while (1){ if (turi == 0){ return (count); } else if (turi >= koin[i]){ turi -= koin[i]; count++; } else { i--; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224009/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224009/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @__const.count.koin = private unnamed_addr constant [6 x i32] [i32 1, i32 5, i32 10, i32 50, i32 100, i32 500], align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp eq i32 %0, 0 br i1 %cmp4, label %if.then, label %if.end if.then: ; preds = %count.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 if.end: ; preds = %entry, %count.exit %1 = phi i32 [ %4, %count.exit ], [ %0, %entry ] %sub = sub nsw i32 1000, %1 store i32 %sub, ptr %n, align 4, !tbaa !5 %cmp19.i = icmp eq i32 %1, 1000 br i1 %cmp19.i, label %count.exit, label %if.else.preheader.i while.cond.outer.loopexit.i: ; preds = %if.else.i %sub.le.i = sub nsw i32 %turi.addr.0.ph20.i, %3 %inc.le.i = add nuw nsw i32 %count.0.ph22.i, 1 %cmp.i = icmp eq i32 %sub.le.i, 0 br i1 %cmp.i, label %count.exit, label %if.else.preheader.i if.else.preheader.i: ; preds = %if.end, %while.cond.outer.loopexit.i %count.0.ph22.i = phi i32 [ %inc.le.i, %while.cond.outer.loopexit.i ], [ 0, %if.end ] %i.0.ph21.i = phi i64 [ %indvars.iv.i, %while.cond.outer.loopexit.i ], [ 5, %if.end ] %turi.addr.0.ph20.i = phi i32 [ %sub.le.i, %while.cond.outer.loopexit.i ], [ %sub, %if.end ] %sext.i = shl i64 %i.0.ph21.i, 32 %2 = ashr exact i64 %sext.i, 32 br label %if.else.i if.else.i: ; preds = %if.else.i, %if.else.preheader.i %indvars.iv.i = phi i64 [ %2, %if.else.preheader.i ], [ %indvars.iv.next.i, %if.else.i ] %arrayidx.i = getelementptr inbounds [6 x i32], ptr @__const.count.koin, i64 0, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %cmp1.not.i = icmp slt i32 %turi.addr.0.ph20.i, %3 %indvars.iv.next.i = add i64 %indvars.iv.i, -1 br i1 %cmp1.not.i, label %if.else.i, label %while.cond.outer.loopexit.i count.exit: ; preds = %while.cond.outer.loopexit.i, %if.end %count.0.ph.lcssa.i = phi i32 [ 0, %if.end ], [ %inc.le.i, %while.cond.outer.loopexit.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.ph.lcssa.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %4, 0 br i1 %cmp, label %if.then, label %if.end } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @count(i32 noundef %turi) local_unnamed_addr #3 { entry: %cmp19 = icmp eq i32 %turi, 0 br i1 %cmp19, label %if.then, label %if.else.preheader while.cond.outer.loopexit: ; preds = %if.else %sub.le = sub nsw i32 %turi.addr.0.ph20, %1 %inc.le = add nuw nsw i32 %count.0.ph22, 1 %cmp = icmp eq i32 %sub.le, 0 br i1 %cmp, label %if.then, label %if.else.preheader if.else.preheader: ; preds = %entry, %while.cond.outer.loopexit %count.0.ph22 = phi i32 [ %inc.le, %while.cond.outer.loopexit ], [ 0, %entry ] %i.0.ph21 = phi i64 [ %indvars.iv, %while.cond.outer.loopexit ], [ 5, %entry ] %turi.addr.0.ph20 = phi i32 [ %sub.le, %while.cond.outer.loopexit ], [ %turi, %entry ] %sext = shl i64 %i.0.ph21, 32 %0 = ashr exact i64 %sext, 32 br label %if.else if.then: ; preds = %while.cond.outer.loopexit, %entry %count.0.ph.lcssa = phi i32 [ 0, %entry ], [ %inc.le, %while.cond.outer.loopexit ] ret i32 %count.0.ph.lcssa if.else: ; preds = %if.else.preheader, %if.else %indvars.iv = phi i64 [ %0, %if.else.preheader ], [ %indvars.iv.next, %if.else ] %arrayidx = getelementptr inbounds [6 x i32], ptr @__const.count.koin, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1.not = icmp slt i32 %turi.addr.0.ph20, %1 %indvars.iv.next = add i64 %indvars.iv, -1 br i1 %cmp1.not, label %if.else, label %while.cond.outer.loopexit } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c[100],i,n; scanf("%d",&b) ; i=0; while(b != 0){ a=1000-b; c[i]=0; c[i]+=a/500; a=a%500; c[i]+=a/100; a=a%100; c[i]+=a/50; a=a%50; c[i]+=a/10; a=a%10; c[i]+=a/5; a=a%5; c[i]+=a/1; i+=1; scanf("%d",&b) ; } for(n=0;n<i;n++){ printf("%d\n",c[n]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224052/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224052/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %b = alloca i32, align 4 %c = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not61 = icmp eq i32 %0, 0 br i1 %cmp.not61, label %for.end, label %while.body for.cond.preheader: ; preds = %while.body %1 = and i64 %indvars.iv.next, 4294967295 %cmp2963.not = icmp eq i64 %1, 0 br i1 %cmp2963.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 ] %2 = phi i32 [ %3, %while.body ], [ %0, %entry ] %sub = sub nsw i32 1000, %2 %arrayidx = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv %div = sdiv i32 %sub, 500 %rem = srem i32 %sub, 500 %div3.lhs.trunc = trunc i32 %rem to i16 %div353 = sdiv i16 %div3.lhs.trunc, 100 %div3.sext = sext i16 %div353 to i32 %add6 = add nsw i32 %div, %div3.sext %rem754 = srem i16 %div3.lhs.trunc, 100 %div8.lhs.trunc = trunc i16 %rem754 to i8 %div855 = sdiv i8 %div8.lhs.trunc, 50 %div8.sext = sext i8 %div855 to i32 %add11 = add nsw i32 %add6, %div8.sext %rem1256 = srem i8 %div8.lhs.trunc, 50 %div1357 = sdiv i8 %rem1256, 10 %div13.sext = sext i8 %div1357 to i32 %add16 = add nsw i32 %add11, %div13.sext %rem1758 = srem i8 %rem1256, 10 %div1859 = sdiv i8 %rem1758, 5 %div18.sext = sext i8 %div1859 to i32 %add21 = add nsw i32 %add16, %div18.sext %rem2260 = srem i8 %rem1758, 5 %rem22.sext = sext i8 %rem2260 to i32 %add26 = add nsw i32 %add21, %rem22.sext store i32 %add26, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %3 = load i32, ptr %b, align 4, !tbaa !5 %cmp.not = icmp eq i32 %3, 0 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv66 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next67, %for.body ] %arrayidx31 = getelementptr inbounds [100 x i32], ptr %c, i64 0, i64 %indvars.iv66 %4 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4) %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1 %exitcond.not = icmp eq i64 %indvars.iv.next67, %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 400, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #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; int _500=0, _100=0, _50=0, _10=0, _5=0, _1=0; while(1) { scanf("%d", &b); if(b == 0) { break; } a = 1000 - b; _500=0, _100=0, _50=0, _10=0, _5=0, _1=0; _500 = a / 500; a -= 500 * _500; _100 = a / 100; a -= 100 * _100; _50 = a / 50; a -= 50 * _50; _10 = a / 10; a -= 10 * _10; _5 = a / 5; a -= 5 * _5; _1 = a; printf("%d\n", _500 + _100 + _50 + _10 + _5 + _1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224096/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224096/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %b, align 4, !tbaa !5 %cmp35 = icmp eq i32 %0, 0 br i1 %cmp35, label %while.end, label %if.end if.end: ; preds = %entry, %if.end %1 = phi i32 [ %2, %if.end ], [ %0, %entry ] %sub = sub nsw i32 1000, %1 %div = sdiv i32 %sub, 500 %mul.neg = mul nsw i32 %div, -500 %sub1 = add i32 %mul.neg, %sub %div2 = sdiv i32 %sub1, 100 %mul3.neg = mul nsw i32 %div2, -100 %sub4 = add i32 %mul3.neg, %sub1 %div5 = sdiv i32 %sub4, 50 %mul6.neg = mul nsw i32 %div5, -50 %sub7 = add i32 %mul6.neg, %sub4 %div8 = sdiv i32 %sub7, 10 %mul9.neg = mul nsw i32 %div8, -10 %sub10 = add i32 %mul9.neg, %sub7 %div11 = sdiv i32 %sub10, 5 %mul12.neg = mul nsw i32 %div11, -5 %sub13 = add nsw i32 %div2, %div %add = add nsw i32 %sub13, %div5 %add14 = add nsw i32 %add, %div8 %add15 = add i32 %add14, %sub10 %add16 = add i32 %add15, %div11 %add17 = add i32 %add16, %mul12.neg %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add17) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp eq i32 %2, 0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define NUM_OF_MONEY_TYPE ( 6 ) int moneyType[ NUM_OF_MONEY_TYPE ] = { 500, 100, 50, 10, 5, 1 }; int getNumOfChange( int change ); int main( void ) { int change; int money; while( scanf("%d", &money), money ) { change = 1000 - money; printf( "%d\n", getNumOfChange( change ) ); } return (0); } int getNumOfChange( int change ) { int i; int j; int numOfChange = 0; int nowArray = 0; while( change != 0 ) { numOfChange += change / moneyType[ nowArray ]; change = change % moneyType[ nowArray ]; nowArray++; } return (numOfChange); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224146/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224146/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @moneyType = dso_local local_unnamed_addr global [6 x i32] [i32 500, i32 100, i32 50, i32 10, i32 5, i32 1], align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %money = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %money) #4 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %money) %0 = load i32, ptr %money, align 4, !tbaa !5 %tobool.not4 = icmp eq i32 %0, 0 br i1 %tobool.not4, label %while.end, label %while.body while.body: ; preds = %entry, %getNumOfChange.exit %1 = phi i32 [ %3, %getNumOfChange.exit ], [ %0, %entry ] %cmp.not8.i = icmp eq i32 %1, 1000 br i1 %cmp.not8.i, label %getNumOfChange.exit, label %while.body.i.preheader while.body.i.preheader: ; preds = %while.body %sub = sub nsw i32 1000, %1 br label %while.body.i while.body.i: ; preds = %while.body.i.preheader, %while.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i ], [ 0, %while.body.i.preheader ] %numOfChange.010.i = phi i32 [ %add.i, %while.body.i ], [ 0, %while.body.i.preheader ] %change.addr.09.i = phi i32 [ %rem.i, %while.body.i ], [ %sub, %while.body.i.preheader ] %arrayidx.i = getelementptr inbounds [6 x i32], ptr @moneyType, i64 0, i64 %indvars.iv.i %2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %div.i = sdiv i32 %change.addr.09.i, %2 %add.i = add nsw i32 %div.i, %numOfChange.010.i %rem.i = srem i32 %change.addr.09.i, %2 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %getNumOfChange.exit, label %while.body.i, !llvm.loop !9 getNumOfChange.exit: ; preds = %while.body.i, %while.body %numOfChange.0.lcssa.i = phi i32 [ 0, %while.body ], [ %add.i, %while.body.i ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %numOfChange.0.lcssa.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %money) %3 = load i32, ptr %money, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %getNumOfChange.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %money) #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(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @getNumOfChange(i32 noundef %change) local_unnamed_addr #3 { entry: %cmp.not8 = icmp eq i32 %change, 0 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %numOfChange.010 = phi i32 [ %add, %while.body ], [ 0, %entry ] %change.addr.09 = phi i32 [ %rem, %while.body ], [ %change, %entry ] %arrayidx = getelementptr inbounds [6 x i32], ptr @moneyType, i64 0, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %div = sdiv i32 %change.addr.09, %0 %add = add nsw i32 %div, %numOfChange.010 %rem = srem i32 %change.addr.09, %0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %numOfChange.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %numOfChange.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(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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> #include <math.h> int main() { int n, i,j,a; scanf("%d",&n); int number[n]; for (i=0; i<n;i++) { scanf("%d",&number[i]); } for (i = 0; i < n; ++i) { for (j = i + 1; j < n; ++j) { if (number[i] > number[j]) { a = number[i]; number[i] = number[j]; number[j] = a; } } } for (i=0; i<n;i=i+2) { printf("%d ",number[i]); } // printf("\n%d\n",i); if(i>n) { i = i-2; } // printf("\n%d\n",i); for (i = i-1; i>0;i=i-2) { printf("%d ",number[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22419/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22419/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = 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 %cmp73 = icmp sgt i32 %3, 0 br i1 %cmp73, label %for.body, label %for.end35 for.cond2.preheader: ; preds = %for.body %cmp377 = icmp sgt i32 %5, 0 br i1 %cmp377, label %for.body4.preheader, label %for.end35 for.body4.preheader: ; preds = %for.cond2.preheader %4 = zext i32 %5 to i64 %wide.trip.count96 = zext i32 %5 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond2.loopexit: ; preds = %for.inc21, %for.body4 %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96 br i1 %exitcond97.not, label %for.cond27.preheader, label %for.body4, !llvm.loop !11 for.cond27.preheader: ; preds = %for.cond2.loopexit br i1 %cmp377, label %for.body29, label %for.end35 for.body4: ; preds = %for.body4.preheader, %for.cond2.loopexit %indvars.iv93 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next94, %for.cond2.loopexit ] %indvars.iv88 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next89, %for.cond2.loopexit ] %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %cmp675 = icmp ult i64 %indvars.iv.next94, %4 br i1 %cmp675, label %for.body7.lr.ph, label %for.cond2.loopexit for.body7.lr.ph: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv93 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc21 %indvars.iv90 = phi i64 [ %indvars.iv88, %for.body7.lr.ph ], [ %indvars.iv.next91, %for.inc21 ] %7 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90 %8 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp sgt i32 %7, %8 br i1 %cmp12, label %if.then, label %for.inc21 if.then: ; preds = %for.body7 store i32 %8, ptr %arrayidx9, align 4, !tbaa !5 store i32 %7, ptr %arrayidx11, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count96 br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body7, !llvm.loop !12 for.body29: ; preds = %for.cond27.preheader, %for.body29 %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body29 ], [ 0, %for.cond27.preheader ] %arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv98 %9 = load i32, ptr %arrayidx31, align 8, !tbaa !5 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %indvars.iv.next99 = add nuw i64 %indvars.iv98, 2 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next99 to i32 %cmp28 = icmp sgt i32 %10, %11 br i1 %cmp28, label %for.body29, label %for.end35, !llvm.loop !13 for.end35: ; preds = %for.body29, %entry, %for.cond2.preheader, %for.cond27.preheader %i.2.lcssa = phi i32 [ 0, %for.cond27.preheader ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %11, %for.body29 ] %.lcssa = phi i32 [ %5, %for.cond27.preheader ], [ %5, %for.cond2.preheader ], [ %3, %entry ], [ %10, %for.body29 ] %cmp36 = icmp sgt i32 %i.2.lcssa, %.lcssa %sub = add nsw i32 %i.2.lcssa, -2 %spec.select = select i1 %cmp36, i32 %sub, i32 %i.2.lcssa %cmp4183 = icmp sgt i32 %spec.select, 1 br i1 %cmp4183, label %for.body42.preheader, label %for.end48 for.body42.preheader: ; preds = %for.end35 %sub39 = add nsw i32 %spec.select, -1 br label %for.body42 for.body42: ; preds = %for.body42.preheader, %for.body42 %i.484 = phi i32 [ %sub47, %for.body42 ], [ %sub39, %for.body42.preheader ] %idxprom43 = zext i32 %i.484 to i64 %arrayidx44 = getelementptr inbounds i32, ptr %vla, i64 %idxprom43 %12 = load i32, ptr %arrayidx44, align 4, !tbaa !5 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) %sub47 = add nsw i32 %i.484, -2 %cmp41 = icmp ugt i32 %i.484, 2 br i1 %cmp41, label %for.body42, label %for.end48, !llvm.loop !14 for.end48: ; preds = %for.body42, %for.end35 call void @llvm.stackrestore.p0(ptr %2) 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 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a+b==c||a+c==b||b+c==a){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224232/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224232/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp eq i32 %add, %2 %add1 = add nsw i32 %2, %0 %cmp2 = icmp eq i32 %add1, %1 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %2, %1 %cmp5 = icmp eq i32 %add4, %0 %or.cond10 = select i1 %or.cond, i1 true, i1 %cmp5 %str.3.str = select i1 %or.cond10, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a+b == c||a+c == b||b+c == a) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224276/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224276/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp eq i32 %add, %2 %add1 = add nsw i32 %2, %0 %cmp2 = icmp eq i32 %add1, %1 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %2, %1 %cmp5 = icmp eq i32 %add4, %0 %or.cond9 = select i1 %or.cond, i1 true, i1 %cmp5 %.str.1..str.2 = select i1 %or.cond9, ptr @.str.1, ptr @.str.2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(int argc, char const *argv[]) { int a,b,c; int flag=0; scanf("%d %d %d",&a , &b, &c ); if( (a == b + c) || (b==a+c) || (c==a+b)) flag = 1; if(flag==1){ puts("Yes"); }else{ puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224319/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224319/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %cmp = icmp eq i32 %0, %add %add1 = add nsw i32 %2, %0 %cmp2 = icmp eq i32 %1, %add1 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %1, %0 %cmp5 = icmp eq i32 %2, %add4 %or.cond12 = select i1 %or.cond, i1 true, i1 %cmp5 %.str.1..str.2 = select i1 %or.cond12, ptr @.str.1, ptr @.str.2 %call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a+b==c||a+c==b||c+b==a) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224362/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224362/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp eq i32 %add, %2 %add1 = add nsw i32 %2, %0 %cmp2 = icmp eq i32 %add1, %1 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %2, %1 %cmp5 = icmp eq i32 %add4, %0 %or.cond9 = select i1 %or.cond, i1 true, i1 %cmp5 %.str.1..str.2 = select i1 %or.cond9, ptr @.str.1, ptr @.str.2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int a,b,c,s; scanf("%d%d%d",&a,&b,&c); s=(a+b+c)/2 + ((a+b+c)%2)*100; puts((s-a)*(s-b)*(s-c)?"No":"Yes"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224405/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224405/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %add1 = add nsw i32 %add, %2 %div = sdiv i32 %add1, 2 %rem = srem i32 %add1, 2 %mul = mul nsw i32 %rem, 100 %add4 = add nsw i32 %mul, %div %sub = sub nsw i32 %add4, %0 %sub5 = sub nsw i32 %add4, %1 %mul6 = mul nsw i32 %sub, %sub5 %sub7 = sub nsw i32 %add4, %2 %mul8 = mul nsw i32 %mul6, %sub7 %tobool.not = icmp eq i32 %mul8, 0 %cond = select i1 %tobool.not, ptr @.str.2, ptr @.str.1 %call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b, c; scanf("%d%d%d", &a, &b, &c); if (a == b+c || b == c+a || c == a+b) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224449/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224449/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %cmp = icmp eq i32 %0, %add %add1 = add nsw i32 %2, %0 %cmp2 = icmp eq i32 %1, %add1 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %1, %0 %cmp5 = icmp eq i32 %2, %add4 %or.cond10 = select i1 %or.cond, i1 true, i1 %cmp5 %str.3.str = select i1 %or.cond10, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main () { int a, b, c; scanf ("%d %d %d", &a, &b, &c); if (a + b == c || b + c == a || c + a == b ) printf ("Yes"); else printf ("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224492/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224492/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp eq i32 %add, %2 %add1 = add nsw i32 %2, %1 %cmp2 = icmp eq i32 %add1, %0 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %2, %0 %cmp5 = icmp eq i32 %add4, %1 %or.cond9 = select i1 %or.cond, i1 true, i1 %cmp5 %.str.1..str.2 = select i1 %or.cond9, ptr @.str.1, ptr @.str.2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a==b+c||b==a+c||c==a+b){ puts("Yes"); }else{ puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224535/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224535/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %2 = load i32, ptr %c, align 4, !tbaa !5 %add = add nsw i32 %2, %1 %cmp = icmp eq i32 %0, %add %add1 = add nsw i32 %2, %0 %cmp2 = icmp eq i32 %1, %add1 %or.cond = select i1 %cmp, i1 true, i1 %cmp2 %add4 = add nsw i32 %1, %0 %cmp5 = icmp eq i32 %2, %add4 %or.cond9 = select i1 %or.cond, i1 true, i1 %cmp5 %.str.1..str.2 = select i1 %or.cond9, ptr @.str.1, ptr @.str.2 %call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int A,B,C; scanf("%d%d%d",&A ,&B ,&C); if((A<C&&C<B)||(B<C&&C<A)){ printf("Yes"); } else { printf("No"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224586/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224586/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C) %0 = load i32, ptr %A, align 4 %1 = load i32, ptr %C, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %B, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %cmp2 = icmp slt i32 %2, %1 %cmp4 = icmp slt i32 %1, %0 %or.cond8 = and i1 %cmp4, %cmp2 %3 = select i1 %or.cond, i1 true, i1 %or.cond8 %.str.2.sink = select i1 %3, ptr @.str.1, ptr @.str.2 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a<c && c<b) || (b<c && c<a)){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224629/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224629/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %cmp2 = icmp slt i32 %2, %1 %cmp4 = icmp slt i32 %1, %0 %or.cond9 = and i1 %cmp4, %cmp2 %3 = select i1 %or.cond, i1 true, i1 %or.cond9 %str.sink = select i1 %3, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a <= c && b >= c || a >= c && b <= c) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224672/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224672/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %c, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1.not = icmp slt i32 %2, %1 %or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not %cmp2.not = icmp slt i32 %0, %1 %cmp4.not = icmp sgt i32 %2, %1 %or.cond8 = select i1 %cmp2.not, i1 true, i1 %cmp4.not %3 = select i1 %or.cond, i1 %or.cond8, i1 false %.str.2.sink = select i1 %3, ptr @.str.2, ptr @.str.1 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b){ if(a<c&&c<b){ printf("Yes\n"); } else{ printf("No\n"); } } else{if(b<c&&c<a){ printf("Yes\n"); } else{ printf("No\n"); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224715/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224715/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4, !tbaa !5 br i1 %cmp, label %if.then, label %if.else6 if.then: ; preds = %entry %cmp1 = icmp slt i32 %0, %2 %cmp2 = icmp slt i32 %2, %1 %or.cond = and i1 %cmp1, %cmp2 %str.5.str.4 = select i1 %or.cond, ptr @str.5, ptr @str.4 br label %if.end15 if.else6: ; preds = %entry %cmp7 = icmp slt i32 %1, %2 %cmp9 = icmp slt i32 %2, %0 %or.cond23 = and i1 %cmp7, %cmp9 %str.3.str = select i1 %or.cond23, ptr @str.5, ptr @str.4 br label %if.end15 if.end15: ; preds = %if.else6, %if.then %str.3.sink = phi ptr [ %str.5.str.4, %if.then ], [ %str.3.str, %if.else6 ] %puts20 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if((c > a && c < b) || (c < a && c > b)){ printf("Yes"); } else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224759/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224759/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, %1 %2 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %0, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %cmp2 = icmp slt i32 %0, %1 %cmp4 = icmp sgt i32 %0, %2 %or.cond8 = select i1 %cmp2, i1 %cmp4, i1 false %3 = select i1 %or.cond, i1 true, i1 %or.cond8 %.str.2.sink = select i1 %3, ptr @.str.1, ptr @.str.2 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <float.h> #include <inttypes.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <math.h> #ifdef __cplusplus #include <bits/stdc++.h> #endif int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; } uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; } #define P 998244353 int comp(const void *a, const void *b){return *(int*)a-*(int*)b;} int compw(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);} int compr(const void *a, const void *b){return *(int*)b-*(int*)a;} int compl(const void *a, const void *b){return (*(long*)a>*(long*)b)-(*(long*)a<*(long*)b);} uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint_fast32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; } inline int min2(const int a, const int b){return a>b?b:a;} inline int dif2(const int a, const int b){return a>b?a-b:b-a;} int p; int n; char s[200001]; void solve25(void){ long ans=0; for(int i=0; i<n; i++){ if(s[i]%p==0){ ans+=i+1; } } printf("%ld\n", ans); } long b[200001]; int bs(long x){ int l=0, r=n; while(l<=r){ int m=(l+r)/2; if(b[m]>=x) r=m-1; else l=m+1; } return l; } void solve(void){ int i; b[0]=0; b[1]=1; for(i=2; i<=n; i++){ b[i]=b[i-1]*10%p; } for(i=1; i<=n; i++){ b[i]*=s[n-i]; b[i]+=b[i-1]; b[i]%=p; } qsort(b, n+1, sizeof(long), compl); for(i=0; i<n&&b[i]==0; i++); long ans2 = (long)i*(i-1)/2; long ans=0; for(; i<=n; i++){ ans += bs(b[i]+1)-bs(b[i])-1; } ans/=2; ans+=ans2; printf("%ld\n", ans); } int main(void){ n=nextint(); p=nextint(); nextstr(s); for(int i=0; i<n; i++) s[i]-='0'; if(n==0 && s[0]==0){ puts("1"); return 0; } if(p==2 || p==5){ solve25(); }else{ solve(); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224809/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224809/source.c" target datalayout = "e-m:e-p270: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] } @n = dso_local local_unnamed_addr global i32 0, align 4 @s = dso_local global [200001 x i8] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 @b = dso_local global [200001 x i64] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [2 x i8] c"1\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nounwind uwtable define dso_local i32 @nextint() 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 !9 %_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 !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 = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #7 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 !9 %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 ] %sext72 = shl i32 %cond.i, 24 %cmp.not73 = icmp ne i32 %sext72, 754974720 %4 = add i32 %sext72, -956301313 %5 = icmp ult i32 %4, -150994945 %or.cond74 = and i1 %cmp.not73, %5 br i1 %or.cond74, label %while.body.preheader, label %while.end while.body.preheader: ; preds = %getchar_unlocked.exit %.pre81 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit51 %6 = phi ptr [ %.pre81, %while.body.preheader ], [ %10, %getchar_unlocked.exit51 ] %_IO_read_ptr.i42 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1 %7 = load ptr, ptr %_IO_read_ptr.i42, align 8, !tbaa !9 %_IO_read_end.i43 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2 %8 = load ptr, ptr %_IO_read_end.i43, align 8, !tbaa !14 %cmp.not.i44 = icmp ult ptr %7, %8 br i1 %cmp.not.i44, label %cond.false.i48, label %cond.true.i45, !prof !15 cond.true.i45: ; preds = %while.body %call.i46 = tail call i32 @__uflow(ptr noundef nonnull %6) #7 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit51 cond.false.i48: ; preds = %while.body %incdec.ptr.i49 = getelementptr inbounds i8, ptr %7, i64 1 store ptr %incdec.ptr.i49, ptr %_IO_read_ptr.i42, align 8, !tbaa !9 %9 = load i8, ptr %7, align 1, !tbaa !16 %conv3.i50 = zext i8 %9 to i32 br label %getchar_unlocked.exit51 getchar_unlocked.exit51: ; preds = %cond.true.i45, %cond.false.i48 %10 = phi ptr [ %.pre, %cond.true.i45 ], [ %6, %cond.false.i48 ] %cond.i47 = phi i32 [ %call.i46, %cond.true.i45 ], [ %conv3.i50, %cond.false.i48 ] %sext = shl i32 %cond.i47, 24 %cmp.not = icmp ne i32 %sext, 754974720 %11 = add i32 %sext, -956301313 %12 = icmp ult i32 %11, -150994945 %or.cond = and i1 %cmp.not, %12 br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !17 while.end: ; preds = %getchar_unlocked.exit51, %getchar_unlocked.exit %c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i47, %getchar_unlocked.exit51 ] %sext.lcssa = phi i32 [ %sext72, %getchar_unlocked.exit ], [ %sext, %getchar_unlocked.exit51 ] %cmp12 = icmp eq i32 %sext.lcssa, 754974720 br i1 %cmp12, label %if.then, label %if.end if.then: ; preds = %while.end %13 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i52 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1 %14 = load ptr, ptr %_IO_read_ptr.i52, align 8, !tbaa !9 %_IO_read_end.i53 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2 %15 = load ptr, ptr %_IO_read_end.i53, align 8, !tbaa !14 %cmp.not.i54 = icmp ult ptr %14, %15 br i1 %cmp.not.i54, label %cond.false.i58, label %cond.true.i55, !prof !15 cond.true.i55: ; preds = %if.then %call.i56 = tail call i32 @__uflow(ptr noundef nonnull %13) #7 br label %if.end cond.false.i58: ; preds = %if.then %incdec.ptr.i59 = getelementptr inbounds i8, ptr %14, i64 1 store ptr %incdec.ptr.i59, ptr %_IO_read_ptr.i52, align 8, !tbaa !9 %16 = load i8, ptr %14, align 1, !tbaa !16 %conv3.i60 = zext i8 %16 to i32 br label %if.end if.end: ; preds = %cond.false.i58, %cond.true.i55, %while.end %c.1.in = phi i32 [ %c.0.in.lcssa, %while.end ], [ %call.i56, %cond.true.i55 ], [ %conv3.i60, %cond.false.i58 ] %sext4076 = shl i32 %c.1.in, 24 %17 = add i32 %sext4076, -788529153 %18 = icmp ult i32 %17, 184549375 br i1 %18, label %while.body25.preheader, label %while.end29 while.body25.preheader: ; preds = %if.end %.pre83 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.body25 while.body25: ; preds = %while.body25.preheader, %getchar_unlocked.exit71 %19 = phi ptr [ %23, %getchar_unlocked.exit71 ], [ %.pre83, %while.body25.preheader ] %x.078 = phi i32 [ %sub, %getchar_unlocked.exit71 ], [ 0, %while.body25.preheader ] %c.2.in77 = phi i32 [ %cond.i67, %getchar_unlocked.exit71 ], [ %c.1.in, %while.body25.preheader ] %conv17 = and i32 %c.2.in77, 255 %mul = mul i32 %x.078, 10 %add = add nsw i32 %conv17, -48 %sub = add i32 %add, %mul %_IO_read_ptr.i62 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 1 %20 = load ptr, ptr %_IO_read_ptr.i62, align 8, !tbaa !9 %_IO_read_end.i63 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 2 %21 = load ptr, ptr %_IO_read_end.i63, align 8, !tbaa !14 %cmp.not.i64 = icmp ult ptr %20, %21 br i1 %cmp.not.i64, label %cond.false.i68, label %cond.true.i65, !prof !15 cond.true.i65: ; preds = %while.body25 %call.i66 = tail call i32 @__uflow(ptr noundef nonnull %19) #7 %.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit71 cond.false.i68: ; preds = %while.body25 %incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1 store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9 %22 = load i8, ptr %20, align 1, !tbaa !16 %conv3.i70 = zext i8 %22 to i32 br label %getchar_unlocked.exit71 getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68 %23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ] %cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ] %sext40 = shl i32 %cond.i67, 24 %24 = add i32 %sext40, -788529153 %25 = icmp ult i32 %24, 184549375 br i1 %25, label %while.body25, label %while.end29, !llvm.loop !19 while.end29: ; preds = %getchar_unlocked.exit71, %if.end %x.0.lcssa = phi i32 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ] %sub31 = sub i32 0, %x.0.lcssa %cond = select i1 %cmp12, i32 %sub31, i32 %x.0.lcssa ret i32 %cond } ; Function Attrs: nounwind uwtable define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) 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 !9 %_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 !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 = %entry %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #7 br label %while.cond.preheader 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 !9 %3 = load i8, ptr %1, align 1, !tbaa !16 %conv3.i = zext i8 %3 to i32 br label %while.cond.preheader while.cond.preheader: ; preds = %cond.true.i, %cond.false.i %c.0.in.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ] br label %while.cond while.cond: ; preds = %while.cond.backedge, %while.cond.preheader %c.0.in = phi i32 [ %c.0.in.ph, %while.cond.preheader ], [ %c.0.in.be, %while.cond.backedge ] %sext = shl i32 %c.0.in, 24 switch i32 %sext, label %while.cond8 [ i32 536870912, label %while.body i32 167772160, label %while.body ] while.body: ; preds = %while.cond, %while.cond %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i26 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1 %5 = load ptr, ptr %_IO_read_ptr.i26, align 8, !tbaa !9 %_IO_read_end.i27 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2 %6 = load ptr, ptr %_IO_read_end.i27, align 8, !tbaa !14 %cmp.not.i28 = icmp ult ptr %5, %6 br i1 %cmp.not.i28, label %cond.false.i32, label %cond.true.i29, !prof !15 cond.true.i29: ; preds = %while.body %call.i30 = tail call i32 @__uflow(ptr noundef nonnull %4) #7 br label %while.cond.backedge while.cond.backedge: ; preds = %cond.true.i29, %cond.false.i32 %c.0.in.be = phi i32 [ %call.i30, %cond.true.i29 ], [ %conv3.i34, %cond.false.i32 ] br label %while.cond, !llvm.loop !20 cond.false.i32: ; preds = %while.body %incdec.ptr.i33 = getelementptr inbounds i8, ptr %5, i64 1 store ptr %incdec.ptr.i33, ptr %_IO_read_ptr.i26, align 8, !tbaa !9 %7 = load i8, ptr %5, align 1, !tbaa !16 %conv3.i34 = zext i8 %7 to i32 br label %while.cond.backedge while.cond8: ; preds = %while.cond, %while.cond8.backedge %s.addr.0 = phi ptr [ %incdec.ptr, %while.cond8.backedge ], [ %s, %while.cond ] %c.1.in = phi i32 [ %c.1.in.be, %while.cond8.backedge ], [ %c.0.in, %while.cond ] %len.0 = phi i32 [ %inc, %while.cond8.backedge ], [ 0, %while.cond ] %sext25 = shl i32 %c.1.in, 24 switch i32 %sext25, label %while.body15 [ i32 536870912, label %while.end18 i32 167772160, label %while.end18 ] while.body15: ; preds = %while.cond8 %c.1 = trunc i32 %c.1.in to i8 %incdec.ptr = getelementptr inbounds i8, ptr %s.addr.0, i64 1 store i8 %c.1, ptr %s.addr.0, align 1, !tbaa !16 %inc = add i32 %len.0, 1 %8 = load ptr, ptr @stdin, align 8, !tbaa !5 %_IO_read_ptr.i36 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1 %9 = load ptr, ptr %_IO_read_ptr.i36, align 8, !tbaa !9 %_IO_read_end.i37 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2 %10 = load ptr, ptr %_IO_read_end.i37, align 8, !tbaa !14 %cmp.not.i38 = icmp ult ptr %9, %10 br i1 %cmp.not.i38, label %cond.false.i42, label %cond.true.i39, !prof !15 cond.true.i39: ; preds = %while.body15 %call.i40 = tail call i32 @__uflow(ptr noundef nonnull %8) #7 br label %while.cond8.backedge while.cond8.backedge: ; preds = %cond.true.i39, %cond.false.i42 %c.1.in.be = phi i32 [ %call.i40, %cond.true.i39 ], [ %conv3.i44, %cond.false.i42 ] br label %while.cond8, !llvm.loop !21 cond.false.i42: ; preds = %while.body15 %incdec.ptr.i43 = getelementptr inbounds i8, ptr %9, i64 1 store ptr %incdec.ptr.i43, ptr %_IO_read_ptr.i36, align 8, !tbaa !9 %11 = load i8, ptr %9, align 1, !tbaa !16 %conv3.i44 = zext i8 %11 to i32 br label %while.cond8.backedge while.end18: ; preds = %while.cond8, %while.cond8 store i8 0, ptr %s.addr.0, align 1, !tbaa !16 ret i32 %len.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !22 %1 = load i32, ptr %b, align 4, !tbaa !22 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compw(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load i32, ptr %a, align 4, !tbaa !22 %1 = load i32, ptr %b, align 4, !tbaa !22 %cmp = icmp sgt i32 %0, %1 %conv = zext i1 %cmp to i32 %cmp1 = icmp slt i32 %0, %1 %conv2.neg = sext i1 %cmp1 to i32 %sub = add nsw i32 %conv2.neg, %conv ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load i32, ptr %b, align 4, !tbaa !22 %1 = load i32, ptr %a, align 4, !tbaa !22 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compl(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 { entry: %0 = load i64, ptr %a, align 8, !tbaa !23 %1 = load i64, ptr %b, align 8, !tbaa !23 %cmp = icmp sgt i64 %0, %1 %conv = zext i1 %cmp to i32 %cmp1 = icmp slt i64 %0, %1 %conv2.neg = sext i1 %cmp1 to i32 %sub = add nsw i32 %conv2.neg, %conv ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @nextpint() local_unnamed_addr #2 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext30 = shl i32 %call.i, 24 %1 = add i32 %sext30, -956301313 %2 = icmp ult i32 %1, -150994945 br i1 %2, label %while.body, label %while.body15.preheader while.body: ; preds = %entry, %while.body %3 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i28 = tail call i32 @getc(ptr noundef %3) %sext = shl i32 %call.i28, 24 %4 = add i32 %sext, -956301313 %5 = icmp ult i32 %4, -150994945 br i1 %5, label %while.body, label %while.body15.preheader, !llvm.loop !24 while.body15.preheader: ; preds = %while.body, %entry %c.1.in32.ph = phi i32 [ %call.i, %entry ], [ %call.i28, %while.body ] br label %while.body15 while.body15: ; preds = %while.body15.preheader, %while.body15 %x.033 = phi i64 [ %sub, %while.body15 ], [ 0, %while.body15.preheader ] %c.1.in32 = phi i32 [ %call.i29, %while.body15 ], [ %c.1.in32.ph, %while.body15.preheader ] %c.1 = zext i32 %c.1.in32 to i64 %mul = mul i64 %x.033, 10 %sext27 = shl i64 %c.1, 56 %conv16 = ashr exact i64 %sext27, 56 %add = add i64 %mul, -48 %sub = add i64 %add, %conv16 %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i29 = tail call i32 @getc(ptr noundef %6) %sext26 = shl i32 %call.i29, 24 %7 = add i32 %sext26, -788529153 %8 = icmp ult i32 %7, 184549375 br i1 %8, label %while.body15, label %while.end19.loopexit, !llvm.loop !25 while.end19.loopexit: ; preds = %while.body15 %9 = trunc i64 %sub to i32 ret i32 %9 } ; Function Attrs: nofree nounwind uwtable define dso_local void @solve25() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !22 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @p, align 4, !tbaa !22 %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %2 = icmp eq i32 %0, 1 br i1 %2, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %ans.1.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %ans.1.1, %for.body ] %indvars.iv.unr = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next.1, %for.body ] %ans.010.unr = phi i64 [ 0, %for.body.lr.ph ], [ %ans.1.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %indvars.iv.unr %3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !16 %conv.epil = sext i8 %3 to i32 %rem.epil = srem i32 %conv.epil, %1 %cmp1.epil = icmp eq i32 %rem.epil, 0 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1 %4 = and i64 %indvars.iv.next.epil, 4294967295 %add4.epil = select i1 %cmp1.epil, i64 %4, i64 0 %ans.1.epil = add nuw nsw i64 %ans.010.unr, %add4.epil br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body.epil ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa) ret void for.body: ; preds = %for.body, %for.body.lr.ph.new %indvars.iv = phi i64 [ 0, %for.body.lr.ph.new ], [ %indvars.iv.next.1, %for.body ] %ans.010 = phi i64 [ 0, %for.body.lr.ph.new ], [ %ans.1.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %indvars.iv %5 = load i8, ptr %arrayidx, align 2, !tbaa !16 %conv = sext i8 %5 to i32 %rem = srem i32 %conv, %1 %cmp1 = icmp eq i32 %rem, 0 %indvars.iv.next = or i64 %indvars.iv, 1 %6 = and i64 %indvars.iv.next, 4294967295 %add4 = select i1 %cmp1, i64 %6, i64 0 %ans.1 = add nuw nsw i64 %ans.010, %add4 %arrayidx.1 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %indvars.iv.next %7 = load i8, ptr %arrayidx.1, align 1, !tbaa !16 %conv.1 = sext i8 %7 to i32 %rem.1 = srem i32 %conv.1, %1 %cmp1.1 = icmp eq i32 %rem.1, 0 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %8 = and i64 %indvars.iv.next.1, 4294967294 %add4.1 = select i1 %cmp1.1, i64 %8, i64 0 %ans.1.1 = add nuw nsw i64 %ans.1, %add4.1 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !26 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @bs(i64 noundef %x) local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !22 %cmp.not8 = icmp slt i32 %0, 0 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %l.010 = phi i32 [ %l.1, %while.body ], [ 0, %entry ] %r.09 = phi i32 [ %r.1, %while.body ], [ %0, %entry ] %add = add nsw i32 %l.010, %r.09 %div = sdiv i32 %add, 2 %idxprom = sext i32 %div to i64 %arrayidx = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %idxprom %1 = load i64, ptr %arrayidx, align 8, !tbaa !23 %cmp1.not = icmp slt i64 %1, %x %sub = add nsw i32 %div, -1 %add2 = add nsw i32 %div, 1 %r.1 = select i1 %cmp1.not, i32 %r.09, i32 %sub %l.1 = select i1 %cmp1.not, i32 %add2, i32 %l.010 %cmp.not = icmp sgt i32 %l.1, %r.1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !27 while.end: ; preds = %while.body, %entry %l.0.lcssa = phi i32 [ 0, %entry ], [ %l.1, %while.body ] ret i32 %l.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @solve() local_unnamed_addr #2 { entry: store i64 0, ptr @b, align 16, !tbaa !23 store i64 1, ptr getelementptr inbounds ([200001 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !23 %0 = load i32, ptr @n, align 4, !tbaa !22 %cmp.not104 = icmp slt i32 %0, 2 br i1 %cmp.not104, label %for.cond3.preheader, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @p, align 4, !tbaa !22 %conv = sext i32 %1 to i64 %2 = add nuw i32 %0, 1 %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %2, 3 br i1 %3, label %for.cond3.preheader.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %4 = and i64 %wide.trip.count, 4294967294 %5 = add nsw i64 %4, -4 br label %for.body for.cond3.preheader.loopexit.unr-lcssa.loopexit: ; preds = %for.body %6 = mul nsw i64 %rem.1, 10 br label %for.cond3.preheader.loopexit.unr-lcssa for.cond3.preheader.loopexit.unr-lcssa: ; preds = %for.cond3.preheader.loopexit.unr-lcssa.loopexit, %for.body.lr.ph %.unr = phi i64 [ 10, %for.body.lr.ph ], [ %6, %for.cond3.preheader.loopexit.unr-lcssa.loopexit ] %indvars.iv.unr = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next.1, %for.cond3.preheader.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond3.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond3.preheader.loopexit.unr-lcssa %rem.epil = srem i64 %.unr, %conv %arrayidx2.epil = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv.unr store i64 %rem.epil, ptr %arrayidx2.epil, align 8, !tbaa !23 br label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body.epil, %for.cond3.preheader.loopexit.unr-lcssa, %entry %cmp4.not106 = icmp slt i32 %0, 1 br i1 %cmp4.not106, label %for.cond3.preheader.for.end25_crit_edge, label %for.body6.lr.ph for.cond3.preheader.for.end25_crit_edge: ; preds = %for.cond3.preheader %.pre = add nsw i32 %0, 1 br label %for.end25 for.body6.lr.ph: ; preds = %for.cond3.preheader %7 = load i32, ptr @p, align 4, !tbaa !22 %conv19 = sext i32 %7 to i64 %8 = zext i32 %0 to i64 %9 = add nuw i32 %0, 1 %10 = zext i32 %0 to i64 %xtraiter143 = and i64 %10, 1 %11 = icmp eq i32 %9, 2 br i1 %11, label %for.end25.loopexit.unr-lcssa, label %for.body6.lr.ph.new for.body6.lr.ph.new: ; preds = %for.body6.lr.ph %unroll_iter146 = and i64 %10, 4294967294 br label %for.body6 for.body: ; preds = %for.body, %for.body.lr.ph.new %12 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem.1, %for.body ] %indvars.iv = phi i64 [ 2, %for.body.lr.ph.new ], [ %indvars.iv.next.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %mul = mul nsw i64 %12, 10 %rem = srem i64 %mul, %conv %arrayidx2 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv store i64 %rem, ptr %arrayidx2, align 16, !tbaa !23 %indvars.iv.next = or i64 %indvars.iv, 1 %mul.1 = mul nsw i64 %rem, 10 %rem.1 = srem i64 %mul.1, %conv %arrayidx2.1 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv.next store i64 %rem.1, ptr %arrayidx2.1, align 8, !tbaa !23 %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, %5 br i1 %niter.ncmp.1, label %for.cond3.preheader.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !28 for.body6: ; preds = %for.body6, %for.body6.lr.ph.new %13 = phi i64 [ 0, %for.body6.lr.ph.new ], [ %rem22.1, %for.body6 ] %indvars.iv121 = phi i64 [ 1, %for.body6.lr.ph.new ], [ %indvars.iv.next122.1, %for.body6 ] %niter147 = phi i64 [ 0, %for.body6.lr.ph.new ], [ %niter147.next.1, %for.body6 ] %14 = sub nsw i64 %8, %indvars.iv121 %arrayidx9 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %14 %15 = load i8, ptr %arrayidx9, align 1, !tbaa !16 %conv10 = sext i8 %15 to i64 %arrayidx12 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv121 %16 = load i64, ptr %arrayidx12, align 8, !tbaa !23 %mul13 = mul nsw i64 %16, %conv10 %add = add nsw i64 %13, %mul13 %rem22 = srem i64 %add, %conv19 store i64 %rem22, ptr %arrayidx12, align 8, !tbaa !23 %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1 %17 = sub nsw i64 %8, %indvars.iv.next122 %arrayidx9.1 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %17 %18 = load i8, ptr %arrayidx9.1, align 1, !tbaa !16 %conv10.1 = sext i8 %18 to i64 %arrayidx12.1 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv.next122 %19 = load i64, ptr %arrayidx12.1, align 8, !tbaa !23 %mul13.1 = mul nsw i64 %19, %conv10.1 %add.1 = add nsw i64 %rem22, %mul13.1 %rem22.1 = srem i64 %add.1, %conv19 store i64 %rem22.1, ptr %arrayidx12.1, align 8, !tbaa !23 %indvars.iv.next122.1 = add nuw nsw i64 %indvars.iv121, 2 %niter147.next.1 = add i64 %niter147, 2 %niter147.ncmp.1 = icmp eq i64 %niter147.next.1, %unroll_iter146 br i1 %niter147.ncmp.1, label %for.end25.loopexit.unr-lcssa, label %for.body6, !llvm.loop !29 for.end25.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.lr.ph %.unr144 = phi i64 [ 0, %for.body6.lr.ph ], [ %rem22.1, %for.body6 ] %indvars.iv121.unr = phi i64 [ 1, %for.body6.lr.ph ], [ %indvars.iv.next122.1, %for.body6 ] %lcmp.mod145.not = icmp eq i64 %xtraiter143, 0 br i1 %lcmp.mod145.not, label %for.end25, label %for.body6.epil for.body6.epil: ; preds = %for.end25.loopexit.unr-lcssa %20 = sub nsw i64 %8, %indvars.iv121.unr %arrayidx9.epil = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %20 %21 = load i8, ptr %arrayidx9.epil, align 1, !tbaa !16 %conv10.epil = sext i8 %21 to i64 %arrayidx12.epil = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv121.unr %22 = load i64, ptr %arrayidx12.epil, align 8, !tbaa !23 %mul13.epil = mul nsw i64 %22, %conv10.epil %add.epil = add nsw i64 %.unr144, %mul13.epil %rem22.epil = srem i64 %add.epil, %conv19 store i64 %rem22.epil, ptr %arrayidx12.epil, align 8, !tbaa !23 br label %for.end25 for.end25: ; preds = %for.body6.epil, %for.end25.loopexit.unr-lcssa, %for.cond3.preheader.for.end25_crit_edge %add26.pre-phi = phi i32 [ %.pre, %for.cond3.preheader.for.end25_crit_edge ], [ %9, %for.end25.loopexit.unr-lcssa ], [ %9, %for.body6.epil ] %conv27 = sext i32 %add26.pre-phi to i64 tail call void @qsort(ptr noundef nonnull @b, i64 noundef %conv27, i64 noundef 8, ptr noundef nonnull @compl) #7 %23 = load i32, ptr @n, align 4, !tbaa !22 %cmp29108 = icmp sgt i32 %23, 0 br i1 %cmp29108, label %land.rhs.preheader, label %for.end38 land.rhs.preheader: ; preds = %for.end25 %wide.trip.count131 = zext i32 %23 to i64 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %for.inc36 %indvars.iv128 = phi i64 [ 0, %land.rhs.preheader ], [ %indvars.iv.next129, %for.inc36 ] %arrayidx32 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv128 %24 = load i64, ptr %arrayidx32, align 8, !tbaa !23 %cmp33 = icmp eq i64 %24, 0 br i1 %cmp33, label %for.inc36, label %for.end38.loopexit for.inc36: ; preds = %land.rhs %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1 %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131 br i1 %exitcond132.not, label %for.body46.lr.ph, label %land.rhs, !llvm.loop !30 for.end38.loopexit: ; preds = %land.rhs %25 = trunc i64 %indvars.iv128 to i32 br label %for.end38 for.end38: ; preds = %for.end38.loopexit, %for.end25 %i.2.lcssa = phi i32 [ 0, %for.end25 ], [ %25, %for.end38.loopexit ] %cmp44.not114 = icmp sgt i32 %i.2.lcssa, %23 br i1 %cmp44.not114, label %for.end59, label %for.body46.lr.ph for.body46.lr.ph: ; preds = %for.inc36, %for.end38 %i.2.lcssa138 = phi i32 [ %i.2.lcssa, %for.end38 ], [ %23, %for.inc36 ] %cmp.not8.i = icmp slt i32 %23, 0 br i1 %cmp.not8.i, label %for.body46.us.preheader, label %for.body46.preheader for.body46.preheader: ; preds = %for.body46.lr.ph %26 = zext i32 %i.2.lcssa138 to i64 br label %for.body46 for.body46.us.preheader: ; preds = %for.body46.lr.ph %27 = sub i32 %23, %i.2.lcssa138 %28 = zext i32 %27 to i64 %29 = xor i64 %28, -1 br label %for.end59 for.body46: ; preds = %for.body46.preheader, %bs.exit100.loopexit %indvars.iv133 = phi i64 [ %26, %for.body46.preheader ], [ %indvars.iv.next134, %bs.exit100.loopexit ] %ans.0116 = phi i64 [ 0, %for.body46.preheader ], [ %add56, %bs.exit100.loopexit ] %arrayidx48 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %indvars.iv133 %30 = load i64, ptr %arrayidx48, align 8, !tbaa !23 br label %while.body.i while.body.i: ; preds = %for.body46, %while.body.i %l.010.i = phi i32 [ %l.1.i, %while.body.i ], [ 0, %for.body46 ] %r.09.i = phi i32 [ %r.1.i, %while.body.i ], [ %23, %for.body46 ] %add.i = add nsw i32 %r.09.i, %l.010.i %div.i = sdiv i32 %add.i, 2 %idxprom.i = sext i32 %div.i to i64 %arrayidx.i = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %idxprom.i %31 = load i64, ptr %arrayidx.i, align 8, !tbaa !23 %cmp1.not.i.not = icmp sgt i64 %31, %30 %sub.i = add nsw i32 %div.i, -1 %add2.i = add nsw i32 %div.i, 1 %r.1.i = select i1 %cmp1.not.i.not, i32 %sub.i, i32 %r.09.i %l.1.i = select i1 %cmp1.not.i.not, i32 %l.010.i, i32 %add2.i %cmp.not.i = icmp sgt i32 %l.1.i, %r.1.i br i1 %cmp.not.i, label %while.body.i86, label %while.body.i, !llvm.loop !27 while.body.i86: ; preds = %while.body.i, %while.body.i86 %l.010.i87 = phi i32 [ %l.1.i97, %while.body.i86 ], [ 0, %while.body.i ] %r.09.i88 = phi i32 [ %r.1.i96, %while.body.i86 ], [ %23, %while.body.i ] %add.i89 = add nsw i32 %r.09.i88, %l.010.i87 %div.i90 = sdiv i32 %add.i89, 2 %idxprom.i91 = sext i32 %div.i90 to i64 %arrayidx.i92 = getelementptr inbounds [200001 x i64], ptr @b, i64 0, i64 %idxprom.i91 %32 = load i64, ptr %arrayidx.i92, align 8, !tbaa !23 %cmp1.not.i93 = icmp slt i64 %32, %30 %sub.i94 = add nsw i32 %div.i90, -1 %add2.i95 = add nsw i32 %div.i90, 1 %r.1.i96 = select i1 %cmp1.not.i93, i32 %r.09.i88, i32 %sub.i94 %l.1.i97 = select i1 %cmp1.not.i93, i32 %add2.i95, i32 %l.010.i87 %cmp.not.i98 = icmp sgt i32 %l.1.i97, %r.1.i96 br i1 %cmp.not.i98, label %bs.exit100.loopexit, label %while.body.i86, !llvm.loop !27 bs.exit100.loopexit: ; preds = %while.body.i86 %33 = xor i32 %l.1.i97, -1 %sub54 = add nsw i32 %l.1.i, %33 %conv55 = sext i32 %sub54 to i64 %add56 = add nsw i64 %ans.0116, %conv55 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %34 = trunc i64 %indvars.iv133 to i32 %cmp44.not.not = icmp sgt i32 %23, %34 br i1 %cmp44.not.not, label %for.body46, label %for.end59, !llvm.loop !31 for.end59: ; preds = %bs.exit100.loopexit, %for.body46.us.preheader, %for.end38 %i.2.lcssa139 = phi i32 [ %i.2.lcssa, %for.end38 ], [ %i.2.lcssa138, %for.body46.us.preheader ], [ %i.2.lcssa138, %bs.exit100.loopexit ] %ans.0.lcssa = phi i64 [ 0, %for.end38 ], [ %29, %for.body46.us.preheader ], [ %add56, %bs.exit100.loopexit ] %conv39 = zext i32 %i.2.lcssa139 to i64 %sub40 = add nsw i32 %i.2.lcssa139, -1 %conv41 = sext i32 %sub40 to i64 %mul42 = mul nsw i64 %conv41, %conv39 %div = sdiv i64 %mul42, 2 %div60 = sdiv i64 %ans.0.lcssa, 2 %add61 = add nsw i64 %div60, %div %call62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add61) ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 @nextint() store i32 %call, ptr @n, align 4, !tbaa !22 %call1 = tail call i32 @nextint() store i32 %call1, ptr @p, align 4, !tbaa !22 %call2 = tail call i32 @nextstr(ptr noundef nonnull @s) %0 = load i32, ptr @n, align 4, !tbaa !22 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %iter.check, label %for.cond.cleanup iter.check: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 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.check22 = icmp ult i32 %0, 32 br i1 %min.iters.check22, label %vec.epilog.ph, label %vector.ph vector.ph: ; preds = %vector.main.loop.iter.check %n.vec = and i64 %wide.trip.count, 4294967264 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %1, align 16, !tbaa !16 %2 = getelementptr inbounds i8, ptr %1, i64 16 %wide.load23 = load <16 x i8>, ptr %2, align 16, !tbaa !16 %3 = add <16 x i8> %wide.load, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48> %4 = add <16 x i8> %wide.load23, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48> store <16 x i8> %3, ptr %1, align 16, !tbaa !16 store <16 x i8> %4, ptr %2, align 16, !tbaa !16 %index.next = add nuw i64 %index, 32 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !32 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %vec.epilog.iter.check vec.epilog.iter.check: ; preds = %middle.block %n.vec.remaining = and i64 %wide.trip.count, 24 %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0 br i1 %min.epilog.iters.check, label %for.body.preheader, label %vec.epilog.ph vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ] %n.vec25 = and i64 %wide.trip.count, 4294967288 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index27 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next29, %vec.epilog.vector.body ] %6 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %index27 %wide.load28 = load <8 x i8>, ptr %6, align 8, !tbaa !16 %7 = add <8 x i8> %wide.load28, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48> store <8 x i8> %7, ptr %6, align 8, !tbaa !16 %index.next29 = add nuw i64 %index27, 8 %8 = icmp eq i64 %index.next29, %n.vec25 br i1 %8, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !35 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n26 = icmp eq i64 %n.vec25, %wide.trip.count br i1 %cmp.n26, 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.vec25, %vec.epilog.middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry %cmp4 = icmp eq i32 %0, 0 %9 = load i8, ptr @s, align 16 %cmp7 = icmp eq i8 %9, 0 %or.cond = select i1 %cmp4, i1 %cmp7, i1 false br i1 %or.cond, label %if.then, label %if.end 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 [200001 x i8], ptr @s, i64 0, i64 %indvars.iv %10 = load i8, ptr %arrayidx, align 1, !tbaa !16 %sub = add i8 %10, -48 store i8 %sub, ptr %arrayidx, align 1, !tbaa !16 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !36 if.then: ; preds = %for.cond.cleanup %call9 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1) br label %if.end15 if.end: ; preds = %for.cond.cleanup %11 = load i32, ptr @p, align 4 switch i32 %11, label %if.else [ i32 5, label %if.then14 i32 2, label %if.then14 ] if.then14: ; preds = %if.end, %if.end br i1 %cmp19, label %for.body.lr.ph.i, label %solve25.exit for.body.lr.ph.i: ; preds = %if.then14 %wide.trip.count.i = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count.i, 1 %12 = icmp eq i32 %0, 1 br i1 %12, label %solve25.exit.loopexit.unr-lcssa, label %for.body.lr.ph.i.new for.body.lr.ph.i.new: ; preds = %for.body.lr.ph.i %unroll_iter = and i64 %wide.trip.count.i, 4294967294 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i.new %indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %indvars.iv.next.i.1, %for.body.i ] %ans.010.i = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %ans.1.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx.i = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %indvars.iv.i %13 = load i8, ptr %arrayidx.i, align 2, !tbaa !16 %conv.i = sext i8 %13 to i32 %rem.i = srem i32 %conv.i, %11 %cmp1.i = icmp eq i32 %rem.i, 0 %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %add4.i = select i1 %cmp1.i, i64 %indvars.iv.next.i, i64 0 %ans.1.i = add nuw nsw i64 %add4.i, %ans.010.i %arrayidx.i.1 = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %indvars.iv.next.i %14 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !16 %conv.i.1 = sext i8 %14 to i32 %rem.i.1 = srem i32 %conv.i.1, %11 %cmp1.i.1 = icmp eq i32 %rem.i.1, 0 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %add4.i.1 = select i1 %cmp1.i.1, i64 %indvars.iv.next.i.1, i64 0 %ans.1.i.1 = add nuw nsw i64 %add4.i.1, %ans.1.i %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %solve25.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !26 solve25.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.lr.ph.i %ans.1.i.lcssa.ph = phi i64 [ undef, %for.body.lr.ph.i ], [ %ans.1.i.1, %for.body.i ] %indvars.iv.i.unr = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i.1, %for.body.i ] %ans.010.i.unr = phi i64 [ 0, %for.body.lr.ph.i ], [ %ans.1.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %solve25.exit, label %for.body.i.epil for.body.i.epil: ; preds = %solve25.exit.loopexit.unr-lcssa %arrayidx.i.epil = getelementptr inbounds [200001 x i8], ptr @s, i64 0, i64 %indvars.iv.i.unr %15 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !16 %conv.i.epil = sext i8 %15 to i32 %rem.i.epil = srem i32 %conv.i.epil, %11 %cmp1.i.epil = icmp eq i32 %rem.i.epil, 0 %indvars.iv.next.i.epil = add nuw nsw i64 %indvars.iv.i.unr, 1 %add4.i.epil = select i1 %cmp1.i.epil, i64 %indvars.iv.next.i.epil, i64 0 %ans.1.i.epil = add nuw nsw i64 %add4.i.epil, %ans.010.i.unr br label %solve25.exit solve25.exit: ; preds = %for.body.i.epil, %solve25.exit.loopexit.unr-lcssa, %if.then14 %ans.0.lcssa.i = phi i64 [ 0, %if.then14 ], [ %ans.1.i.lcssa.ph, %solve25.exit.loopexit.unr-lcssa ], [ %ans.1.i.epil, %for.body.i.epil ] %call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa.i) br label %if.end15 if.else: ; preds = %if.end tail call void @solve() br label %if.end15 if.end15: ; preds = %if.then, %if.else, %solve25.exit ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 declare i32 @__uflow(ptr noundef) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress 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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = { "no-trapping-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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 8} !10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196} !11 = !{!"int", !7, i64 0} !12 = !{!"long", !7, i64 0} !13 = !{!"short", !7, i64 0} !14 = !{!10, !6, i64 16} !15 = !{!"branch_weights", i32 2000, i32 1} !16 = !{!7, !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = distinct !{!19, !18} !20 = distinct !{!20, !18} !21 = distinct !{!21, !18} !22 = !{!11, !11, i64 0} !23 = !{!12, !12, i64 0} !24 = distinct !{!24, !18} !25 = distinct !{!25, !18} !26 = distinct !{!26, !18} !27 = distinct !{!27, !18} !28 = distinct !{!28, !18} !29 = distinct !{!29, !18} !30 = distinct !{!30, !18} !31 = distinct !{!31, !18} !32 = distinct !{!32, !18, !33, !34} !33 = !{!"llvm.loop.isvectorized", i32 1} !34 = !{!"llvm.loop.unroll.runtime.disable"} !35 = distinct !{!35, !18, !33, !34} !36 = distinct !{!36, !18, !34, !33}
#include<stdio.h> int main() { long int a,b,c,d,r; scanf("%ld %ld %ld %ld",&a,&b,&c,&d); r=(b+d)*2; r=r+a+c; r=r+(a-c); r=r+4; printf("%ld\n",r); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22486/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22486/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [16 x i8] c"%ld %ld %ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 %d = 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 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i64, ptr %b, align 8, !tbaa !5 %1 = load i64, ptr %d, align 8, !tbaa !5 %add = add nsw i64 %1, %0 %2 = load i64, ptr %a, align 8, !tbaa !5 %mul9 = add i64 %add, %2 %add3 = shl i64 %mul9, 1 %add4 = add nsw i64 %add3, 4 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add4) 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int N; scanf("%d",&N); long long march[5]={0,0,0,0,0}; for(int i=0;i<N;i++){ char name[11]; scanf("%s",name); switch(name[0]){ case 'M': march[0]++; break; case 'A': march[1]++; break; case 'R': march[2]++; break; case 'C': march[3]++; break; case 'H': march[4]++; break; } } long long ans=0; for(int i=0;i<3;i++){ for(int j=i+1;j<4;j++){ for(int k=j+1;k<5;k++){ ans+=march[i]*march[j]*march[k]; } } } printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224902/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224902/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %name = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp60 = icmp sgt i32 %0, 0 br i1 %cmp60, label %for.body, label %for.cond17.loopexit.2 for.body: ; preds = %entry, %sw.epilog %inc569 = phi i64 [ %inc568, %sw.epilog ], [ 0, %entry ] %inc867 = phi i64 [ %inc866, %sw.epilog ], [ 0, %entry ] %inc1165 = phi i64 [ %inc1164, %sw.epilog ], [ 0, %entry ] %inc1463 = phi i64 [ %inc1462, %sw.epilog ], [ 0, %entry ] %i.061 = phi i32 [ %inc15, %sw.epilog ], [ 0, %entry ] %1 = phi i64 [ %3, %sw.epilog ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %name) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %name) %2 = load i8, ptr %name, align 1, !tbaa !9 %conv = sext i8 %2 to i32 switch i32 %conv, label %sw.epilog [ i32 77, label %sw.bb i32 65, label %sw.bb3 i32 82, label %sw.bb6 i32 67, label %sw.bb9 i32 72, label %sw.bb12 ] sw.bb: ; preds = %for.body %inc = add nsw i64 %1, 1 br label %sw.epilog sw.bb3: ; preds = %for.body %inc5 = add nsw i64 %inc569, 1 br label %sw.epilog sw.bb6: ; preds = %for.body %inc8 = add nsw i64 %inc867, 1 br label %sw.epilog sw.bb9: ; preds = %for.body %inc11 = add nsw i64 %inc1165, 1 br label %sw.epilog sw.bb12: ; preds = %for.body %inc14 = add nsw i64 %inc1463, 1 br label %sw.epilog sw.epilog: ; preds = %for.body, %sw.bb12, %sw.bb9, %sw.bb6, %sw.bb3, %sw.bb %inc568 = phi i64 [ %inc569, %for.body ], [ %inc569, %sw.bb12 ], [ %inc569, %sw.bb9 ], [ %inc569, %sw.bb6 ], [ %inc5, %sw.bb3 ], [ %inc569, %sw.bb ] %inc866 = phi i64 [ %inc867, %for.body ], [ %inc867, %sw.bb12 ], [ %inc867, %sw.bb9 ], [ %inc8, %sw.bb6 ], [ %inc867, %sw.bb3 ], [ %inc867, %sw.bb ] %inc1164 = phi i64 [ %inc1165, %for.body ], [ %inc1165, %sw.bb12 ], [ %inc11, %sw.bb9 ], [ %inc1165, %sw.bb6 ], [ %inc1165, %sw.bb3 ], [ %inc1165, %sw.bb ] %inc1462 = phi i64 [ %inc1463, %for.body ], [ %inc14, %sw.bb12 ], [ %inc1463, %sw.bb9 ], [ %inc1463, %sw.bb6 ], [ %inc1463, %sw.bb3 ], [ %inc1463, %sw.bb ] %3 = phi i64 [ %1, %for.body ], [ %1, %sw.bb12 ], [ %1, %sw.bb9 ], [ %1, %sw.bb6 ], [ %1, %sw.bb3 ], [ %inc, %sw.bb ] call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %name) #3 %inc15 = add nuw nsw i32 %i.061, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp = icmp slt i32 %inc15, %4 br i1 %cmp, label %for.body, label %for.cond17.loopexit.2, !llvm.loop !10 for.cond17.loopexit.2: ; preds = %sw.epilog, %entry %march.sroa.7.0 = phi i64 [ 0, %entry ], [ %inc568, %sw.epilog ] %march.sroa.12.0 = phi i64 [ 0, %entry ], [ %inc866, %sw.epilog ] %march.sroa.18.0 = phi i64 [ 0, %entry ], [ %inc1164, %sw.epilog ] %march.sroa.26.0 = phi i64 [ 0, %entry ], [ %inc1462, %sw.epilog ] %.lcssa = phi i64 [ 0, %entry ], [ %3, %sw.epilog ] %mul.2 = mul nsw i64 %march.sroa.18.0, %march.sroa.12.0 %mul38.2 = mul nsw i64 %mul.2, %march.sroa.26.0 %mul.1.1 = mul nsw i64 %march.sroa.18.0, %march.sroa.7.0 %mul38.1.1 = mul nsw i64 %mul.1.1, %march.sroa.26.0 %mul.1 = mul nsw i64 %march.sroa.12.0, %march.sroa.7.0 %mul38.1.197 = mul nsw i64 %mul.1, %march.sroa.26.0 %mul38.1 = mul nsw i64 %mul.1, %march.sroa.18.0 %mul.2112 = mul nsw i64 %march.sroa.18.0, %.lcssa %mul38.2115 = mul nsw i64 %mul.2112, %march.sroa.26.0 %mul.1102 = mul nsw i64 %march.sroa.12.0, %.lcssa %mul38.1105.1 = mul nsw i64 %mul.1102, %march.sroa.26.0 %mul38.1105 = mul nsw i64 %mul.1102, %march.sroa.18.0 %mul = mul nsw i64 %march.sroa.7.0, %.lcssa %mul38163 = add i64 %march.sroa.18.0, %march.sroa.12.0 %add39.1124164 = add i64 %march.sroa.26.0, %mul38163 %add39.2128 = mul i64 %mul, %add39.1124164 %add39.1106 = add nsw i64 %mul38.1105, %add39.2128 %add39.1106.1 = add nsw i64 %mul38.1105.1, %add39.1106 %add39.2116 = add nsw i64 %mul38.2115, %add39.1106.1 %add39.1 = add nsw i64 %mul38.1, %add39.2116 %add39.1.198 = add nsw i64 %mul38.1.197, %add39.1 %add39.1.1 = add nsw i64 %mul38.1.1, %add39.1.198 %add39.2 = add nsw i64 %mul38.2, %add39.1.1 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add39.2) 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 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void){ int n; char s[100000][20]; int i,j,k; long int counta[5]; long int ans=0; for(i=0;i<5;i++){ counta[i]=0; } //read input scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",s[i]); if(s[i][0]=='M'){ counta[0]++; } else if(s[i][0]=='A'){ counta[1]++; } else if(s[i][0]=='R'){ counta[2]++; } else if(s[i][0]=='C'){ counta[3]++; } else if(s[i][0]=='H'){ counta[4]++; } } for(i=0;i<3;i++){ for(j=i+1;j<4;j++){ for(k=j+1;k<5;k++){ ans += counta[i]*counta[j]*counta[k]; } } } printf("%ld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224953/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224953/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %s = alloca [100000 x [20 x i8]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp2112 = icmp sgt i32 %0, 0 br i1 %cmp2112, label %for.body3, label %for.cond60.loopexit.2 for.body3: ; preds = %entry, %for.inc57 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc57 ], [ 0, %entry ] %inc22121 = phi i64 [ %inc22120, %for.inc57 ], [ 0, %entry ] %inc32119 = phi i64 [ %inc32118, %for.inc57 ], [ 0, %entry ] %inc42117 = phi i64 [ %inc42116, %for.inc57 ], [ 0, %entry ] %inc52115 = phi i64 [ %inc52114, %for.inc57 ], [ 0, %entry ] %1 = phi i64 [ %3, %for.inc57 ], [ 0, %entry ] %arrayidx5 = getelementptr inbounds [100000 x [20 x i8]], ptr %s, i64 0, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %2 = load i8, ptr %arrayidx5, align 4, !tbaa !9 switch i8 %2, label %for.inc57 [ i8 77, label %if.then i8 65, label %if.then20 i8 82, label %if.then30 i8 67, label %if.then40 i8 72, label %if.then50 ] if.then: ; preds = %for.body3 %inc13 = add nsw i64 %1, 1 br label %for.inc57 if.then20: ; preds = %for.body3 %inc22 = add nsw i64 %inc22121, 1 br label %for.inc57 if.then30: ; preds = %for.body3 %inc32 = add nsw i64 %inc32119, 1 br label %for.inc57 if.then40: ; preds = %for.body3 %inc42 = add nsw i64 %inc42117, 1 br label %for.inc57 if.then50: ; preds = %for.body3 %inc52 = add nsw i64 %inc52115, 1 br label %for.inc57 for.inc57: ; preds = %for.body3, %if.then, %if.then30, %if.then50, %if.then40, %if.then20 %inc22120 = phi i64 [ %inc22121, %for.body3 ], [ %inc22121, %if.then ], [ %inc22121, %if.then30 ], [ %inc22121, %if.then50 ], [ %inc22121, %if.then40 ], [ %inc22, %if.then20 ] %inc32118 = phi i64 [ %inc32119, %for.body3 ], [ %inc32119, %if.then ], [ %inc32, %if.then30 ], [ %inc32119, %if.then50 ], [ %inc32119, %if.then40 ], [ %inc32119, %if.then20 ] %inc42116 = phi i64 [ %inc42117, %for.body3 ], [ %inc42117, %if.then ], [ %inc42117, %if.then30 ], [ %inc42117, %if.then50 ], [ %inc42, %if.then40 ], [ %inc42117, %if.then20 ] %inc52114 = phi i64 [ %inc52115, %for.body3 ], [ %inc52115, %if.then ], [ %inc52115, %if.then30 ], [ %inc52, %if.then50 ], [ %inc52115, %if.then40 ], [ %inc52115, %if.then20 ] %3 = phi i64 [ %1, %for.body3 ], [ %inc13, %if.then ], [ %1, %if.then30 ], [ %1, %if.then50 ], [ %1, %if.then40 ], [ %1, %if.then20 ] %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 %cmp2 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2, label %for.body3, label %for.cond60.loopexit.2, !llvm.loop !10 for.cond60.loopexit.2: ; preds = %for.inc57, %entry %counta.sroa.8.0 = phi i64 [ 0, %entry ], [ %inc22120, %for.inc57 ] %counta.sroa.13.0 = phi i64 [ 0, %entry ], [ %inc32118, %for.inc57 ] %counta.sroa.19.0 = phi i64 [ 0, %entry ], [ %inc42116, %for.inc57 ] %counta.sroa.27.0 = phi i64 [ 0, %entry ], [ %inc52114, %for.inc57 ] %.lcssa = phi i64 [ 0, %entry ], [ %3, %for.inc57 ] %mul.2 = mul nsw i64 %counta.sroa.19.0, %counta.sroa.13.0 %mul79.2 = mul nsw i64 %mul.2, %counta.sroa.27.0 %mul.1.1 = mul nsw i64 %counta.sroa.19.0, %counta.sroa.8.0 %mul79.1.1 = mul nsw i64 %mul.1.1, %counta.sroa.27.0 %mul.1 = mul nsw i64 %counta.sroa.13.0, %counta.sroa.8.0 %mul79.1.1153 = mul nsw i64 %mul.1, %counta.sroa.27.0 %mul79.1 = mul nsw i64 %mul.1, %counta.sroa.19.0 %mul.2168 = mul nsw i64 %counta.sroa.19.0, %.lcssa %mul79.2171 = mul nsw i64 %mul.2168, %counta.sroa.27.0 %mul.1158 = mul nsw i64 %counta.sroa.13.0, %.lcssa %mul79.1161.1 = mul nsw i64 %mul.1158, %counta.sroa.27.0 %mul79.1161 = mul nsw i64 %mul.1158, %counta.sroa.19.0 %mul = mul nsw i64 %counta.sroa.8.0, %.lcssa %mul79220 = add i64 %counta.sroa.19.0, %counta.sroa.13.0 %add80.1180221 = add i64 %counta.sroa.27.0, %mul79220 %add80.2184 = mul i64 %mul, %add80.1180221 %add80.1162 = add nsw i64 %mul79.1161, %add80.2184 %add80.1162.1 = add nsw i64 %mul79.1161.1, %add80.1162 %add80.2172 = add nsw i64 %mul79.2171, %add80.1162.1 %add80.1 = add nsw i64 %mul79.1, %add80.2172 %add80.1.1154 = add nsw i64 %mul79.1.1153, %add80.1 %add80.1.1 = add nsw i64 %mul79.1.1, %add80.1.1154 %add80.2 = add nsw i64 %mul79.2, %add80.1.1 %call90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add80.2) call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int i,j; int next; int end = 0; char line[4]; char board[3][3]; while(1){ next = 0; for(i = 0; i < 3; i++){ scanf("%s",line); if(line[0] == '0'){ end = 1; break; } board[0][i] = line[0]; board[1][i] = line[1]; board[2][i] = line[2]; } if(end){break;} for(i = 0; i < 3; i++){ if( board[0][i] == board[1][i] && board[1][i] == board[2][i] && board[2][i] != '+' ){ printf("%c\n",board[0][i]); next = 1; break; } } if(next){continue;} for(i = 0; i < 3; i++){ if( board[i][0] == board[i][1] && board[i][1] == board[i][2] && board[i][2] != '+' ){ printf("%c\n",board[i][0]); next = 1; break; } } if(next){continue;} if( ( board[0][0] == board[1][1] && board[1][1] == board[2][2] || board[2][0] == board[1][1] && board[1][1] == board[0][2] )&& board[1][1] != '+' ){ printf("%c\n",board[1][1]); next = 1; } if(next){continue;} puts("NA"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_224997/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_224997/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NA\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %line = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %line) #3 %arrayidx6 = getelementptr inbounds [4 x i8], ptr %line, i64 0, i64 1 %arrayidx10 = getelementptr inbounds [4 x i8], ptr %line, i64 0, i64 2 %call204 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %line) %0 = load i8, ptr %line, align 1, !tbaa !5 %cmp1205 = icmp eq i8 %0, 48 br i1 %cmp1205, label %while.end, label %if.end if.end: ; preds = %entry, %while.cond.backedge %1 = phi i8 [ %10, %while.cond.backedge ], [ %0, %entry ] %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %3 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %line) %4 = load i8, ptr %line, align 1, !tbaa !5 %cmp1.1 = icmp eq i8 %4, 48 br i1 %cmp1.1, label %while.end, label %if.end.1 if.end.1: ; preds = %if.end %5 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %6 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %line) %7 = load i8, ptr %line, align 1, !tbaa !5 %cmp1.2 = icmp eq i8 %7, 48 br i1 %cmp1.2, label %while.end, label %if.end.2 if.end.2: ; preds = %if.end.1 %8 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %9 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp28 = icmp eq i8 %1, %2 br i1 %cmp28, label %land.lhs.true, label %for.inc54 land.lhs.true: ; preds = %if.end.2 %cmp38 = icmp ne i8 %1, %3 %cmp45.not = icmp eq i8 %3, 43 %or.cond177 = or i1 %cmp38, %cmp45.not br i1 %or.cond177, label %for.inc54, label %if.then47 if.then47: ; preds = %land.lhs.true.2, %land.lhs.true.1, %land.lhs.true %.lcssa = phi i8 [ %1, %land.lhs.true ], [ %4, %land.lhs.true.1 ], [ %7, %land.lhs.true.2 ] %conv23.le = sext i8 %.lcssa to i32 %call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv23.le) br label %while.cond.backedge for.inc54: ; preds = %if.end.2, %land.lhs.true %cmp28.1 = icmp eq i8 %4, %5 br i1 %cmp28.1, label %land.lhs.true.1, label %for.inc54.1 land.lhs.true.1: ; preds = %for.inc54 %cmp38.1 = icmp ne i8 %4, %6 %cmp45.not.1 = icmp eq i8 %6, 43 %or.cond177.1 = or i1 %cmp38.1, %cmp45.not.1 br i1 %or.cond177.1, label %for.inc54.1, label %if.then47 for.inc54.1: ; preds = %land.lhs.true.1, %for.inc54 %cmp28.2 = icmp eq i8 %7, %8 br i1 %cmp28.2, label %land.lhs.true.2, label %for.inc54.2 land.lhs.true.2: ; preds = %for.inc54.1 %cmp38.2 = icmp ne i8 %7, %9 %cmp45.not.2 = icmp eq i8 %9, 43 %or.cond177.2 = or i1 %cmp38.2, %cmp45.not.2 br i1 %or.cond177.2, label %for.inc54.2, label %if.then47 for.inc54.2: ; preds = %land.lhs.true.2, %for.inc54.1 %cmp72 = icmp eq i8 %1, %4 br i1 %cmp72, label %land.lhs.true74, label %for.inc99 land.lhs.true74: ; preds = %for.inc54.2 %cmp83 = icmp ne i8 %1, %7 %cmp90.not = icmp eq i8 %7, 43 %or.cond178 = or i1 %cmp83, %cmp90.not br i1 %or.cond178, label %for.inc99, label %if.then92 if.then92: ; preds = %land.lhs.true74.2, %land.lhs.true74.1, %land.lhs.true74 %.lcssa185 = phi i8 [ %1, %land.lhs.true74 ], [ %2, %land.lhs.true74.1 ], [ %3, %land.lhs.true74.2 ] %conv67.le = sext i8 %.lcssa185 to i32 %call97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv67.le) br label %while.cond.backedge for.inc99: ; preds = %for.inc54.2, %land.lhs.true74 %cmp72.1 = icmp eq i8 %2, %5 br i1 %cmp72.1, label %land.lhs.true74.1, label %for.inc99.1 land.lhs.true74.1: ; preds = %for.inc99 %cmp83.1 = icmp ne i8 %2, %8 %cmp90.not.1 = icmp eq i8 %8, 43 %or.cond178.1 = or i1 %cmp83.1, %cmp90.not.1 br i1 %or.cond178.1, label %for.inc99.1, label %if.then92 for.inc99.1: ; preds = %land.lhs.true74.1, %for.inc99 %cmp72.2 = icmp eq i8 %3, %6 br i1 %cmp72.2, label %land.lhs.true74.2, label %for.inc99.2 land.lhs.true74.2: ; preds = %for.inc99.1 %cmp83.2 = icmp ne i8 %3, %9 %cmp90.not.2 = icmp eq i8 %9, 43 %or.cond178.2 = or i1 %cmp83.2, %cmp90.not.2 br i1 %or.cond178.2, label %for.inc99.2, label %if.then92 for.inc99.2: ; preds = %land.lhs.true74.2, %for.inc99.1 %cmp111 = icmp eq i8 %1, %5 %cmp120 = icmp eq i8 %5, %9 %or.cond179 = select i1 %cmp111, i1 %cmp120, i1 false br i1 %or.cond179, label %land.lhs.true139, label %lor.lhs.false lor.lhs.false: ; preds = %for.inc99.2 %cmp128 = icmp eq i8 %3, %5 br i1 %cmp128, label %land.lhs.true130, label %if.end153 land.lhs.true130: ; preds = %lor.lhs.false %cmp137 = icmp eq i8 %3, %7 %cmp143 = icmp ne i8 %3, 43 %or.cond = and i1 %cmp143, %cmp137 br i1 %or.cond, label %if.then145, label %if.end153 land.lhs.true139: ; preds = %for.inc99.2 %cmp143.old.not = icmp eq i8 %1, 43 br i1 %cmp143.old.not, label %if.end153, label %if.then145 if.then145: ; preds = %land.lhs.true130, %land.lhs.true139 %conv148 = sext i8 %5 to i32 %call149 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv148) br label %while.cond.backedge if.end153: ; preds = %lor.lhs.false, %land.lhs.true130, %land.lhs.true139 %call154 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2) br label %while.cond.backedge while.cond.backedge: ; preds = %if.end153, %if.then145, %if.then47, %if.then92 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %line) %10 = load i8, ptr %line, align 1, !tbaa !5 %cmp1 = icmp eq i8 %10, 48 br i1 %cmp1, label %while.end, label %if.end while.end: ; preds = %while.cond.backedge, %if.end, %if.end.1, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %line) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main (void){ int h = 0; int w = 0; int ch = 0; int cw = 0; while(1){ scanf("%d %d",&h,&w); if((h == 0)&&(w == 0)){ break; } for(ch = 0;ch < h;ch++){ if(ch % 2 == 0){ for(cw = 0;cw < w;cw++){ if(cw % 2 == 0){ printf("#"); }else{ printf("."); } } printf("\n"); }else{ for(cw = 0;cw < w;cw++){ if(cw % 2 == 0){ printf("."); }else{ printf("#"); } } printf("\n"); } } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225046/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225046/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 store i32 0, ptr %h, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 store i32 0, ptr %w, align 4, !tbaa !5 %call54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp55 = icmp eq i32 %0, 0 %1 = load i32, ptr %w, align 4 %cmp156 = icmp eq i32 %1, 0 %or.cond57 = select i1 %cmp55, i1 %cmp156, i1 false br i1 %or.cond57, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end33 %2 = phi i32 [ %7, %for.end33 ], [ %0, %entry ] %cmp252 = icmp sgt i32 %2, 0 br i1 %cmp252, label %for.body, label %for.end33 for.body: ; preds = %for.cond.preheader, %for.inc31 %ch.053 = phi i32 [ %inc32, %for.inc31 ], [ 0, %for.cond.preheader ] %rem = and i32 %ch.053, 1 %cmp3 = icmp eq i32 %rem, 0 %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp650 = icmp sgt i32 %3, 0 br i1 %cmp3, label %for.cond5.preheader, label %for.cond16.preheader for.cond16.preheader: ; preds = %for.body br i1 %cmp650, label %for.body18, label %for.inc31 for.cond5.preheader: ; preds = %for.body br i1 %cmp650, label %for.body7, label %for.inc31 for.body7: ; preds = %for.cond5.preheader, %for.body7 %cw.051 = phi i32 [ %inc, %for.body7 ], [ 0, %for.cond5.preheader ] %rem8 = and i32 %cw.051, 1 %cmp9 = icmp eq i32 %rem8, 0 %. = select i1 %cmp9, i32 35, i32 46 %putchar47 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %cw.051, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp6 = icmp slt i32 %inc, %4 br i1 %cmp6, label %for.body7, label %for.inc31, !llvm.loop !9 for.body18: ; preds = %for.cond16.preheader, %for.body18 %cw.149 = phi i32 [ %inc27, %for.body18 ], [ 0, %for.cond16.preheader ] %rem19 = and i32 %cw.149, 1 %cmp20 = icmp eq i32 %rem19, 0 %.59 = select i1 %cmp20, i32 46, i32 35 %putchar44 = call i32 @putchar(i32 %.59) %inc27 = add nuw nsw i32 %cw.149, 1 %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp17 = icmp slt i32 %inc27, %5 br i1 %cmp17, label %for.body18, label %for.inc31, !llvm.loop !11 for.inc31: ; preds = %for.body18, %for.body7, %for.cond16.preheader, %for.cond5.preheader %putchar45 = call i32 @putchar(i32 10) %inc32 = add nuw nsw i32 %ch.053, 1 %6 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc32, %6 br i1 %cmp2, label %for.body, label %for.end33, !llvm.loop !12 for.end33: ; preds = %for.inc31, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %7 = load i32, ptr %h, align 4, !tbaa !5 %cmp = icmp eq i32 %7, 0 %8 = load i32, ptr %w, align 4 %cmp1 = icmp eq i32 %8, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end33, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int H, W; int i, j; for (;;){ scanf("%d %d", &H, &W); if (H == 0 && W == 0){ break; } for (i = 0; i <H; i++){ for(j = 0; j < W; j++){ if ((i + j) % 2 == 0){ printf("#"); } else { printf("."); } } printf("\n"); } printf("\n"); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225097/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225097/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %H = alloca i32, align 4 %W = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4 %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %H, align 4, !tbaa !5 %cmp30 = icmp eq i32 %0, 0 %1 = load i32, ptr %W, align 4 %cmp131 = icmp eq i32 %1, 0 %or.cond32 = select i1 %cmp30, i1 %cmp131, i1 false br i1 %or.cond32, label %for.end17, label %for.cond2.preheader for.cond2.preheader: ; preds = %entry, %for.end15 %2 = phi i32 [ %6, %for.end15 ], [ %0, %entry ] %cmp327 = icmp sgt i32 %2, 0 br i1 %cmp327, label %for.cond4.preheader, label %for.end15 for.cond4.preheader: ; preds = %for.cond2.preheader, %for.end %i.028 = phi i32 [ %inc14, %for.end ], [ 0, %for.cond2.preheader ] %3 = load i32, ptr %W, align 4, !tbaa !5 %cmp525 = icmp sgt i32 %3, 0 br i1 %cmp525, label %for.body6, label %for.end for.body6: ; preds = %for.cond4.preheader, %for.body6 %j.026 = phi i32 [ %inc, %for.body6 ], [ 0, %for.cond4.preheader ] %add = add nuw nsw i32 %j.026, %i.028 %rem = and i32 %add, 1 %cmp7 = icmp eq i32 %rem, 0 %. = select i1 %cmp7, i32 35, i32 46 %putchar24 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %j.026, 1 %4 = load i32, ptr %W, align 4, !tbaa !5 %cmp5 = icmp slt i32 %inc, %4 br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body6, %for.cond4.preheader %putchar22 = call i32 @putchar(i32 10) %inc14 = add nuw nsw i32 %i.028, 1 %5 = load i32, ptr %H, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc14, %5 br i1 %cmp3, label %for.cond4.preheader, label %for.end15, !llvm.loop !11 for.end15: ; preds = %for.end, %for.cond2.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) %6 = load i32, ptr %H, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 %7 = load i32, ptr %W, align 4 %cmp1 = icmp eq i32 %7, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %for.end17, label %for.cond2.preheader for.end17: ; preds = %for.end15, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #include<stdlib.h> char str[110]; int alp[26]; int main() { int n,i,j,flag; for(i=0;i<26;i++) alp[i]=0; scanf("%d",&n); scanf("%s",str); for(i=0;i<n;i++) { char ch = str[i]; if(ch>='a'&& ch<='z') { alp[ch-'a']++; } else if(ch>='A'&& ch<='Z') { alp[ch-'A']++; } } flag =0; for(i=0;i<26;i++) if(alp[i]==0) flag =1; if(flag ==1) printf("NO\n"); else printf("YES\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22514/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22514/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @alp = dso_local local_unnamed_addr global [26 x i32] zeroinitializer, align 16 @.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 = dso_local global [110 x i8] zeroinitializer, align 16 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @alp, i8 0, i64 104, i1 false), !tbaa !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 @str) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp369 = icmp sgt i32 %0, 0 br i1 %cmp369, label %for.body4.preheader, label %for.cond33.preheader for.body4.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body4 for.cond33.preheader: ; preds = %if.end29, %entry %1 = load i32, ptr @alp, align 16, !tbaa !5 %cmp39 = icmp eq i32 %1, 0 %2 = load i32, ptr getelementptr inbounds ([26 x i32], ptr @alp, i64 0, i64 1), align 4, !tbaa !5 %.fr95 = freeze i32 %2 %cmp39.1 = icmp eq i32 %.fr95, 0 %3 = load <8 x i32>, ptr getelementptr inbounds ([26 x i32], ptr @alp, i64 0, i64 2), align 8, !tbaa !5 %.fr94 = freeze <8 x i32> %3 %4 = icmp eq <8 x i32> %.fr94, zeroinitializer %5 = load <16 x i32>, ptr getelementptr inbounds ([26 x i32], ptr @alp, i64 0, i64 10), align 8, !tbaa !5 %.fr = freeze <16 x i32> %5 %6 = icmp eq <16 x i32> %.fr, zeroinitializer %7 = bitcast <16 x i1> %6 to i16 %8 = icmp ne i16 %7, 0 %9 = bitcast <8 x i1> %4 to i8 %10 = icmp ne i8 %9, 0 %op.rdx = or i1 %8, %10 %op.rdx92 = or i1 %op.rdx, %cmp39.1 %op.rdx93 = select i1 %op.rdx92, i1 true, i1 %cmp39 %str.5.str.4 = select i1 %op.rdx93, ptr @str.5, ptr @str.4 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.str.4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body4: ; preds = %for.body4.preheader, %if.end29 %indvars.iv = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next, %if.end29 ] %arrayidx6 = getelementptr inbounds [110 x i8], ptr @str, i64 0, i64 %indvars.iv %11 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %conv = sext i8 %11 to i64 %12 = add i8 %11, -97 %or.cond = icmp ult i8 %12, 26 br i1 %or.cond, label %if.end29.sink.split, label %if.else if.else: ; preds = %for.body4 %13 = add i8 %11, -65 %or.cond53 = icmp ult i8 %13, 26 br i1 %or.cond53, label %if.end29.sink.split, label %if.end29 if.end29.sink.split: ; preds = %if.else, %for.body4 %.sink = phi i64 [ 4294967199, %for.body4 ], [ 4294967231, %if.else ] %sub = add nsw i64 %.sink, %conv %idxprom13 = and i64 %sub, 4294967295 %arrayidx14 = getelementptr inbounds [26 x i32], ptr @alp, i64 0, i64 %idxprom13 %14 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %inc28 = add nsw i32 %14, 1 store i32 %inc28, ptr %arrayidx14, align 4, !tbaa !5 br label %if.end29 if.end29: ; preds = %if.end29.sink.split, %if.else %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.cond33.preheader, label %for.body4, !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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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"}
/* 整数を2つ入力し、それらを縦・横として枠を描け。 前問で描いた長方形のプログラムを、if文で書くものを変えるとよい。 やり方: ・長方形のを流用。 ・一行目または最終行の時のみ、全て「#」。 ・それ以外は、最初と最後の文字のみ「#」。他は「.」。 結果:正解。 */ #include <stdio.h> #include <math.h> #include <string.h> #include <ctype.h> int main() { int n=0; int h,w,count=0; int i[100],k[100]; while(1){ scanf("%d %d",&i[n],&k[n]); if(i[n]==0&&k[n]==0){ break; } n++; } count=n; for(n=0; n<count; n++){ for(h=0; h<i[n]; h++){ for(w=0; w<k[n]; w++){ if(h%2==0){ if(w%2==0){ printf("#"); } else{ printf("."); } } else{ if(w%2==0){ printf("."); } else{ printf("#"); } } } puts(""); } puts(""); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225183/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225183/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca [100 x i32], align 16 %k = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %i) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %k) #4 br label %while.cond while.cond: ; preds = %if.end, %entry %indvars.iv75 = phi i32 [ %indvars.iv.next76, %if.end ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %i, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100 x i32], ptr %k, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 0 br i1 %cmp, label %land.lhs.true, label %if.end land.lhs.true: ; preds = %while.cond %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp7 = icmp eq i32 %1, 0 br i1 %cmp7, label %for.cond.preheader, label %if.end for.cond.preheader: ; preds = %land.lhs.true %2 = and i64 %indvars.iv, 4294967295 %cmp868.not = icmp eq i64 %2, 0 br i1 %cmp868.not, label %for.end44, label %for.cond9.preheader.preheader for.cond9.preheader.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %indvars.iv75 to i64 br label %for.cond9.preheader if.end: ; preds = %land.lhs.true, %while.cond %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next76 = add nuw i32 %indvars.iv75, 1 br label %while.cond for.cond9.preheader: ; preds = %for.cond9.preheader.preheader, %for.end40 %indvars.iv72 = phi i64 [ 0, %for.cond9.preheader.preheader ], [ %indvars.iv.next73, %for.end40 ] %arrayidx11 = getelementptr inbounds [100 x i32], ptr %i, i64 0, i64 %indvars.iv72 %3 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp1266 = icmp sgt i32 %3, 0 br i1 %cmp1266, label %for.cond14.preheader.lr.ph, label %for.end40 for.cond14.preheader.lr.ph: ; preds = %for.cond9.preheader %arrayidx16 = getelementptr inbounds [100 x i32], ptr %k, i64 0, i64 %indvars.iv72 br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond14.preheader.lr.ph, %for.end %h.067 = phi i32 [ 0, %for.cond14.preheader.lr.ph ], [ %inc39, %for.end ] %4 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp1764 = icmp sgt i32 %4, 0 br i1 %cmp1764, label %for.body18.lr.ph, label %for.end for.body18.lr.ph: ; preds = %for.cond14.preheader %rem = and i32 %h.067, 1 %cmp19 = icmp eq i32 %rem, 0 br i1 %cmp19, label %for.body18.us, label %for.body18 for.body18.us: ; preds = %for.body18.lr.ph, %for.body18.us %w.065.us = phi i32 [ %inc36.us, %for.body18.us ], [ 0, %for.body18.lr.ph ] %rem21.us = and i32 %w.065.us, 1 %cmp22.us = icmp eq i32 %rem21.us, 0 %. = select i1 %cmp22.us, i32 35, i32 46 %putchar63.us = call i32 @putchar(i32 %.) %inc36.us = add nuw nsw i32 %w.065.us, 1 %5 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17.us = icmp slt i32 %inc36.us, %5 br i1 %cmp17.us, label %for.body18.us, label %for.end, !llvm.loop !9 for.body18: ; preds = %for.body18.lr.ph, %for.body18 %w.065 = phi i32 [ %inc36, %for.body18 ], [ 0, %for.body18.lr.ph ] %rem28 = and i32 %w.065, 1 %cmp29 = icmp eq i32 %rem28, 0 %.79 = select i1 %cmp29, i32 46, i32 35 %putchar60 = call i32 @putchar(i32 %.79) %inc36 = add nuw nsw i32 %w.065, 1 %6 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp slt i32 %inc36, %6 br i1 %cmp17, label %for.body18, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body18, %for.body18.us, %for.cond14.preheader %putchar59 = call i32 @putchar(i32 10) %inc39 = add nuw nsw i32 %h.067, 1 %7 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp slt i32 %inc39, %7 br i1 %cmp12, label %for.cond14.preheader, label %for.end40, !llvm.loop !11 for.end40: ; preds = %for.end, %for.cond9.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %exitcond.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count br i1 %exitcond.not, label %for.end44, label %for.cond9.preheader, !llvm.loop !12 for.end44: ; preds = %for.end40, %for.cond.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %i) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int h, w; int i, j; while (1) { scanf("%d %d", &h, &w); if (h == 0 && w ==0) break; for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { if (i % 2) { if (j % 2) { putchar('#'); } else { putchar('.'); } } else { if (j % 2) { putchar('.'); } else { putchar('#'); } } } putchar('\n'); } putchar('\n'); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225233/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225233/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3 %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp42 = icmp eq i32 %0, 0 %1 = load i32, ptr %w, align 4 %cmp143 = icmp eq i32 %1, 0 %or.cond44 = select i1 %cmp42, i1 %cmp143, i1 false br i1 %or.cond44, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end25 %2 = phi i32 [ %11, %for.end25 ], [ %0, %entry ] %cmp239 = icmp sgt i32 %2, 0 br i1 %cmp239, label %for.cond3.preheader, label %for.end25 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.040 = phi i32 [ %inc24, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp437 = icmp sgt i32 %3, 0 br i1 %cmp437, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %rem = and i32 %i.040, 1 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.038.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %rem14.us = and i32 %j.038.us, 1 %tobool15.not.us = icmp eq i32 %rem14.us, 0 %4 = load ptr, ptr @stdout, align 8, !tbaa !9 %. = select i1 %tobool15.not.us, i32 35, i32 46 %call.i34.us = call i32 @putc(i32 noundef %., ptr noundef %4) %inc.us = add nuw nsw i32 %j.038.us, 1 %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %5 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !11 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %j.038 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %rem7 = and i32 %j.038, 1 %tobool8.not = icmp eq i32 %rem7, 0 %6 = load ptr, ptr @stdout, align 8, !tbaa !9 %.48 = select i1 %tobool8.not, i32 46, i32 35 %call.i32 = call i32 @putc(i32 noundef %.48, ptr noundef %6) %inc = add nuw nsw i32 %j.038, 1 %7 = load i32, ptr %w, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %7 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %8 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i35 = call i32 @putc(i32 noundef 10, ptr noundef %8) %inc24 = add nuw nsw i32 %i.040, 1 %9 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc24, %9 br i1 %cmp2, label %for.cond3.preheader, label %for.end25, !llvm.loop !13 for.end25: ; preds = %for.end, %for.cond.preheader %10 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i36 = call i32 @putc(i32 noundef 10, ptr noundef %10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %11 = load i32, ptr %h, align 4, !tbaa !5 %cmp = icmp eq i32 %11, 0 %12 = load i32, ptr %w, align 4 %cmp1 = icmp eq i32 %12, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end25, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12}
#include <stdio.h> int main(void) { int h; int w; int i,j; while(1){ scanf("%d %d", &h, &w); if (h == 0 && w == 0){ break; } for (i = 0; i < h; i++){ for (j = 0; j < w; j++){ if (i % 2 == 0){ if(j % 2 == 0){ printf("#"); } else { printf("."); } } else { if (j % 2 == 0){ printf("."); } else{ printf("#"); } } } printf("\n"); } puts(""); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225277/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225277/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp43 = icmp eq i32 %0, 0 %1 = load i32, ptr %w, align 4 %cmp144 = icmp eq i32 %1, 0 %or.cond45 = select i1 %cmp43, i1 %cmp144, i1 false br i1 %or.cond45, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end26 %2 = phi i32 [ %7, %for.end26 ], [ %0, %entry ] %cmp240 = icmp sgt i32 %2, 0 br i1 %cmp240, label %for.cond3.preheader, label %for.end26 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i.041 = phi i32 [ %inc25, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp438 = icmp sgt i32 %3, 0 br i1 %cmp438, label %for.body5.lr.ph, label %for.end for.body5.lr.ph: ; preds = %for.cond3.preheader %rem = and i32 %i.041, 1 %cmp6 = icmp eq i32 %rem, 0 br i1 %cmp6, label %for.body5.us, label %for.body5 for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us %j.039.us = phi i32 [ %inc.us, %for.body5.us ], [ 0, %for.body5.lr.ph ] %rem8.us = and i32 %j.039.us, 1 %cmp9.us = icmp eq i32 %rem8.us, 0 %. = select i1 %cmp9.us, i32 35, i32 46 %putchar37.us = call i32 @putchar(i32 %.) %inc.us = add nuw nsw i32 %j.039.us, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp4.us = icmp slt i32 %inc.us, %4 br i1 %cmp4.us, label %for.body5.us, label %for.end, !llvm.loop !9 for.body5: ; preds = %for.body5.lr.ph, %for.body5 %j.039 = phi i32 [ %inc, %for.body5 ], [ 0, %for.body5.lr.ph ] %rem15 = and i32 %j.039, 1 %cmp16 = icmp eq i32 %rem15, 0 %.49 = select i1 %cmp16, i32 46, i32 35 %putchar34 = call i32 @putchar(i32 %.49) %inc = add nuw nsw i32 %j.039, 1 %5 = load i32, ptr %w, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %5 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader %putchar33 = call i32 @putchar(i32 10) %inc25 = add nuw nsw i32 %i.041, 1 %6 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc25, %6 br i1 %cmp2, label %for.cond3.preheader, label %for.end26, !llvm.loop !11 for.end26: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %7 = load i32, ptr %h, align 4, !tbaa !5 %cmp = icmp eq i32 %7, 0 %8 = load i32, ptr %w, align 4 %cmp1 = icmp eq i32 %8, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end26, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int h, w, i1, i2; while (1){ scanf("%d %d", &h, &w); if (h == 0 && w == 0){ break; } else { for (i1 = 0; i1 < h; i1++){ for (i2 = 0; i2 < w; i2++){ if ((i2+i1) % 2 == 0){ printf("#"); } else { printf("."); } } printf("\n"); } } printf("\n"); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225341/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225341/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %h = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %0 = load i32, ptr %h, align 4, !tbaa !5 %cmp29 = icmp eq i32 %0, 0 %1 = load i32, ptr %w, align 4 %cmp130 = icmp eq i32 %1, 0 %or.cond31 = select i1 %cmp29, i1 %cmp130, i1 false br i1 %or.cond31, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %if.end15 %2 = phi i32 [ %6, %if.end15 ], [ %0, %entry ] %cmp226 = icmp sgt i32 %2, 0 br i1 %cmp226, label %for.cond3.preheader, label %if.end15 for.cond3.preheader: ; preds = %for.cond.preheader, %for.end %i1.027 = phi i32 [ %inc13, %for.end ], [ 0, %for.cond.preheader ] %3 = load i32, ptr %w, align 4, !tbaa !5 %cmp424 = icmp sgt i32 %3, 0 br i1 %cmp424, label %for.body5, label %for.end for.body5: ; preds = %for.cond3.preheader, %for.body5 %i2.025 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ] %add = add nuw nsw i32 %i2.025, %i1.027 %rem = and i32 %add, 1 %cmp6 = icmp eq i32 %rem, 0 %. = select i1 %cmp6, i32 35, i32 46 %putchar23 = call i32 @putchar(i32 %.) %inc = add nuw nsw i32 %i2.025, 1 %4 = load i32, ptr %w, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %4 br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body5, %for.cond3.preheader %putchar21 = call i32 @putchar(i32 10) %inc13 = add nuw nsw i32 %i1.027, 1 %5 = load i32, ptr %h, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc13, %5 br i1 %cmp2, label %for.cond3.preheader, label %if.end15, !llvm.loop !11 if.end15: ; preds = %for.end, %for.cond.preheader %putchar = call i32 @putchar(i32 10) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w) %6 = load i32, ptr %h, align 4, !tbaa !5 %cmp = icmp eq i32 %6, 0 %7 = load i32, ptr %w, align 4 %cmp1 = icmp eq i32 %7, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %while.end, label %for.cond.preheader while.end: ; preds = %if.end15, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <string.h> #include <stdlib.h> typedef long long ll; int compare_string(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } int main() { int N; scanf("%d", &N); int p[N]; char s[N][11]; char **str; str = (char**)malloc(sizeof(char*) * N); int i = 0; while (i < N) { str[i] = (char *)malloc(sizeof(char) * 11); scanf("%s", s[i]); scanf("%d", &p[i]); strcpy(str[i], s[i]); i++; } qsort(str, N, sizeof *str, compare_string); int rank = 0; int j, k; int n[N]; int max = 0; i = 0; while (i < N) { j = 0; n[i] = 0; max = -1; while (j < N) { if (strcmp(str[i], s[j]) == 0) { if (p[j] > max) { max = p[j]; n[i] = j; } } j++; } p[n[i]] = -1; printf("%d\n", n[i] + 1); i++; } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225385/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225385/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @compare_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load ptr, ptr %a, align 8, !tbaa !5 %1 = load ptr, ptr %b, align 8, !tbaa !5 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #10 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !9 %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 !9 %4 = zext i32 %3 to i64 %vla1 = alloca [11 x i8], i64 %4, align 16 %conv = sext i32 %3 to i64 %mul = shl nsw i64 %conv, 3 %call2 = call noalias ptr @malloc(i64 noundef %mul) #12 %cmp80 = icmp sgt i32 %3, 0 br i1 %cmp80, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %call4 = call noalias dereferenceable_or_null(11) ptr @malloc(i64 noundef 11) #12 %arrayidx = getelementptr inbounds ptr, ptr %call2, i64 %indvars.iv store ptr %call4, ptr %arrayidx, align 8, !tbaa !5 %arrayidx6 = getelementptr inbounds [11 x i8], ptr %vla1, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %call16 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %call4, ptr noundef nonnull dereferenceable(1) %arrayidx6) #11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !9 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %while.body, %entry %conv17.pre-phi = phi i64 [ %conv, %entry ], [ %6, %while.body ] call void @qsort(ptr noundef %call2, i64 noundef %conv17.pre-phi, i64 noundef 8, ptr noundef nonnull @compare_string) #11 %7 = load i32, ptr %N, align 4, !tbaa !9 %cmp2085 = icmp sgt i32 %7, 0 br i1 %cmp2085, label %while.body22, label %while.end57 while.body22: ; preds = %while.end, %while.end48 %indvars.iv92 = phi i64 [ %indvars.iv.next93, %while.end48 ], [ 0, %while.end ] %8 = phi i32 [ %15, %while.end48 ], [ %7, %while.end ] %cmp2682 = icmp sgt i32 %8, 0 br i1 %cmp2682, label %while.body28.lr.ph, label %while.end48 while.body28.lr.ph: ; preds = %while.body22 %arrayidx30 = getelementptr inbounds ptr, ptr %call2, i64 %indvars.iv92 %9 = load ptr, ptr %arrayidx30, align 8, !tbaa !5 %wide.trip.count = zext i32 %8 to i64 br label %while.body28 while.body28: ; preds = %while.body28.lr.ph, %if.end46 %10 = phi i32 [ 0, %while.body28.lr.ph ], [ %13, %if.end46 ] %indvars.iv89 = phi i64 [ 0, %while.body28.lr.ph ], [ %indvars.iv.next90, %if.end46 ] %max.084 = phi i32 [ -1, %while.body28.lr.ph ], [ %max.1, %if.end46 ] %arrayidx32 = getelementptr inbounds [11 x i8], ptr %vla1, i64 %indvars.iv89 %call34 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) %arrayidx32) #10 %cmp35 = icmp eq i32 %call34, 0 br i1 %cmp35, label %if.then, label %if.end46 if.then: ; preds = %while.body28 %arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv89 %11 = load i32, ptr %arrayidx38, align 4, !tbaa !9 %cmp39 = icmp sgt i32 %11, %max.084 %12 = trunc i64 %indvars.iv89 to i32 %spec.select = select i1 %cmp39, i32 %12, i32 %10 %spec.select96 = call i32 @llvm.smax.i32(i32 %11, i32 %max.084) br label %if.end46 if.end46: ; preds = %if.then, %while.body28 %13 = phi i32 [ %10, %while.body28 ], [ %spec.select, %if.then ] %max.1 = phi i32 [ %max.084, %while.body28 ], [ %spec.select96, %if.then ] %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %exitcond.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count br i1 %exitcond.not, label %while.end48, label %while.body28, !llvm.loop !13 while.end48: ; preds = %if.end46, %while.body22 %14 = phi i32 [ 0, %while.body22 ], [ %13, %if.end46 ] %idxprom51 = sext i32 %14 to i64 %arrayidx52 = getelementptr inbounds i32, ptr %vla, i64 %idxprom51 store i32 -1, ptr %arrayidx52, align 4, !tbaa !9 %add = add nsw i32 %14, 1 %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add) %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %15 = load i32, ptr %N, align 4, !tbaa !9 %16 = sext i32 %15 to i64 %cmp20 = icmp slt i64 %indvars.iv.next93, %16 br i1 %cmp20, label %while.body22, label %while.end57, !llvm.loop !14 while.end57: ; preds = %while.end48, %while.end call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #11 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 declare ptr @llvm.stacksave.p0() #5 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6 ; 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 #7 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 attributes #0 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #6 = { 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 #7 = { 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 #8 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } attributes #12 = { 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, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12}
#include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct{ char s[11]; int p; int num; } house; int cmp(const void *a, const void *b){ return ((house *)b)->p - ((house *)a)->p; } int scmp(const void *a, const void *b){ return strcmp(((house *)a)->s, ((house *)b)->s); } int main(void){ int n, i; scanf("%d", &n); house rest[n]; for(i=0; i<n; i++){ scanf("%s %d", rest[i].s, &rest[i].p); rest[i].num = i + 1; } qsort(rest, n, sizeof(house), cmp); qsort(rest, n, sizeof(house), scmp); for(i=0; i<n; i++){ printf("%d\n", rest[i].num); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225442/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225442/source.c" target datalayout = "e-m:e-p270: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.house = type { [11 x i8], i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%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 [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 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %p = getelementptr inbounds %struct.house, ptr %b, i64 0, i32 1 %0 = load i32, ptr %p, align 4, !tbaa !5 %p1 = getelementptr inbounds %struct.house, ptr %a, i64 0, i32 1 %1 = load i32, ptr %p1, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @scmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #8 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !10 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca %struct.house, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !10 %cmp26 = icmp sgt i32 %3, 0 br i1 %cmp26, label %for.body, label %entry.for.end_crit_edge entry.for.end_crit_edge: ; preds = %entry %.pre = sext i32 %3 to i64 br label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds %struct.house, ptr %vla, i64 %indvars.iv %p = getelementptr inbounds %struct.house, ptr %vla, i64 %indvars.iv, i32 1 %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %p) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %num = getelementptr inbounds %struct.house, ptr %vla, i64 %indvars.iv, i32 2 %4 = trunc i64 %indvars.iv.next to i32 store i32 %4, ptr %num, align 4, !tbaa !11 %5 = load i32, ptr %n, align 4, !tbaa !10 %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 !12 for.end: ; preds = %for.body, %entry.for.end_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %6, %for.body ] call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 20, ptr noundef nonnull @cmp) #9 %7 = load i32, ptr %n, align 4, !tbaa !10 %conv6 = sext i32 %7 to i64 call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv6, i64 noundef 20, ptr noundef nonnull @scmp) #9 %8 = load i32, ptr %n, align 4, !tbaa !10 %cmp828 = icmp sgt i32 %8, 0 br i1 %cmp828, label %for.body10, label %for.end17 for.body10: ; preds = %for.end, %for.body10 %indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.body10 ], [ 0, %for.end ] %num13 = getelementptr inbounds %struct.house, ptr %vla, i64 %indvars.iv32, i32 2 %9 = load i32, ptr %num13, align 4, !tbaa !11 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9) %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1 %10 = load i32, ptr %n, align 4, !tbaa !10 %11 = sext i32 %10 to i64 %cmp8 = icmp slt i64 %indvars.iv.next33, %11 br i1 %cmp8, label %for.body10, label %for.end17, !llvm.loop !14 for.end17: ; preds = %for.body10, %for.end call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 declare ptr @llvm.stacksave.p0() #6 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #6 ; 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(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #7 = { 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 #8 = { nounwind willreturn memory(read) } attributes #9 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !9, i64 12} !6 = !{!"", !7, i64 0, !9, i64 12, !9, i64 16} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!"int", !7, i64 0} !10 = !{!9, !9, i64 0} !11 = !{!6, !9, i64 16} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char const *argv[]) { int N, p[100], i,swap,j,key[100],k; char S[100][11], tmp[11]; scanf("%d\n", &N); for (i = 0; i < N; i++) { scanf("%s ", S[i]); scanf("%d\n", &p[i]); } for (i = 0; i < N; i++) { key[i] = i+1; } for(i=1;i<N;i++){ for(j=1;j<N;j++){ if(strcmp(S[j-1], S[j])>0){ strcpy(tmp, S[j-1]); strcpy(S[j-1], S[j]); strcpy(S[j], tmp); swap = p[j-1]; p[j-1] = p[j]; p[j] = swap; swap = key[j-1]; key[j-1] = key[j]; key[j] = swap; } } } for (i = 1; i < N; i++) { if (strcmp(S[i-1], S[i]) == 0) { for (j = i; strcmp(S[j-1], S[j]) == 0; j++) { for(k = i; strcmp(S[k-1], S[k]) == 0; k++){ if(p[k-1] < p[k]){ swap = p[k-1]; p[k-1] = p[k]; p[k] = swap; swap = key[k-1]; key[k-1] = key[k]; key[k] = swap; } } } i=j; } } for (i = 0; i < N; i++) { printf("%d\n",key[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225493/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225493/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%s \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %p = alloca [100 x i32], align 16 %key = alloca [100 x i32], align 16 %S = alloca [100 x [11 x i8]], align 16 %tmp = alloca [11 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %key) #5 call void @llvm.lifetime.start.p0(i64 1100, ptr nonnull %S) #5 call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %tmp) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp207 = icmp sgt i32 %0, 0 br i1 %cmp207, label %for.body, label %for.end153 for.cond5.preheader: ; preds = %for.body %cmp6209 = icmp sgt i32 %8, 0 br i1 %cmp6209, label %for.body7.preheader, label %for.end153 for.body7.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body7.preheader275, label %vector.ph vector.ph: ; preds = %for.body7.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %1 = getelementptr inbounds [100 x i32], ptr %key, i64 0, i64 %index %2 = trunc <4 x i64> %vec.ind to <4 x i32> %3 = add <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1> %4 = trunc <4 x i64> %vec.ind to <4 x i32> %5 = add <4 x i32> %4, <i32 5, i32 5, i32 5, i32 5> store <4 x i32> %3, ptr %1, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> %5, ptr %6, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8> %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond13.preheader, label %for.body7.preheader275 for.body7.preheader275: ; preds = %for.body7.preheader, %middle.block %indvars.iv241.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ] br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %arrayidx3 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx3) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %N, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !13 for.cond13.preheader: ; preds = %for.body7, %middle.block %cmp14213 = icmp sgt i32 %8, 1 br i1 %cmp14213, label %for.cond16.preheader.us.preheader, label %for.cond72.preheader.thread for.cond72.preheader.thread: ; preds = %for.cond13.preheader br i1 %cmp6209, label %for.body147.preheader, label %for.end153 for.cond16.preheader.us.preheader: ; preds = %for.cond13.preheader %wide.trip.count248 = zext i32 %8 to i64 br label %for.cond16.preheader.us for.cond16.preheader.us: ; preds = %for.cond16.preheader.us.preheader, %for.cond16.for.inc69_crit_edge.us %i.2214.us = phi i32 [ %inc70.us, %for.cond16.for.inc69_crit_edge.us ], [ 1, %for.cond16.preheader.us.preheader ] br label %for.body18.us for.body18.us: ; preds = %for.cond16.preheader.us, %for.inc66.us %indvars.iv244 = phi i64 [ 1, %for.cond16.preheader.us ], [ %indvars.iv.next245, %for.inc66.us ] %10 = add nsw i64 %indvars.iv244, -1 %arrayidx20.us = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %10 %arrayidx23.us = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %indvars.iv244 %call25.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx20.us, ptr noundef nonnull dereferenceable(1) %arrayidx23.us) #6 %cmp26.us = icmp sgt i32 %call25.us, 0 br i1 %cmp26.us, label %if.then.us, label %for.inc66.us if.then.us: ; preds = %for.body18.us %call32.us = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %tmp, ptr noundef nonnull dereferenceable(1) %arrayidx20.us) #5 %call40.us = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx20.us, ptr noundef nonnull dereferenceable(1) %arrayidx23.us) #5 %call45.us = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx23.us, ptr noundef nonnull dereferenceable(1) %tmp) #5 %arrayidx48.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %10 %11 = load <2 x i32>, ptr %arrayidx48.us, align 4, !tbaa !5 %12 = shufflevector <2 x i32> %11, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %12, ptr %arrayidx48.us, align 4, !tbaa !5 %arrayidx58.us = getelementptr inbounds [100 x i32], ptr %key, i64 0, i64 %10 %13 = load <2 x i32>, ptr %arrayidx58.us, align 4, !tbaa !5 %14 = shufflevector <2 x i32> %13, <2 x i32> poison, <2 x i32> <i32 1, i32 0> store <2 x i32> %14, ptr %arrayidx58.us, align 4, !tbaa !5 br label %for.inc66.us for.inc66.us: ; preds = %if.then.us, %for.body18.us %indvars.iv.next245 = add nuw nsw i64 %indvars.iv244, 1 %exitcond249.not = icmp eq i64 %indvars.iv.next245, %wide.trip.count248 br i1 %exitcond249.not, label %for.cond16.for.inc69_crit_edge.us, label %for.body18.us, !llvm.loop !14 for.cond16.for.inc69_crit_edge.us: ; preds = %for.inc66.us %inc70.us = add nuw nsw i32 %i.2214.us, 1 %exitcond250.not = icmp eq i32 %inc70.us, %8 br i1 %exitcond250.not, label %for.cond72.preheader, label %for.cond16.preheader.us, !llvm.loop !15 for.body7: ; preds = %for.body7.preheader275, %for.body7 %indvars.iv241 = phi i64 [ %indvars.iv.next242, %for.body7 ], [ %indvars.iv241.ph, %for.body7.preheader275 ] %indvars.iv.next242 = add nuw nsw i64 %indvars.iv241, 1 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %key, i64 0, i64 %indvars.iv241 %15 = trunc i64 %indvars.iv.next242 to i32 store i32 %15, ptr %arrayidx9, align 4, !tbaa !5 %exitcond.not = icmp eq i64 %indvars.iv.next242, %wide.trip.count br i1 %exitcond.not, label %for.cond13.preheader, label %for.body7, !llvm.loop !16 for.cond72.preheader: ; preds = %for.cond16.for.inc69_crit_edge.us br i1 %cmp14213, label %for.body74, label %for.cond145.preheader for.cond145.preheader: ; preds = %for.inc142, %for.cond72.preheader br i1 %cmp6209, label %for.body147.preheader, label %for.end153 for.body147.preheader: ; preds = %for.cond72.preheader.thread, %for.cond145.preheader br label %for.body147 for.body74: ; preds = %for.cond72.preheader, %for.inc142 %i.3235 = phi i32 [ %inc143, %for.inc142 ], [ 1, %for.cond72.preheader ] %sub75 = add nsw i32 %i.3235, -1 %idxprom76 = sext i32 %sub75 to i64 %arrayidx77 = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %idxprom76 %idxprom79 = sext i32 %i.3235 to i64 %arrayidx80 = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %idxprom79 %call82 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx77, ptr noundef nonnull dereferenceable(1) %arrayidx80) #6 %cmp83 = icmp eq i32 %call82, 0 br i1 %cmp83, label %for.cond96.preheader.us.preheader, label %for.inc142 for.cond96.preheader.us.preheader: ; preds = %for.body74 %arrayidx109.us.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %idxprom76 br label %for.cond96.preheader.us for.cond96.preheader.us: ; preds = %for.cond96.preheader.us.preheader, %for.cond96.for.inc138_crit_edge.us %indvars.iv257 = phi i64 [ %idxprom79, %for.cond96.preheader.us.preheader ], [ %indvars.iv.next258, %for.cond96.for.inc138_crit_edge.us ] %.pre = load i32, ptr %arrayidx109.us.phi.trans.insert, align 4, !tbaa !5 br label %for.body106.us for.body106.us: ; preds = %for.cond96.preheader.us, %for.inc135.us %16 = phi i32 [ %.pre, %for.cond96.preheader.us ], [ %20, %for.inc135.us ] %indvars.iv254 = phi i64 [ %idxprom79, %for.cond96.preheader.us ], [ %indvars.iv.next255, %for.inc135.us ] %idxprom98223.us = phi i64 [ %idxprom76, %for.cond96.preheader.us ], [ %indvars.iv254, %for.inc135.us ] %arrayidx111.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv254 %17 = load i32, ptr %arrayidx111.us, align 4, !tbaa !5 %cmp112.us = icmp slt i32 %16, %17 br i1 %cmp112.us, label %if.then113.us, label %for.inc135.us if.then113.us: ; preds = %for.body106.us %arrayidx109.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %idxprom98223.us store i32 %17, ptr %arrayidx109.us, align 4, !tbaa !5 store i32 %16, ptr %arrayidx111.us, align 4, !tbaa !5 %arrayidx126.us = getelementptr inbounds [100 x i32], ptr %key, i64 0, i64 %idxprom98223.us %18 = load i32, ptr %arrayidx126.us, align 4, !tbaa !5 %arrayidx128.us = getelementptr inbounds [100 x i32], ptr %key, i64 0, i64 %indvars.iv254 %19 = load i32, ptr %arrayidx128.us, align 4, !tbaa !5 store i32 %19, ptr %arrayidx126.us, align 4, !tbaa !5 store i32 %18, ptr %arrayidx128.us, align 4, !tbaa !5 br label %for.inc135.us for.inc135.us: ; preds = %if.then113.us, %for.body106.us %20 = phi i32 [ %16, %if.then113.us ], [ %17, %for.body106.us ] %indvars.iv.next255 = add i64 %indvars.iv254, 1 %arrayidx99.us = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %indvars.iv254 %arrayidx102.us = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %indvars.iv.next255 %call104.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx99.us, ptr noundef nonnull dereferenceable(1) %arrayidx102.us) #6 %cmp105.us = icmp eq i32 %call104.us, 0 br i1 %cmp105.us, label %for.body106.us, label %for.cond96.for.inc138_crit_edge.us, !llvm.loop !17 for.cond96.for.inc138_crit_edge.us: ; preds = %for.inc135.us %indvars.iv.next258 = add i64 %indvars.iv257, 1 %arrayidx88.us = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %indvars.iv257 %arrayidx91.us = getelementptr inbounds [100 x [11 x i8]], ptr %S, i64 0, i64 %indvars.iv.next258 %call93.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx88.us, ptr noundef nonnull dereferenceable(1) %arrayidx91.us) #6 %cmp94.us = icmp eq i32 %call93.us, 0 br i1 %cmp94.us, label %for.cond96.preheader.us, label %for.inc142.loopexit, !llvm.loop !18 for.inc142.loopexit: ; preds = %for.cond96.for.inc138_crit_edge.us %21 = trunc i64 %indvars.iv.next258 to i32 br label %for.inc142 for.inc142: ; preds = %for.inc142.loopexit, %for.body74 %i.4 = phi i32 [ %i.3235, %for.body74 ], [ %21, %for.inc142.loopexit ] %inc143 = add nsw i32 %i.4, 1 %cmp73 = icmp slt i32 %inc143, %8 br i1 %cmp73, label %for.body74, label %for.cond145.preheader, !llvm.loop !19 for.body147: ; preds = %for.body147.preheader, %for.body147 %indvars.iv260 = phi i64 [ %indvars.iv.next261, %for.body147 ], [ 0, %for.body147.preheader ] %arrayidx149 = getelementptr inbounds [100 x i32], ptr %key, i64 0, i64 %indvars.iv260 %22 = load i32, ptr %arrayidx149, align 4, !tbaa !5 %call150 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22) %indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1 %23 = load i32, ptr %N, align 4, !tbaa !5 %24 = sext i32 %23 to i64 %cmp146 = icmp slt i64 %indvars.iv.next261, %24 br i1 %cmp146, label %for.body147, label %for.end153, !llvm.loop !20 for.end153: ; preds = %for.body147, %for.cond5.preheader, %entry, %for.cond72.preheader.thread, %for.cond145.preheader call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %tmp) #5 call void @llvm.lifetime.end.p0(i64 1100, ptr nonnull %S) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %key) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include <stdio.h> int main(void){ char s[20]; scanf("%s", s); s[5]=' '; s[13]=' '; printf("%s", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225536/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225536/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 5 store i8 32, ptr %arrayidx, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 13 store i8 32, ptr %arrayidx1, align 1, !tbaa !5 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %s) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char s[20]; scanf("%s", s); s[5] = s[13] = ' '; printf("%s\n", s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225587/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225587/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 13 store i8 32, ptr %arrayidx, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 5 store i8 32, ptr %arrayidx1, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main () { char vet[25]; scanf(" %s", vet); vet[5]=' '; // se você botar duas aspas significa que vc está dando uma string como argumento para uma casa só vet[13]= ' '; // uma string nao consegue ficar dentro de uma casa só for (int k=0; k<19; k++) { printf("%c", vet[k]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225637/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225637/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %vet = alloca [25 x i8], align 16 call void @llvm.lifetime.start.p0(i64 25, ptr nonnull %vet) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vet) %arrayidx = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 5 store i8 32, ptr %arrayidx, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 13 store i8 32, ptr %arrayidx1, align 1, !tbaa !5 %0 = load i8, ptr %vet, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %putchar7 = call i32 @putchar(i32 %conv) %arrayidx2.1 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 1 %1 = load i8, ptr %arrayidx2.1, align 1, !tbaa !5 %conv.1 = sext i8 %1 to i32 %putchar7.1 = call i32 @putchar(i32 %conv.1) %arrayidx2.2 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 2 %2 = load i8, ptr %arrayidx2.2, align 2, !tbaa !5 %conv.2 = sext i8 %2 to i32 %putchar7.2 = call i32 @putchar(i32 %conv.2) %arrayidx2.3 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 3 %3 = load i8, ptr %arrayidx2.3, align 1, !tbaa !5 %conv.3 = sext i8 %3 to i32 %putchar7.3 = call i32 @putchar(i32 %conv.3) %arrayidx2.4 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 4 %4 = load i8, ptr %arrayidx2.4, align 4, !tbaa !5 %conv.4 = sext i8 %4 to i32 %putchar7.4 = call i32 @putchar(i32 %conv.4) %5 = load i8, ptr %arrayidx, align 1, !tbaa !5 %conv.5 = sext i8 %5 to i32 %putchar7.5 = call i32 @putchar(i32 %conv.5) %arrayidx2.6 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 6 %6 = load i8, ptr %arrayidx2.6, align 2, !tbaa !5 %conv.6 = sext i8 %6 to i32 %putchar7.6 = call i32 @putchar(i32 %conv.6) %arrayidx2.7 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 7 %7 = load i8, ptr %arrayidx2.7, align 1, !tbaa !5 %conv.7 = sext i8 %7 to i32 %putchar7.7 = call i32 @putchar(i32 %conv.7) %arrayidx2.8 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 8 %8 = load i8, ptr %arrayidx2.8, align 8, !tbaa !5 %conv.8 = sext i8 %8 to i32 %putchar7.8 = call i32 @putchar(i32 %conv.8) %arrayidx2.9 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 9 %9 = load i8, ptr %arrayidx2.9, align 1, !tbaa !5 %conv.9 = sext i8 %9 to i32 %putchar7.9 = call i32 @putchar(i32 %conv.9) %arrayidx2.10 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 10 %10 = load i8, ptr %arrayidx2.10, align 2, !tbaa !5 %conv.10 = sext i8 %10 to i32 %putchar7.10 = call i32 @putchar(i32 %conv.10) %arrayidx2.11 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 11 %11 = load i8, ptr %arrayidx2.11, align 1, !tbaa !5 %conv.11 = sext i8 %11 to i32 %putchar7.11 = call i32 @putchar(i32 %conv.11) %arrayidx2.12 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 12 %12 = load i8, ptr %arrayidx2.12, align 4, !tbaa !5 %conv.12 = sext i8 %12 to i32 %putchar7.12 = call i32 @putchar(i32 %conv.12) %13 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %conv.13 = sext i8 %13 to i32 %putchar7.13 = call i32 @putchar(i32 %conv.13) %arrayidx2.14 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 14 %14 = load i8, ptr %arrayidx2.14, align 2, !tbaa !5 %conv.14 = sext i8 %14 to i32 %putchar7.14 = call i32 @putchar(i32 %conv.14) %arrayidx2.15 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 15 %15 = load i8, ptr %arrayidx2.15, align 1, !tbaa !5 %conv.15 = sext i8 %15 to i32 %putchar7.15 = call i32 @putchar(i32 %conv.15) %arrayidx2.16 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 16 %16 = load i8, ptr %arrayidx2.16, align 16, !tbaa !5 %conv.16 = sext i8 %16 to i32 %putchar7.16 = call i32 @putchar(i32 %conv.16) %arrayidx2.17 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 17 %17 = load i8, ptr %arrayidx2.17, align 1, !tbaa !5 %conv.17 = sext i8 %17 to i32 %putchar7.17 = call i32 @putchar(i32 %conv.17) %arrayidx2.18 = getelementptr inbounds [25 x i8], ptr %vet, i64 0, i64 18 %18 = load i8, ptr %arrayidx2.18, align 2, !tbaa !5 %conv.18 = sext i8 %18 to i32 %putchar7.18 = call i32 @putchar(i32 %conv.18) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 25, ptr nonnull %vet) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<string.h> int main() { char s[20],s1[20]; int i,count=0,len; scanf("%s",s); len=strlen(s); for(i=0;i<len;i++) { if(s[i]==',') { s1[i]=' '; count++; } else { s1[i]=s[i]; } } for(i=0;i<strlen(s);i++) { printf("%c",s1[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225680/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225680/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [20 x i8], align 16 %s1 = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s1) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %conv = trunc i64 %call2 to i32 %cmp36 = icmp sgt i32 %conv, 0 br i1 %cmp36, label %iter.check, label %for.cond14.preheader iter.check: ; preds = %entry %wide.trip.count = and i64 %call2, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.main.loop.iter.check vector.main.loop.iter.check: ; preds = %iter.check %min.iters.check47 = icmp ult i64 %wide.trip.count, 32 br i1 %min.iters.check47, 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 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %0 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %index %wide.load = load <16 x i8>, ptr %0, align 16, !tbaa !5 %1 = getelementptr inbounds i8, ptr %0, i64 16 %wide.load48 = load <16 x i8>, ptr %1, align 16, !tbaa !5 %2 = icmp eq <16 x i8> %wide.load, <i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44> %3 = icmp eq <16 x i8> %wide.load48, <i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44> %4 = select <16 x i1> %2, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %wide.load %5 = select <16 x i1> %3, <16 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <16 x i8> %wide.load48 %6 = getelementptr inbounds [20 x i8], ptr %s1, i64 0, i64 %index store <16 x i8> %4, ptr %6, align 16 %7 = getelementptr inbounds i8, ptr %6, i64 16 store <16 x i8> %5, ptr %7, align 16 %index.next = add nuw i64 %index, 32 %8 = icmp eq i64 %index.next, %n.vec br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.mod.vf, 0 br i1 %cmp.n, label %for.cond14.preheader, 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.vf49 = and i64 %call2, 7 %n.vec50 = sub nsw i64 %wide.trip.count, %n.mod.vf49 br label %vec.epilog.vector.body vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph %index52 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next54, %vec.epilog.vector.body ] %9 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %index52 %wide.load53 = load <8 x i8>, ptr %9, align 1, !tbaa !5 %10 = icmp eq <8 x i8> %wide.load53, <i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44> %11 = select <8 x i1> %10, <8 x i8> <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>, <8 x i8> %wide.load53 %12 = getelementptr inbounds [20 x i8], ptr %s1, i64 0, i64 %index52 store <8 x i8> %11, ptr %12, align 1 %index.next54 = add nuw i64 %index52, 8 %13 = icmp eq i64 %index.next54, %n.vec50 br i1 %13, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12 vec.epilog.middle.block: ; preds = %vec.epilog.vector.body %cmp.n51 = icmp eq i64 %n.mod.vf49, 0 br i1 %cmp.n51, label %for.cond14.preheader, 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.vec50, %vec.epilog.middle.block ] br label %for.body for.cond14.preheader: ; preds = %for.body, %middle.block, %vec.epilog.middle.block, %entry %char0 = load i8, ptr %s, align 16 %cmp1840.not = icmp eq i8 %char0, 0 br i1 %cmp1840.not, label %for.end27, label %for.body20 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 [20 x i8], ptr %s, i64 0, i64 %indvars.iv %14 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp5 = icmp eq i8 %14, 44 %spec.select = select i1 %cmp5, i8 32, i8 %14 %15 = getelementptr inbounds [20 x i8], ptr %s1, i64 0, i64 %indvars.iv store i8 %spec.select, ptr %15, align 1 %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.cond14.preheader, label %for.body, !llvm.loop !13 for.body20: ; preds = %for.cond14.preheader, %for.body20 %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body20 ], [ 0, %for.cond14.preheader ] %arrayidx22 = getelementptr inbounds [20 x i8], ptr %s1, i64 0, i64 %indvars.iv44 %16 = load i8, ptr %arrayidx22, align 1, !tbaa !5 %conv23 = sext i8 %16 to i32 %putchar = call i32 @putchar(i32 %conv23) %indvars.iv.next45 = add nuw i64 %indvars.iv44, 1 %call17 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6 %cmp18 = icmp ugt i64 %call17, %indvars.iv.next45 br i1 %cmp18, label %for.body20, label %for.end27, !llvm.loop !14 for.end27: ; preds = %for.body20, %for.cond14.preheader call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s1) #5 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !10, !11} !13 = distinct !{!13, !9, !11, !10} !14 = distinct !{!14, !9}
#include<stdio.h> int main(void){ char s[20]; scanf("%s",&s); s[5]=' '; s[13]=' '; printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225752/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225752/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 5 store i8 32, ptr %arrayidx, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 13 store i8 32, ptr %arrayidx1, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ char a[19]; scanf("%s",a); a[5]=' '; a[13]=' '; printf("%s\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225802/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225802/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [19 x i8], align 16 call void @llvm.lifetime.start.p0(i64 19, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %arrayidx = getelementptr inbounds [19 x i8], ptr %a, i64 0, i64 5 store i8 32, ptr %arrayidx, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [19 x i8], ptr %a, i64 0, i64 13 store i8 32, ptr %arrayidx1, align 1, !tbaa !5 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %a) call void @llvm.lifetime.end.p0(i64 19, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(int argc, char **argv) { char s1[8], s2[8], s3[8]; scanf("%[^,],%[^,],%[^,]", s1, s2, s3); printf("%s %s %s\n", s1, s2, s3); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225853/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225853/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^,],%[^,],%[^,]\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%s %s %s\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: %s1 = alloca [8 x i8], align 1 %s2 = alloca [8 x i8], align 1 %s3 = alloca [8 x i8], align 1 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s1) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s2) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s3) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3) %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s3) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s2) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %s1) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int i; char s[20]; scanf("%s", s); for (i = 0; i < 19; i++) { if (i == 5 || i == 13) { printf(" "); continue; } printf("%c", s[i]); } printf("\n"); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225910/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225910/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { for.inc.18: %s = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %conv = sext i8 %0 to i32 %putchar10 = call i32 @putchar(i32 %conv) %arrayidx.1 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %conv.1 = sext i8 %1 to i32 %putchar10.1 = call i32 @putchar(i32 %conv.1) %arrayidx.2 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5 %conv.2 = sext i8 %2 to i32 %putchar10.2 = call i32 @putchar(i32 %conv.2) %arrayidx.3 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %conv.3 = sext i8 %3 to i32 %putchar10.3 = call i32 @putchar(i32 %conv.3) %arrayidx.4 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 4 %4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5 %conv.4 = sext i8 %4 to i32 %putchar10.4 = call i32 @putchar(i32 %conv.4) %putchar11.5 = call i32 @putchar(i32 32) %arrayidx.6 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 6 %5 = load i8, ptr %arrayidx.6, align 2, !tbaa !5 %conv.6 = sext i8 %5 to i32 %putchar10.6 = call i32 @putchar(i32 %conv.6) %arrayidx.7 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 7 %6 = load i8, ptr %arrayidx.7, align 1, !tbaa !5 %conv.7 = sext i8 %6 to i32 %putchar10.7 = call i32 @putchar(i32 %conv.7) %arrayidx.8 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 8 %7 = load i8, ptr %arrayidx.8, align 8, !tbaa !5 %conv.8 = sext i8 %7 to i32 %putchar10.8 = call i32 @putchar(i32 %conv.8) %arrayidx.9 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 9 %8 = load i8, ptr %arrayidx.9, align 1, !tbaa !5 %conv.9 = sext i8 %8 to i32 %putchar10.9 = call i32 @putchar(i32 %conv.9) %arrayidx.10 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 10 %9 = load i8, ptr %arrayidx.10, align 2, !tbaa !5 %conv.10 = sext i8 %9 to i32 %putchar10.10 = call i32 @putchar(i32 %conv.10) %arrayidx.11 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 11 %10 = load i8, ptr %arrayidx.11, align 1, !tbaa !5 %conv.11 = sext i8 %10 to i32 %putchar10.11 = call i32 @putchar(i32 %conv.11) %arrayidx.12 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 12 %11 = load i8, ptr %arrayidx.12, align 4, !tbaa !5 %conv.12 = sext i8 %11 to i32 %putchar10.12 = call i32 @putchar(i32 %conv.12) %putchar11.13 = call i32 @putchar(i32 32) %arrayidx.14 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 14 %12 = load i8, ptr %arrayidx.14, align 2, !tbaa !5 %conv.14 = sext i8 %12 to i32 %putchar10.14 = call i32 @putchar(i32 %conv.14) %arrayidx.15 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 15 %13 = load i8, ptr %arrayidx.15, align 1, !tbaa !5 %conv.15 = sext i8 %13 to i32 %putchar10.15 = call i32 @putchar(i32 %conv.15) %arrayidx.16 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 16 %14 = load i8, ptr %arrayidx.16, align 16, !tbaa !5 %conv.16 = sext i8 %14 to i32 %putchar10.16 = call i32 @putchar(i32 %conv.16) %arrayidx.17 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 17 %15 = load i8, ptr %arrayidx.17, align 1, !tbaa !5 %conv.17 = sext i8 %15 to i32 %putchar10.17 = call i32 @putchar(i32 %conv.17) %arrayidx.18 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 18 %16 = load i8, ptr %arrayidx.18, align 2, !tbaa !5 %conv.18 = sext i8 %16 to i32 %putchar10.18 = call i32 @putchar(i32 %conv.18) %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int A,B,C,d,e; A>=0&&A<=10e9; B>=0&&B<=10e9; C>=0&&C<=10e9; scanf("%d",&A); scanf("%d",&B); scanf("%d",&C); e=A+B; if( A>=C||e>=C ){ d=B+C; printf("%d",d); } else{ d=A+B*2+1; printf("%d",d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_225954/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_225954/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A) %call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B) %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %2 = load i32, ptr %C, align 4, !tbaa !5 %cmp21.not = icmp slt i32 %0, %2 %add = add nsw i32 %1, %0 %cmp23.not = icmp slt i32 %add, %2 %or.cond = select i1 %cmp21.not, i1 %cmp23.not, i1 false %mul = shl nsw i32 %1, 1 %add27 = add nsw i32 %0, 1 %add28 = add i32 %add27, %mul %add25 = add nsw i32 %2, %1 %add28.sink = select i1 %or.cond, i32 %add28, i32 %add25 %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add28.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int a,b,c,max; scanf("%d %d %d",&a,&b,&c); //2連続で毒入り食べると死 if(a+b>=c) max=b+c; else max=a+2*b+1; printf("%d",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226003/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226003/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %cmp.not = icmp slt i32 %add, %2 %add1 = add nsw i32 %2, %1 %mul = shl nsw i32 %1, 1 %add2 = add i32 %0, 1 %add3 = add i32 %add2, %mul %max.0 = select i1 %cmp.not, i32 %add3, i32 %add1 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define INFTY 999999 int main(void){ unsigned long a,b,c; scanf("%lu %lu %lu", &a, &b, &c); unsigned long ans; //もし毒入りクッキーより解毒剤クッキーの方が多ければ、 //毒入り美味しいクッキーを全て食べられる+解毒剤美味しいクッキーも食べられる if(c<=a+b){ ans=b+c; } //毒入りクッキーより解毒剤クッキーの方が少なければ else{ unsigned long poison=a+b; ans=poison+b+1; } printf("%lu\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226047/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226047/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%lu %lu %lu\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %0 = load i64, ptr %c, align 8, !tbaa !5 %1 = load i64, ptr %a, align 8, !tbaa !5 %2 = load i64, ptr %b, align 8, !tbaa !5 %add = add i64 %2, %1 %cmp.not = icmp ugt i64 %0, %add %add1 = add i64 %2, %0 %add3 = add i64 %2, 1 %add4 = add i64 %add3, %add %ans.0 = select i1 %cmp.not, i64 %add4, i64 %add1 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0) 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int s[30],n,i; s[0]=1; s[1]=2; s[2]=4; for(i=3;i<30;i++) s[i]=s[i-1]+s[i-2]+s[i-3]; while(1){ scanf("%d",&n); if(!n)break; printf("%d\n",s[n-1]/3650+(s[n-1]%3650?1:0)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226090/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226090/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [30 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %s) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 store <4 x i32> <i32 1, i32 2, i32 4, i32 7>, ptr %s, align 16, !tbaa !5 %arrayidx12.1 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 4 store <4 x i32> <i32 13, i32 24, i32 44, i32 81>, ptr %arrayidx12.1, align 16, !tbaa !5 %arrayidx12.5 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 8 store <4 x i32> <i32 149, i32 274, i32 504, i32 927>, ptr %arrayidx12.5, align 16, !tbaa !5 %arrayidx12.9 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 12 store <4 x i32> <i32 1705, i32 3136, i32 5768, i32 10609>, ptr %arrayidx12.9, align 16, !tbaa !5 %arrayidx12.13 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 16 store <4 x i32> <i32 19513, i32 35890, i32 66012, i32 121415>, ptr %arrayidx12.13, align 16, !tbaa !5 %arrayidx12.17 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 20 store <4 x i32> <i32 223317, i32 410744, i32 755476, i32 1389537>, ptr %arrayidx12.17, align 16, !tbaa !5 %arrayidx12.21 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 24 store <4 x i32> <i32 2555757, i32 4700770, i32 8646064, i32 15902591>, ptr %arrayidx12.21, align 16, !tbaa !5 %arrayidx12.25 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 28 store i32 29249425, ptr %arrayidx12.25, align 16, !tbaa !5 %arrayidx12.26 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 29 store i32 53798080, ptr %arrayidx12.26, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not29 = icmp eq i32 %0, 0 br i1 %tobool.not29, label %while.end, label %if.end if.end: ; preds = %entry, %if.end %1 = phi i32 [ %3, %if.end ], [ %0, %entry ] %sub13 = add nsw i32 %1, -1 %idxprom14 = sext i32 %sub13 to i64 %arrayidx15 = getelementptr inbounds [30 x i32], ptr %s, i64 0, i64 %idxprom14 %2 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %div = sdiv i32 %2, 3650 %rem = srem i32 %2, 3650 %tobool19.not = icmp ne i32 %rem, 0 %cond = zext i1 %tobool19.not to i32 %add20 = add nsw i32 %div, %cond %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add20) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %3 = load i32, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %3, 0 br i1 %tobool.not, label %while.end, label %if.end while.end: ; preds = %if.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int N, C, p , S; int ans; scanf("%d%d", &N, &C); for(S = 0; C > 0; C--){ scanf("%d", &p); S += p; } ans = S / (N + 1); if (S % (N + 1)) ans++; printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226184/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226184/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %C = alloca i32, align 4 %p = 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 %C) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %C) %.pr = load i32, ptr %C, align 4, !tbaa !5 %cmp8 = icmp sgt i32 %.pr, 0 br i1 %cmp8, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %S.09 = phi i32 [ %add, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p) %0 = load i32, ptr %p, align 4, !tbaa !5 %add = add nsw i32 %0, %S.09 %1 = load i32, ptr %C, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %C, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, 1 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %S.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %2 = load i32, ptr %N, align 4, !tbaa !5 %add2 = add nsw i32 %2, 1 %div = sdiv i32 %S.0.lcssa, %add2 %rem = srem i32 %S.0.lcssa, %add2 %tobool.not = icmp ne i32 %rem, 0 %inc = zext i1 %tobool.not to i32 %spec.select = add nsw i32 %div, %inc %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void){ int N, H, W; scanf("%d%d%d", &N, &H, &W); printf("%d", (N-H+1)*(N-W+1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226227/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226227/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %H = alloca i32, align 4 %W = 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 %H) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %H, ptr noundef nonnull %W) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = load i32, ptr %H, align 4, !tbaa !5 %sub = add i32 %0, 1 %add = sub i32 %sub, %1 %2 = load i32, ptr %W, align 4, !tbaa !5 %add2 = sub i32 %sub, %2 %mul = mul nsw i32 %add2, %add %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #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"}
#include <stdio.h> int main(void){ int h, n, w; scanf("%d", &n); scanf("%d", &h); scanf("%d", &w); printf("%d\n", (n - h + 1) * (n - w + 1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226292/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226292/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %h = alloca i32, align 4 %n = alloca i32, align 4 %w = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #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 %h) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %h, align 4, !tbaa !5 %sub = add i32 %0, 1 %add = sub i32 %sub, %1 %2 = load i32, ptr %w, align 4, !tbaa !5 %add4 = sub i32 %sub, %2 %mul = mul nsw i32 %add4, %add %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> #include<stdlib.h> int cmp(const void *a,const void *b) { int *c,*d; c=(int *)a; d=(int *)b; return *c-*d; } int main() { int i,j,k,n,m,flag=0,v_min,v_max; int a[105],b[105]; scanf("%d%d",&n,&m); for(i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<m;i++) scanf("%d",&b[i]); qsort(a,n,sizeof(int),cmp); qsort(b,m,sizeof(int),cmp); v_min=a[n-1]; v_max=b[0]-1; while(v_min<=v_max) { if(a[0]<=v_min/2) { flag=1; printf("%d\n",v_min); break; } v_min++; } if(!flag) printf("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22635/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22635/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: 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 %m = alloca i32, align 4 %a = alloca [105 x i32], align 16 %b = alloca [105 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %b) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp36 = icmp sgt i32 %0, 0 br i1 %cmp36, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %3, %for.body ] %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp338 = icmp sgt i32 %2, 0 br i1 %cmp338, label %for.body4, label %for.end10 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body4 ], [ 0, %for.cond2.preheader ] %arrayidx6 = getelementptr inbounds [105 x i32], ptr %b, i64 0, i64 %indvars.iv44 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp3 = icmp slt i64 %indvars.iv.next45, %6 br i1 %cmp3, label %for.body4, label %for.end10.loopexit, !llvm.loop !11 for.end10.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.end10 for.end10: ; preds = %for.end10.loopexit, %for.cond2.preheader %7 = phi i32 [ %.pre, %for.end10.loopexit ], [ %1, %for.cond2.preheader ] %conv = sext i32 %7 to i64 call void @qsort(ptr noundef nonnull %a, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @cmp) #6 %8 = load i32, ptr %m, align 4, !tbaa !5 %conv12 = sext i32 %8 to i64 call void @qsort(ptr noundef nonnull %b, i64 noundef %conv12, i64 noundef 4, ptr noundef nonnull @cmp) #6 %9 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %9, -1 %idxprom13 = sext i32 %sub to i64 %arrayidx14 = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %idxprom13 %10 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %11 = load i32, ptr %b, align 16, !tbaa !5 %cmp17.not.not.not40 = icmp slt i32 %10, %11 br i1 %cmp17.not.not.not40, label %while.body.lr.ph, label %if.then24 while.body.lr.ph: ; preds = %for.end10 %12 = load i32, ptr %a, align 16, !tbaa !5 br label %while.body while.body: ; preds = %while.body.lr.ph, %if.end %v_min.041 = phi i32 [ %10, %while.body.lr.ph ], [ %inc23, %if.end ] %div = sdiv i32 %v_min.041, 2 %cmp20.not = icmp sgt i32 %12, %div br i1 %cmp20.not, label %if.end, label %if.then if.then: ; preds = %while.body %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %v_min.041) br label %if.end26 if.end: ; preds = %while.body %inc23 = add i32 %v_min.041, 1 %exitcond.not = icmp eq i32 %inc23, %11 br i1 %exitcond.not, label %if.then24, label %while.body, !llvm.loop !12 if.then24: ; preds = %if.end, %for.end10 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end26 if.end26: ; preds = %if.then, %if.then24 call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %b) #6 call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #define lop(i, n) for(i=0; i<n; i++) int main() { int i, n, cnt=0, p[20]; scanf("%d", &n); lop(i, n){ scanf("%d", &p[i]); } for(i=1; i<n-1; i++){ if(p[i-1]<p[i]&&p[i]<p[i+1]){ cnt++; } else if(p[i-1]>p[i]&&p[i]>p[i+1]){ cnt++; } } printf("%d", cnt); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226393/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226393/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %p = 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 80, ptr nonnull %p) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp52 = icmp sgt i32 %0, 0 br i1 %cmp52, label %for.body, label %for.end35 for.cond2.preheader: ; preds = %for.body %cmp354 = icmp sgt i32 %1, 2 br i1 %cmp354, label %for.body4.preheader, label %for.end35 for.body4.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %1, -1 %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %p, align 16, !tbaa !5 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.preheader, %for.inc33 %3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %for.inc33 ] %indvars.iv61 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next62.pre-phi, %for.inc33 ] %cnt.057 = phi i32 [ 0, %for.body4.preheader ], [ %cnt.1, %for.inc33 ] %arrayidx9 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv61 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp slt i32 %3, %4 br i1 %cmp10, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body4 %5 = add nuw nsw i64 %indvars.iv61, 1 %arrayidx14 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %5 %6 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %cmp15 = icmp slt i32 %4, %6 br i1 %cmp15, label %if.then, label %if.else if.then: ; preds = %land.lhs.true %inc16 = add nsw i32 %cnt.057, 1 br label %for.inc33 if.else: ; preds = %land.lhs.true, %for.body4 %cmp22 = icmp sgt i32 %3, %4 %7 = add nuw nsw i64 %indvars.iv61, 1 br i1 %cmp22, label %land.lhs.true23, label %for.inc33 land.lhs.true23: ; preds = %if.else %arrayidx28 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %7 %8 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %4, %8 %inc31 = zext i1 %cmp29 to i32 %spec.select = add nsw i32 %cnt.057, %inc31 br label %for.inc33 for.inc33: ; preds = %if.else, %land.lhs.true23, %if.then %indvars.iv.next62.pre-phi = phi i64 [ %7, %land.lhs.true23 ], [ %5, %if.then ], [ %7, %if.else ] %cnt.1 = phi i32 [ %spec.select, %land.lhs.true23 ], [ %inc16, %if.then ], [ %cnt.057, %if.else ] %exitcond.not = icmp eq i64 %indvars.iv.next62.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.end35, label %for.body4, !llvm.loop !11 for.end35: ; preds = %for.inc33, %entry, %for.cond2.preheader %cnt.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %cnt.1, %for.inc33 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cnt.0.lcssa) call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %p) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <limits.h> #include <math.h> #include <assert.h> typedef int64_t ll; typedef uint64_t ull; int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */ int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */ #define min(a,b) (a < b ? a: b) #define max(a,b) (a > b ? a: b) #define MAXN (200001) #define MOD (1000000007) int p[20]; int main(void) { int n; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%d",&(p[i])); } int ans = 0; for(int i=1;i<n-1;i++) { int pt[3] = {p[i-1],p[i],p[i+1]}; qsort(pt,3,sizeof(int),acs); if(pt[1]==p[i]) ans++; } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226436/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226436/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @p = dso_local global [20 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @des(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 %pt = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp32 = icmp sgt i32 %0, 0 br i1 %cmp32, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %1 = icmp sgt i32 %2, 2 br i1 %1, label %for.body6.lr.ph, label %for.cond.cleanup5 for.body6.lr.ph: ; preds = %for.cond3.preheader %arrayinit.element = getelementptr inbounds i32, ptr %pt, i64 1 %.pre = load i32, ptr @p, align 16, !tbaa !5 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.body6, %entry, %for.cond3.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %spec.select, %for.body6 ] %call23 = 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 %n) #5 ret i32 0 for.body6: ; preds = %for.body6.lr.ph, %for.body6 %4 = phi i32 [ %.pre, %for.body6.lr.ph ], [ %7, %for.body6 ] %indvars.iv39 = phi i64 [ 1, %for.body6.lr.ph ], [ %indvars.iv.next40, %for.body6 ] %ans.036 = phi i32 [ 0, %for.body6.lr.ph ], [ %spec.select, %for.body6 ] call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %pt) #5 store i32 %4, ptr %pt, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv39 %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %5 = load <2 x i32>, ptr %arrayidx11, align 4, !tbaa !5 store <2 x i32> %5, ptr %arrayinit.element, align 4, !tbaa !5 call void @qsort(ptr noundef nonnull %pt, i64 noundef 3, i64 noundef 4, ptr noundef nonnull @acs) #5 %6 = load i32, ptr %arrayinit.element, align 4, !tbaa !5 %7 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp18 = icmp eq i32 %6, %7 %inc19 = zext i1 %cmp18 to i32 %spec.select = add nuw nsw i32 %ans.036, %inc19 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %pt) #5 %8 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %9 = sext i32 %sub to i64 %cmp4 = icmp slt i64 %indvars.iv.next40, %9 br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define LENGTH 20 int main() { int p[LENGTH]; int n; int result; int i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d", &p[i]); } for (i = 0; i < n - 2; i++) { if ((p[i + 1] < p[i] && p[i + 1]> p[i + 2]) || (p[i + 1] > p[i] && p[i + 1] < p[i + 2])) result++; } printf("%d", result); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226487/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226487/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %p = alloca [20 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %p) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp50 = icmp sgt i32 %0, 0 br i1 %cmp50, label %for.body, label %for.cond2.preheader for.cond2.preheader.loopexit: ; preds = %for.body %.pre.pre = load i32, ptr %p, align 16, !tbaa !5 br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.loopexit, %entry %.pre = phi i32 [ undef, %entry ], [ %.pre.pre, %for.cond2.preheader.loopexit ] %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.cond2.preheader.loopexit ] %sub = add nsw i32 %.lcssa, -2 %cmp352 = icmp sgt i32 %.lcssa, 2 call void @llvm.assume(i1 %cmp352) %wide.trip.count = zext i32 %sub to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader.loopexit, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.inc32 %3 = phi i32 [ %.pre, %for.cond2.preheader ], [ %4, %for.inc32 ] %indvars.iv58 = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next59, %for.inc32 ] %result.053 = phi i32 [ undef, %for.cond2.preheader ], [ %result.1, %for.inc32 ] %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %arrayidx6 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv.next59 %4 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp9 = icmp slt i32 %4, %3 br i1 %cmp9, label %land.lhs.true, label %lor.lhs.false land.lhs.true: ; preds = %for.body4 %5 = add nuw nsw i64 %indvars.iv58, 2 %arrayidx15 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %5 %6 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %4, %6 br i1 %cmp16, label %if.then, label %lor.lhs.false lor.lhs.false: ; preds = %land.lhs.true, %for.body4 %cmp22 = icmp sgt i32 %4, %3 br i1 %cmp22, label %land.lhs.true23, label %for.inc32 land.lhs.true23: ; preds = %lor.lhs.false %7 = add nuw nsw i64 %indvars.iv58, 2 %arrayidx29 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %7 %8 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %cmp30 = icmp slt i32 %4, %8 br i1 %cmp30, label %if.then, label %for.inc32 if.then: ; preds = %land.lhs.true23, %land.lhs.true %inc31 = add nsw i32 %result.053, 1 br label %for.inc32 for.inc32: ; preds = %lor.lhs.false, %land.lhs.true23, %if.then %result.1 = phi i32 [ %inc31, %if.then ], [ %result.053, %land.lhs.true23 ], [ %result.053, %lor.lhs.false ] %exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count br i1 %exitcond.not, label %for.end34, label %for.body4, !llvm.loop !11 for.end34: ; preds = %for.inc32 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %result.1) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %p) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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 int n,m,max=0,min=0; scanf("%ld%ld",&n,&m); if(n==0 && m==0) {printf("0 0\n"); return 0;} if(n==0 && m!=0) {printf("Impossible\n"); return 0;} if(n!=0 && m==0) {printf("%ld %ld\n",n,n); return 0;} if(m<=n) { min=n; max=n+m-1; printf("%ld %ld\n",min,max); } else { min=m; max=n+m-1; printf("%ld %ld\n",min,max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22653/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%ld\00", align 1 @.str.3 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1 @str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"0 0\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp eq i64 %0, 0 %1 = load i64, ptr %m, align 8 %cmp1 = icmp eq i64 %1, 0 %or.cond = select i1 %cmp, i1 %cmp1, i1 false br i1 %or.cond, label %if.then, label %if.end if.then: ; preds = %entry %puts31 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4) br label %cleanup if.end: ; preds = %entry %cmp5 = icmp ne i64 %1, 0 %or.cond25 = select i1 %cmp, i1 %cmp5, i1 false br i1 %or.cond25, label %if.then6, label %if.end8 if.then6: ; preds = %if.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup if.end8: ; preds = %if.end %cmp9 = icmp ne i64 %0, 0 %or.cond26 = select i1 %cmp9, i1 %cmp1, i1 false br i1 %or.cond26, label %if.then12, label %if.end14 if.then12: ; preds = %if.end8 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %0, i64 noundef %0) br label %cleanup if.end14: ; preds = %if.end8 %cmp15.not = icmp sgt i64 %1, %0 %add18 = add i64 %0, -1 %sub19 = add i64 %add18, %1 br i1 %cmp15.not, label %if.else, label %if.then16 if.then16: ; preds = %if.end14 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %0, i64 noundef %sub19) br label %cleanup if.else: ; preds = %if.end14 %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %1, i64 noundef %sub19) br label %cleanup cleanup: ; preds = %if.then16, %if.else, %if.then12, %if.then6, %if.then call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n,i,count=0; int a[20]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } for(i=1;i<n-1;i++){ if(a[i-1] < a[i] && a[i+1] < a[i]); else if(a[i-1] > a[i] && a[i+1] > a[i]); else count++; } printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226573/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226573/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [20 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp51 = icmp sgt i32 %0, 0 br i1 %cmp51, label %for.body, label %for.end35 for.cond2.preheader: ; preds = %for.body %cmp353 = icmp sgt i32 %1, 2 br i1 %cmp353, label %for.body4.preheader, label %for.end35 for.body4.preheader: ; preds = %for.cond2.preheader %sub = add nsw i32 %1, -1 %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %a, align 16, !tbaa !5 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.preheader, %for.inc33 %3 = phi i32 [ %.pre, %for.body4.preheader ], [ %4, %for.inc33 ] %indvars.iv59 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next60.pre-phi, %for.inc33 ] %count.055 = phi i32 [ 0, %for.body4.preheader ], [ %count.1, %for.inc33 ] %arrayidx9 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %indvars.iv59 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp slt i32 %3, %4 br i1 %cmp10, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body4 %5 = add nuw nsw i64 %indvars.iv59, 1 %arrayidx12 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %5 %6 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp15 = icmp slt i32 %6, %4 br i1 %cmp15, label %for.inc33, label %if.else if.else: ; preds = %land.lhs.true, %for.body4 %cmp21 = icmp sgt i32 %3, %4 %7 = add nuw nsw i64 %indvars.iv59, 1 br i1 %cmp21, label %land.lhs.true22, label %if.else30 land.lhs.true22: ; preds = %if.else %arrayidx25 = getelementptr inbounds [20 x i32], ptr %a, i64 0, i64 %7 %8 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %cmp28 = icmp sgt i32 %8, %4 br i1 %cmp28, label %for.inc33, label %if.else30 if.else30: ; preds = %if.else, %land.lhs.true22 %inc31 = add nsw i32 %count.055, 1 br label %for.inc33 for.inc33: ; preds = %land.lhs.true, %land.lhs.true22, %if.else30 %indvars.iv.next60.pre-phi = phi i64 [ %5, %land.lhs.true ], [ %7, %land.lhs.true22 ], [ %7, %if.else30 ] %count.1 = phi i32 [ %count.055, %land.lhs.true ], [ %count.055, %land.lhs.true22 ], [ %inc31, %if.else30 ] %exitcond.not = icmp eq i64 %indvars.iv.next60.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.end35, label %for.body4, !llvm.loop !11 for.end35: ; preds = %for.inc33, %entry, %for.cond2.preheader %count.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %count.1, %for.inc33 ] %call36 = 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 %a) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int getAns(int, int a[]); int main() { int n; int p[20] = {0}; scanf("%d", &n); for (int i = 0; i < n - 1; i++) { scanf("%d ", p + i); } scanf("%d", p + n - 1); printf("%d", getAns(n, p)); return 0; } int getAns(int n, int p[]) { int count = 0; for (int i = 1; i < n - 1; i++) { if (p[i - 1] < p[i] && p[i] < p[i + 1]) { count++; } else if (p[i - 1] > p[i] && p[i] > p[i + 1]) { count++; } } return count; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226616/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226616/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %p = alloca [20 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %p) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %p, i8 0, i64 80, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %0, 1 br i1 %cmp13, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %7, %for.body ] %idx.ext3 = sext i32 %.lcssa to i64 %add.ptr4 = getelementptr inbounds i32, ptr %p, i64 %idx.ext3 %add.ptr5 = getelementptr inbounds i32, ptr %add.ptr4, i64 -1 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr5) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp46.i = icmp sgt i32 %1, 2 br i1 %cmp46.i, label %for.body.preheader.i, label %getAns.exit for.body.preheader.i: ; preds = %for.cond.cleanup %sub.i = add nsw i32 %1, -1 %wide.trip.count.i = zext i32 %sub.i to i64 %.pre.i = load i32, ptr %p, align 16, !tbaa !5 br label %for.body.i for.body.i: ; preds = %for.inc.i, %for.body.preheader.i %2 = phi i32 [ %.pre.i, %for.body.preheader.i ], [ %3, %for.inc.i ] %indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %4, %for.inc.i ] %count.047.i = phi i32 [ 0, %for.body.preheader.i ], [ %count.1.i, %for.inc.i ] %arrayidx3.i = getelementptr inbounds i32, ptr %p, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp slt i32 %2, %3 %4 = add nuw nsw i64 %indvars.iv.i, 1 br i1 %cmp4.i, label %land.lhs.true.i, label %if.else.i land.lhs.true.i: ; preds = %for.body.i %arrayidx8.i = getelementptr inbounds i32, ptr %p, i64 %4 %5 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5 %cmp9.i = icmp slt i32 %3, %5 br i1 %cmp9.i, label %if.then.i, label %if.else.i if.then.i: ; preds = %land.lhs.true.i %inc.i = add nsw i32 %count.047.i, 1 br label %for.inc.i if.else.i: ; preds = %for.body.i, %land.lhs.true.i %cmp15.i = icmp sgt i32 %2, %3 br i1 %cmp15.i, label %land.lhs.true16.i, label %for.inc.i land.lhs.true16.i: ; preds = %if.else.i %arrayidx21.i = getelementptr inbounds i32, ptr %p, i64 %4 %6 = load i32, ptr %arrayidx21.i, align 4, !tbaa !5 %cmp22.i = icmp sgt i32 %3, %6 %inc24.i = zext i1 %cmp22.i to i32 %spec.select.i = add nsw i32 %count.047.i, %inc24.i br label %for.inc.i for.inc.i: ; preds = %land.lhs.true16.i, %if.else.i, %if.then.i %count.1.i = phi i32 [ %spec.select.i, %land.lhs.true16.i ], [ %inc.i, %if.then.i ], [ %count.047.i, %if.else.i ] %exitcond.not.i = icmp eq i64 %4, %wide.trip.count.i br i1 %exitcond.not.i, label %getAns.exit, label %for.body.i, !llvm.loop !9 getAns.exit: ; preds = %for.inc.i, %for.cond.cleanup %count.0.lcssa.i = phi i32 [ 0, %for.cond.cleanup ], [ %count.1.i, %for.inc.i ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %add.ptr = getelementptr inbounds i32, ptr %p, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %7, -1 %8 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @getAns(i32 noundef %n, ptr nocapture noundef readonly %p) local_unnamed_addr #4 { entry: %cmp46 = icmp sgt i32 %n, 2 br i1 %cmp46, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %sub = add nsw i32 %n, -1 %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %p, align 4, !tbaa !5 br label %for.body for.cond.cleanup: ; preds = %for.inc, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1, %for.inc ] ret i32 %count.0.lcssa for.body: ; preds = %for.body.preheader, %for.inc %0 = phi i32 [ %.pre, %for.body.preheader ], [ %1, %for.inc ] %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.pre-phi, %for.inc ] %count.047 = phi i32 [ 0, %for.body.preheader ], [ %count.1, %for.inc ] %arrayidx3 = getelementptr inbounds i32, ptr %p, i64 %indvars.iv %1 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp slt i32 %0, %1 br i1 %cmp4, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body %2 = add nuw nsw i64 %indvars.iv, 1 %arrayidx8 = getelementptr inbounds i32, ptr %p, i64 %2 %3 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %cmp9 = icmp slt i32 %1, %3 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %land.lhs.true %inc = add nsw i32 %count.047, 1 br label %for.inc if.else: ; preds = %land.lhs.true, %for.body %cmp15 = icmp sgt i32 %0, %1 %4 = add nuw nsw i64 %indvars.iv, 1 br i1 %cmp15, label %land.lhs.true16, label %for.inc land.lhs.true16: ; preds = %if.else %arrayidx21 = getelementptr inbounds i32, ptr %p, i64 %4 %5 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %1, %5 %inc24 = zext i1 %cmp22 to i32 %spec.select = add nsw i32 %count.047, %inc24 br label %for.inc for.inc: ; preds = %if.else, %land.lhs.true16, %if.then %indvars.iv.next.pre-phi = phi i64 [ %4, %land.lhs.true16 ], [ %2, %if.then ], [ %4, %if.else ] %count.1 = phi i32 [ %spec.select, %land.lhs.true16 ], [ %inc, %if.then ], [ %count.047, %if.else ] %exitcond.not = icmp eq i64 %indvars.iv.next.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree 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 #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main() { int n,t,k,d; scanf("%d %d %d %d",&n,&t,&k,&d); int time1=t*((n-1)/k+1); if(time1-d>t) printf("YES"); else printf("NO"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22666/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22666/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %t = alloca i32, align 4 %k = alloca i32, align 4 %d = 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 %t) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %k, ptr noundef nonnull %d) %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 %2 = load i32, ptr %k, align 4, !tbaa !5 %div = sdiv i32 %sub, %2 %add = add nsw i32 %div, 1 %mul = mul nsw i32 %add, %0 %3 = load i32, ptr %d, align 4, !tbaa !5 %sub1 = sub nsw i32 %mul, %3 %cmp = icmp sgt i32 %sub1, %0 %.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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"}
#include <stdio.h> int main(void) { int n; int p[20]; int count; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &p[i]); } count = 0; for (int i = 1; i < n - 1; i++) { if (p[i - 1] < p[i] && p[i] < p[i + 1]) { count++; } else if (p[i - 1] > p[i] && p[i] > p[i + 1]) { count++; } } printf("%d\n", count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226702/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226702/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %p = 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 80, ptr nonnull %p) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp53 = icmp sgt i32 %0, 0 br i1 %cmp53, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %cmp455 = icmp sgt i32 %1, 2 br i1 %cmp455, label %for.body6.preheader, label %for.cond.cleanup5 for.body6.preheader: ; preds = %for.cond3.preheader %sub = add nsw i32 %1, -1 %wide.trip.count = zext i32 %sub to i64 %.pre = load i32, ptr %p, align 16, !tbaa !5 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.inc35, %entry, %for.cond3.preheader %count.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %count.1, %for.inc35 ] %call38 = 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 %p) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 for.body6: ; preds = %for.body6.preheader, %for.inc35 %3 = phi i32 [ %.pre, %for.body6.preheader ], [ %4, %for.inc35 ] %indvars.iv62 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next63.pre-phi, %for.inc35 ] %count.056 = phi i32 [ 0, %for.body6.preheader ], [ %count.1, %for.inc35 ] %arrayidx11 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %indvars.iv62 %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp slt i32 %3, %4 br i1 %cmp12, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body6 %5 = add nuw nsw i64 %indvars.iv62, 1 %arrayidx16 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %5 %6 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp slt i32 %4, %6 br i1 %cmp17, label %if.then, label %if.else if.then: ; preds = %land.lhs.true %inc18 = add nsw i32 %count.056, 1 br label %for.inc35 if.else: ; preds = %land.lhs.true, %for.body6 %cmp24 = icmp sgt i32 %3, %4 %7 = add nuw nsw i64 %indvars.iv62, 1 br i1 %cmp24, label %land.lhs.true25, label %for.inc35 land.lhs.true25: ; preds = %if.else %arrayidx30 = getelementptr inbounds [20 x i32], ptr %p, i64 0, i64 %7 %8 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %4, %8 %inc33 = zext i1 %cmp31 to i32 %spec.select = add nsw i32 %count.056, %inc33 br label %for.inc35 for.inc35: ; preds = %if.else, %land.lhs.true25, %if.then %indvars.iv.next63.pre-phi = phi i64 [ %7, %land.lhs.true25 ], [ %5, %if.then ], [ %7, %if.else ] %count.1 = phi i32 [ %spec.select, %land.lhs.true25 ], [ %inc18, %if.then ], [ %count.056, %if.else ] %exitcond.not = icmp eq i64 %indvars.iv.next63.pre-phi, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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,D; scanf("%d%d%d%d",&A,&B,&C,&D); if((A+B)>(C+D)) { printf("Left\n"); } else if((A+B)<(C+D)) { printf("Right\n"); } else { printf("Balanced\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226746/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226746/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @str = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1 @str.4 = private unnamed_addr constant [6 x i8] c"Right\00", align 1 @str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %C, align 4, !tbaa !5 %3 = load i32, ptr %D, align 4, !tbaa !5 %add1 = add nsw i32 %3, %2 %cmp = icmp sgt i32 %add, %add1 %cmp5 = icmp slt i32 %add, %add1 %str.4.str = select i1 %cmp5, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) 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 willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
# include <stdio.h> # include <stdlib.h> # include <string.h> int main() { int ceilnk,ceildt,n,k,t,d; scanf("%d %d %d %d",&n,&t,&k,&d); ceilnk = n%k==0 ? n/k : (n/k)+1; ceildt = d%t==0 ? d/t : (d/t)+1; if((ceilnk-1 > ceildt) || (ceilnk-1 == ceildt && d % t!=0)) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22679/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22679/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %t = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %k, ptr noundef nonnull %d) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp eq i32 %rem, 0 %div = sdiv i32 %0, %1 %2 = sext i1 %cmp to i32 %cond = add nsw i32 %div, %2 %3 = load i32, ptr %d, align 4, !tbaa !5 %4 = load i32, ptr %t, align 4, !tbaa !5 %rem2 = srem i32 %3, %4 %cmp3 = icmp eq i32 %rem2, 0 %div5 = sdiv i32 %3, %4 %not.cmp3 = xor i1 %cmp3, true %add8 = zext i1 %not.cmp3 to i32 %cond10 = add nsw i32 %div5, %add8 %cmp11 = icmp sle i32 %cond, %cond10 %cmp13 = icmp ne i32 %cond, %cond10 %brmerge = or i1 %cmp3, %cmp13 %or.cond = and i1 %cmp11, %brmerge %str.str.3 = select i1 %or.cond, ptr @str, ptr @str.3 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d); if(a+b==c+d) {printf("Balanced");} else if(a+b>c+d) {printf("Left");} else {printf("Right");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226832/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226832/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"Left\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"Right\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %add1 = add nsw i32 %3, %2 %cmp = icmp eq i32 %add, %add1 %cmp5 = icmp sgt i32 %add, %add1 %.str.2..str.3 = select i1 %cmp5, ptr @.str.2, ptr @.str.3 %.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int A,B,C,D,left=0,right=0; scanf("%d %d %d %d",&A,&B,&C,&D); left=A+B; right=C+D; if(left>right){ printf("Left\n"); } else if(left==right){ printf("Balanced\n"); } else{ printf("Right\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226883/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226883/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"Right\00", align 1 @str.4 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1 @str.5 = private unnamed_addr constant [5 x i8] c"Left\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %A = alloca i32, align 4 %B = alloca i32, align 4 %C = alloca i32, align 4 %D = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) %0 = load i32, ptr %A, align 4, !tbaa !5 %1 = load i32, ptr %B, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %C, align 4, !tbaa !5 %3 = load i32, ptr %D, align 4, !tbaa !5 %add1 = add nsw i32 %3, %2 %cmp = icmp sgt i32 %add, %add1 %cmp3 = icmp eq i32 %add, %add1 %str.4.str = select i1 %cmp3, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) 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 willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a,b,c,d; scanf("%d %d %d %d",&a,&b,&c,&d); if(a+b==c+d){ printf("Balanced\n"); }else if(a+b>c+d){ printf("Left\n"); }else{ printf("Right\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_226926/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_226926/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @str = private unnamed_addr constant [6 x i8] c"Right\00", align 1 @str.4 = private unnamed_addr constant [5 x i8] c"Left\00", align 1 @str.5 = private unnamed_addr constant [9 x i8] c"Balanced\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 %c = alloca i32, align 4 %d = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %add = add nsw i32 %1, %0 %2 = load i32, ptr %c, align 4, !tbaa !5 %3 = load i32, ptr %d, align 4, !tbaa !5 %add1 = add nsw i32 %3, %2 %cmp = icmp eq i32 %add, %add1 %cmp5 = icmp sgt i32 %add, %add1 %str.4.str = select i1 %cmp5, ptr @str.4, ptr @str %str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str %puts11 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) 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 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"}